Add a device info event for the Uwatec Aladin.

This commit is contained in:
Jef Driesen 2009-02-20 12:24:47 +00:00
parent 2be97f0e12
commit 8e05b91502

View File

@ -42,6 +42,7 @@
#define DISTANCE(a,b) ringbuffer_distance (a, b, 0, 0x600)
#define HEADER 4
typedef struct uwatec_aladin_device_t uwatec_aladin_device_t;
@ -257,12 +258,17 @@ uwatec_aladin_device_foreach (device_t *abstract, dive_callback_t callback, void
if (rc != DEVICE_STATUS_SUCCESS)
return rc;
// Emit a device info event.
device_devinfo_t devinfo;
devinfo.model = data[HEADER + 0x7bc];
devinfo.firmware = 0;
devinfo.serial = (data[HEADER + 0x7ed] << 16) + (data[HEADER + 0x7ee] << 8) + data[HEADER + 0x7ef];
device_event_emit (abstract, DEVICE_EVENT_DEVINFO, &devinfo);
return uwatec_aladin_extract_dives (data, sizeof (data), callback, userdata, device->timestamp);
}
#define HEADER 4
device_status_t
uwatec_aladin_extract_dives (const unsigned char* data, unsigned int size, dive_callback_t callback, void *userdata, unsigned int timestamp)
{