COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
Cosmos::Serial Class Reference

#include <serialclass.h>

Collaboration diagram for Cosmos::Serial:

Public Member Functions

 Serial (string dname, size_t dbaud=9600, size_t dbits=8, size_t dparity=0, size_t dstop=1)
 
 ~Serial ()
 
int32_t open_device ()
 
int32_t close_device ()
 
int32_t set_restoreonclose (bool argument)
 
int32_t set_params (size_t dbaud, size_t dbits, size_t dparity, size_t dstop)
 
int32_t set_flowcontrol (bool rtscts, bool xonxoff)
 
int32_t set_timeout (int, double timeout)
 
int32_t set_timeout (double timeout)
 
int32_t set_dtr (bool state)
 
int32_t set_rts (bool state)
 
bool get_cts ()
 
int32_t put_char (uint8_t c)
 
int32_t put_string (string data)
 
int32_t put_data (vector< uint8_t > data)
 
int32_t put_data (const uint8_t *data, size_t size)
 
int32_t put_slip (vector< uint8_t > data)
 
int32_t put_nmea (vector< uint8_t > data)
 
int32_t drain ()
 
int32_t poll_char ()
 
int32_t get_char ()
 
int32_t get_char (uint8_t &buffer)
 
int32_t get_data (vector< uint8_t > &data, size_t size=SIZE_MAX)
 
int32_t get_string (string &data, size_t size=SIZE_MAX)
 
int32_t get_string (string &data, char endc=0)
 
int32_t get_data (uint8_t *data, size_t size)
 
int32_t get_slip (vector< uint8_t > &data, size_t size=SIZE_MAX)
 Read SLIP frame. More...
 
int32_t get_nmea (vector< uint8_t > &data, size_t size)
 Read NMEA response. More...
 
int32_t get_xmodem (vector< uint8_t > &data, size_t size)
 Read Xmodem frame. More...
 
int32_t get_error ()
 
bool get_open ()
 
int32_t SendByte (uint8_t byte)
 
int32_t ReceiveBuffer (uint8_t *buf, int size)
 
int32_t ReceiveByte (uint8_t &buf)
 
int32_t SendBuffer (uint8_t *buffer, int size)
 

Private Attributes

int fd = -1
 
int32_t error
 
vector< uint32_t > baud_speed [2]
 
double ictimeout = .002
 
bool restoreonclose = true
 
DCB dcb
 
HANDLE handle
 
string name
 
size_t baud
 
size_t bits
 
size_t parity
 
size_t stop
 

Member Data Documentation

int Cosmos::Serial::fd = -1
private
int32_t Cosmos::Serial::error
private
vector<uint32_t> Cosmos::Serial::baud_speed[2]
private
Initial value:
= {
{0, 50, 75, 110, 134, 150, 200, 300, 500, 1200, 1800, 2400, 4800, 9600, 19200, 38400},
{57600, 115200, 230400, 460800, 500000, 576000, 921600, 1000000, 1152000, 1500000, 2000000, 2500000, 3000000, 3500000, 4000000}
}
double Cosmos::Serial::ictimeout = .002
private
bool Cosmos::Serial::restoreonclose = true
private
DCB Cosmos::Serial::dcb
private
HANDLE Cosmos::Serial::handle
private
string Cosmos::Serial::name
private
size_t Cosmos::Serial::baud
private
size_t Cosmos::Serial::bits
private
size_t Cosmos::Serial::parity
private
size_t Cosmos::Serial::stop
private

The documentation for this class was generated from the following files: