#include <Serial.h>
Public Types |
enum | BaudRate {
BAUDRATE_110BPS,
BAUDRATE_300BPS,
BAUDRATE_600BPS,
BAUDRATE_1200BPS,
BAUDRATE_2400BPS,
BAUDRATE_4800BPS,
BAUDRATE_9600BPS,
BAUDRATE_19200BPS,
BAUDRATE_38400BPS,
BAUDRATE_57600BPS,
BAUDRATE_115200BPS,
BAUDRATE_230400BPS,
BAUDRATE_460800BPS,
BAUDRATE_500000BPS,
BAUDRATE_576000BPS,
BAUDRATE_921600BPS,
BAUDRATE_1000000BPS,
BAUDRATE_1152000BPS,
BAUDRATE_1500000BPS,
BAUDRATE_2000000BPS,
BAUDRATE_2500000BPS,
BAUDRATE_3000000BPS,
BAUDRATE_3500000BPS,
BAUDRATE_4000000BPS
} |
enum | DataBits { DATABITS_5BITS,
DATABITS_6BITS,
DATABITS_7BITS,
DATABITS_8BITS
} |
enum | FlowControl { FLOWCONTROL_OFF,
FLOWCONTROL_RTSCTS,
FLOWCONTROL_XONXOFF
} |
enum | Parity { PARITY_EVENPARITY,
PARITY_NOPARITY,
PARITY_ODDPARITY
} |
enum | StopBits { STOPBITS_1BIT,
STOPBITS_2BITS
} |
Public Member Functions |
| Serial (const ::std::string &filename, const BaudRate &baudRate=BAUDRATE_9600BPS, const DataBits &dataBits=DATABITS_8BITS, const FlowControl &flowControl=FLOWCONTROL_OFF, const Parity &parity=PARITY_NOPARITY, const StopBits &stopBits=STOPBITS_1BIT) |
virtual | ~Serial () |
void | changeParameters () |
void | close () |
void | flush (const bool &read, const bool &write) |
BaudRate | getBaudRate () const |
DataBits | getDataBits () const |
::std::string | getFilename () const |
FlowControl | getFlowControl () const |
Parity | getParity () const |
StopBits | getStopBits () const |
void | open () |
::std::size_t | read (void *buf, const ::std::size_t &count) |
::std::size_t | select (const bool &read, const bool &write, const ::rl::math::Real &timeout) |
void | setBaudRate (const BaudRate &baudRate) |
void | setDataBits (const DataBits &dataBits) |
void | setFilename (const ::std::string &filename) |
void | setFlowControl (const FlowControl &flowControl) |
void | setParity (const Parity &parity) |
void | setStopBits (const StopBits &stopBits) |
::std::size_t | write (const void *buf, const ::std::size_t &count) |
| Com () |
virtual | ~Com () |
bool | isConnected () const |
Member Enumeration Documentation
- Enumerator:
BAUDRATE_110BPS |
110 bps.
|
BAUDRATE_300BPS |
300 bps.
|
BAUDRATE_600BPS |
600 bps.
|
BAUDRATE_1200BPS |
1,200 bps.
|
BAUDRATE_2400BPS |
2,400 bps.
|
BAUDRATE_4800BPS |
4,800 bps.
|
BAUDRATE_9600BPS |
9,600 bps.
|
BAUDRATE_19200BPS |
19,200 bps.
|
BAUDRATE_38400BPS |
38,400 bps.
|
BAUDRATE_57600BPS |
57,600 bps.
|
BAUDRATE_115200BPS |
115,200 bps.
|
BAUDRATE_230400BPS |
230,400 bps.
|
BAUDRATE_460800BPS |
460,800 bps.
|
BAUDRATE_500000BPS |
500,000 bps.
|
BAUDRATE_576000BPS |
576,000 bps.
|
BAUDRATE_921600BPS |
921,600 bps.
|
BAUDRATE_1000000BPS |
1,000,000 bps.
|
BAUDRATE_1152000BPS |
1,152000 bps.
|
BAUDRATE_1500000BPS |
1,500,000 bps.
|
BAUDRATE_2000000BPS |
2,000,000 bps.
|
BAUDRATE_2500000BPS |
2,500,000 bps.
|
BAUDRATE_3000000BPS |
3,000,000 bps.
|
BAUDRATE_3500000BPS |
3,500,000 bps.
|
BAUDRATE_4000000BPS |
4,000,000 bps.
|
- Enumerator:
DATABITS_5BITS |
5 data bits.
|
DATABITS_6BITS |
6 data bits.
|
DATABITS_7BITS |
7 data bits.
|
DATABITS_8BITS |
8 data bits.
|
- Enumerator:
FLOWCONTROL_OFF |
No flow control.
|
FLOWCONTROL_RTSCTS |
Hardware flow control (RTS/CTS).
|
FLOWCONTROL_XONXOFF |
Software flow control (XON/XOFF).
|
- Enumerator:
PARITY_EVENPARITY |
Even parity.
|
PARITY_NOPARITY |
No parity.
|
PARITY_ODDPARITY |
Odd parity.
|
- Enumerator:
STOPBITS_1BIT |
1 stop bit.
|
STOPBITS_2BITS |
2 stop bits.
|
Constructor & Destructor Documentation
rl::hal::Serial::~Serial |
( |
| ) |
|
|
virtual |
Member Function Documentation
void rl::hal::Serial::changeParameters |
( |
| ) |
|
void rl::hal::Serial::close |
( |
| ) |
|
|
virtual |
void rl::hal::Serial::flush |
( |
const bool & |
read, |
|
|
const bool & |
write |
|
) |
| |
std::string rl::hal::Serial::getFilename |
( |
| ) |
const |
void rl::hal::Serial::open |
( |
| ) |
|
|
virtual |
std::size_t rl::hal::Serial::read |
( |
void * |
buf, |
|
|
const ::std::size_t & |
count |
|
) |
| |
std::size_t rl::hal::Serial::select |
( |
const bool & |
read, |
|
|
const bool & |
write, |
|
|
const ::rl::math::Real & |
timeout |
|
) |
| |
void rl::hal::Serial::setBaudRate |
( |
const BaudRate & |
baudRate | ) |
|
void rl::hal::Serial::setDataBits |
( |
const DataBits & |
dataBits | ) |
|
void rl::hal::Serial::setFilename |
( |
const ::std::string & |
filename | ) |
|
void rl::hal::Serial::setFlowControl |
( |
const FlowControl & |
flowControl | ) |
|
void rl::hal::Serial::setParity |
( |
const Parity & |
parity | ) |
|
void rl::hal::Serial::setStopBits |
( |
const StopBits & |
stopBits | ) |
|
std::size_t rl::hal::Serial::write |
( |
const void * |
buf, |
|
|
const ::std::size_t & |
count |
|
) |
| |
Member Data Documentation
struct termios rl::hal::Serial::current |
|
private |
::std::string rl::hal::Serial::filename |
|
private |
Parity rl::hal::Serial::parity |
|
private |
struct termios rl::hal::Serial::restore |
|
private |
The documentation for this class was generated from the following files: