Add support for a new Suunto Zoop Novo variant
This commit is contained in:
parent
76d225dcfc
commit
d85d8811f0
@ -125,6 +125,7 @@ static const dc_descriptor_t g_descriptors[] = {
|
|||||||
{"Suunto", "DX", DC_FAMILY_SUUNTO_D9, 0x1C, DC_TRANSPORT_SERIAL, NULL},
|
{"Suunto", "DX", DC_FAMILY_SUUNTO_D9, 0x1C, DC_TRANSPORT_SERIAL, NULL},
|
||||||
{"Suunto", "Vyper Novo", DC_FAMILY_SUUNTO_D9, 0x1D, DC_TRANSPORT_SERIAL, NULL},
|
{"Suunto", "Vyper Novo", DC_FAMILY_SUUNTO_D9, 0x1D, DC_TRANSPORT_SERIAL, NULL},
|
||||||
{"Suunto", "Zoop Novo", DC_FAMILY_SUUNTO_D9, 0x1E, DC_TRANSPORT_SERIAL, NULL},
|
{"Suunto", "Zoop Novo", DC_FAMILY_SUUNTO_D9, 0x1E, DC_TRANSPORT_SERIAL, NULL},
|
||||||
|
{"Suunto", "Zoop Novo", DC_FAMILY_SUUNTO_D9, 0x1F, DC_TRANSPORT_SERIAL, NULL},
|
||||||
{"Suunto", "D4f", DC_FAMILY_SUUNTO_D9, 0x20, DC_TRANSPORT_SERIAL, NULL},
|
{"Suunto", "D4f", DC_FAMILY_SUUNTO_D9, 0x20, DC_TRANSPORT_SERIAL, NULL},
|
||||||
/* Suunto EON Steel */
|
/* Suunto EON Steel */
|
||||||
{"Suunto", "EON Steel", DC_FAMILY_SUUNTO_EONSTEEL, 0, DC_TRANSPORT_USBHID | DC_TRANSPORT_BLE, dc_filter_suunto},
|
{"Suunto", "EON Steel", DC_FAMILY_SUUNTO_EONSTEEL, 0, DC_TRANSPORT_USBHID | DC_TRANSPORT_BLE, dc_filter_suunto},
|
||||||
|
|||||||
@ -33,13 +33,14 @@
|
|||||||
|
|
||||||
#define C_ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
|
#define C_ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
|
||||||
|
|
||||||
#define D4i 0x19
|
#define D4i 0x19
|
||||||
#define D6i 0x1A
|
#define D6i 0x1A
|
||||||
#define D9tx 0x1B
|
#define D9tx 0x1B
|
||||||
#define DX 0x1C
|
#define DX 0x1C
|
||||||
#define VYPERNOVO 0x1D
|
#define VYPERNOVO 0x1D
|
||||||
#define ZOOPNOVO 0x1E
|
#define ZOOPNOVO_A 0x1E
|
||||||
#define D4F 0x20
|
#define ZOOPNOVO_B 0x1F
|
||||||
|
#define D4F 0x20
|
||||||
|
|
||||||
typedef struct suunto_d9_device_t {
|
typedef struct suunto_d9_device_t {
|
||||||
suunto_common2_device_t base;
|
suunto_common2_device_t base;
|
||||||
@ -100,7 +101,7 @@ suunto_d9_device_autodetect (suunto_d9_device_t *device, unsigned int model)
|
|||||||
// Use the model number as a hint to speedup the detection.
|
// Use the model number as a hint to speedup the detection.
|
||||||
unsigned int hint = 0;
|
unsigned int hint = 0;
|
||||||
if (model == D4i || model == D6i || model == D9tx ||
|
if (model == D4i || model == D6i || model == D9tx ||
|
||||||
model == DX || model == VYPERNOVO || model == ZOOPNOVO ||
|
model == DX || model == VYPERNOVO || model == ZOOPNOVO_A || model == ZOOPNOVO_B ||
|
||||||
model == D4F)
|
model == D4F)
|
||||||
hint = 1;
|
hint = 1;
|
||||||
|
|
||||||
@ -184,7 +185,7 @@ suunto_d9_device_open (dc_device_t **out, dc_context_t *context, dc_iostream_t *
|
|||||||
// Override the base class values.
|
// Override the base class values.
|
||||||
model = device->base.version[0];
|
model = device->base.version[0];
|
||||||
if (model == D4i || model == D6i || model == D9tx ||
|
if (model == D4i || model == D6i || model == D9tx ||
|
||||||
model == VYPERNOVO || model == ZOOPNOVO ||
|
model == VYPERNOVO || model == ZOOPNOVO_A || model == ZOOPNOVO_B ||
|
||||||
model == D4F)
|
model == D4F)
|
||||||
device->base.layout = &suunto_d9tx_layout;
|
device->base.layout = &suunto_d9tx_layout;
|
||||||
else if (model == DX)
|
else if (model == DX)
|
||||||
|
|||||||
@ -32,21 +32,22 @@
|
|||||||
#define MAXPARAMS 3
|
#define MAXPARAMS 3
|
||||||
#define NGASMIXES 11
|
#define NGASMIXES 11
|
||||||
|
|
||||||
#define D9 0x0E
|
#define D9 0x0E
|
||||||
#define D6 0x0F
|
#define D6 0x0F
|
||||||
#define VYPER2 0x10
|
#define VYPER2 0x10
|
||||||
#define COBRA2 0x11
|
#define COBRA2 0x11
|
||||||
#define D4 0x12
|
#define D4 0x12
|
||||||
#define VYPERAIR 0x13
|
#define VYPERAIR 0x13
|
||||||
#define COBRA3 0x14
|
#define COBRA3 0x14
|
||||||
#define HELO2 0x15
|
#define HELO2 0x15
|
||||||
#define D4i 0x19
|
#define D4i 0x19
|
||||||
#define D6i 0x1A
|
#define D6i 0x1A
|
||||||
#define D9tx 0x1B
|
#define D9tx 0x1B
|
||||||
#define DX 0x1C
|
#define DX 0x1C
|
||||||
#define VYPERNOVO 0x1D
|
#define VYPERNOVO 0x1D
|
||||||
#define ZOOPNOVO 0x1E
|
#define ZOOPNOVO_A 0x1E
|
||||||
#define D4F 0x20
|
#define ZOOPNOVO_B 0x1F
|
||||||
|
#define D4F 0x20
|
||||||
|
|
||||||
#define ID_D6I_V1_MIX2 0x1871C062
|
#define ID_D6I_V1_MIX2 0x1871C062
|
||||||
#define ID_D6I_V1_MIX3 0x1871C063
|
#define ID_D6I_V1_MIX3 0x1871C063
|
||||||
@ -142,8 +143,8 @@ suunto_d9_parser_cache (suunto_d9_parser_t *parser)
|
|||||||
gasmode_offset = 0x1F;
|
gasmode_offset = 0x1F;
|
||||||
gasmix_offset = 0x54;
|
gasmix_offset = 0x54;
|
||||||
gasmix_count = 8;
|
gasmix_count = 8;
|
||||||
} else if (parser->model == D4i || parser->model == ZOOPNOVO ||
|
} else if (parser->model == D4i || parser->model == ZOOPNOVO_A ||
|
||||||
parser->model == D4F) {
|
parser->model == ZOOPNOVO_B || parser->model == D4F) {
|
||||||
gasmode_offset = 0x1D;
|
gasmode_offset = 0x1D;
|
||||||
if (id == ID_D4I_V2)
|
if (id == ID_D4I_V2)
|
||||||
gasmix_offset = 0x67;
|
gasmix_offset = 0x67;
|
||||||
@ -180,8 +181,9 @@ suunto_d9_parser_cache (suunto_d9_parser_t *parser)
|
|||||||
config += 1;
|
config += 1;
|
||||||
} else if (parser->model == HELO2 || parser->model == D4i ||
|
} else if (parser->model == HELO2 || parser->model == D4i ||
|
||||||
parser->model == D6i || parser->model == D9tx ||
|
parser->model == D6i || parser->model == D9tx ||
|
||||||
parser->model == DX || parser->model == ZOOPNOVO ||
|
parser->model == DX || parser->model == ZOOPNOVO_A ||
|
||||||
parser->model == VYPERNOVO || parser->model == D4F) {
|
parser->model == ZOOPNOVO_B || parser->model == VYPERNOVO ||
|
||||||
|
parser->model == D4F) {
|
||||||
config = gasmix_offset + gasmix_count * 6;
|
config = gasmix_offset + gasmix_count * 6;
|
||||||
}
|
}
|
||||||
if (config + 1 > size)
|
if (config + 1 > size)
|
||||||
@ -204,8 +206,9 @@ suunto_d9_parser_cache (suunto_d9_parser_t *parser)
|
|||||||
for (unsigned int i = 0; i < gasmix_count; ++i) {
|
for (unsigned int i = 0; i < gasmix_count; ++i) {
|
||||||
if (parser->model == HELO2 || parser->model == D4i ||
|
if (parser->model == HELO2 || parser->model == D4i ||
|
||||||
parser->model == D6i || parser->model == D9tx ||
|
parser->model == D6i || parser->model == D9tx ||
|
||||||
parser->model == DX || parser->model == ZOOPNOVO ||
|
parser->model == DX || parser->model == ZOOPNOVO_A ||
|
||||||
parser->model == VYPERNOVO || parser->model == D4F) {
|
parser->model == ZOOPNOVO_B || parser->model == VYPERNOVO ||
|
||||||
|
parser->model == D4F) {
|
||||||
parser->oxygen[i] = data[gasmix_offset + 6 * i + 1];
|
parser->oxygen[i] = data[gasmix_offset + 6 * i + 1];
|
||||||
parser->helium[i] = data[gasmix_offset + 6 * i + 2];
|
parser->helium[i] = data[gasmix_offset + 6 * i + 2];
|
||||||
} else {
|
} else {
|
||||||
@ -222,8 +225,9 @@ suunto_d9_parser_cache (suunto_d9_parser_t *parser)
|
|||||||
if (parser->model == HELO2) {
|
if (parser->model == HELO2) {
|
||||||
parser->gasmix = data[0x26];
|
parser->gasmix = data[0x26];
|
||||||
} else if (parser->model == D4i || parser->model == D6i ||
|
} else if (parser->model == D4i || parser->model == D6i ||
|
||||||
parser->model == D9tx || parser->model == ZOOPNOVO ||
|
parser->model == D9tx || parser->model == ZOOPNOVO_A ||
|
||||||
parser->model == VYPERNOVO || parser->model == D4F) {
|
parser->model == ZOOPNOVO_B || parser->model == VYPERNOVO ||
|
||||||
|
parser->model == D4F) {
|
||||||
if (id == ID_D4I_V2 || id == ID_D6I_V2) {
|
if (id == ID_D4I_V2 || id == ID_D6I_V2) {
|
||||||
parser->gasmix = data[0x2D];
|
parser->gasmix = data[0x2D];
|
||||||
} else {
|
} else {
|
||||||
@ -309,8 +313,9 @@ suunto_d9_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime)
|
|||||||
if (parser->model == HELO2 || parser->model == DX)
|
if (parser->model == HELO2 || parser->model == DX)
|
||||||
offset = 0x17;
|
offset = 0x17;
|
||||||
else if (parser->model == D4i || parser->model == D6i ||
|
else if (parser->model == D4i || parser->model == D6i ||
|
||||||
parser->model == D9tx || parser->model == ZOOPNOVO ||
|
parser->model == D9tx || parser->model == ZOOPNOVO_A ||
|
||||||
parser->model == VYPERNOVO || parser->model == D4F)
|
parser->model == ZOOPNOVO_B || parser->model == VYPERNOVO ||
|
||||||
|
parser->model == D4F)
|
||||||
offset = 0x13;
|
offset = 0x13;
|
||||||
|
|
||||||
if (abstract->size < offset + 7)
|
if (abstract->size < offset + 7)
|
||||||
@ -321,8 +326,8 @@ suunto_d9_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime)
|
|||||||
if (datetime) {
|
if (datetime) {
|
||||||
if (parser->model == D4i || parser->model == D6i ||
|
if (parser->model == D4i || parser->model == D6i ||
|
||||||
parser->model == D9tx || parser->model == DX ||
|
parser->model == D9tx || parser->model == DX ||
|
||||||
parser->model == ZOOPNOVO || parser->model == VYPERNOVO ||
|
parser->model == ZOOPNOVO_A || parser->model == ZOOPNOVO_B ||
|
||||||
parser->model == D4F) {
|
parser->model == VYPERNOVO || parser->model == D4F) {
|
||||||
datetime->year = p[0] + (p[1] << 8);
|
datetime->year = p[0] + (p[1] << 8);
|
||||||
datetime->month = p[2];
|
datetime->month = p[2];
|
||||||
datetime->day = p[3];
|
datetime->day = p[3];
|
||||||
@ -364,8 +369,8 @@ suunto_d9_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigne
|
|||||||
*((unsigned int *) value) = array_uint16_le (data + 0x0B);
|
*((unsigned int *) value) = array_uint16_le (data + 0x0B);
|
||||||
else if (parser->model == D4i || parser->model == D6i ||
|
else if (parser->model == D4i || parser->model == D6i ||
|
||||||
parser->model == D9tx || parser->model == DX ||
|
parser->model == D9tx || parser->model == DX ||
|
||||||
parser->model == ZOOPNOVO || parser->model == VYPERNOVO ||
|
parser->model == ZOOPNOVO_A || parser->model == ZOOPNOVO_B ||
|
||||||
parser->model == D4F)
|
parser->model == VYPERNOVO || parser->model == D4F)
|
||||||
*((unsigned int *) value) = array_uint16_le (data + 0x0D);
|
*((unsigned int *) value) = array_uint16_le (data + 0x0D);
|
||||||
else if (parser->model == HELO2)
|
else if (parser->model == HELO2)
|
||||||
*((unsigned int *) value) = array_uint16_le (data + 0x0D) * 60;
|
*((unsigned int *) value) = array_uint16_le (data + 0x0D) * 60;
|
||||||
@ -476,8 +481,8 @@ suunto_d9_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t ca
|
|||||||
unsigned int interval_sample_offset = 0x18;
|
unsigned int interval_sample_offset = 0x18;
|
||||||
if (parser->model == HELO2 || parser->model == D4i ||
|
if (parser->model == HELO2 || parser->model == D4i ||
|
||||||
parser->model == D6i || parser->model == D9tx ||
|
parser->model == D6i || parser->model == D9tx ||
|
||||||
parser->model == ZOOPNOVO || parser->model == VYPERNOVO ||
|
parser->model == ZOOPNOVO_A || parser->model == ZOOPNOVO_B ||
|
||||||
parser->model == D4F)
|
parser->model == VYPERNOVO || parser->model == D4F)
|
||||||
interval_sample_offset = 0x1E;
|
interval_sample_offset = 0x1E;
|
||||||
else if (parser->model == DX)
|
else if (parser->model == DX)
|
||||||
interval_sample_offset = 0x22;
|
interval_sample_offset = 0x22;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user