diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-06-18 15:50:37 +0900 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-06-22 08:43:47 -0700 |
commit | add253ca9eee79f97de5bfd25a456102f49bef86 (patch) | |
tree | 3f2d04b6786fb4e2b57d41bd1adef78bf5c2b5ff /core/serial_ftdi.c | |
parent | fc8068c57446d6db54e8f32215d6aee6f295e28f (diff) | |
download | subsurface-add253ca9eee79f97de5bfd25a456102f49bef86.tar.gz |
Convert to new libdivecomputer custom IO model
Instead of being "custom serial", it's a IO model that allows serial or
packet modes, independently of each other (ie you can have a bluetooth
device that does serial over BT rfcomm and packet-based communication
over BLE GATT with the same serial operations that describe both cases).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'core/serial_ftdi.c')
-rw-r--r-- | core/serial_ftdi.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/core/serial_ftdi.c b/core/serial_ftdi.c index 9b26517ab..0c9e6c428 100644 --- a/core/serial_ftdi.c +++ b/core/serial_ftdi.c @@ -43,7 +43,7 @@ //#define SYSERROR(context, errcode) ERROR(__FILE__ ":" __LINE__ ": %s", strerror(errcode)) #define SYSERROR(context, errcode) ; -#include <libdivecomputer/custom_serial.h> +#include <libdivecomputer/custom_io.h> #include <libdivecomputer/context.h> #define VID 0x0403 // Vendor ID of FTDI @@ -590,21 +590,21 @@ static dc_status_t serial_ftdi_set_rts (void **userdata, int level) return DC_STATUS_SUCCESS; } -dc_custom_serial_t serial_ftdi_ops = { +dc_custom_io_t serial_ftdi_ops = { .userdata = NULL, - .open = serial_ftdi_open, - .close = serial_ftdi_close, - .read = serial_ftdi_read, - .write = serial_ftdi_write, - .purge = serial_ftdi_flush, - .get_available = serial_ftdi_get_received, - .set_timeout = serial_ftdi_set_timeout, - .configure = serial_ftdi_configure, - .set_dtr = serial_ftdi_set_dtr, - .set_rts = serial_ftdi_set_rts, - .set_halfduplex = serial_ftdi_set_halfduplex, + .serial_open = serial_ftdi_open, + .serial_close = serial_ftdi_close, + .serial_read = serial_ftdi_read, + .serial_write = serial_ftdi_write, + .serial_purge = serial_ftdi_flush, + .serial_get_available = serial_ftdi_get_received, + .serial_set_timeout = serial_ftdi_set_timeout, + .serial_configure = serial_ftdi_configure, + .serial_set_dtr = serial_ftdi_set_dtr, + .serial_set_rts = serial_ftdi_set_rts, + .serial_set_halfduplex = serial_ftdi_set_halfduplex, // Can't be done in ftdi? // only used in vyper2 // NULL means NOP - .set_break = NULL + .serial_set_break = NULL }; |