21#include <piduino/terminal.h>
414 explicit Info (
const std::string & name);
817 virtual ssize_t
write (
const char * data,
size_t maxSize);
818 virtual ssize_t
write (
const char * data,
size_t maxSize,
bool endl);
virtual std::string path() const
A type-safe flags class for bitwise operations on enum values.
Provides information about existing serial ports.
Info & operator=(const Info &other)
bool operator==(const Info &other)
Info(const SerialPort &port)
std::string portName() const
std::string systemLocation() const
uint16_t vendorIdentifier() const
static std::deque< int32_t > standardBaudRates()
std::string serialNumber() const
bool hasVendorIdentifier() const
std::unique_ptr< Private > d_ptr
uint16_t productIdentifier() const
std::string description() const
Info(const std::string &name)
std::string manufacturer() const
bool operator!=(const Info &other)
static Info defaultPort()
Information sur le port série par défaut sur la carte Pi Dépend du modèle de carte (informations stoc...
static std::deque< Info > availablePorts()
bool hasProductIdentifier() const
std::string driverName() const
Provides settings information about serial ports.
std::string flowControlString() const
Convert current flow control to string.
std::string parityString() const
Convert current parity to string.
std::string dataBitsString() const
Convert current data bits to string.
int32_t outputBaudRate
data baud rate for the desired direction
Settings(int32_t baudRate=Baud9600, DataBits dataBits=Data8, Parity parity=NoParity, StopBits stopBits=OneStop, FlowControl flowControl=NoFlowControl)
int32_t inputBaudRate
data baud rate for the desired direction
friend std::ostream & operator<<(std::ostream &os, const Settings &s)
Print settings to stream.
static std::string flowControlToString(FlowControl flowControl)
Convert flow control to string.
std::string stopBitsString() const
Convert current stop bits to string.
static std::string stopBitsToString(StopBits stopBits)
Convert stop bits to string.
FlowControl flowControl
the desired flow control mode
bool operator==(const Settings &other)
equality operator
unsigned long rs485Delay
the rs485 delay in microseconds before and after send
unsigned long onebyteTime
time for send on byte
StopBits stopBits
the number of stop bits in a frame
DataBits dataBits
number of data bits used
static std::string parityToString(Parity parity)
Convert parity to string.
static std::string dataBitsToString(DataBits dataBits)
Convert data bits to string.
Parity parity
the parity checking mode
void updateOneByteTime()
Update the time of an byte in accordance with the baudrate and the number of bits of data,...
std::string toString() const
Convert to string.
Provides functions to access serial ports.
SerialPort(const Info &serialPortInfo)
virtual ssize_t write(const char *data, size_t maxSize, bool endl)
bool setStopBits(StopBits stopBits)
void setPort(const Info &info)
StopBits stopBits() const
the number of stop bits in a frame
Flags< PinoutSignal > PinoutSignals
SerialPort(const std::string &path)
bool isBreakEnabled() const
FlowControl flowControl() const
the desired flow control mode
void discard(Directions directions=AllDirections)
bool setDataBits(DataBits dataBits)
bool setBaudRate(int32_t baudRate, Directions directions=AllDirections)
bool setFlowControl(FlowControl flowControl)
bool setRequestToSend(bool set)
bool setSettings(const Settings &settings)
void setPortName(const std::string &name)
int32_t baudRate(Directions directions=AllDirections) const
the data baud rate for the desired direction
virtual ~SerialPort()
Closes the serial port, if necessary, and then destroys object.
Parity parity() const
the parity checking mode
bool sendBreak(int duration=0)
virtual ssize_t write(const char *data, size_t maxSize)
bool isDataTerminalReady()
bool setDataTerminalReady(bool set)
bool setParity(Parity parity)
Flags< Direction > Directions
bool setBreakEnabled(bool set=true)
std::string portName() const
Settings settings() const
settings information
DataBits dataBits() const
the data bits in a frame
PinoutSignals pinoutSignals()
@ DataCarrierDetectSignal
@ DataTerminalReadySignal
@ SecondaryReceivedDataSignal
@ SecondaryTransmittedDataSignal
Provides an interface for reading from and writing to terminals (tty)
Internal implementation class for GpioDevice.
#define PIMP_DECLARE_PRIVATE(Class)
PIMP_DECLARE_PRIVATE.
Global namespace for Piduino.