MOOS 0.2375
Public Member Functions | Protected Member Functions | Protected Attributes
CMOOSLinuxSerialPort Class Reference

Implements linux aspects of CMOOSSerialPort. More...

#include <MOOSLinuxSerialPort.h>

Inheritance diagram for CMOOSLinuxSerialPort:
Inheritance graph
[legend]
Collaboration diagram for CMOOSLinuxSerialPort:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual bool Close ()
 CMOOSLinuxSerialPort ()
virtual ~CMOOSLinuxSerialPort ()
virtual bool Create (const char *pPortNum=DEFAULT_PORT, int nBaudRate=DEFAULT_BAUDRATE)
int Write (const char *Str, int nLen, double *pTime=NULL)
virtual void Break ()
virtual int Flush ()
int GetFD ()

Protected Member Functions

virtual int GrabN (char *pBuffer, int nRequired)

Protected Attributes

int m_nPortFD
struct termios m_OldPortOptions
struct termios m_PortOptions

Detailed Description

Implements linux aspects of CMOOSSerialPort.

Definition at line 59 of file MOOSLinuxSerialPort.h.


Constructor & Destructor Documentation

CMOOSLinuxSerialPort::CMOOSLinuxSerialPort ( )

constructor.

Definition at line 43 of file MOOSLinuxSerialPort.cpp.

CMOOSLinuxSerialPort::~CMOOSLinuxSerialPort ( ) [virtual]

Destructor.Reset the port option to what every they were before and close port

Definition at line 50 of file MOOSLinuxSerialPort.cpp.


Member Function Documentation

void CMOOSLinuxSerialPort::Break ( ) [virtual]

send break signal

The ability to send a Break signal (~.5sec of tying the TX pin low) in Linux

Reimplemented from CMOOSSerialPort.

Definition at line 214 of file MOOSLinuxSerialPort.cpp.

bool CMOOSLinuxSerialPort::Close ( void  ) [virtual]

Reimplemented from CMOOSSerialPort.

Definition at line 252 of file MOOSLinuxSerialPort.cpp.

bool CMOOSLinuxSerialPort::Create ( const char *  sPort = DEFAULT_PORT,
int  nBaudRate = DEFAULT_BAUDRATE 
) [virtual]

Create and set up the port

Implements CMOOSSerialPort.

Definition at line 56 of file MOOSLinuxSerialPort.cpp.

int CMOOSLinuxSerialPort::Flush ( void  ) [virtual]

Call this method in order to free the Output Buffer of any characters that may not have been sent during our last write. We use the queue_selector TCOFLUSH.

See also:
http://www.mkssoftware.com/docs/man3/tcflush.3.asp

Reimplemented from CMOOSSerialPort.

Definition at line 236 of file MOOSLinuxSerialPort.cpp.

int CMOOSLinuxSerialPort::GetFD ( )

returns the file descriptor

returns the port file descriptor

Definition at line 128 of file MOOSLinuxSerialPort.cpp.

int CMOOSLinuxSerialPort::GrabN ( char *  pBuffer,
int  nRequired 
) [protected, virtual]

Just grab N characters NOW

Implements CMOOSSerialPort.

Definition at line 134 of file MOOSLinuxSerialPort.cpp.

int CMOOSLinuxSerialPort::Write ( const char *  Str,
int  nLen,
double *  pTime = NULL 
) [virtual]

Write a string out of port

Write a string out of the port. The time at which it was written is written to *pTime

Implements CMOOSSerialPort.

Definition at line 159 of file MOOSLinuxSerialPort.cpp.


Member Data Documentation

FileDescriptor of Port

Definition at line 84 of file MOOSLinuxSerialPort.h.

struct termios CMOOSLinuxSerialPort::m_OldPortOptions [protected]

Definition at line 90 of file MOOSLinuxSerialPort.h.

struct termios CMOOSLinuxSerialPort::m_PortOptions [protected]

Definition at line 91 of file MOOSLinuxSerialPort.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines