+
+ printf("Requesting firmware-version\n");
+ culfw_send(dev.culfw, "\r\n", 2);
+ culfw_flush(dev.culfw);
+
+ while (1) {
+ culfw_send(dev.culfw, "V\r\n", 3);
+
+ errno = 0;
+ pfd = culfw_poll(dev.culfw, 1);
+ if ((pfd < 0) && errno) {
+ if (errno != ETIMEDOUT) {
+ perror("\n\nhmcfgusb_poll");
+ exit(EXIT_FAILURE);
+ }
+ }
+ if (rdata.version)
+ break;
+ }
+
+ printf("culfw-device firmware version: %u.%02u\n",
+ (rdata.version >> 8) & 0xff,
+ rdata.version & 0xff);
+
+ if (rdata.version < 0x0139) {
+ fprintf(stderr, "\nThis version does _not_ support firmware upgrade mode!\n");
+ exit(EXIT_FAILURE);
+ } else if (rdata.version < 0x0140) {
+ printf("\n*** This version probably not supports firmware upgrade mode! ***\n\n");
+ }