From 2a7e4fdc7db2811fe6bb20b864c4a923f7c71bf0 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Fri, 21 Nov 2008 08:40:08 +0000 Subject: [PATCH] Discard garbage bytes before sending a command. --- src/oceanic_veo250.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/oceanic_veo250.c b/src/oceanic_veo250.c index 3a27727..35c9aeb 100644 --- a/src/oceanic_veo250.c +++ b/src/oceanic_veo250.c @@ -82,6 +82,9 @@ device_is_oceanic_veo250 (device_t *abstract) static device_status_t oceanic_veo250_send (oceanic_veo250_device_t *device, const unsigned char command[], unsigned int csize) { + // Discard garbage bytes. + serial_flush (device->port, SERIAL_QUEUE_INPUT); + // Send the command to the dive computer and // wait until all data has been transmitted. serial_write (device->port, command, csize);