36 #if defined(COSMOS_LINUX_OS) || defined(COSMOS_CYGWIN_OS) || defined(COSMOS_MAC_OS) 38 #include <sys/select.h> 46 Serial(
string dname,
size_t dbaud=9600,
size_t dbits=8,
size_t dparity=0,
size_t dstop=1);
51 int32_t
set_params(
size_t dbaud,
size_t dbits,
size_t dparity,
size_t dstop);
53 #if defined(COSMOS_LINUX_OS) || defined(COSMOS_CYGWIN_OS) || defined(COSMOS_MAC_OS) 64 int32_t
put_data(vector <uint8_t> data);
65 int32_t
put_data(
const uint8_t *data,
size_t size);
66 int32_t
put_slip(vector <uint8_t> data);
67 int32_t
put_nmea(vector <uint8_t> data);
72 int32_t
get_data(vector <uint8_t> &data,
size_t size=SIZE_MAX);
73 int32_t
get_string(
string &data,
size_t size=SIZE_MAX);
75 int32_t
get_data(uint8_t *data,
size_t size);
76 int32_t
get_slip(vector <uint8_t> &data,
size_t size=SIZE_MAX);
77 int32_t
get_nmea(vector <uint8_t> &data,
size_t size);
78 int32_t
get_xmodem(vector <uint8_t> &data,
size_t size);
91 {0, 50, 75, 110, 134, 150, 200, 300, 500, 1200, 1800, 2400, 4800, 9600, 19200, 38400},
92 {57600, 115200, 230400, 460800, 500000, 576000, 921600, 1000000, 1152000, 1500000, 2000000, 2500000, 3000000, 3500000, 4000000}
98 #if defined(COSMOS_LINUX_OS) || defined(COSMOS_CYGWIN_OS) || defined(COSMOS_MAC_OS) 100 struct termios oldtio;
112 #define XMODEM_SOH 0x01 113 #define XMODEM_EOT 0x04 114 #define XMODEM_ACK 0x06 115 #define XMODEM_NAK 0x15 116 #define XMODEM_CAN 0x18 122 #endif // SERIALCLASS_H Definition: agentclass.cpp:54
int32_t get_xmodem(vector< uint8_t > &data, size_t size)
Read Xmodem frame.
Definition: serialclass.cpp:1268
Serial(string dname, size_t dbaud=9600, size_t dbits=8, size_t dparity=0, size_t dstop=1)
Definition: serialclass.cpp:49
int32_t put_data(vector< uint8_t > data)
Definition: serialclass.cpp:707
COSMOS SLIP support include file.
int32_t close_device()
Definition: serialclass.cpp:126
int32_t put_string(string data)
Definition: serialclass.cpp:686
vector< uint32_t > baud_speed[2]
Definition: serialclass.h:90
string name
Definition: serialclass.h:106
Definition: serialclass.h:43
int32_t set_params(size_t dbaud, size_t dbits, size_t dparity, size_t dstop)
Definition: serialclass.cpp:181
int32_t put_nmea(vector< uint8_t > data)
Definition: serialclass.cpp:825
int32_t get_char()
Definition: serialclass.cpp:987
bool restoreonclose
Definition: serialclass.h:96
int32_t put_slip(vector< uint8_t > data)
Definition: serialclass.cpp:763
int32_t put_char(uint8_t c)
Definition: serialclass.cpp:609
size_t parity
Definition: serialclass.h:109
int32_t set_restoreonclose(bool argument)
Definition: serialclass.cpp:175
static char buffer[255]
Definition: propagator_simple.cpp:60
int32_t drain()
Definition: serialclass.cpp:927
Headers and definitions common to all COSMOS.
size_t baud
Definition: serialclass.h:107
int32_t set_dtr(bool state)
Definition: serialclass.cpp:447
~Serial()
Definition: serialclass.cpp:153
int fd
Definition: serialclass.h:88
size_t bits
Definition: serialclass.h:108
int32_t set_rts(bool state)
Definition: serialclass.cpp:474
int32_t poll_char()
Definition: serialclass.cpp:1072
int32_t open_device()
Definition: serialclass.cpp:60
bool get_open()
Definition: serialclass.cpp:158
bool get_cts()
Definition: serialclass.cpp:501
int32_t ReceiveByte(uint8_t &buf)
Definition: serialclass.cpp:963
int32_t get_nmea(vector< uint8_t > &data, size_t size)
Read NMEA response.
Definition: serialclass.cpp:1400
int32_t set_timeout(int, double timeout)
Definition: serialclass.cpp:515
int32_t get_string(string &data, size_t size=SIZE_MAX)
Definition: serialclass.cpp:1141
DCB dcb
Definition: serialclass.h:102
HANDLE handle
Definition: serialclass.h:103
char buf[128]
Definition: rw_test.cpp:40
int32_t set_flowcontrol(bool rtscts, bool xonxoff)
Definition: serialclass.cpp:386
int32_t get_data(vector< uint8_t > &data, size_t size=SIZE_MAX)
Definition: serialclass.cpp:1202
int32_t error
Definition: serialclass.h:89
int32_t SendByte(uint8_t byte)
Definition: serialclass.cpp:547
size_t stop
Definition: serialclass.h:110
double ictimeout
Definition: serialclass.h:95
int32_t SendBuffer(uint8_t *buffer, int size)
Definition: serialclass.cpp:578
int32_t get_error()
Definition: serialclass.cpp:170
int32_t get_slip(vector< uint8_t > &data, size_t size=SIZE_MAX)
Read SLIP frame.
Definition: serialclass.cpp:1322
int32_t ReceiveBuffer(uint8_t *buf, int size)
Definition: serialclass.cpp:974