Added a new function for the keepalive command.

This commit is contained in:
Jef Driesen 2008-12-27 16:17:49 +00:00
parent 56b52f8fad
commit 7195c000e4
3 changed files with 22 additions and 0 deletions

View File

@ -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

View File

@ -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)
{

View File

@ -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 */