subsurface/core/device.h
Linus Torvalds c840ab4332 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>
2016-08-14 10:22:41 -07:00

19 lines
589 B
C

#ifndef DEVICE_H
#define DEVICE_H
#ifdef __cplusplus
#include "dive.h"
extern "C" {
#endif
extern struct divecomputer *fake_dc(struct divecomputer *dc, bool alloc);
extern void set_dc_deviceid(struct divecomputer *dc, unsigned int deviceid);
extern void create_device_node(const char *model, uint32_t deviceid, const char *serial, const char *firmware, const char *nickname);
extern void call_for_each_dc(void *f, void (*callback)(void *, const char *, uint32_t,
const char *, const char *, const char *), bool select_only);
#ifdef __cplusplus
}
#endif
#endif // DEVICE_H