From 2bcb3d88a090582d6d3dcda8810f011beb22caa6 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 19 Oct 2020 19:19:32 +0200 Subject: divecomputer: add device_table pointer to device_data_t In one weird case (suunto), the code in libdivecomputer.c generates a device node directly instead of going the usual way (setting the data in the dc-structure of the imported dive). It is unclear to me whether that has to be that way, as it depends on the chronological order of callbacks to event_cb() and dive_cb(). Therefore add a device_table pointer to device_data_t so that the downloader can add the device to this table. This only adds the pointer, but does not yet use it in the downloading code. Signed-off-by: Berthold Stoeger --- core/datatrak.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/datatrak.c') diff --git a/core/datatrak.c b/core/datatrak.c index b10ef55ad..01a16210a 100644 --- a/core/datatrak.c +++ b/core/datatrak.c @@ -177,6 +177,8 @@ static unsigned char *dt_dive_parser(unsigned char *runner, struct dive *dt_dive char is_nitrox = 0, is_O2 = 0, is_SCR = 0; device_data_t *devdata = calloc(1, sizeof(device_data_t)); + devdata->sites = sites; + devdata->devices = devices; /* * Parse byte to byte till next dive entry -- cgit v1.2.3-70-g09d2