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

void SerialPort::Open ( const BaudRate  baudRate = BAUD_DEFAULT,
const CharacterSize  charSize = CHAR_SIZE_DEFAULT,
const Parity  parityType = PARITY_DEFAULT,
const StopBits  stopBits = STOP_BITS_DEFAULT,
const FlowControl  flowControl = FLOW_CONTROL_DEFAULT 
) throw ( AlreadyOpen, OpenFailed, UnsupportedBaudRate, std::invalid_argument )

Open the serial port with the specified settings. A serial port cannot be used till it is open.

Exceptions:
AlreadyOpen This exception is thrown if the serial port is already open.
OpenFailed This exception is thrown if the serial port could not be opened.
std::invalid_argument This exception is thrown if an invalid parameter value is specified.

Definition at line 262 of file SerialPort.cpp.

{
    //
    // Open the serial port.
    mSerialPortImpl->Open() ;
    //
    // Set the various parameters of the serial port if it is open.
    //
    this->SetBaudRate(baudRate) ;
    this->SetCharSize(charSize) ;
    this->SetParity(parityType) ;
    this->SetNumOfStopBits(stopBits) ;
    this->SetFlowControl(flowControl) ;
    //
    // All done.
    //
    return ;
}


Generated by  Doxygen 1.6.0   Back to index