Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.7.1
-
CM-FX6 (EVK) from Compulab.
Linux-compulab-imx_4.1.15_1.0.0_ga.
Qt cross-compiled using Yocto Project.
Description
Using QtSerialBus (5.7.0 at first, then I tried 5.7.1 too) and taking the CAN-bus example from Qt I have modified sendMessage() method simulating a heavy-download. I send the same frame i times consecutively (being i >1000 per example). I tried this:
for(int i=0; i<m_ui->loopBox->currentData().toInt(); i++){ while(m_canDevice->framesToWrite() > 0){/*do nothing*/} m_canDevice->writeFrame(frame); }
But I still getting "No buffer space available" errors, resulting on packets loss.
If I print framesToWrite() it always returns me 0.
The workaround I do:
while(!m_canDevice->writeFrame(frame)){}
Which isn't the best way as I'm forcing the error to occur ("No buffer space available") but I send as fast as possible without loosing packets.
The documentation specifies:
qint64 QCanBusDevice::framesToWrite() const
Returns the number of frames waiting to be written.
So why it doesn't work as I'm expecting?
My configuration:
Socketcan backend, 1MB/s bitrate, 4B data frame
Attachments
Issue Links
- resulted in
-
QTBUG-54297 Make socketcan backend buffered
- In Progress