X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/hmcfgusb/blobdiff_plain/47ea478b44e3c529201c6678f5e2cbbe0fc60bf9..9718f9faebacf4cd01307b87e5dfb89ed012e8aa:/flash-ota.c diff --git a/flash-ota.c b/flash-ota.c index ea2bcad..71cb57e 100644 --- a/flash-ota.c +++ b/flash-ota.c @@ -227,7 +227,7 @@ int send_hm_message(struct ota_dev *dev, struct recv_data *rdata, uint8_t *msg) } if (msg[CTL] & 0x20) { - int cnt = 10; + int cnt = 3; int pfd; do { errno = 0; @@ -242,6 +242,11 @@ int send_hm_message(struct ota_dev *dev, struct recv_data *rdata, uint8_t *msg) break; } } while(cnt--); + + if (cnt == -1) { + fprintf(stderr, "\nMissing ACK!\n"); + return 0; + } } } break; @@ -329,7 +334,7 @@ int main(int argc, char **argv) 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);