Logo Search packages:      
Sourcecode: libserial version File versions  Download package

LibSerial::SerialStream Class Reference

#include <SerialStream.h>

List of all members.

Detailed Description

A stream class for accessing serial ports on POSIX operating systems. A lot of the functionality of this class has been obtained by looking at the code of libserial package by Linas Vepstas (linas@linas.org) and the excellent document on serial programming by Michael R. Sweet. This document can be found at http://www.easysw.com/~mike/serial/serial.html. The libserial package can be found at http://www.linas.org/serial/. This class allows one to set various parameters of a serial port and then access it like a simple fstream. In fact, that is exactly what it does. It sets the parameters of the serial port by maintaining a file descriptor for the port and uses the basic_fstream functions for the IO. We have not implemented any file locking yet but it will be added soon.

Make sure you read the documentation of the standard fstream template before using this class because most of the functionality is inherited from fstream. Also a lot of information about the various system calls used in the implementation can also be found in the Single Unix Specification (Version 2). A copy of this document can be obtained from http://www.UNIX-systems.org/. We will refer to this document as SUS-2.

Manish P. Pagey
$Id: SerialStream.h,v 1.5 2004/05/06 18:32:02 crayzeewulf

Definition at line 51 of file SerialStream.h.

Public Member Functions

Other Public Methods
const SerialStreamBuf::BaudRateEnum BaudRate ()
const SerialStreamBuf::CharSizeEnum CharSize ()
void Close ()
FlowControl ()
const bool IsOpen () const
const short NumOfStopBits ()
void Open (const std::string filename, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out)
const SerialStreamBuf::ParityEnum Parity ()
void SetBaudRate (SerialStreamBuf::BaudRateEnum baud_rate)
void SetCharSize (const SerialStreamBuf::CharSizeEnum size)
void SetFlowControl (const SerialStreamBuf::FlowControlEnum flow_c)
void SetNumOfStopBits (short stop_bits)
void SetParity (const SerialStreamBuf::ParityEnum parity)
const short SetVMin (short vtime)
const short SetVTime (short vtime)
const short VMin ()
const short VTime ()
Constructors and Destructor
 SerialStream ()
 SerialStream (const std::string filename, std::ios_base::openmode mode=std::ios::in|std::ios::out)
virtual ~SerialStream ()

Private Attributes


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

Generated by  Doxygen 1.6.0   Back to index