diff --git a/src/descriptor.c b/src/descriptor.c index b8106a6..c68ef1f 100644 --- a/src/descriptor.c +++ b/src/descriptor.c @@ -99,6 +99,7 @@ static const dc_descriptor_t g_descriptors[] = { /* Suunto EON Steel */ #ifdef USBHID {"Suunto", "EON Steel", DC_FAMILY_SUUNTO_EONSTEEL, 0}, + {"Suunto", "EON Core", DC_FAMILY_SUUNTO_EONSTEEL, 1}, #endif /* Uwatec Aladin */ {"Uwatec", "Aladin Air Twin", DC_FAMILY_UWATEC_ALADIN, 0x1C}, diff --git a/src/device.c b/src/device.c index 349ed1d..266007a 100644 --- a/src/device.c +++ b/src/device.c @@ -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); + rc = suunto_eonsteel_device_open (&device, context, dc_descriptor_get_model (descriptor)); break; case DC_FAMILY_UWATEC_ALADIN: rc = uwatec_aladin_device_open (&device, context, name); diff --git a/src/suunto_eonsteel.c b/src/suunto_eonsteel.c index cf36184..cd7bc79 100644 --- a/src/suunto_eonsteel.c +++ b/src/suunto_eonsteel.c @@ -30,9 +30,13 @@ #include "usbhid.h" #include "platform.h" +#define EONSTEEL 0 +#define EONCORE 1 + typedef struct suunto_eonsteel_device_t { dc_device_t base; dc_usbhid_t *usbhid; + unsigned int model; unsigned int magic; unsigned short seq; unsigned char version[0x30]; @@ -551,7 +555,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) +suunto_eonsteel_device_open(dc_device_t **out, dc_context_t *context, unsigned int model) { dc_status_t status = DC_STATUS_SUCCESS; suunto_eonsteel_device_t *eon = NULL; @@ -564,12 +568,19 @@ suunto_eonsteel_device_open(dc_device_t **out, dc_context_t *context) return DC_STATUS_NOMEMORY; // Set up the magic handshake fields + eon->model = model; eon->magic = INIT_MAGIC; eon->seq = INIT_SEQ; memset (eon->version, 0, sizeof (eon->version)); memset (eon->fingerprint, 0, sizeof (eon->fingerprint)); - status = dc_usbhid_open(&eon->usbhid, context, 0x1493, 0x0030); + unsigned int vid = 0x1493, pid = 0; + if (model == EONCORE) { + pid = 0x0033; + } else { + pid = 0x0030; + } + status = dc_usbhid_open(&eon->usbhid, context, vid, pid); if (status != DC_STATUS_SUCCESS) { ERROR(context, "unable to open device"); goto error_free; @@ -622,7 +633,7 @@ suunto_eonsteel_device_foreach(dc_device_t *abstract, dc_dive_callback_t callbac // Emit a device info event. dc_event_devinfo_t devinfo; - devinfo.model = 0; + devinfo.model = eon->model; devinfo.firmware = array_uint32_be (eon->version + 0x20); devinfo.serial = array_convert_str2num(eon->version + 0x10, 16); device_event_emit (abstract, DC_EVENT_DEVINFO, &devinfo); diff --git a/src/suunto_eonsteel.h b/src/suunto_eonsteel.h index 98763c9..2927dce 100644 --- a/src/suunto_eonsteel.h +++ b/src/suunto_eonsteel.h @@ -31,7 +31,7 @@ extern "C" { #endif /* __cplusplus */ dc_status_t -suunto_eonsteel_device_open(dc_device_t **device, dc_context_t *context); +suunto_eonsteel_device_open(dc_device_t **device, dc_context_t *context, unsigned int model); dc_status_t suunto_eonsteel_parser_create(dc_parser_t **parser, dc_context_t *context, unsigned int model);