diff --git a/src/oceanic_veo250.c b/src/oceanic_veo250.c index c63168b..9ac90f2 100644 --- a/src/oceanic_veo250.c +++ b/src/oceanic_veo250.c @@ -193,21 +193,6 @@ oceanic_veo250_init (oceanic_veo250_device_t *device) return rc; } - return DEVICE_STATUS_SUCCESS; -} - - -static device_status_t -oceanic_veo250_handshake (oceanic_veo250_device_t *device) -{ - // Send the command to the dive computer. - unsigned char command[2] = {0x98, 0x00}; - device_status_t rc = oceanic_veo250_send (device, command, sizeof (command)); - if (rc != DEVICE_STATUS_SUCCESS) { - WARNING ("Failed to send the command."); - return rc; - } - // Receive the answer of the dive computer. unsigned char answer[14] = {0}; int n = serial_read (device->port, answer, sizeof (answer)); @@ -229,6 +214,21 @@ oceanic_veo250_handshake (oceanic_veo250_device_t *device) } +static device_status_t +oceanic_veo250_handshake (oceanic_veo250_device_t *device) +{ + // Send the command to the dive computer. + unsigned char command[2] = {0x98, 0x00}; + device_status_t rc = oceanic_veo250_send (device, command, sizeof (command)); + if (rc != DEVICE_STATUS_SUCCESS) { + WARNING ("Failed to send the command."); + return rc; + } + + return DEVICE_STATUS_SUCCESS; +} + + device_status_t oceanic_veo250_device_open (device_t **out, const char* name) {