Add suport for the OSTC Sport variant.

Although the OSTC Sport uses bluetooth communication, the new model
remains fully compatible with the OSTC3, because it provides a virtual
serial port interface. As usual, the new model can be detected based on
the serial number.
This commit is contained in:
Jef Driesen 2014-08-15 11:29:18 +02:00
parent b12d5acb86
commit 549207a48b
2 changed files with 5 additions and 1 deletions

View File

@ -200,6 +200,7 @@ static const dc_descriptor_t g_descriptors[] = {
{"Heinrichs Weikamp", "OSTC 2C", DC_FAMILY_HW_OSTC, 3},
{"Heinrichs Weikamp", "Frog", DC_FAMILY_HW_FROG, 0},
{"Heinrichs Weikamp", "OSTC 3", DC_FAMILY_HW_OSTC3, 0},
{"Heinrichs Weikamp", "OSTC Sport", DC_FAMILY_HW_OSTC3, 1},
/* Cressi Edy */
{"Cressi", "Edy", DC_FAMILY_CRESSI_EDY, 0},
/* Cressi Leonardo */

View File

@ -346,9 +346,12 @@ hw_ostc3_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, voi
// Emit a device info event.
dc_event_devinfo_t devinfo;
devinfo.model = 0;
devinfo.firmware = array_uint16_be (id + 2);
devinfo.serial = array_uint16_le (id + 0);
if (devinfo.serial > 10000)
devinfo.model = 1; // OSTC Sport
else
devinfo.model = 0; // OSTC3
device_event_emit (abstract, DC_EVENT_DEVINFO, &devinfo);
// Allocate memory.