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:
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.
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().