Fill in divecomputer serial number and firmware version on loading

We have the serial number and firmware version fields in "struct
divecomputer", but we don't actually fill them in when loading the data
from git or xml, because we save all that information in the separate
device table instead.

But in order to always have the serial number associated with a device,
let's make sure to fill those fields in.  It won't hurt, and this way we
have the information available whether we just loaded the dive from a
file, or imported it from the dive computer.  One less semantic
difference to worry about.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2016-06-20 21:07:36 -07:00 committed by Dirk Hohndel
parent 777cbd9cfe
commit c840ab4332
4 changed files with 35 additions and 2 deletions

View file

@ -643,7 +643,7 @@ static void parse_dc_date(char *line, struct membuffer *str, void *_dc)
{ (void) str; struct divecomputer *dc = _dc; update_date(&dc->when, line); }
static void parse_dc_deviceid(char *line, struct membuffer *str, void *_dc)
{ (void) str; struct divecomputer *dc = _dc; dc->deviceid = get_hex(line); }
{ (void) str; struct divecomputer *dc = _dc; set_dc_deviceid(dc, get_hex(line)); }
static void parse_dc_diveid(char *line, struct membuffer *str, void *_dc)
{ (void) str; struct divecomputer *dc = _dc; dc->diveid = get_hex(line); }