Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How do I use QCanBusDevice::framesToWrite() ?
Forum Update on Monday, May 27th 2025

How do I use QCanBusDevice::framesToWrite() ?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 527 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aV_V
    wrote on last edited by aV_V
    #1

    Using QtSerialBus (5.7.0) 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, which happens when the tx queue has been overflowed, resulting on packets loss.
    If I print framesToWrite() it always returns me 0.

    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
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved