From 236d84a2531179b487f11b88ec21bf6a7718677f Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Fri, 20 Feb 2009 12:25:37 +0000 Subject: [PATCH] Add a device info event for the Suunto Eon and Solution. --- src/suunto_eon.c | 7 +++++++ src/suunto_solution.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/suunto_eon.c b/src/suunto_eon.c index 76e5b8d..c32db5a 100644 --- a/src/suunto_eon.c +++ b/src/suunto_eon.c @@ -215,6 +215,13 @@ suunto_eon_device_foreach (device_t *abstract, dive_callback_t callback, void *u if (rc != DEVICE_STATUS_SUCCESS) return rc; + // Emit a device info event. + device_devinfo_t devinfo; + devinfo.model = 0; + devinfo.firmware = 0; + devinfo.serial = (data[244 + 0] << 16) + (data[244 + 1] << 8) + data[244 + 2]; + device_event_emit (abstract, DEVICE_EVENT_DEVINFO, &devinfo); + return suunto_eon_extract_dives (data, sizeof (data), callback, userdata); } diff --git a/src/suunto_solution.c b/src/suunto_solution.c index 9a87a6f..8ae1205 100644 --- a/src/suunto_solution.c +++ b/src/suunto_solution.c @@ -267,6 +267,13 @@ suunto_solution_device_foreach (device_t *abstract, dive_callback_t callback, vo if (rc != DEVICE_STATUS_SUCCESS) return rc; + // Emit a device info event. + device_devinfo_t devinfo; + devinfo.model = 0; + devinfo.firmware = 0; + devinfo.serial = (data[0x1D + 0] << 16) + (data[0x1D + 1] << 8) + data[0x1D + 2]; + device_event_emit (abstract, DEVICE_EVENT_DEVINFO, &devinfo); + return suunto_solution_extract_dives (data, sizeof (data), callback, userdata); }