Driver for the RS-232 serial port on the roboRIO.
Definition: SerialPort.h:27
SerialPort(SerialPort &&rhs)=default
void Flush()
Force the output buffer to be written to the port.
SerialPort(int baudRate, std::string_view portName, Port port=kOnboard, int dataBits=8, Parity parity=kParity_None, StopBits stopBits=kStopBits_One)
Create an instance of a Serial Port class.
void EnableTermination(char terminator='\n')
Enable termination and specify the termination character.
void SetReadBufferSize(int size)
Specify the size of the input buffer.
StopBits
Definition: SerialPort.h:37
@ kStopBits_OnePointFive
Definition: SerialPort.h:39
@ kStopBits_One
Definition: SerialPort.h:38
@ kStopBits_Two
Definition: SerialPort.h:40
void SetWriteBufferSize(int size)
Specify the size of the output buffer.
SerialPort & operator=(SerialPort &&rhs)=default
SerialPort(int baudRate, Port port=kOnboard, int dataBits=8, Parity parity=kParity_None, StopBits stopBits=kStopBits_One)
Create an instance of a Serial Port class.
void DisableTermination()
Disable termination behavior.
void SetWriteBufferMode(WriteBufferMode mode)
Specify the flushing behavior of the output buffer.
int Write(const char *buffer, int count)
Write raw bytes to the buffer.
int Write(std::string_view buffer)
Write raw bytes to the buffer.
void SetTimeout(units::second_t timeout)
Configure the timeout of the serial port.
FlowControl
Definition: SerialPort.h:43
@ kFlowControl_XonXoff
Definition: SerialPort.h:45
@ kFlowControl_DtrDsr
Definition: SerialPort.h:47
@ kFlowControl_RtsCts
Definition: SerialPort.h:46
@ kFlowControl_None
Definition: SerialPort.h:44
Port
Definition: SerialPort.h:52
@ kOnboard
Definition: SerialPort.h:52
@ kUSB2
Definition: SerialPort.h:52
@ kMXP
Definition: SerialPort.h:52
@ kUSB
Definition: SerialPort.h:52
@ kUSB1
Definition: SerialPort.h:52
void Reset()
Reset the serial port driver to a known state.
Parity
Definition: SerialPort.h:29
@ kParity_Space
Definition: SerialPort.h:34
@ kParity_None
Definition: SerialPort.h:30
@ kParity_Mark
Definition: SerialPort.h:33
@ kParity_Even
Definition: SerialPort.h:32
@ kParity_Odd
Definition: SerialPort.h:31
WriteBufferMode
Definition: SerialPort.h:50
@ kFlushWhenFull
Definition: SerialPort.h:50
@ kFlushOnAccess
Definition: SerialPort.h:50
int GetBytesReceived()
Get the number of bytes currently available to read from the serial port.
int Read(char *buffer, int count)
Read raw bytes out of the buffer.
void SetFlowControl(FlowControl flowControl)
Set the type of flow control to enable on this port.
basic_string_view< char > string_view
Definition: core.h:501
constexpr auto count() -> size_t
Definition: core.h:1203
Definition: AprilTagPoseEstimator.h:15