Hi,

i'm using QSerialPort to read a constant datastream from my comport.
Therefore i'm using a seperate thread that calls itself with a QTimer within a 1ms interval with signal and slots.

Basically like this:
Qt Code:
  1. connect(ReceiveTimer, SIGNAL(timeout()), this, SLOT(SlotTimer()));
  2.  
  3. void SlotTimer(void){
  4. QByteArray ReceivedDat = SerialPort->readAll();
  5. qDebug() << "Received bytes: " << ReceivedDat.size() << " Timestamp: " << QDateTime::currentMSecsSinceEpoch();
  6. }
To copy to clipboard, switch view to plain text mode 

So far this works fine for me. The outputs of qDebug() show me that the thread is called every millisecond like it should be.
The problem is that ReceivedDat does not hold data at some calls of the slot depending on the baudrate.

I use two baudrates 38400 and 57600 so therefore within 1ms about 3-4 Bytes and 5-6 Bytes should be stored in the buffer.
When running my program i got new data in an interval of 16ms (38400) and around 800!ms (57600).

Is there anything i'm missing?


Win7 Prof 64-bit
Qt 5.2.0 (MSVC 2010, 32 bit)
Revision 27d10d8dcd