}
if (msg[CTL] & 0x20) {
- int cnt = 10;
+ int cnt = 3;
int pfd;
do {
errno = 0;
pfd = culfw_poll(dev->culfw, 1);
if ((pfd < 0) && errno) {
if (errno != ETIMEDOUT) {
- perror("\n\nhmcfgusb_poll");
+ perror("\n\nculfw_poll");
exit(EXIT_FAILURE);
}
}
break;
}
} while(cnt--);
+
+ if (cnt == -1) {
+ fprintf(stderr, "\nMissing ACK!\n");
+ return 0;
+ }
}
}
break;
printf("HomeMatic OTA flasher version " VERSION "\n\n");
- while((opt = getopt(argc, argv, "f:s:c:s:h")) != -1) {
+ while((opt = getopt(argc, argv, "b:c:f:hs:")) != -1) {
switch (opt) {
case 'b':
bps = atoi(optarg);
}
if ((pfd < 0) && errno) {
if (errno != ETIMEDOUT) {
- perror("\n\nhmcfgusb_poll");
+ perror("\n\npoll");
exit(EXIT_FAILURE);
}
}