Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages | Examples

ArSerialConnection Class Reference

#include <ArSerialConnection.h>

Inheritance diagram for ArSerialConnection:

ArDeviceConnection List of all members.

Detailed Description

For connecting to devices through a serial port.
Examples:

sonyPTZDemo.cpp, and vcc4CameraExample.cpp.

Definition at line 39 of file ArSerialConnection.h.

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
 

Enumeration values:
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.

Definition at line 95 of file ArSerialConnection.h.


Member Function Documentation

int ArSerialConnection::getBaud void   ) 
 

Gets what the current baud rate is set to.

Returns:
the current baud rate of the connection

Definition at line 286 of file ArSerialConnection_LIN.cpp.

bool ArSerialConnection::getHardwareControl void   ) 
 

Gets whether the hardware control lines are enabled or disabled.

Returns:
true if hardware control of lines is enabled, false otherwise

Definition at line 363 of file ArSerialConnection_LIN.cpp.

const char * ArSerialConnection::getPort void   ) 
 

Gets the port this is using

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

Definition at line 183 of file ArSerialConnection_LIN.cpp.

int ArSerialConnection::open const char *  port = NULL  ) 
 

Opens the serial port

See also:
ArUtil::COM1, ArUtil::COM2, ArUtil::COM3, ArUtil::COM4
Examples:
sonyPTZDemo.cpp.

Definition at line 194 of file ArSerialConnection_LIN.cpp.

bool ArSerialConnection::setBaud int  baud  ) 
 

Sets the baud rate on the connection.

Parameters:
rate the baud rate to set the connection to
Returns:
whether the set succeeded
See also:
getBaud

Definition at line 230 of file ArSerialConnection_LIN.cpp.

bool ArSerialConnection::setHardwareControl bool  hardwareControl  ) 
 

Sets whether to enable or disable the hardware control lines.

Parameters:
hardwareControl true to enable hardware control of lines
Returns:
true if the set succeeded

Definition at line 335 of file ArSerialConnection_LIN.cpp.

void ArSerialConnection::setPort const char *  port = NULL  ) 
 

Sets the port this connection will use

See also:
ArUtil::COM1, ArUtil::COM2, ArUtil::COM3, ArUtil::COM4
Examples:
vcc4CameraExample.cpp.

Definition at line 172 of file ArSerialConnection_LIN.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Feb 20 10:51:45 2007 for Aria by  doxygen 1.4.0