Use the common fingerprint function directly.
This commit is contained in:
parent
ce84e85bb6
commit
f8b465fba1
@ -44,8 +44,10 @@ suunto_common_device_init (suunto_common_device_t *device, const device_backend_
|
||||
|
||||
|
||||
device_status_t
|
||||
suunto_common_device_set_fingerprint (suunto_common_device_t *device, const unsigned char data[], unsigned int size)
|
||||
suunto_common_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size)
|
||||
{
|
||||
suunto_common_device_t *device = (suunto_common_device_t *) abstract;
|
||||
|
||||
assert (device != NULL);
|
||||
|
||||
if (size && size != sizeof (device->fingerprint))
|
||||
|
||||
@ -49,7 +49,7 @@ void
|
||||
suunto_common_device_init (suunto_common_device_t *device, const device_backend_t *backend);
|
||||
|
||||
device_status_t
|
||||
suunto_common_device_set_fingerprint (suunto_common_device_t *device, const unsigned char data[], unsigned int size);
|
||||
suunto_common_device_set_fingerprint (device_t *device, const unsigned char data[], unsigned int size);
|
||||
|
||||
device_status_t
|
||||
suunto_common_extract_dives (suunto_common_device_t *device, const suunto_common_layout_t *layout, const unsigned char data[], dive_callback_t callback, void *userdata);
|
||||
|
||||
@ -41,14 +41,13 @@ typedef struct suunto_eon_device_t {
|
||||
struct serial *port;
|
||||
} suunto_eon_device_t;
|
||||
|
||||
static device_status_t suunto_eon_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size);
|
||||
static device_status_t suunto_eon_device_dump (device_t *abstract, dc_buffer_t *buffer);
|
||||
static device_status_t suunto_eon_device_foreach (device_t *abstract, dive_callback_t callback, void *userdata);
|
||||
static device_status_t suunto_eon_device_close (device_t *abstract);
|
||||
|
||||
static const device_backend_t suunto_eon_device_backend = {
|
||||
DEVICE_TYPE_SUUNTO_EON,
|
||||
suunto_eon_device_set_fingerprint, /* set_fingerprint */
|
||||
suunto_common_device_set_fingerprint, /* set_fingerprint */
|
||||
NULL, /* version */
|
||||
NULL, /* read */
|
||||
NULL, /* write */
|
||||
@ -155,18 +154,6 @@ suunto_eon_device_close (device_t *abstract)
|
||||
}
|
||||
|
||||
|
||||
static device_status_t
|
||||
suunto_eon_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size)
|
||||
{
|
||||
suunto_common_device_t *device = (suunto_common_device_t*) abstract;
|
||||
|
||||
if (! device_is_suunto_eon (abstract))
|
||||
return DEVICE_STATUS_TYPE_MISMATCH;
|
||||
|
||||
return suunto_common_device_set_fingerprint (device, data, size);
|
||||
}
|
||||
|
||||
|
||||
static device_status_t
|
||||
suunto_eon_device_dump (device_t *abstract, dc_buffer_t *buffer)
|
||||
{
|
||||
|
||||
@ -50,7 +50,6 @@ typedef struct suunto_vyper_device_t {
|
||||
unsigned int delay;
|
||||
} suunto_vyper_device_t;
|
||||
|
||||
static device_status_t suunto_vyper_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size);
|
||||
static device_status_t suunto_vyper_device_read (device_t *abstract, unsigned int address, unsigned char data[], unsigned int size);
|
||||
static device_status_t suunto_vyper_device_write (device_t *abstract, unsigned int address, const unsigned char data[], unsigned int size);
|
||||
static device_status_t suunto_vyper_device_dump (device_t *abstract, dc_buffer_t *buffer);
|
||||
@ -59,7 +58,7 @@ static device_status_t suunto_vyper_device_close (device_t *abstract);
|
||||
|
||||
static const device_backend_t suunto_vyper_device_backend = {
|
||||
DEVICE_TYPE_SUUNTO_VYPER,
|
||||
suunto_vyper_device_set_fingerprint, /* set_fingerprint */
|
||||
suunto_common_device_set_fingerprint, /* set_fingerprint */
|
||||
NULL, /* version */
|
||||
suunto_vyper_device_read, /* read */
|
||||
suunto_vyper_device_write, /* write */
|
||||
@ -195,18 +194,6 @@ suunto_vyper_device_set_delay (device_t *abstract, unsigned int delay)
|
||||
}
|
||||
|
||||
|
||||
static device_status_t
|
||||
suunto_vyper_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size)
|
||||
{
|
||||
suunto_common_device_t *device = (suunto_common_device_t*) abstract;
|
||||
|
||||
if (! device_is_suunto_vyper (abstract))
|
||||
return DEVICE_STATUS_TYPE_MISMATCH;
|
||||
|
||||
return suunto_common_device_set_fingerprint (device, data, size);
|
||||
}
|
||||
|
||||
|
||||
static device_status_t
|
||||
suunto_vyper_send (suunto_vyper_device_t *device, const unsigned char command[], unsigned int csize)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user