QSerialPort crashes if incoming data is more than 127 bytes at a time
Unsolved
General and Desktop
-
Following code is implemented and crashes if data is more than 127bytes at a time.
serial->setPortName(currentPortName);
serial->open(QSerialPort::ReadWrite);
serial->setBaudRate(currentBaudRate.toInt());
serial->setDataBits(QSerialPort::Data8);
serial->setParity(QSerialPort::NoParity);
serial->setStopBits(QSerialPort::OneStop);
serial->setFlowControl(QSerialPort::NoFlowControl);connect(serial,SIGNAL(readyRead()),this,SLOT(serialReceived()));
serialReceived()
{
int byte_count;
byte_count = serial->bytesAvailable();
QByteArray data = serial->readAll();
}Please help to solve the above issue.
-
Hi @Akash_Patil,
where exactly does it crash? From the snippet you provided, nothing obvious is seen.
Run your program in a debugger and provide the stack trace after the crash.
Regards