Add support for new Suunto EON Core dive computer
Nick Shore reports that it seems to act exactly like an EON Steel, just with a different USB device ID. Acting like the EON Steel is not a surprise: it does seem to be the same dive computer, just in a smaller and lighter package (same screen size, but more compact body and without the stainless steel to make it less than half the weight). Looks like the battery is smaller, but the electronics are likely the same. We probably really should have some way to add new device ID's without having to add whole new model numbers etc. It's not the first time this happens (see the Scubapro Aladin Square vs the G2), and it's likely not the last time. Reported-by: Nick Shore <support@mac-dive.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
c44d2a8faf
commit
238a3734a5
@ -100,6 +100,7 @@ static const dc_descriptor_t g_descriptors[] = {
|
||||
/* Suunto EON Steel */
|
||||
#ifdef USBHID
|
||||
{"Suunto", "EON Steel", DC_FAMILY_SUUNTO_EONSTEEL, 0}, // BLE
|
||||
{"Suunto", "EON Core", DC_FAMILY_SUUNTO_EONSTEEL, 1}, // BLE
|
||||
#endif
|
||||
/* Uwatec Aladin */
|
||||
{"Uwatec", "Aladin Air Twin", DC_FAMILY_UWATEC_ALADIN, 0x1C}, // FTDI
|
||||
|
||||
@ -125,7 +125,7 @@ dc_device_open (dc_device_t **out, dc_context_t *context, dc_descriptor_t *descr
|
||||
rc = suunto_d9_device_open (&device, context, name, dc_descriptor_get_model (descriptor));
|
||||
break;
|
||||
case DC_FAMILY_SUUNTO_EONSTEEL:
|
||||
rc = suunto_eonsteel_device_open (&device, context, name);
|
||||
rc = suunto_eonsteel_device_open (&device, context, name, dc_descriptor_get_model(descriptor));
|
||||
break;
|
||||
case DC_FAMILY_UWATEC_ALADIN:
|
||||
rc = uwatec_aladin_device_open (&device, context, name);
|
||||
|
||||
@ -727,7 +727,7 @@ static int initialize_eonsteel(suunto_eonsteel_device_t *eon)
|
||||
}
|
||||
|
||||
dc_status_t
|
||||
suunto_eonsteel_device_open(dc_device_t **out, dc_context_t *context, const char *name)
|
||||
suunto_eonsteel_device_open(dc_device_t **out, dc_context_t *context, const char *name, unsigned int model)
|
||||
{
|
||||
dc_status_t status = DC_STATUS_SUCCESS;
|
||||
suunto_eonsteel_device_t *eon = NULL;
|
||||
@ -748,8 +748,12 @@ suunto_eonsteel_device_open(dc_device_t **out, dc_context_t *context, const char
|
||||
dc_custom_io_t *io = _dc_context_custom_io(eon->base.context);
|
||||
if (io && io->packet_open)
|
||||
status = io->packet_open(io, context, name);
|
||||
else
|
||||
status = dc_usbhid_custom_io(context, 0x1493, 0x0030);
|
||||
else {
|
||||
/* We really need some way to specify USB ID's in the descriptor */
|
||||
unsigned int vendor_id = 0x1493;
|
||||
unsigned int device_id = model ? 0x0033 : 0x0030;
|
||||
status = dc_usbhid_custom_io(context, vendor_id, device_id);
|
||||
}
|
||||
|
||||
if (status != DC_STATUS_SUCCESS) {
|
||||
ERROR(context, "unable to open device");
|
||||
|
||||
@ -31,7 +31,7 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
dc_status_t
|
||||
suunto_eonsteel_device_open(dc_device_t **device, dc_context_t *context, const char *name);
|
||||
suunto_eonsteel_device_open(dc_device_t **device, dc_context_t *context, const char *name, unsigned int model);
|
||||
|
||||
dc_status_t
|
||||
suunto_eonsteel_parser_create(dc_parser_t **parser, dc_context_t *context, unsigned int model);
|
||||
|
||||
@ -319,7 +319,7 @@ dc_usbhid_open (dc_usbhid_t **out, dc_context_t *context, unsigned int vid, unsi
|
||||
}
|
||||
|
||||
if (device == NULL) {
|
||||
ERROR (context, "No matching USB device found.");
|
||||
ERROR (context, "No matching USB device (%04x:%04x) found.", vid, pid);
|
||||
status = DC_STATUS_NODEVICE;
|
||||
goto error_usb_free_list;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user