Added a new function for the keepalive command.
This commit is contained in:
parent
56b52f8fad
commit
7195c000e4
@ -32,6 +32,7 @@ message_set_logfile
|
||||
mares_nemo_device_open
|
||||
mares_nemo_extract_dives
|
||||
oceanic_atom2_device_open
|
||||
oceanic_atom2_device_keepalive
|
||||
oceanic_veo250_device_open
|
||||
oceanic_veo250_device_keepalive
|
||||
oceanic_vtpro_device_open
|
||||
|
||||
@ -314,6 +314,24 @@ oceanic_atom2_device_close (device_t *abstract)
|
||||
}
|
||||
|
||||
|
||||
device_status_t
|
||||
oceanic_atom2_device_keepalive (device_t *abstract)
|
||||
{
|
||||
oceanic_atom2_device_t *device = (oceanic_atom2_device_t*) abstract;
|
||||
|
||||
if (! device_is_oceanic_atom2 (abstract))
|
||||
return DEVICE_STATUS_TYPE_MISMATCH;
|
||||
|
||||
// Send the command to the dive computer.
|
||||
unsigned char command[4] = {0x91, 0x05, 0xA5, 0x00};
|
||||
device_status_t rc = oceanic_atom2_transfer (device, command, sizeof (command), NULL, 0);
|
||||
if (rc != DEVICE_STATUS_SUCCESS)
|
||||
return rc;
|
||||
|
||||
return DEVICE_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static device_status_t
|
||||
oceanic_atom2_device_version (device_t *abstract, unsigned char data[], unsigned int size)
|
||||
{
|
||||
|
||||
@ -34,6 +34,9 @@ extern "C" {
|
||||
device_status_t
|
||||
oceanic_atom2_device_open (device_t **device, const char* name);
|
||||
|
||||
device_status_t
|
||||
oceanic_atom2_device_keepalive (device_t *device);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user