Add fingerprint support for the Uwatec Aladin, Memomouse and Smart.
This commit is contained in:
parent
4368b94ff0
commit
03212f5c6f
@ -52,13 +52,14 @@ struct uwatec_aladin_device_t {
|
||||
unsigned int timestamp;
|
||||
};
|
||||
|
||||
static device_status_t uwatec_aladin_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size);
|
||||
static device_status_t uwatec_aladin_device_dump (device_t *abstract, unsigned char data[], unsigned int size, unsigned int *result);
|
||||
static device_status_t uwatec_aladin_device_foreach (device_t *abstract, dive_callback_t callback, void *userdata);
|
||||
static device_status_t uwatec_aladin_device_close (device_t *abstract);
|
||||
|
||||
static const device_backend_t uwatec_aladin_device_backend = {
|
||||
DEVICE_TYPE_UWATEC_ALADIN,
|
||||
NULL, /* set_fingerprint */
|
||||
uwatec_aladin_device_set_fingerprint, /* set_fingerprint */
|
||||
NULL, /* handshake */
|
||||
NULL, /* version */
|
||||
NULL, /* read */
|
||||
@ -173,6 +174,26 @@ uwatec_aladin_device_set_timestamp (device_t *abstract, unsigned int timestamp)
|
||||
}
|
||||
|
||||
|
||||
static device_status_t
|
||||
uwatec_aladin_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size)
|
||||
{
|
||||
uwatec_aladin_device_t *device = (uwatec_aladin_device_t*) abstract;
|
||||
|
||||
if (! device_is_uwatec_aladin (abstract))
|
||||
return DEVICE_STATUS_TYPE_MISMATCH;
|
||||
|
||||
if (size && size != 4)
|
||||
return DEVICE_STATUS_ERROR;
|
||||
|
||||
if (size)
|
||||
device->timestamp = data[0] + (data[1] << 8) + (data[2] << 16) + (data[3] << 24);
|
||||
else
|
||||
device->timestamp = 0;
|
||||
|
||||
return DEVICE_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static device_status_t
|
||||
uwatec_aladin_device_dump (device_t *abstract, unsigned char data[], unsigned int size, unsigned int *result)
|
||||
{
|
||||
|
||||
@ -51,13 +51,14 @@ struct uwatec_memomouse_device_t {
|
||||
unsigned int timestamp;
|
||||
};
|
||||
|
||||
static device_status_t uwatec_memomouse_device_set_fingerprint (device_t *device, const unsigned char data[], unsigned int size);
|
||||
static device_status_t uwatec_memomouse_device_dump (device_t *abstract, unsigned char data[], unsigned int size, unsigned int *result);
|
||||
static device_status_t uwatec_memomouse_device_foreach (device_t *abstract, dive_callback_t callback, void *userdata);
|
||||
static device_status_t uwatec_memomouse_device_close (device_t *abstract);
|
||||
|
||||
static const device_backend_t uwatec_memomouse_device_backend = {
|
||||
DEVICE_TYPE_UWATEC_MEMOMOUSE,
|
||||
NULL, /* set_fingerprint */
|
||||
uwatec_memomouse_device_set_fingerprint, /* set_fingerprint */
|
||||
NULL, /* handshake */
|
||||
NULL, /* version */
|
||||
NULL, /* read */
|
||||
@ -176,6 +177,26 @@ uwatec_memomouse_device_set_timestamp (device_t *abstract, unsigned int timestam
|
||||
}
|
||||
|
||||
|
||||
static device_status_t
|
||||
uwatec_memomouse_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size)
|
||||
{
|
||||
uwatec_memomouse_device_t *device = (uwatec_memomouse_device_t*) abstract;
|
||||
|
||||
if (! device_is_uwatec_memomouse (abstract))
|
||||
return DEVICE_STATUS_TYPE_MISMATCH;
|
||||
|
||||
if (size && size != 4)
|
||||
return DEVICE_STATUS_ERROR;
|
||||
|
||||
if (size)
|
||||
device->timestamp = data[0] + (data[1] << 8) + (data[2] << 16) + (data[3] << 24);
|
||||
else
|
||||
device->timestamp = 0;
|
||||
|
||||
return DEVICE_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static device_status_t
|
||||
uwatec_memomouse_confirm (uwatec_memomouse_device_t *device, unsigned char value)
|
||||
{
|
||||
|
||||
@ -48,13 +48,14 @@ struct uwatec_smart_device_t {
|
||||
unsigned int timestamp;
|
||||
};
|
||||
|
||||
static device_status_t uwatec_smart_device_set_fingerprint (device_t *device, const unsigned char data[], unsigned int size);
|
||||
static device_status_t uwatec_smart_device_dump (device_t *abstract, unsigned char data[], unsigned int size, unsigned int *result);
|
||||
static device_status_t uwatec_smart_device_foreach (device_t *abstract, dive_callback_t callback, void *userdata);
|
||||
static device_status_t uwatec_smart_device_close (device_t *abstract);
|
||||
|
||||
static const device_backend_t uwatec_smart_device_backend = {
|
||||
DEVICE_TYPE_UWATEC_SMART,
|
||||
NULL, /* set_fingerprint */
|
||||
uwatec_smart_device_set_fingerprint, /* set_fingerprint */
|
||||
NULL, /* handshake */
|
||||
NULL, /* version */
|
||||
NULL, /* read */
|
||||
@ -203,6 +204,26 @@ uwatec_smart_device_set_timestamp (device_t *abstract, unsigned int timestamp)
|
||||
}
|
||||
|
||||
|
||||
static device_status_t
|
||||
uwatec_smart_device_set_fingerprint (device_t *abstract, const unsigned char data[], unsigned int size)
|
||||
{
|
||||
uwatec_smart_device_t *device = (uwatec_smart_device_t*) abstract;
|
||||
|
||||
if (! device_is_uwatec_smart (abstract))
|
||||
return DEVICE_STATUS_TYPE_MISMATCH;
|
||||
|
||||
if (size && size != 4)
|
||||
return DEVICE_STATUS_ERROR;
|
||||
|
||||
if (size)
|
||||
device->timestamp = data[0] + (data[1] << 8) + (data[2] << 16) + (data[3] << 24);
|
||||
else
|
||||
device->timestamp = 0;
|
||||
|
||||
return DEVICE_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static device_status_t
|
||||
uwatec_smart_transfer (uwatec_smart_device_t *device, const unsigned char command[], unsigned int csize, unsigned char answer[], unsigned int asize)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user