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. DTR resets when changing baud rate of QSerialPort object on Windows systems.
Forum Updated to NodeBB v4.3 + New Features

DTR resets when changing baud rate of QSerialPort object on Windows systems.

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.1k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    Senseless1972
    wrote on last edited by
    #1

    Unfortunately (re)setting the DTR line state via setDataTerminalReady does not change the DCB for the Windows serial port object. The function only uses the EscapeCommFunction of Windows. Result is, for example, changing the serial port baud rate will (re)set DTR line to it's initial state, too. Unfortunately there are some serial devices available using the DTR line for internal reset.
    A scenario where this might be pain in the a... is describerd here:
    1.) clear DTR to let the device run.
    2.) Send device command to make it work with higher baud rate.
    3.) Set serial port to this higher baud rate.
    4.) DTR is reset to it's initial state, device goes thru reset and works with it's initial baud rate.....
    Would be good to add something like the following in future code releases:

        if (set) {
            EscapeCommFunction(Win_Handle, SETDTR);
            Win_CommConfig.dcb.fDtrControl = 1;
        }
        else {
            EscapeCommFunction(Win_Handle, CLRDTR);
            Win_CommConfig.dcb.fDtrControl = 0;
        }
    

    Any comments?
    THX

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kuzulis
      Qt Champions 2020
      wrote on last edited by
      #2

      Hi.

      Hmm. It is interesting things, thanks. :)
      We can discuss about it on bug-tracker. Please add your issue there.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Senseless1972
        wrote on last edited by
        #3

        Thanks, I added my issue there, but as a suggestion....
        Hopefully we can discuss it there....
        THX

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kuzulis
          Qt Champions 2020
          wrote on last edited by
          #4

          Can you please provide an url to the issue?

          UPD:

          I found and re-assign Issue to me, see here: https://bugreports.qt-project.org/browse/QTBUG-36490

          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