#include <ArSerialConnection.h>
Inheritance diagram for ArSerialConnection:
Public Types | |
enum | Open { OPEN_COULD_NOT_OPEN_PORT = 1, OPEN_COULD_NOT_SET_UP_PORT, OPEN_INVALID_BAUD_RATE, OPEN_COULD_NOT_SET_BAUD, OPEN_ALREADY_OPEN } |
Public Member Functions | |
ArSerialConnection () | |
Constructor. | |
virtual bool | close (void) |
Closes the connection. | |
int | getBaud (void) |
Gets what the current baud rate is set to. | |
bool | getCTS (void) |
Sees how the CTS line is set (true = high). | |
bool | getDCD (void) |
Sees how the DCD line is set (true = high). | |
bool | getDSR (void) |
Sees how the DSR line is set (true = high). | |
bool | getHardwareControl (void) |
Gets whether the hardware control lines are enabled or disabled. | |
virtual const char * | getOpenMessage (int messageNumber) |
Gets the string of the message associated with opening the device. | |
const char * | getPort (void) |
bool | getRing (void) |
Sees how the Ring line is set (true = high). | |
virtual int | getStatus (void) |
Gets the status of the connection, which is one of the enum status. | |
virtual ArTime | getTimeRead (int index) |
Gets the time data was read in. | |
int | internalOpen (void) |
virtual bool | isTimeStamping (void) |
sees if timestamping is really going on or not | |
int | open (const char *port=NULL) |
virtual bool | openSimple (void) |
Opens the connection again, using the values from setLocation or. | |
virtual int | read (const char *data, unsigned int size, unsigned int msWait=0) |
Reads data from connection. | |
bool | setBaud (int baud) |
Sets the baud rate on the connection. | |
bool | setHardwareControl (bool hardwareControl) |
Sets whether to enable or disable the hardware control lines. | |
void | setPort (const char *port=NULL) |
virtual int | write (const char *data, unsigned int size) |
Writes data to connection. | |
virtual | ~ArSerialConnection () |
Destructor also closes the connection. | |
Protected Member Functions | |
int | baudToRate (int baud) |
void | buildStrMap (void) |
int | rateToBaud (int rate) |
void | startTimeStamping (void) |
Protected Attributes | |
int | myBaudRate |
bool | myHardwareControl |
int | myPort |
std::string | myPortName |
int | myStatus |
ArStrMap | myStrMap |
bool | myTakingTimeStamps |
Definition at line 40 of file ArSerialConnection.h.
|
Definition at line 96 of file ArSerialConnection.h. |
|
Closes the connection.
Reimplemented from ArDeviceConnection. Definition at line 201 of file ArSerialConnection_LIN.cpp. References ArLog::log(). Referenced by ~ArSerialConnection(). |
|
Gets what the current baud rate is set to.
Definition at line 287 of file ArSerialConnection_LIN.cpp. Referenced by ArRobot::asyncConnectHandler(). |
|
Gets whether the hardware control lines are enabled or disabled.
Definition at line 364 of file ArSerialConnection_LIN.cpp. |
|
Gets the string of the message associated with opening the device. Each class inherited from this one has an open method which returns 0 for success or an integer which can be passed into this function to obtain a string describing the reason for failure
Implements ArDeviceConnection. Definition at line 69 of file ArSerialConnection_LIN.cpp. |
|
Gets the port this is using
Definition at line 184 of file ArSerialConnection_LIN.cpp. Referenced by ArSimpleConnector::setupRobot(). |
|
Gets the status of the connection, which is one of the enum status. Gets the status of the connection, which is one of the enum status. If you want to get a string to go along with the number, use getStatusMessage
Implements ArDeviceConnection. Definition at line 447 of file ArSerialConnection_LIN.cpp. Referenced by setBaud(), and setHardwareControl(). |
|
Gets the time data was read in.
Implements ArDeviceConnection. Definition at line 452 of file ArSerialConnection_LIN.cpp. References ArTime::setMSec(), ArTime::setSec(), and ArTime::setToNow(). |
|
sees if timestamping is really going on or not
Implements ArDeviceConnection. Definition at line 479 of file ArSerialConnection_LIN.cpp. |
|
Opens the serial port
Definition at line 195 of file ArSerialConnection_LIN.cpp. References setPort(). |
|
Reads data from connection. Reads data from connection
Implements ArDeviceConnection. Definition at line 399 of file ArSerialConnection_LIN.cpp. References ArTime::addMSec(), ArLog::log(), ArTime::mSecTo(), and ArTime::setToNow(). |
|
Sets the baud rate on the connection.
Definition at line 231 of file ArSerialConnection_LIN.cpp. References getStatus(), and ArLog::log(). Referenced by ArRobot::asyncConnectHandler(), ArSick::disconnect(), ArRobot::disconnect(), ArSick::internalConnectHandler(), and ArSimpleConnector::setupRobot(). |
|
Sets whether to enable or disable the hardware control lines.
Definition at line 336 of file ArSerialConnection_LIN.cpp. References getStatus(), and ArLog::log(). |
|
Sets the port this connection will use
Definition at line 173 of file ArSerialConnection_LIN.cpp. Referenced by open(), ArSimpleConnector::setupLaserArbitrary(), and ArSimpleConnector::setupRobot(). |
|
Writes data to connection. Writes data to connection
Implements ArDeviceConnection. Definition at line 369 of file ArSerialConnection_LIN.cpp. References ArLog::log(). |