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

void SerialStream::Open ( const std::string  filename,
std::ios_base::openmode  mode = std::ios_base::in | std::ios_base::out 
)

Open the serial port associated with the specified filename, s and the specified mode, mode.

Definition at line 20 of file SerialStream.cc.

References mIOBuffer, and LibSerial::SerialStreamBuf::open().

{
    //
    // Create a new SerialStreamBuf if one does not exist. 
    //
    if( ! mIOBuffer ) {
        this->rdbuf(mIOBuffer=new SerialStreamBuf) ;
        assert(mIOBuffer!=0) ;
    }
    //
    // Open the serial port. 
    //
    if( 0 == mIOBuffer->open(filename, mode) ) {
        setstate(badbit) ;    
    }
    return ;
}


Generated by  Doxygen 1.6.0   Back to index