From: Michael Gernoth Date: Sat, 12 Sep 2015 10:29:01 +0000 (+0200) Subject: flash-ota: add support for a-culfw X-Git-Tag: v0.102~6 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/hmcfgusb/commitdiff_plain/bcc4286832802319feb44be923b82cdfa8670610 flash-ota: add support for a-culfw --- diff --git a/flash-ota.c b/flash-ota.c index 5e24aa6..a93446f 100644 --- a/flash-ota.c +++ b/flash-ota.c @@ -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");