DESERT 3.5.1
|
#include <uwserial.h>
Public Member Functions | |
UwSerial () | |
virtual | ~UwSerial () |
virtual bool | openConnection (const std::string &path) |
virtual bool | closeConnection () |
virtual const bool | isConnected () |
virtual int | writeToDevice (const std::string &msg) |
virtual int | readFromDevice (void *wpos, int maxlen) |
virtual int | configurePort (const std::string &path) |
virtual bool | refreshConnection (const std::string &path) |
![]() | |
UwConnector () | |
virtual | ~UwConnector () |
virtual void | setServer () |
virtual void | setTCP () |
virtual void | setUDP () |
virtual const int | getErrno () |
Private Attributes | |
int | serialfd |
struct termios | tty |
Additional Inherited Members | |
![]() | |
int | local_errno |
Class that implements serial port connection.
Definition at line 52 of file uwserial.h.
UwSerial::UwSerial | ( | ) |
Constructor of the UwSerial class.
Definition at line 35 of file uwserial.cpp.
|
virtual |
Destructor of the UwSerial class.
Definition at line 42 of file uwserial.cpp.
|
virtual |
Method that closes an active connection to a device.
Implements UwConnector.
Definition at line 86 of file uwserial.cpp.
|
virtual |
Method that loads the termios struct with the serial port parameters.
path | const std::string with address and flag |
Definition at line 123 of file uwserial.cpp.
|
virtual |
Returns true if serial port fd differs from -1, that means the connection is up.
Implements UwConnector.
Definition at line 47 of file uwserial.cpp.
|
virtual |
Method that opens a serial connection, the input string has to be with a format like <port_name>:parity:stop:flow:baud, e.g.
tty0:p=0:s=1:f=0:b=123456
Implements UwConnector.
Definition at line 53 of file uwserial.cpp.
|
virtual |
Function that receives data from the device's port to a backup buffer.
The unloaded data is saved to a temporary buffer, to be parsed later.
pos | position to start writing data to: a pointer to some buffer |
Implements UwConnector.
Definition at line 109 of file uwserial.cpp.
|
virtual |
Method that refreshes an existing connection creating a new file descriptor.
path | const std::string with address and flag |
Definition at line 261 of file uwserial.cpp.
|
virtual |
Method that writes a command to the port interface.
msg | std::string command to be sent through the port |
Implements UwConnector.
Definition at line 97 of file uwserial.cpp.
|
private |
Integer value that stores the serial port descriptor as generated by the function UwSerial:openConnection().
Definition at line 119 of file uwserial.h.
|
private |
Definition at line 121 of file uwserial.h.