From c120f98754dd8f5c89b52350e49c42be29bd8bd4 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Wed, 26 Nov 2008 10:11:30 +0000 Subject: [PATCH] Stop reading the response to the init command in the handshake function. --- src/oceanic_veo250.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) 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) {