added reconnect after error

This commit is contained in:
2017-12-28 10:47:37 +01:00
parent 7e50526d8e
commit cd950c2659

View File

@@ -250,8 +250,18 @@ void HardwareSetup::run() {
}
//}
if (nBytes < 0)
if (nBytes < 0) {
fprintf(stderr, "USB error: %sn", usb_strerror());
while (!this->handle) {
this->handle =
usbOpenDevice(0x16C0, "test01", 0x05DC, "USBExample");
if (this->handle == NULL) {
fprintf(stderr, "Could not find USB device!\n");
}
sleep(1);
}
}
}
}
}