Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Serial com port and break signal
Hi everybody. Is there a way to send a break signal for 0.5 ms on Linux?
This feature seems to be available only on Windows but on Linux the break signal, send with the function
requires at least 250 ms.
I know nothing about this topic, but its an interesting question :)
on Linux the break signal, send with the function tcsendbreak, requires at least 250 ms.
Why do you say it requires at least 250ms?
The man page says:
If duration is not zero, it sends zero-valued bits for some implementation-defined length of time.
So it's going to be platform-dependant, but since you're specifically asking about Linux, the same man page goes on to say:
The effect of a nonzero duration with tcsendbreak() varies ... Linux, AIX, DU, Tru64 send a break of duration milliseconds.
It does mention that SunOS has a 250ms minimum limit, but suggests that does not apply to Linux.
Have you tried it? :)
After have verified with an oscilloscope the function, if it is different from 0, seems to be defined in seconds and not in milliseconds. I need a break signal for only one millisecond.
verified with an oscilloscope the function, if it is different from 0, seems to be defined in seconds and not in milliseconds.
So, for example, if you do:
Will it spend 60 seconds doing a break, or just 1 second? The former would indicate that the documentation is wrong for your platform (assuming it's Linux based), the latter that your platform has some minimum.
What platform (hardware + software) are you using?
Linux, now on an intel machine, in the future on a beaglebone board.
tcsendbreak(SerialPort.handle(), 0); means 250 ms
tcsendbreak(SerialPort.handle(), 1); means 100 ms
tcsendbreak(SerialPort.handle(), 10); means 100 ms
tcsendbreak(SerialPort.handle(), 60); still 100 ms
requires 10 ms, 5 up, 5 down.
I need only 1 ms.
I need only 1 ms.
It is impossible then.
It does sounds like your platform (driver or hardware) is imposing a minimum of 100ms.
What baud rate did you open the serial port with?