]> git.zerfleddert.de Git - hmcfgusb/commitdiff
flash-ota: add support for a-culfw
authorMichael Gernoth <michael@gernoth.net>
Sat, 12 Sep 2015 10:29:01 +0000 (12:29 +0200)
committerMichael Gernoth <michael@gernoth.net>
Sat, 12 Sep 2015 10:29:01 +0000 (12:29 +0200)
flash-ota.c

index 5e24aa6ddb74216e943b4318d94ad932c882b5b1..a93446fc550cf0043ba756008d5d7738ebf4f96c 100644 (file)
@@ -177,6 +177,16 @@ static int parse_culfw(uint8_t *buf, int buf_len, void *data)
                                *e = '\0';
                                v = atoi(s);
                                rdata->version |= v;
+
+                               s = e + 1;
+                               e = strchr(s, ' ');
+                               if (!e) {
+                                       break;
+                               }
+                               *e = '\0';
+                               if (!strcmp(s, "a-culfw")) {
+                                       rdata->version = 0xffff;
+                               }
                        }
                        break;
                case 'E':
@@ -535,9 +545,14 @@ int main(int argc, char **argv)
                                break;
                }
 
-               printf("culfw-device firmware version: %u.%02u\n", 
-                       (rdata.version >> 8) & 0xff,
-                       rdata.version & 0xff);
+               printf("culfw-device firmware version: ");
+               if (rdata.version != 0xffff) {
+                       printf("%u.%02u\n",
+                               (rdata.version >> 8) & 0xff,
+                               rdata.version & 0xff);
+               } else {
+                       printf("a-culfw\n");
+               }
 
                if (rdata.version < 0x013a) {
                        fprintf(stderr, "\nThis version does _not_ support firmware upgrade mode, you need at least 1.58!\n");
Impressum, Datenschutz