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

Improve usage of the break state for the Tx line



    • Type: Suggestion
    • Status: Closed
    • Priority: P4: Low
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.8.x, 5.5.0
    • Component/s: Serial Port
    • Labels:


      At present use of the methods setBreakEnabled() and sendBreak()
      is a little ambiguous and not clear, has not a common use case.

      Besides these methods have various behavior on different platforms.
      For example, in Windows, the method sendBreak() is implemented as
      blocking through the Sleep() call; but at the same time, in *nix
      this method is non-blocking. Besides, behavior of this method
      in *nix variously for the Linux and BSD platforms (add url: ... ).

      I offer to implement identical behavior of these methods and to
      expand the use case:

      • sendBreak():

      To make asynchronous with use a QTimer in the
      "single shot" mode. And to emulate through twice calls of the
      method setBreakEnabled() with the true and false value. Also to
      forbid a multiple call of the sendBreak() by user while
      operation is in progress.

      • setBreakEnabled()

      To make as property and to add the symmetric method
      isSetBreakEnabled(). Besides, to add the breakEnabledChanged
      signal for the notification that the Tx line is switched to
      the "break/nonbreak" mode. By analogy with DTR/RTS signals.

      The main problem here is implementation of the isSetBreakEnabled()
      method. Because it seems that in *nix doesn't exist an API for
      determination of a status of Tx line (or the "break" mode on the
      Tx line). Though, probably it can be done through the

      On Windows there is an possible to define a "break" mode since
      there is I/O control code which can return an appropriate flag of
      the "hold reason".

      But anyway, even if it is impossible, then we can try get a
      "break" mode indirectly after a successful call of
      the method setBreakEnabled().


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



            kuzulis Denis Shienkov
            kuzulis Denis Shienkov
            0 Vote for this issue
            2 Start watching this issue



                Gerrit Reviews

                There are no open Gerrit changes