Problem trying to read from serial port
-
Hi everyone,
I'm having a hard time trying to read some data from the serial port. I'm able to write from it to a bluepill, but it seems that the program stucks on usbDevice -> readAll(), because after that I put a lot of qDebug() that will print something on the console debugger, and it doesn't happen.The code for read the serial port is:
dataread = usbDevice -> readAll(); if(dataread[0] != 0){ qDebug() << "ok"; } digin.append(dataread); if(dataread.size() >= 2){ qDebug() << "Ok"; } qDebug() << dataread; qDebug() << digin; qDebug() << dataread.size(); qDebug() << dataread.count(); qDebug() << dataread.length(); qDebug() << digin.size(); qDebug() << digin.count(); qDebug() << digin.length();
This is the last I tried, but nothing happens, I'm desperate.
-
Hi everyone,
I'm having a hard time trying to read some data from the serial port. I'm able to write from it to a bluepill, but it seems that the program stucks on usbDevice -> readAll(), because after that I put a lot of qDebug() that will print something on the console debugger, and it doesn't happen.The code for read the serial port is:
dataread = usbDevice -> readAll(); if(dataread[0] != 0){ qDebug() << "ok"; } digin.append(dataread); if(dataread.size() >= 2){ qDebug() << "Ok"; } qDebug() << dataread; qDebug() << digin; qDebug() << dataread.size(); qDebug() << dataread.count(); qDebug() << dataread.length(); qDebug() << digin.size(); qDebug() << digin.count(); qDebug() << digin.length();
This is the last I tried, but nothing happens, I'm desperate.