From ec04cc516cc9af73aa6f97f47d7ea9586575969a Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Wed, 19 Dec 2007 09:15:12 +0000 Subject: [PATCH] Prepare to add support for other Suunto dive computers. --- suunto.h | 38 +++------------------------- suunto_vyper.h | 36 ++++++++++++++++++++++++++ suunto_test.c => suunto_vyper_test.c | 0 3 files changed, 40 insertions(+), 34 deletions(-) create mode 100644 suunto_vyper.h rename suunto_test.c => suunto_vyper_test.c (100%) diff --git a/suunto.h b/suunto.h index e10759a..6a4cc89 100644 --- a/suunto.h +++ b/suunto.h @@ -1,36 +1,6 @@ -#ifndef SUUNTO_VYPER_H -#define SUUNTO_VYPER_H +#ifndef SUUNTO_H +#define SUUNTO_H -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +#include "suunto_vyper.h" -typedef struct vyper vyper; - -#define SUUNTO_VYPER_MEMORY_SIZE 0x2000 -#define SUUNTO_VYPER_PACKET_SIZE 32 - -#define SUUNTO_VYPER_SUCCESS 0 -#define SUUNTO_VYPER_ERROR -1 -#define SUUNTO_VYPER_ERROR_IO -2 -#define SUUNTO_VYPER_ERROR_MEMORY -3 -#define SUUNTO_VYPER_ERROR_PROTOCOL -4 -#define SUUNTO_VYPER_ERROR_TIMEOUT -5 - -int suunto_vyper_open (vyper **device, const char* name); - -int suunto_vyper_close (vyper *device); - -int suunto_vyper_detect_interface (vyper *device); - -int suunto_vyper_read_dive (vyper *device, unsigned char data[], unsigned int size, int init); - -int suunto_vyper_read_memory (vyper *device, unsigned int address, unsigned char data[], unsigned int size); - -int suunto_vyper_write_memory (vyper *device, unsigned int address, const unsigned char data[], unsigned int size); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* SUUNTO_VYPER_H */ +#endif /* SUUNTO_H */ diff --git a/suunto_vyper.h b/suunto_vyper.h new file mode 100644 index 0000000..e10759a --- /dev/null +++ b/suunto_vyper.h @@ -0,0 +1,36 @@ +#ifndef SUUNTO_VYPER_H +#define SUUNTO_VYPER_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +typedef struct vyper vyper; + +#define SUUNTO_VYPER_MEMORY_SIZE 0x2000 +#define SUUNTO_VYPER_PACKET_SIZE 32 + +#define SUUNTO_VYPER_SUCCESS 0 +#define SUUNTO_VYPER_ERROR -1 +#define SUUNTO_VYPER_ERROR_IO -2 +#define SUUNTO_VYPER_ERROR_MEMORY -3 +#define SUUNTO_VYPER_ERROR_PROTOCOL -4 +#define SUUNTO_VYPER_ERROR_TIMEOUT -5 + +int suunto_vyper_open (vyper **device, const char* name); + +int suunto_vyper_close (vyper *device); + +int suunto_vyper_detect_interface (vyper *device); + +int suunto_vyper_read_dive (vyper *device, unsigned char data[], unsigned int size, int init); + +int suunto_vyper_read_memory (vyper *device, unsigned int address, unsigned char data[], unsigned int size); + +int suunto_vyper_write_memory (vyper *device, unsigned int address, const unsigned char data[], unsigned int size); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* SUUNTO_VYPER_H */ diff --git a/suunto_test.c b/suunto_vyper_test.c similarity index 100% rename from suunto_test.c rename to suunto_vyper_test.c