COSMOS core
1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
|
Functions | |
Cosmos::I2C::I2C (string bus, uint8_t address, double delay=2e-4) | |
Cosmos::I2C::~I2C () | |
int32_t | Cosmos::I2C::send (string data) |
int32_t | Cosmos::I2C::send (uint8_t *data, size_t len) |
int32_t | Cosmos::I2C::send (vector< uint8_t > data) |
int32_t | Cosmos::I2C::receive (string &data) |
int32_t | Cosmos::I2C::receive (uint8_t *data, size_t len) |
int32_t | Cosmos::I2C::receive (vector< uint8_t > &data) |
int32_t | Cosmos::I2C::get_error () |
int32_t | Cosmos::I2C::get_fh () |
Cosmos::Serial::Serial (string dname, size_t dbaud=9600, size_t dbits=8, size_t dparity=0, size_t dstop=1) | |
int32_t | Cosmos::Serial::open_device () |
int32_t | Cosmos::Serial::close_device () |
Cosmos::Serial::~Serial () | |
bool | Cosmos::Serial::get_open () |
int32_t | Cosmos::Serial::get_error () |
int32_t | Cosmos::Serial::set_restoreonclose (bool argument) |
int32_t | Cosmos::Serial::set_params (size_t dbaud, size_t dbits, size_t dparity, size_t dstop) |
int32_t | Cosmos::Serial::set_flowcontrol (bool rtscts, bool xonxoff) |
int32_t | Cosmos::Serial::set_dtr (bool state) |
int32_t | Cosmos::Serial::set_rts (bool state) |
bool | Cosmos::Serial::get_cts () |
int32_t | Cosmos::Serial::set_timeout (int, double timeout) |
int32_t | Cosmos::Serial::set_timeout (double timeout) |
int32_t | Cosmos::Serial::SendByte (uint8_t byte) |
int32_t | Cosmos::Serial::SendBuffer (uint8_t *buffer, int size) |
int32_t | Cosmos::Serial::put_char (uint8_t c) |
int32_t | Cosmos::Serial::put_string (string data) |
int32_t | Cosmos::Serial::put_data (vector< uint8_t > data) |
int32_t | Cosmos::Serial::put_data (const uint8_t *data, size_t size) |
int32_t | Cosmos::Serial::put_slip (vector< uint8_t > data) |
int32_t | Cosmos::Serial::put_nmea (vector< uint8_t > data) |
int32_t | Cosmos::Serial::drain () |
int32_t | Cosmos::Serial::get_char (uint8_t &buffer) |
int32_t | Cosmos::Serial::ReceiveByte (uint8_t &buf) |
int32_t | Cosmos::Serial::ReceiveBuffer (uint8_t *buf, int size) |
int32_t | Cosmos::Serial::get_char () |
int32_t | Cosmos::Serial::poll_char () |
int32_t | Cosmos::Serial::get_string (string &data, size_t size=SIZE_MAX) |
int32_t | Cosmos::Serial::get_string (string &data, char endc=0) |
int32_t | Cosmos::Serial::get_data (vector< uint8_t > &data, size_t size=SIZE_MAX) |
int32_t | Cosmos::Serial::get_data (uint8_t *data, size_t size) |
int32_t | Cosmos::Serial::get_xmodem (vector< uint8_t > &data, size_t size) |
Read Xmodem frame. More... | |
int32_t | Cosmos::Serial::get_slip (vector< uint8_t > &data, size_t size=SIZE_MAX) |
Read SLIP frame. More... | |
int32_t | Cosmos::Serial::get_nmea (vector< uint8_t > &data, size_t size) |
Read NMEA response. More... | |
Cosmos::I2C::I2C | ( | string | bus, |
uint8_t | address, | ||
double | delay = 2e-4 |
||
) |
Cosmos::I2C::~I2C | ( | ) |
int32_t Cosmos::I2C::send | ( | string | data | ) |
int32_t Cosmos::I2C::send | ( | uint8_t * | data, |
size_t | len | ||
) |
int32_t Cosmos::I2C::send | ( | vector< uint8_t > | data | ) |
int32_t Cosmos::I2C::receive | ( | string & | data | ) |
int32_t Cosmos::I2C::receive | ( | uint8_t * | data, |
size_t | len | ||
) |
int32_t Cosmos::I2C::receive | ( | vector< uint8_t > & | data | ) |
int32_t Cosmos::I2C::get_error | ( | ) |
int32_t Cosmos::I2C::get_fh | ( | ) |
Cosmos::Serial::Serial | ( | string | dname, |
size_t | dbaud = 9600 , |
||
size_t | dbits = 8 , |
||
size_t | dparity = 0 , |
||
size_t | dstop = 1 |
||
) |
Create serial port instance. Create a serial port object to be used for reading and writing to a physical serial port.
dname | Name of physical serial port. |
dbaud | Baud rate. Will be rounded to nearest of 75, 110, 150, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200. |
dbits | Number of data bits. |
dparity | 0 = even, 1 = odd. |
dstop | Number of stop bits. |
int32_t Cosmos::Serial::open_device | ( | ) |
int32_t Cosmos::Serial::close_device | ( | ) |
Cosmos::Serial::~Serial | ( | ) |
bool Cosmos::Serial::get_open | ( | ) |
int32_t Cosmos::Serial::get_error | ( | ) |
int32_t Cosmos::Serial::set_restoreonclose | ( | bool | argument | ) |
int32_t Cosmos::Serial::set_params | ( | size_t | dbaud, |
size_t | dbits, | ||
size_t | dparity, | ||
size_t | dstop | ||
) |
int32_t Cosmos::Serial::set_flowcontrol | ( | bool | rtscts, |
bool | xonxoff | ||
) |
int32_t Cosmos::Serial::set_dtr | ( | bool | state | ) |
int32_t Cosmos::Serial::set_rts | ( | bool | state | ) |
bool Cosmos::Serial::get_cts | ( | ) |
int32_t Cosmos::Serial::set_timeout | ( | int | , |
double | timeout | ||
) |
int32_t Cosmos::Serial::set_timeout | ( | double | timeout | ) |
int32_t Cosmos::Serial::SendByte | ( | uint8_t | byte | ) |
int32_t Cosmos::Serial::SendBuffer | ( | uint8_t * | buffer, |
int | size | ||
) |
int32_t Cosmos::Serial::put_char | ( | uint8_t | c | ) |
int32_t Cosmos::Serial::put_string | ( | string | data | ) |
int32_t Cosmos::Serial::put_data | ( | vector< uint8_t > | data | ) |
int32_t Cosmos::Serial::put_data | ( | const uint8_t * | data, |
size_t | size | ||
) |
int32_t Cosmos::Serial::put_slip | ( | vector< uint8_t > | data | ) |
int32_t Cosmos::Serial::put_nmea | ( | vector< uint8_t > | data | ) |
int32_t Cosmos::Serial::drain | ( | ) |
int32_t Cosmos::Serial::get_char | ( | uint8_t & | buffer | ) |
int32_t Cosmos::Serial::ReceiveByte | ( | uint8_t & | buf | ) |
int32_t Cosmos::Serial::ReceiveBuffer | ( | uint8_t * | buf, |
int | size | ||
) |
int32_t Cosmos::Serial::get_char | ( | ) |
int32_t Cosmos::Serial::poll_char | ( | ) |
int32_t Cosmos::Serial::get_string | ( | string & | data, |
size_t | size = SIZE_MAX |
||
) |
int32_t Cosmos::Serial::get_string | ( | string & | data, |
char | endc = 0 |
||
) |
int32_t Cosmos::Serial::get_data | ( | vector< uint8_t > & | data, |
size_t | size = SIZE_MAX |
||
) |
int32_t Cosmos::Serial::get_data | ( | uint8_t * | data, |
size_t | size | ||
) |
int32_t Cosmos::Serial::get_xmodem | ( | vector< uint8_t > & | data, |
size_t | size | ||
) |
Read Xmodem frame.
Read one Xmodem block (frame) of data, removing control characters and calculating checksum. Supplied buffer is assumed to be at least 128 bytes.
data | Byte array to store incoming data. |
size | Size , in bytes, of byte array. |
int32_t Cosmos::Serial::get_slip | ( | vector< uint8_t > & | data, |
size_t | size = SIZE_MAX |
||
) |
Read SLIP frame.
Read an entire frame of SLIP encoded data from the serial port. Special SLIP characters are removed on the fly. Will stop early if supplied buffer size is exceeded.
data | Byte array to store incoming data. |
size | Size , in bytes, of byte array. |
int32_t Cosmos::Serial::get_nmea | ( | vector< uint8_t > & | data, |
size_t | size | ||
) |
Read NMEA response.
Read an entire NMEA response from the serial port. The leading $ and trailing * and checksum are removed, and only the payload of the response is returned. Will stop early if supplied buffer size is exceeded.
data | Byte array to store incoming data. |
size | Size , in bytes, of byte array. |