]> git.zerfleddert.de Git - hmcfgusb/blobdiff - flash-ota.c
increase hm-buffer for culfw-devices
[hmcfgusb] / flash-ota.c
index ea2bcad9b3c503d15a0690a8baea64c10c15c0b4..7afab1399c64b24d8eaeebe2d77e58bd9df6ced9 100644 (file)
@@ -207,7 +207,7 @@ int send_hm_message(struct ota_dev *dev, struct recv_data *rdata, uint8_t *msg)
                        break;
                case DEVICE_TYPE_CULFW:
                        {
-                               char buf[128];
+                               char buf[256];
                                int i;
 
                                memset(buf, 0, sizeof(buf));
@@ -227,14 +227,14 @@ 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;
                                                pfd = culfw_poll(dev->culfw, 1);
                                                if ((pfd < 0) && errno) {
                                                        if (errno != ETIMEDOUT) {
-                                                               perror("\n\nhmcfgusb_poll");
+                                                               perror("\n\nculfw_poll");
                                                                exit(EXIT_FAILURE);
                                                        }
                                                }
@@ -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);
@@ -654,7 +659,7 @@ int main(int argc, char **argv)
                }
                if ((pfd < 0) && errno) {
                        if (errno != ETIMEDOUT) {
-                               perror("\n\nhmcfgusb_poll");
+                               perror("\n\npoll");
                                exit(EXIT_FAILURE);
                        }
                }
Impressum, Datenschutz