Public Member Functions | Protected Attributes | Private Member Functions
Dashel::SerialStream Class Reference

Stream for serial port, in addition to FileDescriptorStream, save old state of serial port. More...

Inheritance diagram for Dashel::SerialStream:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void flush ()
 Flushes stream.
 SerialStream (const string &targetName)
 Parse the target name and create the corresponding serial stream.
 SerialStream (const std::string &params)
 Create the stream and associates a file descriptor.
virtual ~SerialStream ()
 Destructor, restore old serial port state.

Protected Attributes

struct termios oldtio
 old serial port state

Private Member Functions

bool buildDCB (HANDLE sp, int speed, int bits, const std::string &parity, const std::string &stopbits, const std::string &fc)
 Set up a DCB for the given port parameters.

Detailed Description

Stream for serial port, in addition to FileDescriptorStream, save old state of serial port.

Serial port stream.

Definition at line 846 of file dashel-posix.cpp.


Constructor & Destructor Documentation

Dashel::SerialStream::SerialStream ( const string &  targetName) [inline]

Parse the target name and create the corresponding serial stream.

Definition at line 853 of file dashel-posix.cpp.

virtual Dashel::SerialStream::~SerialStream ( ) [inline, virtual]

Destructor, restore old serial port state.

Definition at line 995 of file dashel-posix.cpp.

Dashel::SerialStream::SerialStream ( const std::string &  params) [inline]

Create the stream and associates a file descriptor.

Parameters:
paramsParameter string.

Definition at line 866 of file dashel-win32.cpp.


Member Function Documentation

bool Dashel::SerialStream::buildDCB ( HANDLE  sp,
int  speed,
int  bits,
const std::string &  parity,
const std::string &  stopbits,
const std::string &  fc 
) [inline, private]

Set up a DCB for the given port parameters.

Parameters:
spFile handle to the serial port.
speedBits per second.
bitsNumber of bits.
parityParity type.
stopbitsNumber of stop bits.

Definition at line 794 of file dashel-win32.cpp.

virtual void Dashel::SerialStream::flush ( ) [inline, virtual]

Flushes stream.

Calling this function requests the stream to be flushed, this may ensure that data is written to physical media or actually sent over a wire. The exact performed function depends on the stream type and operating system.

Reimplemented from Dashel::FileDescriptorStream.

Definition at line 1000 of file dashel-posix.cpp.


Member Data Documentation

struct termios Dashel::SerialStream::oldtio [protected]

old serial port state

Definition at line 849 of file dashel-posix.cpp.


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


dashel
Author(s): Stéphane Magnenat
autogenerated on Sun Oct 5 2014 23:46:32