Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

vpr::SerialPort_t Class Template Reference

Cross-platform serial port interface. More...

#include <SerialPort_t.h>

Inheritance diagram for vpr::SerialPort_t:

Inheritance graph
[legend]
Collaboration diagram for vpr::SerialPort_t:

Collaboration graph
[legend]
List of all members.

Public Methods

 SerialPort_t (const std::string &port_name)
 Constructor. More...

virtual ~SerialPort_t ()
 Destructor. More...

virtual const std::string & getName () const
 Gets the name of the encapsulated serial port. More...

vpr::ReturnStatus open ()
 Opens the serial port. More...

vpr::ReturnStatus close ()
 Closes the serial port. More...

vpr::ReturnStatus setBlocking (bool blocking)
 Reconfigures the serial port so that it is in blocking or non-blocking mode depending on the value of the parameter. More...

vpr::ReturnStatus clearAll ()
 Clears all of the serial port settings. More...

bool isBlocking () const
 Get the current blocking state for the serial port. More...

virtual IOSys::Handle getHandle () const
 Gets the vpr::IOSys::Handle object for this serial port. More...

void setOpenReadOnly ()
 Sets the open flags so that the serial port is opened in read-only mode. More...

void setOpenWriteOnly ()
 Sets the open flags so that the serial port is opened in write-only mode. More...

void setOpenReadWrite ()
 Sets the open flags so that the serial port is opened in read/write mode. More...

vpr::SerialTypes::UpdateActionOption getUpdateAction () const
 Gets the current update action. More...

void setUpdateAction (vpr::SerialTypes::UpdateActionOption action)
 Changes the current update action to take place as described by the given value. More...

vpr::ReturnStatus getMinInputSize (vpr::Uint16 &size) const
 Queries the serial port for the minimum buffer size. More...

vpr::ReturnStatus setMinInputSize (const vpr::Uint8 size)
 Attempts to change the minimum buffer size to the given argument. More...

vpr::ReturnStatus getTimeout (vpr::Uint8 &timeout) const
 Gets the value of the timeout (in tenths of a second) to wait for data to arrive. More...

vpr::ReturnStatus setTimeout (const vpr::Uint8 timeout_val)
 Sets the value of the timeout to wait for data to arrive. More...

vpr::ReturnStatus getCharacterSize (vpr::SerialTypes::CharacterSizeOption &size) const
 Gets the character size (the bits per byte). More...

vpr::ReturnStatus setCharacterSize (const vpr::SerialTypes::CharacterSizeOption bpb)
 Sets the current character size (the bits per byte) to the size in the given value. More...

bool getReadState () const
 Gets the current read state for the port. More...

vpr::ReturnStatus setRead (bool flag)
 Changes the receiver so that bytes can or cannot be read from the port. More...

bool getLocalAttachState () const
 Gets the current local attach state for the port. More...

vpr::ReturnStatus setLocalAttach (bool flag)
 Mark the device as locally attached or not. More...

vpr::ReturnStatus getStopBits (vpr::Uint8 &num_bits) const
 Gets the number of stop bits in use. More...

vpr::ReturnStatus setStopBits (const vpr::Uint8 num_bits)
 Sets the number of stop bits to use. More...

bool getCanonicalState () const
 Queries the canonical input state of the serial port. More...

vpr::ReturnStatus setCanonicalInput (bool flag)
 Enables canonical input. More...

bool getBadByteIgnoreState () const
 Gets the current state of ignoring bytes with framing errors (other than a BREAK) or parity errors. More...

vpr::ReturnStatus setBadByteIgnore (bool flag)
 Enables or disables ignoring of received bytes with framing errors or parity errors. More...

bool getBreakByteIgnoreState () const
 Gets the current state of ignoring BREAK bytes. More...

vpr::ReturnStatus setBreakByteIgnore (bool flag)
 Enables or disables ignoring of received BREAK bytes. More...

bool getInputParityCheckState () const
 Gets the state of parity checking for input. More...

vpr::ReturnStatus setInputParityCheck (bool flag)
 Enables or disables input parity checking. More...

bool getBitStripState () const
 Gets the current state of bit stripping. More...

vpr::ReturnStatus setBitStripping (bool flag)
 Enables or disables stripping of input bytes to seven bits. More...

bool getStartStopInputState () const
 Gets the state of start-stop input control. More...

vpr::ReturnStatus setStartStopInput (bool flag)
 Enables or disables start-stop input control. More...

bool getStartStopOutputState () const
 Gets the state of start-stop output control. More...

vpr::ReturnStatus setStartStopOutput (bool flag)
 Enables or disables start-stop output control. More...

bool getParityGenerationState () const
 Gets the current state of parity generation for outgoing bytes and parity checking for incoming bytes. More...

vpr::ReturnStatus setParityGeneration (bool flag)
 Enables or disables parity generation for outgoing bytes and parity checking for incoming bytes. More...

bool getParityErrorMarkingState () const
 Returns the current state of parity error marking for this serial port. More...

vpr::ReturnStatus setParityErrorMarking (bool flag)
 Enables or disables marking of bytes with parity errors or framing errors (except BREAKs). More...

vpr::SerialTypes::ParityType getParity () const
 Gets the current parity checking type (either odd or even). More...

vpr::ReturnStatus setParity (const vpr::SerialTypes::ParityType &type)
 Enables even or odd parity. More...

vpr::ReturnStatus getInputBaudRate (vpr::Uint32 &rate) const
 Gets the current input baud rate. More...

vpr::ReturnStatus setInputBaudRate (const vpr::Uint32 baud)
 Sets the current input baud rate. More...

vpr::ReturnStatus getOutputBaudRate (vpr::Uint32 &rate) const
 Gets the current output baud rate. More...

vpr::ReturnStatus setOutputBaudRate (const vpr::Uint32 baud)
 Sets the current output baud rate. More...

vpr::ReturnStatus drainOutput ()
 Waits for all output to be transmitted. More...

vpr::ReturnStatus controlFlow (SerialTypes::FlowActionOption opt)
 Alters the input or output flow control. More...

bool getHardwareFlowControlState () const
 Returns the current enable state of hardware flow control. More...

vpr::ReturnStatus setHardwareFlowControl (bool flag)
 Attempts to enable "hardware" flow control. More...

vpr::ReturnStatus flushQueue (SerialTypes::FlushQueueOption queue)
 Discards either the input buffer (unread data received from the terminal device) or the output buffer (data written but not yet transmitted to the terminal device). More...

vpr::ReturnStatus sendBreak (const int duration)
 Transmit a continuous stream of zero bits for the given duration. More...

int getCarrierDetect () const
 Return the status of the carrier detect signal. More...

int getDataSetReady () const
 Returns the status of the data set ready line. More...

int getClearToSend () const
 Returns the status of the clear to send. More...

int getRingIndicator () const
 Returns the status of the ring indicator line. More...

vpr::ReturnStatus setDataTerminalReady (bool val)
 Sets the data terminal ready line. More...

vpr::ReturnStatus setRequestToSend (bool val)
 Sets the ready to send line. More...


Protected Methods

virtual vpr::ReturnStatus read_i (void *buffer, const vpr::Uint32 length, vpr::Uint32 &bytes_read, const vpr::Interval timeout=vpr::Interval::NoTimeout)
 Implementation of the read template method. More...

virtual vpr::ReturnStatus readn_i (void *buffer, const vpr::Uint32 length, vpr::Uint32 &bytes_read, const vpr::Interval timeout=vpr::Interval::NoTimeout)
 Implementation of the readn template method. More...

virtual vpr::ReturnStatus write_i (const void *buffer, const vpr::Uint32 length, vpr::Uint32 &bytes_written, const vpr::Interval timeout=vpr::Interval::NoTimeout)
 Implementation of the write template method. More...


Protected Attributes

RealSerialPortImpl mSioImpl
 Platform-specific serial port implementation object. More...


Detailed Description

template<class RealSerialPortImpl>
class vpr::SerialPort_t< RealSerialPortImpl >

Cross-platform serial port interface.

See also:
vpr::SerialPortImplTermios , vpr::SerialPortImplWin32

Definition at line 56 of file SerialPort_t.h.


Constructor & Destructor Documentation

template<class RealSerialPortImpl>
vpr::SerialPort_t< RealSerialPortImpl >::SerialPort_t const std::string &    port_name [inline]
 

Constructor.

Precondition:
None.
Postcondition:
A serial port interface implementation object is created using the given port name.
Parameters:
port_name  The name of the serial port to be accessed through this object.

Definition at line 69 of file SerialPort_t.h.

References mSioImpl, and vpr::Port::Port.

00070       : Port(port_name), mSioImpl(port_name)
00071    {
00072       /* Do nothing. */ ;
00073    }

template<class RealSerialPortImpl>
virtual vpr::SerialPort_t< RealSerialPortImpl >::~SerialPort_t   [inline, virtual]
 

Destructor.

This does nothing.

Precondition:
None.
Postcondition:
None.

Definition at line 81 of file SerialPort_t.h.

00082    {
00083       /* Do nothing. */ ;
00084    }


Member Function Documentation

template<class RealSerialPortImpl>
virtual const std::string& vpr::SerialPort_t< RealSerialPortImpl >::getName   const [inline, virtual]
 

Gets the name of the encapsulated serial port.

Precondition:
None.
Postcondition:
A constant reference to the mName object is returned to the caller.
Returns:
An object containing the name of this serial port.

Reimplemented from vpr::BlockIO.

Definition at line 99 of file SerialPort_t.h.

References mSioImpl.

00100    {
00101       return mSioImpl.getName();
00102    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::open   [inline, virtual]
 

Opens the serial port.

Precondition:
The serial port is not already open.
Postcondition:
An attempt is made to open the serial port. The resulting status is returned to the caller.
Returns:
vpr::ReturnStatus::Succeed is returned if the serial port opened successfully.
vpr::ReturnStatus::Fail is returned otherwise.

Implements vpr::BlockIO.

Definition at line 115 of file SerialPort_t.h.

References mSioImpl.

00116    {
00117       return mSioImpl.open();
00118    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::close   [inline, virtual]
 

Closes the serial port.

Precondition:
The serial port is open.
Postcondition:
An attempt is made to close the serial port. The resulting status is returned to the caller.
Returns:
vpr::ReturnStatus::Succeed is returned if the serial port is closed successfully.
vpr::ReturnStatus::Fail is returned otherwise.

Implements vpr::BlockIO.

Definition at line 131 of file SerialPort_t.h.

References mSioImpl.

00132    {
00133       return mSioImpl.close();
00134    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setBlocking bool    blocking [inline, virtual]
 

Reconfigures the serial port so that it is in blocking or non-blocking mode depending on the value of the parameter.

If the serial port has not been opened yet, it will be opened in blocking or non-blocking mode appropriately.

Postcondition:
Processes may block when accessing the port.
Parameters:
blocking  A value of true makes the serial port blocking. A value of false makes it non-blocking.
Returns:
vpr::ReturnStatus::Succeed is returned if the device's blocking mode is set to blocking. vpr::ReturnStatus::Fail is returned otherwise.

Implements vpr::BlockIO.

Definition at line 151 of file SerialPort_t.h.

References mSioImpl.

00152    {
00153       return mSioImpl.setBlocking(blocking);
00154    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::clearAll   [inline]
 

Clears all of the serial port settings.

Precondition:
The port is open.
Postcondition:
All of the serial port flags are set to 0 except VMIN=1
Returns:
vpr::ReturnStatus::Succeed is returned if the port's flags were cleard successfully vpr::ReturnStatus::Fail is returned otherwise.

Definition at line 166 of file SerialPort_t.h.

References mSioImpl.

00167    {
00168       return mSioImpl.clearAll();
00169    }

template<class RealSerialPortImpl>
bool vpr::SerialPort_t< RealSerialPortImpl >::isBlocking   const [inline, virtual]
 

Get the current blocking state for the serial port.

Precondition:
The blocking state is set correctly.
Returns:
true is returned if the port is in blocking mode. false is returned if the port is in non-blocking mode.

Reimplemented from vpr::BlockIO.

Definition at line 179 of file SerialPort_t.h.

References mSioImpl.

00180    {
00181       return mSioImpl.isBlocking();
00182    }

template<class RealSerialPortImpl>
virtual IOSys::Handle vpr::SerialPort_t< RealSerialPortImpl >::getHandle   const [inline, virtual]
 

Gets the vpr::IOSys::Handle object for this serial port.

Returns:
vpr::IOSys::NullHandle is returned if the port has no handle or if the handle could not be returned for some reason.

Implements vpr::BlockIO.

Definition at line 190 of file SerialPort_t.h.

References mSioImpl.

00191    {
00192       return mSioImpl.getHandle();
00193    }

template<class RealSerialPortImpl>
void vpr::SerialPort_t< RealSerialPortImpl >::setOpenReadOnly   [inline]
 

Sets the open flags so that the serial port is opened in read-only mode.

Precondition:
None.
Postcondition:
The open flags are updated so that when the port is opened, it is opened in read-only mode. If the port is already open, this has no effect.

Definition at line 207 of file SerialPort_t.h.

References mSioImpl.

00208    {
00209       mSioImpl.setOpenReadOnly();
00210    }

template<class RealSerialPortImpl>
void vpr::SerialPort_t< RealSerialPortImpl >::setOpenWriteOnly   [inline]
 

Sets the open flags so that the serial port is opened in write-only mode.

Precondition:
None.
Postcondition:
The open flags are updated so that when the port is opened, it is opened in write-only mode. If the port is already open, this has no effect.

Definition at line 221 of file SerialPort_t.h.

References mSioImpl.

00222    {
00223       mSioImpl.setOpenWriteOnly();
00224    }

template<class RealSerialPortImpl>
void vpr::SerialPort_t< RealSerialPortImpl >::setOpenReadWrite   [inline]
 

Sets the open flags so that the serial port is opened in read/write mode.

Precondition:
None.
Postcondition:
The open flags are updated so that when the port is opened, it is opened in read/write mode. If the port is already open, this has no effect.

Definition at line 235 of file SerialPort_t.h.

References mSioImpl.

00236    {
00237       mSioImpl.setOpenReadWrite();
00238    }

template<class RealSerialPortImpl>
vpr::SerialTypes::UpdateActionOption vpr::SerialPort_t< RealSerialPortImpl >::getUpdateAction   const [inline]
 

Gets the current update action.

This tells when updates to the serial device take effect.

Precondition:
None.
Postcondition:
The current update action is returned to the caller.
Returns:
A vpr::SerialTypes::UpdateActionOption value stating when updates take effect.
See also:
vpr::SerialTypes::UpdateActionOption

Definition at line 252 of file SerialPort_t.h.

References mSioImpl.

00253    {
00254       return mSioImpl.getUpdateAction();
00255    }

template<class RealSerialPortImpl>
void vpr::SerialPort_t< RealSerialPortImpl >::setUpdateAction vpr::SerialTypes::UpdateActionOption    action [inline]
 

Changes the current update action to take place as described by the given value.

Precondition:
None.
Postcondition:
The update action is modified to use the new value. The results will be seen with the next device operation.
Parameters:
action  The new update action value.
See also:
vpr::SerialTypes::UpdateActionOption

Definition at line 269 of file SerialPort_t.h.

References mSioImpl.

00270    {
00271       mSioImpl.setUpdateAction(action);
00272    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::getMinInputSize vpr::Uint16   size const [inline]
 

Queries the serial port for the minimum buffer size.

This is only applicable in non-canonical mode. The min buffer size determines how many bytes must be read before a read can return.

Precondition:
The serial port is open.
Postcondition:
The minimum buffer size is returned to the caller through the by-reference argument.
Parameters:
size  A reference to a vpr::Uint16 where the buffer size is stored for return to the caller.
Returns:
vpr::ReturnStatus::Succeed is returned if the buffer size was retrieved successfully. vpr::ReturnStatus::Fail is returned otherwise.
See also:
getTimeout

Definition at line 291 of file SerialPort_t.h.

References mSioImpl.

00292    {
00293       return mSioImpl.getMinInputSize(size);
00294    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setMinInputSize const vpr::Uint8    size [inline]
 

Attempts to change the minimum buffer size to the given argument.

This will change the minimum number of bytes required in the buffer before a read call will return. This is only applicable in non-canonical mode.

Precondition:
The serial port is open.
Postcondition:
If the buffer size is usable on the port, the port attributes are updated and success is returned. Otherwise, a failure status is returned.
Returns:
vpr::ReturnStatus::Succeed is returned if the buffer size was set successfully. vpr::ReturnStatus::Fail is returned otherwise.
See also:
setTimeout

Definition at line 311 of file SerialPort_t.h.

References mSioImpl.

00312    {
00313       return mSioImpl.setMinInputSize(size);
00314    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::getTimeout vpr::Uint8   timeout const [inline]
 

Gets the value of the timeout (in tenths of a second) to wait for data to arrive.

This is only applicable in non-canonical mode.

Precondition:
The serial port is open.
Postcondition:
The current timeout setting is returned to the caller in the by-reference argument.
Parameters:
timeout  A reference to a vpr::Uint8 to be used as storage for the timeout value.
Returns:
vpr::ReturnStatus::Succeed is returned if the timeout length was retrieved successfully.
vpr::ReturnStatus::Fail is returned otherwise.

Definition at line 331 of file SerialPort_t.h.

References mSioImpl.

00332    {
00333       return mSioImpl.getTimeout(timeout);
00334    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setTimeout const vpr::Uint8    timeout_val [inline]
 

Sets the value of the timeout to wait for data to arrive.

The value given must be in tenths of a second. This is only applicable in non-canonical mode.

Precondition:
The serial port is open.
Postcondition:
The timeout interval is updated to use the given value.
Parameters:
timeout_val  The new timeout value measured in tenths of a second.
Returns:
vpr::ReturnStatus::Succeed is returned if the timeout length was updated successfully.
vpr::ReturnStatus::Fail is returned otherwise.

Definition at line 351 of file SerialPort_t.h.

References mSioImpl.

00352    {
00353       return mSioImpl.setTimeout(timeout_val);
00354    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::getCharacterSize vpr::SerialTypes::CharacterSizeOption   size const [inline]
 

Gets the character size (the bits per byte).

Precondition:
The serial port is open.
Postcondition:
The current character size is returned to the caller in the by-reference argument.
Parameters:
size  A reference to a vpr::SerialTypes::CharacterSizeOption object to be used as storage for the character size value.
Returns:
vpr::ReturnStatus::Succeed is returned if the character size was retrieved successfully.
vpr::ReturnStatus::Fail is returned otherwise.
See also:
vpr::SerialTypes::CharacterSizeOption

Definition at line 372 of file SerialPort_t.h.

References mSioImpl.

00373    {
00374       return mSioImpl.getCharacterSize(size);
00375    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setCharacterSize const vpr::SerialTypes::CharacterSizeOption    bpb [inline]
 

Sets the current character size (the bits per byte) to the size in the given value.

This is used for both reding and writing, and the size does not include the parity bit (if any).

Precondition:
The serial port is open.
Postcondition:
The bits per byte for the serial port is updated.
Parameters:
bpb  The new character size.
Returns:
vpr::ReturnStatus::Succeed is returned if the character size was updated successfully. vpr::ReturnStatus::Fail is is returned otherwise.
See also:
vpr::SerialTypes::CharacterSizeOption

Definition at line 393 of file SerialPort_t.h.

References mSioImpl.

00394    {
00395       return mSioImpl.setCharacterSize(bpb);
00396    }

template<class RealSerialPortImpl>
bool vpr::SerialPort_t< RealSerialPortImpl >::getReadState   const [inline]
 

Gets the current read state for the port.

Precondition:
The serial port is open.
Postcondition:
The read state (either enabled or disabled) is returne to the caller.
Returns:
true is returned if bytes can be read from the device.
false is returned otherwise.

Definition at line 408 of file SerialPort_t.h.

References mSioImpl.

00409    {
00410       return mSioImpl.getReadState();
00411    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setRead bool    flag [inline]
 

Changes the receiver so that bytes can or cannot be read from the port.

Precondition:
The serial port is open.
Postcondition:
An attempt is made to make the device readable or unreadable.
Parameters:
flag  A value of true makes the port readable. A value of false makes it unreadable.
Returns:
vpr::ReturnStatus::Succeed is returned if reading was enabled. vpr::ReturnStatus::Fail is returned otherwise.

Definition at line 425 of file SerialPort_t.h.

References mSioImpl.

00426    {
00427       return mSioImpl.setRead(flag);
00428    }

template<class RealSerialPortImpl>
bool vpr::SerialPort_t< RealSerialPortImpl >::getLocalAttachState   const [inline]
 

Gets the current local attach state for the port.

Precondition:
The serial port is open.
Postcondition:
The CLOCAL state (either enabled or disabled) is returned to the caller.
Returns:
true is returned if local attachment is set. false is returned otherwise.

Definition at line 440 of file SerialPort_t.h.

References mSioImpl.

00441    {
00442       return mSioImpl.getLocalAttachState();
00443    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setLocalAttach bool    flag [inline]
 

Mark the device as locally attached or not.

Precondition:
This serial port is open.
Postcondition:
The device has its local attachment state enabled or disabled.
Parameters:
flag  A value of true enables local attachment.
Returns:
A vpr::ReturnStatus object describing the results of the operation.

Definition at line 456 of file SerialPort_t.h.

References mSioImpl.

00457    {
00458       return mSioImpl.setLocalAttach(flag);
00459    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::getStopBits vpr::Uint8   num_bits const [inline]
 

Gets the number of stop bits in use.

This will be either 1 or 2.

Precondition:
The serial port is open.
Postcondition:
The number of stop bits currently in use is returned via the by-reference argument.
Parameters:
num_bits  A reference to a vpr::Uint8 that will be used to store the number of stop bits.
Returns:
vpr::ReturnStatus::Succeed is returned if the number of stop bits was retrieved successfully. vpr::ReturnStatus::Fail is returned otherwise.

Definition at line 475 of file SerialPort_t.h.

References mSioImpl.

00476    {
00477       return mSioImpl.getStopBits(num_bits);
00478    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setStopBits const vpr::Uint8    num_bits [inline]
 

Sets the number of stop bits to use.

The value must be either 1 or 2.

Precondition:
The serial port is open, and the given number of stop bits is either 1 or 2.
Postcondition:
The number of stop bits is updated to use the given value.
Parameters:
num_bits  The number of stop bits to use.
Returns:
vpr::ReturnStatus::Succeed is returned if the number of stop bits was updated successfully. vpr::ReturnStatus::Fail is returned otherwise.

Definition at line 493 of file SerialPort_t.h.

References mSioImpl.

00494    {
00495       return mSioImpl.setStopBits(num_bits);
00496    }

template<class RealSerialPortImpl>
bool vpr::SerialPort_t< RealSerialPortImpl >::getCanonicalState   const [inline]
 

Queries the canonical input state of the serial port.

If canonical mode is enabled, the characters EOF, EOL, EOL2, ERASE, KILL, REPRINT, STATUS, and WERASE are enabled, and the input characters are assembled into lines. Otherwise, read requests are satisfied directly from the input queue, and a read will not return until the buffer is at its minimum capacity or the timeout has expired.

Precondition:
The serial port is open.
Postcondition:
The current state of canonical input is returnd to the caller.
Returns:
true is returned if canonical input mode is enabled. Otherwise, false is returned.
See also:
getMinInputSize , getTimeout

Definition at line 517 of file SerialPort_t.h.

References mSioImpl.

00518    {
00519       return mSioImpl.getCanonicalState();
00520    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setCanonicalInput bool    flag [inline]
 

Enables canonical input.

See getCanonicalState() for more information about what this means.

Precondition:
The serial port is open.
Postcondition:
Canonical input is enabled or disabled.
Returns:
vpr::ReturnStatus::Succeed is returned if canonical input was enabled. Otherwise, vpr::ReturnStatus::Fail is returned.
See also:
getCanonicalState

Definition at line 534 of file SerialPort_t.h.

References mSioImpl.

00535    {
00536       return mSioImpl.setCanonicalInput(flag);
00537    }

template<class RealSerialPortImpl>
bool vpr::SerialPort_t< RealSerialPortImpl >::getBadByteIgnoreState   const [inline]
 

Gets the current state of ignoring bytes with framing errors (other than a BREAK) or parity errors.

Precondition:
The serial port is open.
Postcondition:
The erroneous byte ignore state is returned to the caller.
Returns:
true is returned if bad bytes are ignored. false is returned if bad bytes are not ignored.

Definition at line 549 of file SerialPort_t.h.

References mSioImpl.

00550    {
00551       return mSioImpl.getBadByteIgnoreState();
00552    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setBadByteIgnore bool    flag [inline]
 

Enables or disables ignoring of received bytes with framing errors or parity errors.

Precondition:
The serial port is open.
Postcondition:
Erroneous byte ignoring is enabled or disabled.
Parameters:
flag  A value of true enables ignoring of bad bytes. A value of false disables it.
Returns:
vpr::ReturnStatus::Succeed is returned if bad byte ignoring is enabled. vpr::ReturnStatus::Fail is returned otherwise.

Definition at line 568 of file SerialPort_t.h.

References mSioImpl.

00569    {
00570       return mSioImpl.setBadByteIgnore(flag);
00571    }

template<class RealSerialPortImpl>
bool vpr::SerialPort_t< RealSerialPortImpl >::getBreakByteIgnoreState   const [inline]
 

Gets the current state of ignoring BREAK bytes.

Precondition:
The serial port is open.
Postcondition:
The BREAK byte ignore state is returned to the caller.
Returns:
true is returned if BREAK bytes are ignored. false is returned if BREAK bytes are not ignored.

Definition at line 582 of file SerialPort_t.h.

References mSioImpl.

00583    {
00584       return mSioImpl.getBreakByteIgnoreState();
00585    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setBreakByteIgnore bool    flag [inline]
 

Enables or disables ignoring of received BREAK bytes.

Precondition:
The serial port is open.
Postcondition:
BREAK byte ignoring is enabled or disabled.
Parameters:
flag  A value of true enables ignoring of BREAK bytes. A value of false disables it.
Returns:
vpr::ReturnStatus::Succeed is returned if BREAK byte ignoring is enabled. vpr::ReturnStatus::Fail is returned otherwise.

Definition at line 599 of file SerialPort_t.h.

References mSioImpl.

00600    {
00601       return mSioImpl.setBreakByteIgnore(flag);
00602    }

template<class RealSerialPortImpl>
bool vpr::SerialPort_t< RealSerialPortImpl >::getInputParityCheckState   const [inline]
 

Gets the state of parity checking for input.

Precondition:
The serial port is open. @posr The state of input parity checking is returned to the caller.
Returns:
true is returned if input parity checking is enabled. false is returned if input parity checking is disabled.

Definition at line 613 of file SerialPort_t.h.

References mSioImpl.

00614    {
00615       return mSioImpl.getInputParityCheckState();
00616    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setInputParityCheck bool    flag [inline]
 

Enables or disables input parity checking.

Precondition:
The serial port is open.
Postcondition:
Input parity checking is enabled or disabled.
Parameters:
flag  A value of true enables input parity checking. A value of false disables it.
Returns:
A vpr::ReturnStatus object describing the results of the operation.

Definition at line 630 of file SerialPort_t.h.

References mSioImpl.

00631    {
00632       return mSioImpl.setInputParityCheck(flag);
00633    }

template<class RealSerialPortImpl>
bool vpr::SerialPort_t< RealSerialPortImpl >::getBitStripState   const [inline]
 

Gets the current state of bit stripping.

When enabled, input bytes are stripped to seven bits. Otherwise, all eight bits are processed.

Precondition:
The serial port is open.
Postcondition:
The current bit stripping state is returned to the caller.
Returns:
true is returned if input bytes are stripped to seven bits. false is returned if input bytes are not stripped.

Definition at line 645 of file SerialPort_t.h.

References mSioImpl.

00646    {
00647       return mSioImpl.getBitStripState();
00648    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setBitStripping bool    flag [inline]
 

Enables or disables stripping of input bytes to seven bits.

Precondition:
The serial port is open.
Postcondition:
Input bit stripping is enabled or disabled.
Parameters:
flag  A value of true enables input byte stripping. A value of false disables it.
Returns:
A vpr::ReturnStatus object describing the results of the operation.

Definition at line 662 of file SerialPort_t.h.

References mSioImpl.

00663    {
00664       return mSioImpl.setBitStripping(flag);
00665    }

template<class RealSerialPortImpl>
bool vpr::SerialPort_t< RealSerialPortImpl >::getStartStopInputState   const [inline]
 

Gets the state of start-stop input control.

When enabled, if the terminal driver sees that the receive buffer is getting full, a STOP command is sent to the serial port. The device should respond by halting its data flow. When the input queue has been processed, a START command is sent to the serial port which should cause it to resume putting bytes onto the input queue.

PRE: The serial port is open. POST: The current state of start-stop input control is returned to the caller.

Returns:
true is returned if start-stop input control is enabled. false is returned if start-stop input control is not enabled.

Definition at line 682 of file SerialPort_t.h.

References mSioImpl.

00683    {
00684       return mSioImpl.getStartStopInputState();
00685    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setStartStopInput bool    flag [inline]
 

Enables or disables start-stop input control.

See getStartStopInputState() for more information.

Precondition:
The serial port is open.
Postcondition:
Start-stop input control is enabled or disabled.
Parameters:
flag  A value of true enables start-stop input control. A value of false disables it.
Returns:
A vpr::ReturnStatus object describing the results of the operation.

Definition at line 700 of file SerialPort_t.h.

References mSioImpl.

00701    {
00702       return mSioImpl.setStartStopInput(flag);
00703    }

template<class RealSerialPortImpl>
bool vpr::SerialPort_t< RealSerialPortImpl >::getStartStopOutputState   const [inline]
 

Gets the state of start-stop output control.

When enabled, when the terminal driver receives a STOP command, output stops. When it receives a START command, output resumes. If disabled, these commands are read as normal characters.

Precondition:
The serial port is open.
Postcondition:
The current state of start-stop output control is returned to the caller.
Returns:
true is returned if start-stop output control is enabled. false is returned if start-stop output control is not enabled.

Definition at line 718 of file SerialPort_t.h.

References mSioImpl.

00719    {
00720       return mSioImpl.getStartStopOutputState();
00721    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setStartStopOutput bool    flag [inline]
 

Enables or disables start-stop output control.

See getStartStopOutputState() for more information.

Precondition:
The serial port is open.
Postcondition:
Start-stop output control is enabled or disabled.
Parameters:
flag  A value of true enables start-stop output control. A value of false disables it.
Returns:
A vpr::ReturnStatus object describing the results of the operation.
See also:
getStartStopOutputState

Definition at line 738 of file SerialPort_t.h.

References mSioImpl.

00739    {
00740       return mSioImpl.setStartStopOutput(flag);
00741    }

template<class RealSerialPortImpl>
bool vpr::SerialPort_t< RealSerialPortImpl >::getParityGenerationState   const [inline]
 

Gets the current state of parity generation for outgoing bytes and parity checking for incoming bytes.

Precondition:
The serial port is open.
Postcondition:
The current parity generation/checking state is returned to the caller.
Returns:
true is returned if parity generation and checking are enabled for outgoing and incoming bytes respectively. false is returned if parity generation and checking are disabled.

Definition at line 755 of file SerialPort_t.h.

References mSioImpl.

00756    {
00757       return mSioImpl.getParityGenerationState();
00758    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setParityGeneration bool    flag [inline]
 

Enables or disables parity generation for outgoing bytes and parity checking for incoming bytes.

Precondition:
The serial port is open.
Postcondition:
Parity generation and checking are enabled or disabled.
Parameters:
flag  A value of true anables parity generation. A value of true disables it.
Returns:
A vpr::ReturnStatus object describing the results of the operation.

Definition at line 773 of file SerialPort_t.h.

References mSioImpl.

00774    {
00775       return mSioImpl.setParityGeneration(flag);
00776    }

template<class RealSerialPortImpl>
bool vpr::SerialPort_t< RealSerialPortImpl >::getParityErrorMarkingState   const [inline]
 

Returns the current state of parity error marking for this serial port.

Precondition:
This serial port is open.
Returns:
true is returned if parity error marking is enabled. false is returned if parity error masking is disabled.

Definition at line 786 of file SerialPort_t.h.

References mSioImpl.

00787    {
00788       return mSioImpl.getParityErrorMarkingState();
00789    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setParityErrorMarking bool    flag [inline]
 

Enables or disables marking of bytes with parity errors or framing errors (except BREAKs).

This is only active if input parity and framing error reporting is enabled (see setInputParityCheck() for more information). The mark is the three-byte sequence \377 \0 X where X is the byte received in error. If bit stripping is enabled, a valid \377 byte is passed as the two-byte sequence \377 \377.

Precondition:
This serial port is open.
Postcondition:
Bytes with an error are marked and passed on to the reader.
Parameters:
flag  A value of true enables parity error marking. A value of false disables it.
Returns:
A vpr::ReturnStatus object describing the results of the operation.
See also:
setInputParityCheck

Definition at line 810 of file SerialPort_t.h.

References mSioImpl.

00811    {
00812       return mSioImpl.setParityErrorMarking(flag);
00813    }

template<class RealSerialPortImpl>
vpr::SerialTypes::ParityType vpr::SerialPort_t< RealSerialPortImpl >::getParity   const [inline]
 

Gets the current parity checking type (either odd or even).

Precondition:
The serial port is open.
Postcondition:
The parity type is returned to the caller.
Returns:
A vpr::SerialTypes::ParityType value giving the parity checking being done.

Definition at line 824 of file SerialPort_t.h.

References mSioImpl.

00825    {
00826       return mSioImpl.getParity();
00827    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setParity const vpr::SerialTypes::ParityType   type [inline]
 

Enables even or odd parity.

Precondition:
The serial port is open.
Postcondition:
Odd parity is enabled.
Parameters:
type  The type of parity to use.
Returns:
A vpr::ReturnStatus object describing the results of the operation.

Definition at line 840 of file SerialPort_t.h.

References mSioImpl.

00841    {
00842       return mSioImpl.setParity(type);
00843    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::getInputBaudRate vpr::Uint32   rate const [inline]
 

Gets the current input baud rate.

Precondition:
The serial port is open.
Postcondition:
The current input baud rate is returned to the caller via the by-reference parameter.
Parameters:
rate  A reference to a vpr::Uint32 to be used as storage for the current input baud rate.
Returns:
A vpr::ReturnStatus object describing the results of the operation.

Definition at line 858 of file SerialPort_t.h.

References mSioImpl.

00859    {
00860       return mSioImpl.getInputBaudRate(rate);
00861    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::setInputBaudRate const vpr::Uint32    baud [inline]
 

Sets the current input baud rate.

Precondition:
The serial port is open, and the rate is a valid baud rate.
Postcondition:
The input baud rate is updated to use the given value.
Parameters:
rate  The new input baud rate.
Returns:
A vpr::ReturnStatus object describing the results of the operation.

Definition at line 874 of file SerialPort_t.h.

References mSioImpl.

00875    {
00876       return mSioImpl.setInputBaudRate(baud);
00877    }

template<class RealSerialPortImpl>
vpr::ReturnStatus vpr::SerialPort_t< RealSerialPortImpl >::getOutputBaudRate vpr::Uint32   rate const [inline]
 

Gets the current output baud rate.

Precondition:
The serial port is open.
Postcondition:
The current output baud rate is returned to the caller via the by-reference parameter.
Parameters:
rate  A reference to a vpr::Uint32 to be used as storage for the current out