Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-36490

DTR (re)sets when changing baud rate of QSerialPort object on Windows systems.

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P4: Low
    • 5.3.0
    • 5.2.0
    • Serial Port
    • None
    • Windows 7; x64
      VS2012 Ultimate

    Description

      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; }

      I didn't verify the behaviour under Linux or other OSs.

      Any comments?
      THX

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kuzulis Denis Shienkov
            senseless1972 Dr. Alexander W. Lenhardt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes