Autodetect the difference between a Vyper and a Spyder.
This commit is contained in:
parent
8391b4201d
commit
1c736835eb
@ -66,7 +66,6 @@ suunto_eon_device_open
|
||||
suunto_eon_device_write_interval
|
||||
suunto_eon_device_write_name
|
||||
suunto_eon_extract_dives
|
||||
suunto_spyder_extract_dives
|
||||
suunto_vyper2_device_open
|
||||
suunto_vyper2_device_reset_maxdepth
|
||||
suunto_vyper_device_open
|
||||
|
||||
@ -613,18 +613,15 @@ suunto_vyper_extract_dives (const unsigned char data[], unsigned int size, dive_
|
||||
{
|
||||
assert (size >= SUUNTO_VYPER_MEMORY_SIZE);
|
||||
|
||||
unsigned int eop = (data[0x51] << 8) + data[0x52];
|
||||
unsigned int vyper = 1;
|
||||
if (data[HDR_DEVINFO_VYPER] == 20 || data[HDR_DEVINFO_VYPER] == 30 || data[HDR_DEVINFO_VYPER] == 60)
|
||||
vyper = 0;
|
||||
|
||||
return suunto_common_extract_dives (data, 0x71, SUUNTO_VYPER_MEMORY_SIZE, eop, 5, callback, userdata);
|
||||
}
|
||||
|
||||
|
||||
device_status_t
|
||||
suunto_spyder_extract_dives (const unsigned char data[], unsigned int size, dive_callback_t callback, void *userdata)
|
||||
{
|
||||
assert (size >= SUUNTO_VYPER_MEMORY_SIZE);
|
||||
|
||||
unsigned int eop = (data[0x1C] << 8) + data[0x1D];
|
||||
|
||||
return suunto_common_extract_dives (data, 0x4C, SUUNTO_VYPER_MEMORY_SIZE, eop, 3, callback, userdata);
|
||||
if (vyper) {
|
||||
unsigned int eop = (data[0x51] << 8) + data[0x52];
|
||||
return suunto_common_extract_dives (data, 0x71, SUUNTO_VYPER_MEMORY_SIZE, eop, 5, callback, userdata);
|
||||
} else {
|
||||
unsigned int eop = (data[0x1C] << 8) + data[0x1D];
|
||||
return suunto_common_extract_dives (data, 0x4C, SUUNTO_VYPER_MEMORY_SIZE, eop, 3, callback, userdata);
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,9 +44,6 @@ suunto_vyper_device_read_dive (device_t *device, unsigned char data[], unsigned
|
||||
device_status_t
|
||||
suunto_vyper_extract_dives (const unsigned char data[], unsigned int size, dive_callback_t callback, void *userdata);
|
||||
|
||||
device_status_t
|
||||
suunto_spyder_extract_dives (const unsigned char data[], unsigned int size, dive_callback_t callback, void *userdata);
|
||||
|
||||
parser_status_t
|
||||
suunto_vyper_parser_create (parser_t **parser);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user