# HG changeset patch # User Hasan Yavuz Ă–ZDERYA # Date 2015-05-26 08:50:20 # Node ID b259a534fe6841573196b155ebf79cc63b3cc4fd # Parent be167cc7f2fb9acc4e80043a09e9b640634822b0 advanced port settings are applied after opening port diff --git a/portcontrol.cpp b/portcontrol.cpp --- a/portcontrol.cpp +++ b/portcontrol.cpp @@ -215,15 +215,15 @@ void PortControl::togglePort() // open port if (serialPort->open(QIODevice::ReadWrite)) { + // set port settings + selectBaudRate(ui->cbBaudRate->currentText()); + selectParity((QSerialPort::Parity) parityButtons.checkedId()); + selectDataBits((QSerialPort::DataBits) dataBitsButtons.checkedId()); + selectStopBits((QSerialPort::StopBits) stopBitsButtons.checkedId()); + selectFlowControl((QSerialPort::FlowControl) flowControlButtons.checkedId()); + qDebug() << "Port opened, " << serialPort->portName(); emit portToggled(true); - - // set baud rate - if (!serialPort->setBaudRate(ui->cbBaudRate->currentText().toInt())) - { - qDebug() << "Set baud rate failed during port opening: " - << serialPort->error(); - } } else {