Use a more consistent typedef in the serial and irda backends.
This commit is contained in:
parent
d4766904f5
commit
887d744e6d
@ -49,7 +49,7 @@
|
||||
|
||||
typedef struct cressi_edy_device_t {
|
||||
device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
unsigned char fingerprint[PAGESIZE / 2];
|
||||
} cressi_edy_device_t;
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
|
||||
typedef struct hw_ostc_device_t {
|
||||
device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
unsigned char fingerprint[5];
|
||||
} hw_ostc_device_t;
|
||||
|
||||
|
||||
22
src/irda.c
22
src/irda.c
@ -63,7 +63,7 @@
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
struct irda {
|
||||
struct irda_t {
|
||||
#ifdef _WIN32
|
||||
SOCKET fd;
|
||||
#else
|
||||
@ -152,13 +152,13 @@ int irda_cleanup (void)
|
||||
|
||||
|
||||
int
|
||||
irda_socket_open (irda **out)
|
||||
irda_socket_open (irda_t **out)
|
||||
{
|
||||
if (out == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
|
||||
// Allocate memory.
|
||||
struct irda *device = (struct irda *) malloc (sizeof (struct irda));
|
||||
irda_t *device = (irda_t *) malloc (sizeof (irda_t));
|
||||
if (device == NULL) {
|
||||
TRACE ("malloc");
|
||||
return -1; // ENOMEM (Not enough space)
|
||||
@ -186,7 +186,7 @@ irda_socket_open (irda **out)
|
||||
|
||||
|
||||
int
|
||||
irda_socket_close (irda *device)
|
||||
irda_socket_close (irda_t *device)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1;
|
||||
@ -214,7 +214,7 @@ irda_socket_close (irda *device)
|
||||
|
||||
|
||||
int
|
||||
irda_socket_set_timeout (irda *device, long timeout)
|
||||
irda_socket_set_timeout (irda_t *device, long timeout)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
@ -237,7 +237,7 @@ irda_socket_set_timeout (irda *device, long timeout)
|
||||
#endif
|
||||
|
||||
int
|
||||
irda_socket_discover (irda *device, irda_callback_t callback, void *userdata)
|
||||
irda_socket_discover (irda_t *device, irda_callback_t callback, void *userdata)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1;
|
||||
@ -319,7 +319,7 @@ irda_socket_discover (irda *device, irda_callback_t callback, void *userdata)
|
||||
|
||||
|
||||
int
|
||||
irda_socket_connect_name (irda *device, unsigned int address, const char *name)
|
||||
irda_socket_connect_name (irda_t *device, unsigned int address, const char *name)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1;
|
||||
@ -354,7 +354,7 @@ irda_socket_connect_name (irda *device, unsigned int address, const char *name)
|
||||
}
|
||||
|
||||
int
|
||||
irda_socket_connect_lsap (irda *device, unsigned int address, unsigned int lsap)
|
||||
irda_socket_connect_lsap (irda_t *device, unsigned int address, unsigned int lsap)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1;
|
||||
@ -385,7 +385,7 @@ irda_socket_connect_lsap (irda *device, unsigned int address, unsigned int lsap)
|
||||
|
||||
|
||||
int
|
||||
irda_socket_available (irda* device)
|
||||
irda_socket_available (irda_t *device)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
@ -407,7 +407,7 @@ irda_socket_available (irda* device)
|
||||
|
||||
|
||||
int
|
||||
irda_socket_read (irda* device, void* data, unsigned int size)
|
||||
irda_socket_read (irda_t *device, void *data, unsigned int size)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
@ -448,7 +448,7 @@ irda_socket_read (irda* device, void* data, unsigned int size)
|
||||
|
||||
|
||||
int
|
||||
irda_socket_write (irda* device, const void *data, unsigned int size)
|
||||
irda_socket_write (irda_t *device, const void *data, unsigned int size)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
|
||||
20
src/irda.h
20
src/irda.h
@ -26,7 +26,7 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct irda irda;
|
||||
typedef struct irda_t irda_t;
|
||||
|
||||
typedef void (*irda_callback_t) (unsigned int address, const char *name, unsigned int charset, unsigned int hints, void *userdata);
|
||||
|
||||
@ -38,22 +38,22 @@ int irda_init (void);
|
||||
|
||||
int irda_cleanup (void);
|
||||
|
||||
int irda_socket_open (irda **device);
|
||||
int irda_socket_open (irda_t **device);
|
||||
|
||||
int irda_socket_close (irda *device);
|
||||
int irda_socket_close (irda_t *device);
|
||||
|
||||
int irda_socket_set_timeout (irda *device, long timeout);
|
||||
int irda_socket_set_timeout (irda_t *device, long timeout);
|
||||
|
||||
int irda_socket_discover (irda *device, irda_callback_t callback, void *userdata);
|
||||
int irda_socket_discover (irda_t *device, irda_callback_t callback, void *userdata);
|
||||
|
||||
int irda_socket_connect_name (irda *device, unsigned int address, const char *name);
|
||||
int irda_socket_connect_lsap (irda *device, unsigned int address, unsigned int lsap);
|
||||
int irda_socket_connect_name (irda_t *device, unsigned int address, const char *name);
|
||||
int irda_socket_connect_lsap (irda_t *device, unsigned int address, unsigned int lsap);
|
||||
|
||||
int irda_socket_available (irda* device);
|
||||
int irda_socket_available (irda_t *device);
|
||||
|
||||
int irda_socket_read (irda* device, void* data, unsigned int size);
|
||||
int irda_socket_read (irda_t *device, void *data, unsigned int size);
|
||||
|
||||
int irda_socket_write (irda* device, const void *data, unsigned int size);
|
||||
int irda_socket_write (irda_t *device, const void *data, unsigned int size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -52,63 +52,63 @@ irda_cleanup (void)
|
||||
|
||||
|
||||
int
|
||||
irda_socket_open (irda **out)
|
||||
irda_socket_open (irda_t **out)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
irda_socket_close (irda *device)
|
||||
irda_socket_close (irda_t *device)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
irda_socket_set_timeout (irda *device, long timeout)
|
||||
irda_socket_set_timeout (irda_t *device, long timeout)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
irda_socket_discover (irda *device, irda_callback_t callback, void *userdata)
|
||||
irda_socket_discover (irda_t *device, irda_callback_t callback, void *userdata)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
irda_socket_connect_name (irda *device, unsigned int address, const char *name)
|
||||
irda_socket_connect_name (irda_t *device, unsigned int address, const char *name)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
irda_socket_connect_lsap (irda *device, unsigned int address, unsigned int lsap)
|
||||
irda_socket_connect_lsap (irda_t *device, unsigned int address, unsigned int lsap)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
irda_socket_available (irda* device)
|
||||
irda_socket_available (irda_t *device)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
irda_socket_read (irda* device, void* data, unsigned int size)
|
||||
irda_socket_read (irda_t *device, void *data, unsigned int size)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
irda_socket_write (irda* device, const void *data, unsigned int size)
|
||||
irda_socket_write (irda_t *device, const void *data, unsigned int size)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
|
||||
typedef struct mares_iconhd_device_t {
|
||||
device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
} mares_iconhd_device_t;
|
||||
|
||||
static device_status_t mares_iconhd_device_dump (device_t *abstract, dc_buffer_t *buffer);
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
typedef struct mares_nemo_device_t {
|
||||
mares_common_device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
} mares_nemo_device_t;
|
||||
|
||||
static device_status_t mares_nemo_device_dump (device_t *abstract, dc_buffer_t *buffer);
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
typedef struct mares_puck_device_t {
|
||||
mares_common_device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
} mares_puck_device_t;
|
||||
|
||||
static device_status_t mares_puck_device_read (device_t *abstract, unsigned int address, unsigned char data[], unsigned int size);
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
typedef struct oceanic_atom2_device_t {
|
||||
oceanic_common_device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
unsigned char version[PAGESIZE];
|
||||
} oceanic_atom2_device_t;
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
|
||||
typedef struct oceanic_veo250_device_t {
|
||||
oceanic_common_device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
unsigned int last;
|
||||
unsigned char version[PAGESIZE];
|
||||
} oceanic_veo250_device_t;
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
|
||||
typedef struct oceanic_vtpro_device_t {
|
||||
oceanic_common_device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
unsigned char version[PAGESIZE];
|
||||
} oceanic_vtpro_device_t;
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
|
||||
typedef struct reefnet_sensus_device_t {
|
||||
device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
unsigned char handshake[REEFNET_SENSUS_HANDSHAKE_SIZE];
|
||||
unsigned int waiting;
|
||||
unsigned int timestamp;
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
typedef struct reefnet_sensuspro_device_t {
|
||||
device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
unsigned char handshake[REEFNET_SENSUSPRO_HANDSHAKE_SIZE];
|
||||
unsigned int timestamp;
|
||||
unsigned int devtime;
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
typedef struct reefnet_sensusultra_device_t {
|
||||
device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
unsigned char handshake[REEFNET_SENSUSULTRA_HANDSHAKE_SIZE];
|
||||
unsigned int maxretries;
|
||||
unsigned int timestamp;
|
||||
|
||||
44
src/serial.h
44
src/serial.h
@ -26,34 +26,34 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct serial serial;
|
||||
typedef struct serial_t serial_t;
|
||||
|
||||
enum parity_t {
|
||||
typedef enum serial_parity_t {
|
||||
SERIAL_PARITY_NONE,
|
||||
SERIAL_PARITY_EVEN,
|
||||
SERIAL_PARITY_ODD
|
||||
};
|
||||
} serial_parity_t;
|
||||
|
||||
enum flowcontrol_t {
|
||||
typedef enum serial_flowcontrol_t {
|
||||
SERIAL_FLOWCONTROL_NONE,
|
||||
SERIAL_FLOWCONTROL_HARDWARE,
|
||||
SERIAL_FLOWCONTROL_SOFTWARE
|
||||
};
|
||||
} serial_flowcontrol_t;
|
||||
|
||||
enum queue_t {
|
||||
typedef enum serial_queue_t {
|
||||
SERIAL_QUEUE_INPUT = 0x01,
|
||||
SERIAL_QUEUE_OUTPUT = 0x02,
|
||||
SERIAL_QUEUE_BOTH = SERIAL_QUEUE_INPUT | SERIAL_QUEUE_OUTPUT
|
||||
};
|
||||
} serial_queue_t;
|
||||
|
||||
int serial_errcode (void);
|
||||
const char* serial_errmsg (void);
|
||||
|
||||
int serial_open (serial **device, const char* name);
|
||||
int serial_open (serial_t **device, const char* name);
|
||||
|
||||
int serial_close (serial *device);
|
||||
int serial_close (serial_t *device);
|
||||
|
||||
int serial_configure (serial *device, int baudrate, int databits, int parity, int stopbits, int flowcontrol);
|
||||
int serial_configure (serial_t *device, int baudrate, int databits, int parity, int stopbits, int flowcontrol);
|
||||
|
||||
//
|
||||
// Available read modes:
|
||||
@ -77,24 +77,24 @@ int serial_configure (serial *device, int baudrate, int databits, int parity, in
|
||||
// with the bytes that have already been received.
|
||||
//
|
||||
|
||||
int serial_set_timeout (serial *device, long timeout /* milliseconds */);
|
||||
int serial_set_timeout (serial_t *device, long timeout /* milliseconds */);
|
||||
|
||||
int serial_set_queue_size (serial *device, unsigned int input, unsigned int output);
|
||||
int serial_set_queue_size (serial_t *device, unsigned int input, unsigned int output);
|
||||
|
||||
int serial_read (serial *device, void* data, unsigned int size);
|
||||
int serial_write (serial *device, const void* data, unsigned int size);
|
||||
int serial_read (serial_t *device, void* data, unsigned int size);
|
||||
int serial_write (serial_t *device, const void* data, unsigned int size);
|
||||
|
||||
int serial_flush (serial *device, int queue);
|
||||
int serial_drain (serial *device);
|
||||
int serial_flush (serial_t *device, int queue);
|
||||
int serial_drain (serial_t *device);
|
||||
|
||||
int serial_send_break (serial *device);
|
||||
int serial_send_break (serial_t *device);
|
||||
|
||||
int serial_set_break (serial *device, int level);
|
||||
int serial_set_dtr (serial *device, int level);
|
||||
int serial_set_rts (serial *device, int level);
|
||||
int serial_set_break (serial_t *device, int level);
|
||||
int serial_set_dtr (serial_t *device, int level);
|
||||
int serial_set_rts (serial_t *device, int level);
|
||||
|
||||
int serial_get_received (serial *device);
|
||||
int serial_get_transmitted (serial *device);
|
||||
int serial_get_received (serial_t *device);
|
||||
int serial_get_transmitted (serial_t *device);
|
||||
|
||||
int serial_sleep (unsigned long timeout /* milliseconds */);
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
errno = error; \
|
||||
}
|
||||
|
||||
struct serial {
|
||||
struct serial_t {
|
||||
/*
|
||||
* The file descriptor corresponding to the serial port.
|
||||
*/
|
||||
@ -78,13 +78,13 @@ const char* serial_errmsg (void)
|
||||
//
|
||||
|
||||
int
|
||||
serial_open (serial** out, const char* name)
|
||||
serial_open (serial_t **out, const char* name)
|
||||
{
|
||||
if (out == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
|
||||
// Allocate memory.
|
||||
struct serial *device = (struct serial *) malloc (sizeof (struct serial));
|
||||
serial_t *device = (serial_t *) malloc (sizeof (serial_t));
|
||||
if (device == NULL) {
|
||||
TRACE ("malloc");
|
||||
return -1; // ENOMEM (Not enough space)
|
||||
@ -123,7 +123,7 @@ serial_open (serial** out, const char* name)
|
||||
//
|
||||
|
||||
int
|
||||
serial_close (serial* device)
|
||||
serial_close (serial_t *device)
|
||||
{
|
||||
if (device == NULL)
|
||||
return 0;
|
||||
@ -154,7 +154,7 @@ serial_close (serial* device)
|
||||
//
|
||||
|
||||
int
|
||||
serial_configure (serial *device, int baudrate, int databits, int parity, int stopbits, int flowcontrol)
|
||||
serial_configure (serial_t *device, int baudrate, int databits, int parity, int stopbits, int flowcontrol)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
@ -328,7 +328,7 @@ serial_configure (serial *device, int baudrate, int databits, int parity, int st
|
||||
//
|
||||
|
||||
int
|
||||
serial_set_timeout (serial *device, long timeout)
|
||||
serial_set_timeout (serial_t *device, long timeout)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
@ -344,7 +344,7 @@ serial_set_timeout (serial *device, long timeout)
|
||||
//
|
||||
|
||||
int
|
||||
serial_set_queue_size (serial *device, unsigned int input, unsigned int output)
|
||||
serial_set_queue_size (serial_t *device, unsigned int input, unsigned int output)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // ERROR_INVALID_PARAMETER (The parameter is incorrect)
|
||||
@ -431,7 +431,7 @@ serial_poll_internal (int fd, int queue, long timeout, const struct timeval *tim
|
||||
|
||||
|
||||
int
|
||||
serial_read (serial* device, void* data, unsigned int size)
|
||||
serial_read (serial_t *device, void* data, unsigned int size)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
@ -492,7 +492,7 @@ serial_read (serial* device, void* data, unsigned int size)
|
||||
|
||||
|
||||
int
|
||||
serial_write (serial* device, const void* data, unsigned int size)
|
||||
serial_write (serial_t *device, const void* data, unsigned int size)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
@ -527,7 +527,7 @@ serial_write (serial* device, const void* data, unsigned int size)
|
||||
|
||||
|
||||
int
|
||||
serial_flush (serial *device, int queue)
|
||||
serial_flush (serial_t *device, int queue)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
@ -556,7 +556,7 @@ serial_flush (serial *device, int queue)
|
||||
|
||||
|
||||
int
|
||||
serial_drain (serial *device)
|
||||
serial_drain (serial_t *device)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
@ -573,7 +573,7 @@ serial_drain (serial *device)
|
||||
|
||||
|
||||
int
|
||||
serial_send_break (serial *device)
|
||||
serial_send_break (serial_t *device)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
@ -588,7 +588,7 @@ serial_send_break (serial *device)
|
||||
|
||||
|
||||
int
|
||||
serial_set_break (serial *device, int level)
|
||||
serial_set_break (serial_t *device, int level)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
@ -619,7 +619,7 @@ serial_set_status (int fd, int value, int level)
|
||||
|
||||
|
||||
int
|
||||
serial_set_dtr (serial *device, int level)
|
||||
serial_set_dtr (serial_t *device, int level)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
@ -629,7 +629,7 @@ serial_set_dtr (serial *device, int level)
|
||||
|
||||
|
||||
int
|
||||
serial_set_rts (serial *device, int level)
|
||||
serial_set_rts (serial_t *device, int level)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
@ -639,7 +639,7 @@ serial_set_rts (serial *device, int level)
|
||||
|
||||
|
||||
int
|
||||
serial_get_received (serial *device)
|
||||
serial_get_received (serial_t *device)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
@ -655,7 +655,7 @@ serial_get_received (serial *device)
|
||||
|
||||
|
||||
int
|
||||
serial_get_transmitted (serial *device)
|
||||
serial_get_transmitted (serial_t *device)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // EINVAL (Invalid argument)
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
SetLastError (error); \
|
||||
}
|
||||
|
||||
struct serial {
|
||||
struct serial_t {
|
||||
/*
|
||||
* The file descriptor corresponding to the serial port.
|
||||
*/
|
||||
@ -86,13 +86,13 @@ const char* serial_errmsg (void)
|
||||
//
|
||||
|
||||
int
|
||||
serial_open (serial** out, const char* name)
|
||||
serial_open (serial_t **out, const char* name)
|
||||
{
|
||||
if (out == NULL)
|
||||
return -1; // ERROR_INVALID_PARAMETER (The parameter is incorrect)
|
||||
|
||||
// Allocate memory.
|
||||
struct serial *device = (struct serial *) malloc (sizeof (struct serial));
|
||||
serial_t *device = (serial_t *) malloc (sizeof (serial_t));
|
||||
if (device == NULL) {
|
||||
TRACE ("malloc");
|
||||
return -1; // ERROR_OUTOFMEMORY (Not enough storage is available to complete this operation)
|
||||
@ -133,7 +133,7 @@ serial_open (serial** out, const char* name)
|
||||
//
|
||||
|
||||
int
|
||||
serial_close (serial* device)
|
||||
serial_close (serial_t *device)
|
||||
{
|
||||
if (device == NULL)
|
||||
return 0;
|
||||
@ -165,7 +165,7 @@ serial_close (serial* device)
|
||||
//
|
||||
|
||||
int
|
||||
serial_configure (serial *device, int baudrate, int databits, int parity, int stopbits, int flowcontrol)
|
||||
serial_configure (serial_t *device, int baudrate, int databits, int parity, int stopbits, int flowcontrol)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // ERROR_INVALID_PARAMETER (The parameter is incorrect)
|
||||
@ -279,7 +279,7 @@ serial_configure (serial *device, int baudrate, int databits, int parity, int st
|
||||
//
|
||||
|
||||
int
|
||||
serial_set_timeout (serial* device, long timeout)
|
||||
serial_set_timeout (serial_t *device, long timeout)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // ERROR_INVALID_PARAMETER (The parameter is incorrect)
|
||||
@ -329,7 +329,7 @@ serial_set_timeout (serial* device, long timeout)
|
||||
//
|
||||
|
||||
int
|
||||
serial_set_queue_size (serial *device, unsigned int input, unsigned int output)
|
||||
serial_set_queue_size (serial_t *device, unsigned int input, unsigned int output)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // ERROR_INVALID_PARAMETER (The parameter is incorrect)
|
||||
@ -343,7 +343,7 @@ serial_set_queue_size (serial *device, unsigned int input, unsigned int output)
|
||||
}
|
||||
|
||||
int
|
||||
serial_read (serial* device, void* data, unsigned int size)
|
||||
serial_read (serial_t *device, void* data, unsigned int size)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // ERROR_INVALID_PARAMETER (The parameter is incorrect)
|
||||
@ -359,7 +359,7 @@ serial_read (serial* device, void* data, unsigned int size)
|
||||
|
||||
|
||||
int
|
||||
serial_write (serial* device, const void* data, unsigned int size)
|
||||
serial_write (serial_t *device, const void* data, unsigned int size)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // ERROR_INVALID_PARAMETER (The parameter is incorrect)
|
||||
@ -375,7 +375,7 @@ serial_write (serial* device, const void* data, unsigned int size)
|
||||
|
||||
|
||||
int
|
||||
serial_flush (serial* device, int queue)
|
||||
serial_flush (serial_t *device, int queue)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // ERROR_INVALID_PARAMETER (The parameter is incorrect)
|
||||
@ -404,7 +404,7 @@ serial_flush (serial* device, int queue)
|
||||
|
||||
|
||||
int
|
||||
serial_drain (serial* device)
|
||||
serial_drain (serial_t *device)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // ERROR_INVALID_PARAMETER (The parameter is incorrect)
|
||||
@ -419,7 +419,7 @@ serial_drain (serial* device)
|
||||
|
||||
|
||||
int
|
||||
serial_send_break (serial* device)
|
||||
serial_send_break (serial_t *device)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // ERROR_INVALID_PARAMETER (The parameter is incorrect)
|
||||
@ -441,7 +441,7 @@ serial_send_break (serial* device)
|
||||
|
||||
|
||||
int
|
||||
serial_set_break (serial *device, int level)
|
||||
serial_set_break (serial_t *device, int level)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // ERROR_INVALID_PARAMETER (The parameter is incorrect)
|
||||
@ -462,7 +462,7 @@ serial_set_break (serial *device, int level)
|
||||
}
|
||||
|
||||
int
|
||||
serial_set_dtr (serial* device, int level)
|
||||
serial_set_dtr (serial_t *device, int level)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // ERROR_INVALID_PARAMETER (The parameter is incorrect)
|
||||
@ -479,7 +479,7 @@ serial_set_dtr (serial* device, int level)
|
||||
|
||||
|
||||
int
|
||||
serial_set_rts (serial* device, int level)
|
||||
serial_set_rts (serial_t *device, int level)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // ERROR_INVALID_PARAMETER (The parameter is incorrect)
|
||||
@ -496,7 +496,7 @@ serial_set_rts (serial* device, int level)
|
||||
|
||||
|
||||
int
|
||||
serial_get_received (serial* device)
|
||||
serial_get_received (serial_t *device)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // ERROR_INVALID_PARAMETER (The parameter is incorrect)
|
||||
@ -513,7 +513,7 @@ serial_get_received (serial* device)
|
||||
|
||||
|
||||
int
|
||||
serial_get_transmitted (serial* device)
|
||||
serial_get_transmitted (serial_t *device)
|
||||
{
|
||||
if (device == NULL)
|
||||
return -1; // ERROR_INVALID_PARAMETER (The parameter is incorrect)
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
|
||||
typedef struct suunto_d9_device_t {
|
||||
suunto_common2_device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
} suunto_d9_device_t;
|
||||
|
||||
static device_status_t suunto_d9_device_packet (device_t *abstract, const unsigned char command[], unsigned int csize, unsigned char answer[], unsigned int asize, unsigned int size);
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
typedef struct suunto_eon_device_t {
|
||||
suunto_common_device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
} suunto_eon_device_t;
|
||||
|
||||
static device_status_t suunto_eon_device_dump (device_t *abstract, dc_buffer_t *buffer);
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
|
||||
typedef struct suunto_solution_device_t {
|
||||
device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
} suunto_solution_device_t;
|
||||
|
||||
static device_status_t suunto_solution_device_dump (device_t *abstract, dc_buffer_t *buffer);
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
|
||||
typedef struct suunto_vyper_device_t {
|
||||
suunto_common_device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
unsigned int delay;
|
||||
} suunto_vyper_device_t;
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
|
||||
typedef struct suunto_vyper2_device_t {
|
||||
suunto_common2_device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
} suunto_vyper2_device_t;
|
||||
|
||||
static device_status_t suunto_vyper2_device_packet (device_t *abstract, const unsigned char command[], unsigned int csize, unsigned char answer[], unsigned int asize, unsigned int size);
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
|
||||
typedef struct uwatec_aladin_device_t {
|
||||
device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
unsigned int timestamp;
|
||||
unsigned int devtime;
|
||||
dc_ticks_t systime;
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
|
||||
typedef struct uwatec_memomouse_device_t {
|
||||
device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
unsigned int timestamp;
|
||||
unsigned int devtime;
|
||||
dc_ticks_t systime;
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
typedef struct uwatec_smart_device_t {
|
||||
device_t base;
|
||||
struct irda *socket;
|
||||
irda_t *socket;
|
||||
unsigned int address;
|
||||
unsigned int timestamp;
|
||||
unsigned int devtime;
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
|
||||
typedef struct zeagle_n2ition3_device_t {
|
||||
device_t base;
|
||||
struct serial *port;
|
||||
serial_t *port;
|
||||
unsigned char fingerprint[16];
|
||||
} zeagle_n2ition3_device_t;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user