GATE
serialports.h File Reference

Serial port communication utilities. More...

#include "gate/io/gate_io_api.h"
#include "gate/gatetypes.h"
#include "gate/strings.h"
#include "gate/streams.h"

Macros

#define GATE_SERIALPORT_PARITY_NONE   0
 
#define GATE_SERIALPORT_PARITY_ODD   1
 
#define GATE_SERIALPORT_PARITY_EVEN   2
 
#define GATE_SERIALPORT_PARITY_MARK   3
 
#define GATE_SERIALPORT_PARITY_SPACE   4
 
#define GATE_SERIALPORT_STOPBITS_1_0   10
 
#define GATE_SERIALPORT_STOPBITS_1_5   15
 
#define GATE_SERIALPORT_STOPBITS_2_0   20
 
#define GATE_SERIALPORT_FLOWCTRL_NONE   0
 
#define GATE_SERIALPORT_FLOWCTRL_HARDWARE   1
 
#define GATE_SERIALPORT_FLOWCTRL_XON   2
 
#define GATE_SERIALPORT_FLOWCTRL_HANDSHAKE   3
 
#define GATE_SERIALPORT_BAUDRATE_110   110
 
#define GATE_SERIALPORT_BAUDRATE_300   300
 
#define GATE_SERIALPORT_BAUDRATE_600   600
 
#define GATE_SERIALPORT_BAUDRATE_1200   1200
 
#define GATE_SERIALPORT_BAUDRATE_2400   2400
 
#define GATE_SERIALPORT_BAUDRATE_4800   4800
 
#define GATE_SERIALPORT_BAUDRATE_9600   9600
 
#define GATE_SERIALPORT_BAUDRATE_14400   14400
 
#define GATE_SERIALPORT_BAUDRATE_19200   19200
 
#define GATE_SERIALPORT_BAUDRATE_28800   28800
 
#define GATE_SERIALPORT_BAUDRATE_38400   38400
 
#define GATE_SERIALPORT_BAUDRATE_56000   56000
 
#define GATE_SERIALPORT_BAUDRATE_57600   57600
 
#define GATE_SERIALPORT_BAUDRATE_115200   115200
 
#define GATE_SERIALPORT_BAUDRATE_128000   128000
 
#define GATE_SERIALPORT_BAUDRATE_230400   230400
 
#define GATE_SERIALPORT_BAUDRATE_256000   256000
 
#define GATE_SERIALPORT_BAUDRATE_460800   460800
 
#define GATE_SERIALPORT_BAUDRATE_921600   921600
 

Typedefs

typedef gate_bool_t(* gate_serialport_enum_callback_t) (char const *portid, char const *description, void *userparam)
 
typedef void * gate_serialport_t
 

Functions

GATE_IO_API gate_result_t gate_serialport_enum (gate_serialport_enum_callback_t callback, void *userparam)
 
GATE_IO_API gate_result_t gate_serialport_open (gate_string_t const *port_id, gate_uint32_t baudrate, gate_uint8_t bits, gate_uint8_t parity, gate_uint8_t stopbits, gate_uint8_t flowcontrol, gate_uint32_t timeout_ms, gate_bool_t asynchronous, gate_serialport_t *port_handle)
 
GATE_IO_API gate_result_t gate_serialport_close (gate_serialport_t port_handle)
 
GATE_IO_API gate_result_t gate_serialport_read (gate_serialport_t port_handle, char *buffer, gate_size_t bufferlen, gate_size_t *bytesreceived)
 
GATE_IO_API gate_result_t gate_serialport_write (gate_serialport_t port_handle, char const *buffer, gate_size_t bufferlen, gate_size_t *byteswritten)
 
GATE_IO_API gate_result_t gate_serialport_openstream (gate_string_t const *port_id, gate_uint32_t baudrate, gate_uint8_t bits, gate_uint8_t parity, gate_uint8_t stopbits, gate_uint8_t flowcontrol, gate_stream_t **stream)
 

Detailed Description

Serial port communication utilities.