Enable the model hint to speedup the autodetection.
This commit is contained in:
parent
781f0db71f
commit
52d8f08281
@ -32,7 +32,7 @@ test_dump_sdm (const char* name)
|
||||
device_t *device = NULL;
|
||||
|
||||
message ("suunto_d9_device_open\n");
|
||||
device_status_t rc = suunto_d9_device_open (&device, name);
|
||||
device_status_t rc = suunto_d9_device_open (&device, name, 0);
|
||||
if (rc != DEVICE_STATUS_SUCCESS) {
|
||||
WARNING ("Error opening serial port.");
|
||||
return rc;
|
||||
@ -72,7 +72,7 @@ test_dump_memory (const char* name, const char* filename)
|
||||
device_t *device = NULL;
|
||||
|
||||
message ("suunto_d9_device_open\n");
|
||||
device_status_t rc = suunto_d9_device_open (&device, name);
|
||||
device_status_t rc = suunto_d9_device_open (&device, name, 0);
|
||||
if (rc != DEVICE_STATUS_SUCCESS) {
|
||||
WARNING ("Error opening serial port.");
|
||||
return rc;
|
||||
|
||||
@ -604,7 +604,7 @@ dowork (device_type_t backend, unsigned int model, const char *devname, const ch
|
||||
rc = suunto_vyper2_device_open (&device, devname);
|
||||
break;
|
||||
case DEVICE_TYPE_SUUNTO_D9:
|
||||
rc = suunto_d9_device_open (&device, devname);
|
||||
rc = suunto_d9_device_open (&device, devname, model);
|
||||
break;
|
||||
case DEVICE_TYPE_UWATEC_ALADIN:
|
||||
rc = uwatec_aladin_device_open (&device, devname);
|
||||
|
||||
@ -123,7 +123,7 @@ suunto_d9_device_autodetect (suunto_d9_device_t *device, unsigned int model)
|
||||
|
||||
|
||||
device_status_t
|
||||
suunto_d9_device_open (device_t **out, const char* name)
|
||||
suunto_d9_device_open (device_t **out, const char* name, unsigned int model)
|
||||
{
|
||||
if (out == NULL)
|
||||
return DEVICE_STATUS_ERROR;
|
||||
@ -182,7 +182,7 @@ suunto_d9_device_open (device_t **out, const char* name)
|
||||
serial_flush (device->port, SERIAL_QUEUE_BOTH);
|
||||
|
||||
// Try to autodetect the protocol variant.
|
||||
device_status_t status = suunto_d9_device_autodetect (device, 0);
|
||||
device_status_t status = suunto_d9_device_autodetect (device, model);
|
||||
if (status != DEVICE_STATUS_SUCCESS) {
|
||||
WARNING ("Failed to identify the protocol variant.");
|
||||
serial_close (device->port);
|
||||
@ -191,7 +191,7 @@ suunto_d9_device_open (device_t **out, const char* name)
|
||||
}
|
||||
|
||||
// Override the base class values.
|
||||
unsigned int model = device->version[0];
|
||||
model = device->version[0];
|
||||
if (model == D4i || model == D6i || model == D9tx)
|
||||
device->base.layout = &suunto_d9tx_layout;
|
||||
else
|
||||
|
||||
@ -34,7 +34,7 @@ extern "C" {
|
||||
#define SUUNTO_D9_VERSION_SIZE 0x04
|
||||
|
||||
device_status_t
|
||||
suunto_d9_device_open (device_t **device, const char* name);
|
||||
suunto_d9_device_open (device_t **device, const char* name, unsigned int model);
|
||||
|
||||
device_status_t
|
||||
suunto_d9_device_reset_maxdepth (device_t *device);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user