|
DESERT 4.0.0
|
#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) |
Public Member Functions inherited from UwConnector | |
| 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 | |
Protected Attributes inherited from UwConnector | |
| int | local_errno |
Class that implements serial port connection.
| UwSerial::UwSerial | ( | ) |
Constructor of the UwSerial class
References UwConnector::local_errno.
|
virtual |
Destructor of the UwSerial class
|
virtual |
Method that closes an active connection to a device
Implements UwConnector.
References serialfd.
Referenced by refreshConnection().
|
virtual |
Method that loads the termios struct with the serial port parameters.
| path | const std::string with address and flag |
References UwConnector::local_errno, serialfd, and tty.
Referenced by openConnection().
|
virtual |
Returns true if serial port fd differs from -1, that means the connection is up
Implements UwConnector.
References serialfd.
|
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.
References configurePort(), UwConnector::local_errno, and serialfd.
Referenced by refreshConnection().

|
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.
References UwConnector::local_errno, and serialfd.
|
virtual |
Method that refreshes an existing connection creating a new file descriptor.
| path | const std::string with address and flag |
References closeConnection(), openConnection(), and serialfd.

|
virtual |
Method that writes a command to the port interface
| msg | std::string command to be sent through the port |
Implements UwConnector.
References serialfd.
|
private |
Integer value that stores the serial port descriptor as generated by the function UwSerial:openConnection().
Referenced by closeConnection(), configurePort(), isConnected(), openConnection(), readFromDevice(), refreshConnection(), and writeToDevice().
|
private |
Referenced by configurePort().