Serial port open() fails



  • Hi,

    I have a customer display unit with serial port. If I close and re open the serial port it gives me error and port is unable to open.

    void CustomerDisplay::handleErrorOccurance(QSerialPort::SerialPortError) Invoked
    void CustomerDisplay::handleErrorOccurance(QSerialPort::SerialPortError) "The parameter is incorrect."

    my port open code is as below, same code when i used for serial port printer it worked...

    @mpSerialPort->setPortName(mCustDisplaySetup.portName);
    qDebug() << Q_FUNC_INFO << "port name is set";

            if (mpSerialPort->open(QIODevice::WriteOnly))
            {
                qDebug() << Q_FUNC_INFO << "port is opened";
    
                if (mpSerialPort->setBaudRate(mCustDisplaySetup.baudRate)
                    && mpSerialPort->setDataBits(QSerialPort::Data8)
                    && mpSerialPort->setParity(QSerialPort::NoParity)
                    && mpSerialPort->setStopBits(QSerialPort::OneStop)
                    && mpSerialPort->setFlowControl(QSerialPort::HardwareControl))
                {@

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.