- // check result of uart opening
- if (sp == INVALID_SERIAL_PORT) {
- printf("ERROR: invalid serial port\n");
- usb_present = false;
- } else if (sp == CLAIMED_SERIAL_PORT) {
- printf("ERROR: serial port is claimed by another process\n");
- usb_present = false;
- } else {
- usb_present = true;
- }
-
- // create a mutex to avoid interlacing print commands from our different threads
- pthread_mutex_init(&print_lock, NULL);
+ // try to open USB connection to Proxmark
+ usb_present = OpenProxmark(argv[1], waitCOMPort, 20);