mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
Add serial and firmware to the extra data
And add the missing newline to the debug output to help us identify encodings for serial and firmware. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5437e9f637
commit
acb8a0e118
1 changed files with 3 additions and 6 deletions
|
@ -382,9 +382,9 @@ static void parse_string_field(struct dive *dive, dc_field_string_t *str)
|
||||||
dive->dc.diveid = calculate_string_hash(str->value);
|
dive->dc.diveid = calculate_string_hash(str->value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
add_extra_data(&dive->dc, str->desc, str->value);
|
||||||
if (!strcmp(str->desc, "Serial")) {
|
if (!strcmp(str->desc, "Serial")) {
|
||||||
fprintf(stderr, "string field \"Serial\": %s -- overwriting the existing serial of %s", str->value, dive->dc.serial);
|
fprintf(stderr, "string field \"Serial\": %s -- overwriting the existing serial of %s\n", str->value, dive->dc.serial);
|
||||||
dive->dc.serial = strdup(str->value);
|
dive->dc.serial = strdup(str->value);
|
||||||
/* should we just overwrite this whenever we have the "Serial" field?
|
/* should we just overwrite this whenever we have the "Serial" field?
|
||||||
* It's a much better deviceid then what we have so far... for now I'm leaving it as is */
|
* It's a much better deviceid then what we have so far... for now I'm leaving it as is */
|
||||||
|
@ -392,14 +392,11 @@ static void parse_string_field(struct dive *dive, dc_field_string_t *str)
|
||||||
dive->dc.deviceid = calculate_string_hash(str->value);
|
dive->dc.deviceid = calculate_string_hash(str->value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(str->desc, "FW Version")) {
|
if (!strcmp(str->desc, "FW Version")) {
|
||||||
fprintf(stderr, "string field \"FW Version\": %s -- overwriting the existing firware of %s", str->value, dive->dc.fw_version);
|
fprintf(stderr, "string field \"FW Version\": %s -- overwriting the existing firware of %s\n", str->value, dive->dc.fw_version);
|
||||||
dive->dc.fw_version = strdup(str->value);
|
dive->dc.fw_version = strdup(str->value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
add_extra_data(&dive->dc, str->desc, str->value);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue