Add set_timeout callback for serial custom implementation

The new callback will be usefull when we will implement the support
for Windows. The implementation of native serial set_timeout method
uses a HANDLER on Windows and we will use the WinSock2 API which has
a socket descriptor.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Claudiu Olteanu 2015-08-13 01:38:03 +03:00 committed by Dirk Hohndel
parent adfff2d4a7
commit a6274a3a55
2 changed files with 3 additions and 1 deletions

View File

@ -44,6 +44,7 @@ typedef struct dc_serial_operations_t
int (*flush) (serial_t *device, int queue);
int (*get_received) (serial_t *device);
int (*get_transmitted) (serial_t *device);
int (*set_timeout) (serial_t *device, long timeout);
} dc_serial_operations_t;
typedef struct dc_serial_t {

View File

@ -32,7 +32,8 @@ const dc_serial_operations_t native_serial_ops = {
.write = serial_write,
.flush = serial_flush,
.get_received = serial_get_received,
.get_transmitted = serial_get_transmitted
.get_transmitted = serial_get_transmitted,
.set_timeout = serial_set_timeout
};