LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::serial::parameters Class Reference

the parameters for the class serial More...

#include <ltiSerial.h>

Inheritance diagram for lti::serial::parameters:
Inheritance graph
[legend]
Collaboration diagram for lti::serial::parameters:
Collaboration graph
[legend]

List of all members.

Public Types

enum  ePortType {
  Com1 = 0, Com2, Com3, Com4,
  Com5, Com6, Com7, Com8,
  USB0, USB1
}
enum  eBaudRateType {
  Baud0, Baud300, Baud600, Baud1200,
  Baud1800, Baud2400, Baud4800, Baud9600,
  Baud19200, Baud38400, Baud57600, Baud76800,
  Baud115200
}
enum  eCharBitSizeType {
  Cs4 = 4, Cs5, Cs6, Cs7,
  Cs8
}
enum  eStopBitType { One, OneFive, Two }
enum  eParityType {
  No, Even, Odd, Space,
  Mark
}

Public Member Functions

 parameters ()
 parameters (const parameters &other)
virtual ~parameters ()
const char * getTypeName () const
parameterscopy (const parameters &other)
parametersoperator= (const parameters &other)
virtual parametersclone () const
virtual bool write (ioHandler &handler, const bool &complete=true) const
virtual bool read (ioHandler &handler, const bool &complete=true)

Public Attributes

eBaudRateType baudRate
ePortType port
eCharBitSizeType characterSize
eParityType parity
eStopBitType stopBits
int receiveTimeout

Detailed Description

the parameters for the class serial


Member Enumeration Documentation

Type to specify the baud rate.

Baud rate is a measure of the number of times per second a signal in a communications channel varies, or makes a transition between states (states being frequencies, voltage levels, or phase angles). One baud is one such change. Thus, a 1200-baud modem's signal changes state 1200 times each second. The number of bits transmitted in a second (baudrate in bits-per-second (bps) ) depends on the modulation technique being used. A 2400 baud modem can transmit 9400 bps if there are 4 bits/baud.

Enumerator:
Baud0 

0 baud

Baud300 

300 baud

Baud600 

600 baud

Baud1200 

1200 baud

Baud1800 

1800 baud

Baud2400 

2400 baud

Baud4800 

4800 baud

Baud9600 

9600 baud

Baud19200 

19200 baud

Baud38400 

38400 baud

Baud57600 

57600 baud

Baud76800 

76800 baud

Baud115200 

115200 baud

Type to specify the number of bits of a character.

The first element Cs4 means for example 4 bits/character.

Enumerator:
Cs4 

4 bits per character

Cs5 

5 bits per character

Cs6 

6 bits per character

Cs7 

7 bits per character

Cs8 

8 bits per character

definition of the parity bit the optional parity bit is a simple checksum of the data bits indicating whether or not the data contains an even or odd number of "1" bits.

Enumerator:
No 

no parity

Even 

even parity

Odd 

odd parity

Space 

space

Mark 

mark

Type to specificy the port to be used.

Enumerator:
Com1 

first port usually called COM1 in Windows or /dev/ttyS0 in Linux

Com2 

first port usually called COM2 in Windows or /dev/ttyS1 in Linux

Com3 

first port usually called COM3 in Windows or /dev/ttyS2 in Linux

Com4 

first port usually called COM4 in Windows or /dev/ttyS3 in Linux

Com5 

first port usually called COM5 in Windows or /dev/ttyS4 in Linux

Com6 

first port usually called COM6 in Windows or /dev/ttyS5 in Linux

Com7 

first port usually called COM7 in Windows or /dev/ttyS6 in Linux

Com8 

first port usually called COM8 in Windows or /dev/ttyS7 in Linux

USB0 

first USB port

USB1 

second USB port

definiton of the stop bit This is also called the remaining bits.

Stop bits serve to synchronise the receiving computer to the incoming characters.

Enumerator:
One 

one stop bit

OneFive 

one and a half stop bits

Two 

two stop bits


Constructor & Destructor Documentation

lti::serial::parameters::parameters (  ) 

default constructor

lti::serial::parameters::parameters ( const parameters other  ) 

copy constructor

Parameters:
other the parameters object to be copied
virtual lti::serial::parameters::~parameters (  )  [virtual]

destructor


Member Function Documentation

virtual parameters* lti::serial::parameters::clone (  )  const [virtual]

returns a pointer to a clone of the parameters

parameters& lti::serial::parameters::copy ( const parameters other  ) 

copy the contents of a parameters object

Parameters:
other the parameters object to be copied
Returns:
a reference to this parameters object

Reimplemented from lti::ioObject.

const char* lti::serial::parameters::getTypeName (  )  const [virtual]

returns name of this type

Reimplemented from lti::ioObject.

parameters& lti::serial::parameters::operator= ( const parameters other  ) 

copy the contents of a parameters object

Parameters:
other the parameters object to be copied
Returns:
a reference to this parameters object

Reimplemented from lti::ioObject.

virtual bool lti::serial::parameters::read ( ioHandler handler,
const bool &  complete = true 
) [virtual]

write the parameters in the given ioHandler

Parameters:
handler the ioHandler to be used
complete if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written.
Returns:
true if write was successful
virtual bool lti::serial::parameters::write ( ioHandler handler,
const bool &  complete = true 
) const [virtual]

write the parameters in the given ioHandler

Parameters:
handler the ioHandler to be used
complete if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written.
Returns:
true if write was successful

Member Data Documentation

Baud rate.

Default value: Baud9600

Character size.

Default value: Cs8

Parity.

Default value: No

Which serial port.

Default value: Com1

Receive timeout in milliseconds.

If you specify zero, then no timeout will exist. The receive method will check if there is something in the buffer. If so, then it will normally return (reading the first character in the serial FIFO). If there is nothing in the buffer, the receive() method will return inmediatly a "false" value.

You should consider that for Linux systems the expected timeout precision is in deciseconds. The given value will be rounded to the best decisecond precision. For example 1 ms will be rounded to 0 ms, 80ms will be rounded to 0.1s.

Windows OS accepts the ms value.

Default value: 5000 (i.e. 5 seconds)

Stop bits Default: One.


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

Generated on Sat Apr 10 15:28:53 2010 for LTI-Lib by Doxygen 1.6.1