From 173390ed0556b039a1d5cefa59160a7d1d1ba46a Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Sun, 6 Jan 2013 08:05:02 +0100 Subject: [PATCH] Decode the serial number as a 32 bit number. Apparantly there are also two different type of serial numbers present, and their interpretation depends on the application. The Windows Dive Organizer application shows both a serial number (byte offset 0x04) and a warranty number (byte offset 0x0C). However, the Mac OS X Divers' Diary application shows the number at byte offset 0x0C as the serial number. Very confusing. For now, we just stick to the number at byte offset 0x0C, because that's the number that is shown by the device itself. --- src/mares_iconhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mares_iconhd.c b/src/mares_iconhd.c index 05b2ef7..d5035da 100644 --- a/src/mares_iconhd.c +++ b/src/mares_iconhd.c @@ -364,7 +364,7 @@ mares_iconhd_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, dc_event_devinfo_t devinfo; devinfo.model = mares_iconhd_get_model (device, data[0]); devinfo.firmware = 0; - devinfo.serial = array_uint16_le (data + 12); + devinfo.serial = array_uint32_le (data + 0x0C); device_event_emit (abstract, DC_EVENT_DEVINFO, &devinfo); rc = mares_iconhd_extract_dives (abstract, dc_buffer_get_data (buffer),