Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Give function a deadline?

Give function a deadline?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 599 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.
  • W Offline
    W Offline
    wost
    wrote on last edited by
    #1

    I'm working on some communication with a RS232-port and I'm using QSerialPort to communicate between the client and the emulator I'm running. Everything is working fine, data is flowing nicely between the two.

    My problem, however, is that I want to make sure that the process of reading data from the emulator should take 100ms or less; or else return a NAK. Currently I write, flush and then wait for readyRead to get all the data and then I manipulate that data as I see fit and then I return an ACK back to the emulator, but I need that timeout operation. How can I achieve this?

    In advance, thanks!

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi! bool QSerialPort::waitForReadyRead(int msecs = 30000) has a built-in timeout. Or do you mean something else?

      1 Reply Last reply
      4
      • W Offline
        W Offline
        wost
        wrote on last edited by wost
        #3

        Hm, I'll try that out. Thanks! :)

        1 Reply Last reply
        1

        • Login

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