Aria: ArSerialConnection Class Reference

- Main Page
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ArSerialConnection Class Reference

`#include <ArSerialConnection.h>`

Inheritance diagram for ArSerialConnection:

List of all members.

## Detailed Description

For connecting to devices through a serial port.

## 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)
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)
const char * | getPort (void)
bool | getRing (void)
| Sees how the Ring line is set (true = high).
virtual int | getStatus (void)
virtual ArTime | getTimeRead (int index)
int | internalOpen (void)
virtual bool | isTimeStamping (void)
int | open (const char *port=NULL)
virtual bool | openSimple (void)
virtual int | read (const char *data, unsigned int size, unsigned int msWait=0)
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)
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

## Member Enumeration Documentation

enum ArSerialConnection::Open

Enumerator:

  OPEN_COULD_NOT_OPEN_PORT | Could not open the port.
  OPEN_COULD_NOT_SET_UP_PORT | Could not set up the port.
  OPEN_INVALID_BAUD_RATE | Baud rate is not valid.
  OPEN_COULD_NOT_SET_BAUD | Baud rate valid, but could not set it.
  OPEN_ALREADY_OPEN | Connection was already open.

## Member Function Documentation

const char* ArSerialConnection::getPort | ( | void |  | ) |

Gets the port this is using

See also:
  ArUtil::COM1, ArUtil::COM2, ArUtil::COM3, ArUtil::COM4

int ArSerialConnection::open | ( | const char * | port = `NULL` | ) |

Opens the serial port

See also:
  ArUtil::COM1, ArUtil::COM2, ArUtil::COM3, ArUtil::COM4

void ArSerialConnection::setPort | ( | const char * | port = `NULL` | ) |

Sets the port this connection will use

See also:
  ArUtil::COM1, ArUtil::COM2, ArUtil::COM3, ArUtil::COM4

The documentation for this class was generated from the following file:

- ArSerialConnection.h