|
Robotics Library
0.7.0
|
Go to the documentation of this file.
27 #ifndef RL_HAL_SERIAL_H
28 #define RL_HAL_SERIAL_H
167 const int&
flags = GENERIC_READ | GENERIC_WRITE
169 const int&
flags = O_RDWR | O_NONBLOCK | O_NOCTTY
179 void doBreak(
const bool& doOn);
181 void doDtr(
const bool& doOn);
183 void doModemStatus(
bool& ctsOn,
bool& dsrOn,
bool& riOn,
bool& dcdOn);
185 void doRts(
const bool& doOn);
203 ::std::size_t
read(
void* buf, const ::std::size_t& count);
205 ::std::size_t
select(
const bool&
read,
const bool&
write, const ::std::chrono::nanoseconds& timeout);
219 ::std::size_t
write(
const void* buf, const ::std::size_t& count);
259 #endif // RL_HAL_SERIAL_H
@ BAUDRATE_1500000BPS
1,500,000 bps.
Definition: Serial.h:104
dummy cpp endif() if(CMAKE_SIZEOF_VOID_P EQUAL 4) target_compile_definitions(math INTERFACE -DEIGEN_DONT_ALIGN_STATICALLY) endif() if(NOT CMAKE_VERSION VERSION_LESS 3.8) target_compile_features(math INTERFACE cxx_std_11) endif() target_include_directories(math INTERFACE $< BUILD_INTERFACE
Definition: CMakeLists.txt:66
@ BAUDRATE_2500000BPS
2,500,000 bps.
Definition: Serial.h:108
void setFlowControl(const FlowControl &flowControl)
Definition: Serial.cpp:634
@ BAUDRATE_57600BPS
57,600 bps.
Definition: Serial.h:75
@ BAUDRATE_3500000BPS
3,500,000 bps.
Definition: Serial.h:112
DataBits
Definition: Serial.h:120
@ PARITY_EVENPARITY
Even parity.
Definition: Serial.h:144
@ BAUDRATE_2400BPS
2,400 bps.
Definition: Serial.h:61
int flags
Definition: Serial.h:242
@ BAUDRATE_230400BPS
230,400 bps.
Definition: Serial.h:90
@ BAUDRATE_4000000BPS
4,000,000 bps.
Definition: Serial.h:114
@ PARITY_NOPARITY
No parity.
Definition: Serial.h:146
@ BAUDRATE_600BPS
600 bps.
Definition: Serial.h:57
void doBreak(const bool &doOn)
Definition: Serial.cpp:147
@ DATABITS_7BITS
7 data bits.
Definition: Serial.h:126
@ BAUDRATE_3000000BPS
3,000,000 bps.
Definition: Serial.h:110
@ DATABITS_5BITS
5 data bits.
Definition: Serial.h:122
@ BAUDRATE_460800BPS
460,800 bps.
Definition: Serial.h:92
Parity parity
Definition: Serial.h:246
@ BAUDRATE_921600BPS
921,600 bps.
Definition: Serial.h:98
DataBits dataBits
Definition: Serial.h:232
@ BAUDRATE_1200BPS
1,200 bps.
Definition: Serial.h:59
@ DATABITS_8BITS
8 data bits.
Definition: Serial.h:128
const Parity & getParity() const
Definition: Serial.cpp:301
struct termios current
Definition: Serial.h:229
StopBits stopBits
Definition: Serial.h:254
const StopBits & getStopBits() const
Definition: Serial.cpp:307
void setFilename(const ::std::string &filename)
Definition: Serial.cpp:628
@ PARITY_ODDPARITY
Odd parity.
Definition: Serial.h:148
virtual ~Serial()
Definition: Serial.cpp:88
@ BAUDRATE_38400BPS
38,400 bps.
Definition: Serial.h:73
void close()
Definition: Serial.cpp:113
@ BAUDRATE_1152000BPS
1,152000 bps.
Definition: Serial.h:102
void setStopBits(const StopBits &stopBits)
Definition: Serial.cpp:747
void open()
Definition: Serial.cpp:313
@ STOPBITS_1BIT
1 stop bit.
Definition: Serial.h:154
@ BAUDRATE_1000000BPS
1,000,000 bps.
Definition: Serial.h:100
::std::size_t read(void *buf, const ::std::size_t &count)
Definition: Serial.cpp:366
::std::size_t select(const bool &read, const bool &write, const ::std::chrono::nanoseconds &timeout)
Definition: Serial.cpp:392
const FlowControl & getFlowControl() const
Definition: Serial.cpp:295
const DataBits & getDataBits() const
Definition: Serial.cpp:283
struct termios restore
Definition: Serial.h:251
void doRts(const bool &doOn)
Definition: Serial.cpp:209
@ FLOWCONTROL_RTSCTS
Hardware flow control (RTS/CTS).
Definition: Serial.h:136
FlowControl
Definition: Serial.h:132
const BaudRate & getBaudRate() const
Definition: Serial.cpp:277
@ BAUDRATE_576000BPS
576,000 bps.
Definition: Serial.h:96
int fd
Definition: Serial.h:237
@ BAUDRATE_110BPS
110 bps.
Definition: Serial.h:53
void changeParameters()
Definition: Serial.cpp:97
BaudRate baudRate
Definition: Serial.h:224
@ BAUDRATE_19200BPS
19,200 bps.
Definition: Serial.h:71
void setDataBits(const DataBits &dataBits)
Definition: Serial.cpp:576
@ FLOWCONTROL_OFF
No flow control.
Definition: Serial.h:134
FlowControl flowControl
Definition: Serial.h:244
BaudRate
Definition: Serial.h:51
@ FLOWCONTROL_XONXOFF
Software flow control (XON/XOFF).
Definition: Serial.h:138
@ BAUDRATE_4800BPS
4,800 bps.
Definition: Serial.h:63
Parity
Definition: Serial.h:142
@ BAUDRATE_115200BPS
115,200 bps.
Definition: Serial.h:80
void flush(const bool &read, const bool &write)
Definition: Serial.cpp:225
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, const int &flags=O_RDWR|O_NONBLOCK|O_NOCTTY)
Definition: Serial.cpp:57
::std::string filename
Definition: Serial.h:240
@ DATABITS_6BITS
6 data bits.
Definition: Serial.h:124
@ BAUDRATE_500000BPS
500,000 bps.
Definition: Serial.h:94
void setBaudRate(const BaudRate &baudRate)
Definition: Serial.cpp:426
@ BAUDRATE_2000000BPS
2,000,000 bps.
Definition: Serial.h:106
void doModemStatus(bool &ctsOn, bool &dsrOn, bool &riOn, bool &dcdOn)
Definition: Serial.cpp:179
StopBits
Definition: Serial.h:152
const ::std::string & getFilename() const
Definition: Serial.cpp:289
@ BAUDRATE_9600BPS
9,600 bps.
Definition: Serial.h:65
void setParity(const Parity &parity)
Definition: Serial.cpp:702
@ STOPBITS_2BITS
2 stop bits.
Definition: Serial.h:156
@ BAUDRATE_300BPS
300 bps.
Definition: Serial.h:55
::std::size_t write(const void *buf, const ::std::size_t &count)
Definition: Serial.cpp:779
Robotics Library.
Definition: AnalogInput.cpp:30
void doDtr(const bool &doOn)
Definition: Serial.cpp:163