Hi all
I am trying to a simple serial receive communication. I have a Col VF61 and Iris Carrier board. I have written program in QT but it seems not to be working. On my development system I have a com port through which I have connected a null modem cable. Right now I do not have 10 pin female IDC to 9-pin male D-Sub RS-232 serial cable so I am using jumper wires. I have connected the 3rd pin of null modem cable to 3rd pin of X13 connector (Tx-Rx) and connected 5th pin to 9th pin (GND-GND). I am trying to send a data from cutecom installed on my ubuntu 16.04 but I am not able to receive the data on vf61 application.
Here is the code:
void MainWindow::SerialInit()
{
this->Serial = new QextSerialPort("/dev/ttyLP1", QextSerialPort::EventDriven);
Serial->open(QIODevice::ReadWrite);
Serial->setBaudRate(BAUD9600);
Serial->setFlowControl(FLOW_OFF);
Serial->setParity(PAR_NONE);
Serial->setDataBits(DATA_8);
Serial->setStopBits(STOP_2);
qWarning("Serial Port active \n");
connect(Serial, SIGNAL(readyRead()), this, SLOT(SerialRead()));
qWarning("Slot connected \n");
}
QString serialData;
void MainWindow::SerialRead()
{
ui->textEdit->clear();
serialData = Serial->readAll();
ui->textEdit->setText(serialData);
qWarning("Data received successfully");
qWarning(serialData.toUtf8());
serialData.clear();
}
As you can see I have connected a signal which will call SerialRead when data is ready to receive. and then it will print the data on a label. I am getting the serial port active and slot connected message but not able to receive the data.
Is the setup I have used wrong.? How can I test a loopback test on iris.? Thanks
EDIT:
As you can see in the image, when ever I am sending data to the ColVf from ubuntu, I receive Data Received Successfully
which means that the code is working fine. But the received data is not what I am sending. As you can see, I sent Hello World
but only received llo wor
. Can anyone please suggest me something about this behaviour. Thanks