Rewrite libdivecomputer custom serial code

This rewrites the custom serial code to use the new api which I
implemented in the Subsurface-branch of libdivecomputer.

This is a bit to big patch but I haven't had the time to break it down
into more sensible patches.

This rewrite enables us to support more ftdi based divecomputer
communication and is tested with both a OSTC3, OSTC2N and a Suunto
Vyper, all over the libftdi driver.

The bluetooth code paths are tested to, and should work as before.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2016-09-17 17:27:56 +02:00 committed by Dirk Hohndel
parent 1219dc6931
commit ffa3c48593
6 changed files with 204 additions and 293 deletions

View file

@ -10,6 +10,7 @@
#include <libdivecomputer/version.h>
#include <libdivecomputer/device.h>
#include <libdivecomputer/parser.h>
#include <libdivecomputer/custom_serial.h>
#include "dive.h"
@ -59,8 +60,11 @@ extern char *logfile_name;
extern char *dumpfile_name;
#if SSRF_CUSTOM_SERIAL
extern dc_status_t dc_serial_qt_open(dc_serial_t **out, dc_context_t *context, const char *devaddr);
extern dc_status_t dc_serial_ftdi_open(dc_serial_t **out, dc_context_t *context);
// WTF. this symbol never shows up at link time
//extern dc_custom_serial_t qt_serial_ops;
// Thats why I've worked around it with a stupid helper returning it.
dc_custom_serial_t* get_qt_serial_ops();
extern dc_custom_serial_t serial_ftdi_ops;
#endif
#ifdef __cplusplus