Interface to a serial port. More...
#include <Devices/Serial.H>
Public Member Functions | |
Serial (OptionManager &mgr, const std::string &descrName="Serial Port", const std::string &tagName="SerialPort") | |
Constructor. | |
~Serial (void) | |
destructor | |
void | closePort () |
Close the serial port device file. | |
void | enablePort (std::string DeviceName) |
Enable the serial port. | |
void | configure (const char *dev="", const int speed=9600, const char *format="8N1", const bool flowSoft=false, const bool flowHard=false, const int=0) |
Configure the port before it is started. | |
void | configureSearch (const std::string DeviceDescription, const int speed=115200, const std::string SearchPrefix="ttyUSB", const char *format="8N1", const bool flowSoft=false, const bool flowHard=false, const int=0) |
Configure the serial port to search for a device. | |
serialError | setSpeed (const int speed) |
Set serial port speed for both input and output. | |
serialError | setFlowControl (const bool useHard, const bool useSoft) |
Set the serial port flow control on Input as well as Ouput. | |
serialError | setCharBits (const int bits) |
Set character size. | |
serialError | setParity (const bool useParity, const bool oddParity) |
Set parity mode. | |
serialError | setStopBits (const int bits) |
Set number of stop bits. | |
serialError | setBlocking (const bool blocking) |
Set the access to blocking or not. | |
void | toggleDTR (const time_t millisec) |
Set the DTR mode off momentarily. | |
void | sendBreak (void) |
transmit continuous stream of zero-valued bits for specific duration. | |
int | read (void *buffer, const int nbytes) |
attempt to read up to nbytes from serial port into the buffer | |
std::vector< unsigned char > | readFrame (const unsigned char frameStart, const unsigned char frameEnd=255, const int frameLength=-1, const double timeout=-1) |
Attempt to read a serial frame. | |
char | read (void) |
attempts to get the next character from the serial port | |
int | write (const void *buffer, const int nbytes) |
write bytes to the port | |
int | write (const unsigned char character) |
write a single byte to the port - a simple wrapper around write(const void* buffer, const int nbytes) | |
void | perror (void) |
print a verbal message indicating the last error. | |
void | flush (void) |
std::string | getDeviceDescriptor () |
std::string | getDevName () |
bool | isSerialOk () |
int | getSerialErrno () |
Serial () | |
Constructor. | |
~Serial (void) | |
destructor | |
void | closePort () |
Close the serial port device file. | |
void | enablePort (std::string DeviceName) |
Enable the serial port. | |
void | configure (const char *dev="", const int speed=9600, const char *format="8N1", const bool flowSoft=false, const bool flowHard=false, const int=0) |
Configure the port before it is started. | |
void | configureSearch (const std::string DeviceDescription, const int speed=115200, const std::string SearchPrefix="ttyUSB", const char *format="8N1", const bool flowSoft=false, const bool flowHard=false, const int=0) |
Configure the serial port to search for a device. | |
serialError | setSpeed (const int speed) |
Set serial port speed for both input and output. | |
serialError | setFlowControl (const bool useHard, const bool useSoft) |
Set the serial port flow control on Input as well as Ouput. | |
serialError | setCharBits (const int bits) |
Set character size. | |
serialError | setParity (const bool useParity, const bool oddParity) |
Set parity mode. | |
serialError | setStopBits (const int bits) |
Set number of stop bits. | |
serialError | setBlocking (const bool blocking) |
Set the access to blocking or not. | |
void | toggleDTR (const time_t millisec) |
Set the DTR mode off momentarily. | |
void | sendBreak (void) |
transmit continuous stream of zero-valued bits for specific duration. | |
int | read (void *buffer, const int nbytes) |
attempt to read up to nbytes from serial port into the buffer | |
std::vector< unsigned char > | readFrame (const unsigned char frameStart, const unsigned char frameEnd=255, const int frameLength=-1, const double timeout=-1) |
Attempt to read a serial frame. | |
char | read (void) |
attempts to get the next character from the serial port | |
int | write (const void *buffer, const int nbytes) |
write bytes to the port | |
int | write (const unsigned char character) |
write a single byte to the port - a simple wrapper around write(const void* buffer, const int nbytes) | |
void | perror (void) |
print a verbal message indicating the last error. | |
void | flush (void) |
std::string | getDeviceDescriptor () |
std::string | getDevName () |
bool | isSerialOk () |
int | getSerialErrno () |
void | start () |
open the port and get started | |
void | stop () |
close the port and get stopped | |
Serial () | |
Constructor. | |
~Serial (void) | |
destructor | |
void | closePort () |
Close the serial port device file. | |
void | enablePort (std::string DeviceName) |
Enable the serial port. | |
void | configure (const char *dev="", const int speed=9600, const char *format="8N1", const bool flowSoft=false, const bool flowHard=false, const int=0) |
Configure the port before it is started. | |
void | configureSearch (const std::string DeviceDescription, const int speed=115200, const std::string SearchPrefix="ttyUSB", const char *format="8N1", const bool flowSoft=false, const bool flowHard=false, const int=0) |
Configure the serial port to search for a device. | |
serialError | setSpeed (const int speed) |
Set serial port speed for both input and output. | |
serialError | setFlowControl (const bool useHard, const bool useSoft) |
Set the serial port flow control on Input as well as Ouput. | |
serialError | setCharBits (const int bits) |
Set character size. | |
serialError | setParity (const bool useParity, const bool oddParity) |
Set parity mode. | |
serialError | setStopBits (const int bits) |
Set number of stop bits. | |
serialError | setBlocking (const bool blocking) |
Set the access to blocking or not. | |
void | toggleDTR (const time_t millisec) |
Set the DTR mode off momentarily. | |
void | sendBreak (void) |
transmit continuous stream of zero-valued bits for specific duration. | |
int | read (void *buffer, const int nbytes) |
attempt to read up to nbytes from serial port into the buffer | |
std::vector< unsigned char > | readFrame (const unsigned char frameStart, const unsigned char frameEnd=255, const int frameLength=-1, const double timeout=-1) |
Attempt to read a serial frame. | |
char | read (void) |
attempts to get the next character from the serial port | |
int | write (const void *buffer, const int nbytes) |
write bytes to the port | |
int | write (const unsigned char character) |
write a single byte to the port - a simple wrapper around write(const void* buffer, const int nbytes) | |
void | perror (void) |
print a verbal message indicating the last error. | |
void | flush (void) |
std::string | getDeviceDescriptor () |
std::string | getDevName () |
bool | isSerialOk () |
int | getSerialErrno () |
void | start () |
open the port and get started | |
void | stop () |
close the port and get stopped | |
Protected Member Functions | |
void | start2 () |
open the port and get started | |
void | stop2 () |
close the port and get stopped | |
Protected Attributes | |
OModelParam< std::string > | itsCmdDevName |
device name passed from cmd line | |
NModelParam< std::string > | itsDeviceDescription |
device description to seach for | |
NModelParam< std::string > | itsSearchPrefix |
device name prefix (e.g. ttyUSB) | |
NModelParam< int > | itsBaud |
Baudrate. | |
NModelParam< int > | itsCharBits |
number of useful bits per char | |
NModelParam< int > | itsStopBits |
number of stop bits | |
NModelParam< bool > | itsUseParity |
use parity if true | |
NModelParam< bool > | itsParityOdd |
parity is odd if true, otherwise even | |
NModelParam< bool > | itsFlowHard |
use hardware flow control if true | |
NModelParam< bool > | itsFlowSoft |
use software flow control if true | |
NModelParam< int > | itsRdTout |
read timeout in 1/10000s | |
NModelParam< bool > | itsBlocking |
use blocking mode | |
NModelParam< bool > | itsSerialOk |
Port opened success if true. | |
std::string | itsCmdDevName |
device name passed from cmd line | |
std::string | itsDeviceDescription |
device description to seach for | |
std::string | itsSearchPrefix |
device name prefix (e.g. ttyUSB) | |
int | itsBaud |
Baudrate. | |
int | itsCharBits |
number of useful bits per char | |
int | itsStopBits |
number of stop bits | |
bool | itsUseParity |
use parity if true | |
bool | itsParityOdd |
parity is odd if true, otherwise even | |
bool | itsFlowHard |
use hardware flow control if true | |
bool | itsFlowSoft |
use software flow control if true | |
int | itsRdTout |
read timeout in 1/10000s | |
bool | itsBlocking |
use blocking mode | |
bool | itsSerialOk |
Port opened success if true. |
Interface to a serial port.
The port will be open at start() time; see ModelComponent.H for details. Because typically one may use several serial ports with different configs, this ModelComponent does not export any command-line option (there would be too many otherwise if many ports are used). Typically, thus, the port can be configured either via config files or using the various access functions provided in this class.
Definition at line 86 of file Serial.H.
Serial::Serial | ( | OptionManager & | mgr, | |
const std::string & | descrName = "Serial Port" , |
|||
const std::string & | tagName = "SerialPort" | |||
) |
Serial::~Serial | ( | void | ) |
destructor
Serial::Serial | ( | ) |
Constructor.
Serial::~Serial | ( | void | ) |
destructor
void Serial::closePort | ( | ) |
Close the serial port device file.
void Serial::closePort | ( | ) |
Close the serial port device file.
void Serial::closePort | ( | ) |
Close the serial port device file.
Definition at line 179 of file Serial.C.
Referenced by enablePort(), stop(), and stop2().
void Serial::configure | ( | const char * | dev = "" , |
|
const int | speed = 9600 , |
|||
const char * | format = "8N1" , |
|||
const bool | flowSoft = false , |
|||
const bool | flowHard = false , |
|||
const | int = 0 | |||
) |
Configure the port before it is started.
This will update our internal ModelParam values to the specified ones; thus this should be called before start(). In contrast, the setXXX functions below are for reconfiguration at runtime, once the port is already open and running. This function is provided as a shortcut to set a bunch of ModelParam values in one simple call.
dev | device name (e.g., "/dev/ttyS0") | |
speed | speed in bauds. See setSpeed() for valid values | |
format | a 3-char string for charbits, parity, and stop bits; for example "8N1"; parity should be "N", "E" or "O". | |
flowSoft | use software flow control if true | |
flowHard | use hardware flow control if true | |
tout | read timeout in 1/10000s or 0 for no timeout |
void Serial::configure | ( | const char * | dev = "" , |
|
const int | speed = 9600 , |
|||
const char * | format = "8N1" , |
|||
const bool | flowSoft = false , |
|||
const bool | flowHard = false , |
|||
const | int = 0 | |||
) |
Configure the port before it is started.
This will update our internal ModelParam values to the specified ones; thus this should be called before start(). In contrast, the setXXX functions below are for reconfiguration at runtime, once the port is already open and running. This function is provided as a shortcut to set a bunch of ModelParam values in one simple call.
dev | device name (e.g., "/dev/ttyS0") | |
speed | speed in bauds. See setSpeed() for valid values | |
format | a 3-char string for charbits, parity, and stop bits; for example "8N1"; parity should be "N", "E" or "O". | |
flowSoft | use software flow control if true | |
flowHard | use hardware flow control if true | |
tout | read timeout in 1/10000s or 0 for no timeout |
void Serial::configure | ( | const char * | dev = "" , |
|
const int | speed = 9600 , |
|||
const char * | format = "8N1" , |
|||
const bool | flowSoft = false , |
|||
const bool | flowHard = false , |
|||
const int | tout = 0 | |||
) |
Configure the port before it is started.
This will update our internal ModelParam values to the specified ones; thus this should be called before start(). In contrast, the setXXX functions below are for reconfiguration at runtime, once the port is already open and running. This function is provided as a shortcut to set a bunch of ModelParam values in one simple call.
dev | device name (e.g., "/dev/ttyS0") | |
speed | speed in bauds. See setSpeed() for valid values | |
format | a 3-char string for charbits, parity, and stop bits; for example "8N1"; parity should be "N", "E" or "O". | |
flowSoft | use software flow control if true | |
flowHard | use hardware flow control if true | |
tout | read timeout in 1/10000s or 0 for no timeout |
Definition at line 203 of file Serial.C.
References itsBaud, itsCharBits, itsFlowHard, itsFlowSoft, itsParityOdd, itsRdTout, itsStopBits, itsUseParity, and NModelParam< T >::setVal().
Referenced by configureSearch().
void Serial::configureSearch | ( | const std::string | DeviceDescription, | |
const int | speed = 115200 , |
|||
const std::string | SearchPrefix = "ttyUSB" , |
|||
const char * | format = "8N1" , |
|||
const bool | flowSoft = false , |
|||
const bool | flowHard = false , |
|||
const | int = 0 | |||
) |
Configure the serial port to search for a device.
void Serial::configureSearch | ( | const std::string | DeviceDescription, | |
const int | speed = 115200 , |
|||
const std::string | SearchPrefix = "ttyUSB" , |
|||
const char * | format = "8N1" , |
|||
const bool | flowSoft = false , |
|||
const bool | flowHard = false , |
|||
const | int = 0 | |||
) |
Configure the serial port to search for a device.
void Serial::configureSearch | ( | const std::string | DeviceDescription, | |
const int | speed = 115200 , |
|||
const std::string | SearchPrefix = "ttyUSB" , |
|||
const char * | format = "8N1" , |
|||
const bool | flowSoft = false , |
|||
const bool | flowHard = false , |
|||
const int | tout = 0 | |||
) |
Configure the serial port to search for a device.
Definition at line 188 of file Serial.C.
References configure(), itsDeviceDescription, itsSearchPrefix, and NModelParam< T >::setVal().
void Serial::enablePort | ( | std::string | DeviceName | ) |
Enable the serial port.
enablePort will do all of the work of actually setting the config properties that have been requested, as well as opening the device file, etc...
void Serial::enablePort | ( | std::string | DeviceName | ) |
Enable the serial port.
enablePort will do all of the work of actually setting the config properties that have been requested, as well as opening the device file, etc...
void Serial::enablePort | ( | std::string | DeviceName | ) |
Enable the serial port.
enablePort will do all of the work of actually setting the config properties that have been requested, as well as opening the device file, etc...
Definition at line 144 of file Serial.C.
References closePort(), NModelParam< T >::getVal(), itsBaud, itsBlocking, itsCharBits, itsFlowHard, itsFlowSoft, itsParityOdd, itsUseParity, perror(), setBlocking(), setCharBits(), setFlowControl(), setParity(), and setSpeed().
void Serial::perror | ( | void | ) |
print a verbal message indicating the last error.
void Serial::perror | ( | void | ) |
print a verbal message indicating the last error.
void Serial::perror | ( | void | ) |
print a verbal message indicating the last error.
Definition at line 727 of file Serial.C.
Referenced by enablePort().
char Serial::read | ( | void | ) |
attempts to get the next character from the serial port
for comptability with dirk's code
int Serial::read | ( | void * | buffer, | |
const int | nbytes | |||
) |
attempt to read up to nbytes from serial port into the buffer
buffer | holds bytes after read number of bytes to attempt to read |
char Serial::read | ( | void | ) |
attempts to get the next character from the serial port
for comptability with dirk's code
int Serial::read | ( | void * | buffer, | |
const int | nbytes | |||
) |
attempt to read up to nbytes from serial port into the buffer
buffer | holds bytes after read number of bytes to attempt to read |
char Serial::read | ( | void | ) |
attempts to get the next character from the serial port
for comptability with dirk's code
Definition at line 579 of file Serial.C.
Referenced by read(), and readFrame().
int Serial::read | ( | void * | buffer, | |
const int | nbytes | |||
) |
std::vector<unsigned char> Serial::readFrame | ( | const unsigned char | frameStart, | |
const unsigned char | frameEnd = 255 , |
|||
const int | frameLength = -1 , |
|||
const double | timeout = -1 | |||
) |
Attempt to read a serial frame.
The frame returned by the device should have the following format: [start byte] [optional number of data bytes] [data...] ... [...data] [end byte]
frameStart | holds the byte signifying the start of the frame | |
frameEnd | holds the byte signifying the end of the frame | |
frameLength | optionally specifies the number of bytes in the frame. If this is -1, then the second byte of the frame is assumed to contain the total number of bytes in the frame. | |
timeout | the number of seconds to wait before giving up (default of -1 is no timeout) |
std::vector<unsigned char> Serial::readFrame | ( | const unsigned char | frameStart, | |
const unsigned char | frameEnd = 255 , |
|||
const int | frameLength = -1 , |
|||
const double | timeout = -1 | |||
) |
Attempt to read a serial frame.
The frame returned by the device should have the following format: [start byte] [optional number of data bytes] [data...] ... [...data] [end byte]
frameStart | holds the byte signifying the start of the frame | |
frameEnd | holds the byte signifying the end of the frame | |
frameLength | optionally specifies the number of bytes in the frame. If this is -1, then the second byte of the frame is assumed to contain the total number of bytes in the frame. | |
timeout | the number of seconds to wait before giving up (default of -1 is no timeout) |
std::vector< unsigned char > Serial::readFrame | ( | const unsigned char | frameStart, | |
const unsigned char | frameEnd = 255 , |
|||
const int | frameLength = -1 , |
|||
const double | timeout = -1 | |||
) |
Attempt to read a serial frame.
The frame returned by the device should have the following format: [start byte] [optional number of data bytes] [data...] ... [...data] [end byte]
frameStart | holds the byte signifying the start of the frame | |
frameEnd | holds the byte signifying the end of the frame | |
frameLength | optionally specifies the number of bytes in the frame. If this is -1, then the second byte of the frame is assumed to contain the total number of bytes in the frame. | |
timeout | the number of seconds to wait before giving up (default of -1 is no timeout) |
Definition at line 588 of file Serial.C.
References Timer::getSecs(), read(), and Timer::reset().
void Serial::sendBreak | ( | void | ) |
transmit continuous stream of zero-valued bits for specific duration.
void Serial::sendBreak | ( | void | ) |
transmit continuous stream of zero-valued bits for specific duration.
void Serial::sendBreak | ( | void | ) |
serialError Serial::setBlocking | ( | const bool | blocking | ) |
Set the access to blocking or not.
If blocking, a write will block until all data has actually been sent through; otherwise it will return immediately while the data is being transmitted.
serialError Serial::setBlocking | ( | const bool | blocking | ) |
Set the access to blocking or not.
If blocking, a write will block until all data has actually been sent through; otherwise it will return immediately while the data is being transmitted.
serialError Serial::setBlocking | ( | const bool | blocking | ) |
Set the access to blocking or not.
If blocking, a write will block until all data has actually been sent through; otherwise it will return immediately while the data is being transmitted.
Definition at line 435 of file Serial.C.
References itsBlocking, and NModelParam< T >::setVal().
Referenced by enablePort().
serialError Serial::setCharBits | ( | const int | bits | ) |
Set character size.
This function is to change the char size while already started.
bits | character size to use; valid values are 5, 6, 7, 8. |
serialError Serial::setCharBits | ( | const int | bits | ) |
Set character size.
This function is to change the char size while already started.
bits | character size to use; valid values are 5, 6, 7, 8. |
serialError Serial::setCharBits | ( | const int | bits | ) |
Set character size.
This function is to change the char size while already started.
bits | character size to use; valid values are 5, 6, 7, 8. |
Definition at line 347 of file Serial.C.
References itsCharBits, and NModelParam< T >::setVal().
Referenced by enablePort().
serialError Serial::setFlowControl | ( | const bool | useHard, | |
const bool | useSoft | |||
) |
Set the serial port flow control on Input as well as Ouput.
This function is to change the flow control while already started.
useHard | use hardware flow control if true | |
useSoft | use software flow control if true |
serialError Serial::setFlowControl | ( | const bool | useHard, | |
const bool | useSoft | |||
) |
Set the serial port flow control on Input as well as Ouput.
This function is to change the flow control while already started.
useHard | use hardware flow control if true | |
useSoft | use software flow control if true |
serialError Serial::setFlowControl | ( | const bool | useHard, | |
const bool | useSoft | |||
) |
Set the serial port flow control on Input as well as Ouput.
This function is to change the flow control while already started.
useHard | use hardware flow control if true | |
useSoft | use software flow control if true |
Definition at line 319 of file Serial.C.
References itsFlowHard, itsFlowSoft, and NModelParam< T >::setVal().
Referenced by enablePort().
serialError Serial::setParity | ( | const bool | useParity, | |
const bool | oddParity | |||
) |
Set parity mode.
This function is to change the parity while already started.
useParity | use some parity if true | |
oddParity | parity is odd if true, otherwise even |
serialError Serial::setParity | ( | const bool | useParity, | |
const bool | oddParity | |||
) |
Set parity mode.
This function is to change the parity while already started.
useParity | use some parity if true | |
oddParity | parity is odd if true, otherwise even |
serialError Serial::setParity | ( | const bool | useParity, | |
const bool | oddParity | |||
) |
Set parity mode.
This function is to change the parity while already started.
useParity | use some parity if true | |
oddParity | parity is odd if true, otherwise even |
Definition at line 379 of file Serial.C.
References itsParityOdd, itsUseParity, and NModelParam< T >::setVal().
Referenced by enablePort().
serialError Serial::setSpeed | ( | const int | speed | ) |
Set serial port speed for both input and output.
This function is to change the speed while already started.
speed | to select. 0 signifies modem "hang up" and possible values are 0, 110, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200. |
serialError Serial::setSpeed | ( | const int | speed | ) |
Set serial port speed for both input and output.
This function is to change the speed while already started.
speed | to select. 0 signifies modem "hang up" and possible values are 0, 110, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200. |
serialError Serial::setSpeed | ( | const int | speed | ) |
Set serial port speed for both input and output.
This function is to change the speed while already started.
speed | to select. 0 signifies modem "hang up" and possible values are 0, 110, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200. |
Definition at line 240 of file Serial.C.
References itsBaud, and NModelParam< T >::setVal().
Referenced by enablePort().
serialError Serial::setStopBits | ( | const int | bits | ) |
Set number of stop bits.
This function is to change the stop bits while started.
bits | stop bits (only values 1 and 2 are valid). |
serialError Serial::setStopBits | ( | const int | bits | ) |
Set number of stop bits.
This function is to change the stop bits while started.
bits | stop bits (only values 1 and 2 are valid). |
serialError Serial::setStopBits | ( | const int | bits | ) |
Set number of stop bits.
This function is to change the stop bits while started.
bits | stop bits (only values 1 and 2 are valid). |
Definition at line 410 of file Serial.C.
References itsStopBits, and NModelParam< T >::setVal().
void Serial::start | ( | ) |
open the port and get started
Reimplemented from ModelComponent.
void Serial::start | ( | ) |
open the port and get started
Reimplemented from ModelComponent.
Definition at line 77 of file Serial.C.
References enablePort(), itsCmdDevName, itsDeviceDescription, itsSearchPrefix, readFrame(), and write().
void Serial::start2 | ( | ) | [protected, virtual] |
open the port and get started
Reimplemented from ModelComponent.
Definition at line 83 of file Serial.C.
References enablePort(), OModelParam< T >::getVal(), NModelParam< T >::getVal(), itsCmdDevName, itsDeviceDescription, itsSearchPrefix, readFrame(), OModelParam< T >::setVal(), and write().
void Serial::stop | ( | ) |
close the port and get stopped
Reimplemented from ModelComponent.
void Serial::stop | ( | ) |
close the port and get stopped
Reimplemented from ModelComponent.
Definition at line 167 of file Serial.C.
References closePort().
void Serial::stop2 | ( | ) | [protected, virtual] |
close the port and get stopped
Reimplemented from ModelComponent.
Definition at line 173 of file Serial.C.
References closePort().
void Serial::toggleDTR | ( | const time_t | millisec | ) |
Set the DTR mode off momentarily.
millisec | number of milliseconds. |
void Serial::toggleDTR | ( | const time_t | millisec | ) |
Set the DTR mode off momentarily.
millisec | number of milliseconds. |
void Serial::toggleDTR | ( | const time_t | millisec | ) |
int Serial::write | ( | const unsigned char | character | ) |
write a single byte to the port - a simple wrapper around write(const void* buffer, const int nbytes)
character | the single byte to write |
int Serial::write | ( | const void * | buffer, | |
const int | nbytes | |||
) |
write bytes to the port
buffer | begin writing from the location buffer. | |
nbytes | number of bytes to write |
int Serial::write | ( | const unsigned char | character | ) |
write a single byte to the port - a simple wrapper around write(const void* buffer, const int nbytes)
character | the single byte to write |
int Serial::write | ( | const void * | buffer, | |
const int | nbytes | |||
) |
write bytes to the port
buffer | begin writing from the location buffer. | |
nbytes | number of bytes to write |
int Serial::write | ( | const unsigned char | character | ) |
write a single byte to the port - a simple wrapper around write(const void* buffer, const int nbytes)
character | the single byte to write |
Definition at line 710 of file Serial.C.
References write().
int Serial::write | ( | const void * | buffer, | |
const int | nbytes | |||
) |
int Serial::itsBaud [protected] |
int Serial::itsBaud [protected] |
Baudrate.
Definition at line 235 of file Serial.H.
Referenced by configure(), enablePort(), and setSpeed().
bool Serial::itsBlocking [protected] |
bool Serial::itsBlocking [protected] |
use blocking mode
Definition at line 243 of file Serial.H.
Referenced by enablePort(), and setBlocking().
int Serial::itsCharBits [protected] |
int Serial::itsCharBits [protected] |
number of useful bits per char
Definition at line 236 of file Serial.H.
Referenced by configure(), enablePort(), and setCharBits().
std::string Serial::itsCmdDevName [protected] |
std::string Serial::itsCmdDevName [protected] |
std::string Serial::itsDeviceDescription [protected] |
std::string Serial::itsDeviceDescription [protected] |
device description to seach for
Definition at line 233 of file Serial.H.
Referenced by configureSearch(), start(), and start2().
bool Serial::itsFlowHard [protected] |
bool Serial::itsFlowHard [protected] |
use hardware flow control if true
Definition at line 240 of file Serial.H.
Referenced by configure(), enablePort(), and setFlowControl().
bool Serial::itsFlowSoft [protected] |
bool Serial::itsFlowSoft [protected] |
use software flow control if true
Definition at line 241 of file Serial.H.
Referenced by configure(), enablePort(), and setFlowControl().
bool Serial::itsParityOdd [protected] |
bool Serial::itsParityOdd [protected] |
parity is odd if true, otherwise even
Definition at line 239 of file Serial.H.
Referenced by configure(), enablePort(), and setParity().
int Serial::itsRdTout [protected] |
int Serial::itsRdTout [protected] |
std::string Serial::itsSearchPrefix [protected] |
std::string Serial::itsSearchPrefix [protected] |
device name prefix (e.g. ttyUSB)
Definition at line 234 of file Serial.H.
Referenced by configureSearch(), start(), and start2().
bool Serial::itsSerialOk [protected] |
bool Serial::itsSerialOk [protected] |
int Serial::itsStopBits [protected] |
int Serial::itsStopBits [protected] |
number of stop bits
Definition at line 237 of file Serial.H.
Referenced by configure(), and setStopBits().
bool Serial::itsUseParity [protected] |
bool Serial::itsUseParity [protected] |
use parity if true
Definition at line 238 of file Serial.H.
Referenced by configure(), enablePort(), and setParity().