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

LOW_portSerial Class Reference

Abstract base class for serial ports. More...

#include <LOW_portSerial.h>

Inheritance diagram for LOW_portSerial:

Inheritance graph
[legend]
List of all members.

Public Types

enum  flowControl_t { none_flowControl, xonxoff_flowControl, rtscts_flowControl }
 Serial flow control type. More...

enum  dataBitsSite_t { bit5_size, bit6_size, bit7_size, bit8_size }
 Number of data bits type. More...

enum  parity_t { no_parity, odd_parity, even_parity }
 Parity control type. More...

enum  stopBits_t { bit1_stopBit, bit2_stopBit }
 Number of stop bits type. More...

enum  speed_t {
  B50_speed, B75_speed, B110_speed, B134_speed,
  B150_speed, B200_speed, B300_speed, B600_speed,
  B1200_speed, B1800_speed, B2400_speed, B4800_speed,
  B9600_speed, B19200_speed, B38400_speed, B57600_speed,
  B115200_speed, B10472_speed
}
 Serial speed control type. More...


Public Methods

virtual void tty_configure (const flowControl_t inFlowCtl, const dataBitsSite_t inDataBits, const parity_t inParity, const stopBits_t inStopBits, const speed_t inSpeed) const=0
 Configure the serial port. More...

virtual void tty_flush (const bool inFlushIn=true, const bool inFlushOut=true) const=0
 Flushs serial input and/or output buffers. More...

virtual void tty_break () const=0
 Sends break signal. More...

virtual uint8_t tty_readByte (const bool inTrashExtraReply=false) const=0
 Reads on byte from serial port. More...

virtual void tty_read (byteVec_t &outReadBytes, const bool inTrashExtraReply=false) const=0
 Reads multiple bytes from serial port. More...

virtual void tty_write (const uint8_t inWriteByte) const=0
 Writes one byte to serial port. More...

virtual void tty_write (const byteVec_t &inWriteBytes) const=0
 Writes multiple bytes to serial port. More...


Detailed Description

Abstract base class for serial ports.

Each instance represents one serial port.

Specific platforms dereive their implementation classes from this class.

The instances are created by LOW_portSerialFactory, following the factory design pattern.

Note: There is no prescribed constructor. A class deriving from this one should have a constructor which only requires to specify the port, but no extra setup parameters for it.
This enables parts of your software to specify a serial port by creating an object, but without knowing the specific setup for it. This setup might be known then by other parts, which receive the object as port specification.

See also:
LOW_portSerialFactory
Author:
Harald Roelle, Helmut Reiser

Definition at line 46 of file LOW_portSerial.h.


Member Enumeration Documentation

enum LOW_portSerial::dataBitsSite_t
 

Number of data bits type.

Enumeration values:
bit5_size 
bit6_size 
bit7_size 
bit8_size 

Definition at line 69 of file LOW_portSerial.h.

enum LOW_portSerial::flowControl_t
 

Serial flow control type.

Enumeration values:
none_flowControl 
xonxoff_flowControl 
rtscts_flowControl 

Definition at line 66 of file LOW_portSerial.h.

enum LOW_portSerial::parity_t
 

Parity control type.

Enumeration values:
no_parity 
odd_parity 
even_parity 

Definition at line 72 of file LOW_portSerial.h.

enum LOW_portSerial::speed_t
 

Serial speed control type.

Enumeration values:
B50_speed 
B75_speed 
B110_speed 
B134_speed 
B150_speed 
B200_speed 
B300_speed 
B600_speed 
B1200_speed 
B1800_speed 
B2400_speed 
B4800_speed 
B9600_speed 
B19200_speed 
B38400_speed 
B57600_speed 
B115200_speed 
B10472_speed 

Definition at line 78 of file LOW_portSerial.h.

enum LOW_portSerial::stopBits_t
 

Number of stop bits type.

Enumeration values:
bit1_stopBit 
bit2_stopBit 

Definition at line 75 of file LOW_portSerial.h.


Member Function Documentation

virtual void LOW_portSerial::tty_break   const [pure virtual]
 

Sends break signal.

Abstract method to be implemented by derived class.

Reimplemented in LOW_portSerial_Linux.

Referenced by LOW_linkDS2480B::resetLinkAdapter().

virtual void LOW_portSerial::tty_configure const flowControl_t    inFlowCtl,
const dataBitsSite_t    inDataBits,
const parity_t    inParity,
const stopBits_t    inStopBits,
const speed_t    inSpeed
const [pure virtual]
 

Configure the serial port.

Abstract method to be implemented by derived class.

Parameters:
inFlowCtl  Flow control.
inDataBits  Number of data bits.
inParity  Parity control.
inStopBits  Number of stop bits.
inSpeed  Port speed.

Reimplemented in LOW_portSerial_Linux.

Referenced by LOW_linkPassiveSerial::resetBus(), LOW_linkPassiveSerial::resetLinkAdapter(), and LOW_linkDS2480B::resetLinkAdapter().

virtual void LOW_portSerial::tty_flush const bool    inFlushIn = true,
const bool    inFlushOut = true
const [pure virtual]
 

Flushs serial input and/or output buffers.

Abstract method to be implemented by derived class.

Parameters:
inFlushIn  If set to true input buffer is flushed.
inFlushOut  If set to true output buffer is flushed.

Reimplemented in LOW_portSerial_Linux.

Referenced by LOW_linkDS2480B::reset_cmd(), LOW_linkPassiveSerial::resetBus(), LOW_linkPassiveSerial::resetLinkAdapter(), LOW_linkDS2480B::resetLinkAdapter(), LOW_linkPassiveSerial::touchBit(), LOW_linkDS2480B::~LOW_linkDS2480B(), and LOW_linkPassiveSerial::~LOW_linkPassiveSerial().

virtual void LOW_portSerial::tty_read byteVec_t   outReadBytes,
const bool    inTrashExtraReply = false
const [pure virtual]
 

Reads multiple bytes from serial port.

The desired number of bytes to read is specified by the preset length of the vector parameter.

Abstract method to be implemented by derived class.

Parameters:
outReadBytes  Reference to byte vector, where read bytes are stored in.
inTrashExtraReply  If true one extra byte is read from serial port at the end and trashed.

Reimplemented in LOW_portSerial_Linux.

Referenced by LOW_linkDS2480B::touchBlock().

virtual uint8_t LOW_portSerial::tty_readByte const bool    inTrashExtraReply = false const [pure virtual]
 

Reads on byte from serial port.

Abstract method to be implemented by derived class.

Parameters:
inTrashExtraReply  If true one extra byte is read from serial port and trashed.
Returns:
Byte read from serial port.

Reimplemented in LOW_portSerial_Linux.

Referenced by LOW_linkDS2480B::pulse_cmd(), LOW_linkDS2480B::readConfigValue(), LOW_linkDS2480B::reset_cmd(), LOW_linkPassiveSerial::resetBus(), LOW_linkDS2480B::singleBit_cmd(), LOW_linkPassiveSerial::touchBit(), LOW_linkDS2480B::touchByte(), and LOW_linkDS2480B::writeConfigValue().

virtual void LOW_portSerial::tty_write const byteVec_t   inWriteBytes const [pure virtual]
 

Writes multiple bytes to serial port.

The desired number of bytes to write is specified by the preset length of the vector parameter.

Abstract method to be implemented by derived class.

Parameters:
inWriteBytes  Reference to byte vector which contains bytes to write.

Reimplemented in LOW_portSerial_Linux.

virtual void LOW_portSerial::tty_write const uint8_t    inWriteByte const [pure virtual]
 

Writes one byte to serial port.

Abstract method to be implemented by derived class.

Parameters:
inWriteByte  Byte to write.

Reimplemented in LOW_portSerial_Linux.

Referenced by LOW_linkDS2480B::pulse_cmd(), LOW_linkDS2480B::readConfigValue(), LOW_linkDS2480B::reset_cmd(), LOW_linkPassiveSerial::resetBus(), LOW_linkDS2480B::resetLinkAdapter(), LOW_linkDS2480B::searchAccelCtrl_cmd(), LOW_linkDS2480B::setMode(), LOW_linkDS2480B::singleBit_cmd(), LOW_linkDS2480B::strongPullup(), LOW_linkPassiveSerial::touchBit(), LOW_linkDS2480B::touchBlock(), LOW_linkDS2480B::touchByte(), and LOW_linkDS2480B::writeConfigValue().


The documentation for this class was generated from the following file:
Generated on Sun Jan 12 21:07:58 2003 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001