Transmitting a BREAK Signal
Retired KB Content Disclaimer
Comm API contains two functions, SetCommBreak() and ClearCommBreak(), toassist in sending a BREAK signal. Merely calling these two functions insequence will not cause a BREAK signal to be sent. Use one of the twomethods described below to transmit the BREAK signal:
Method 1The International Consultative Committee for Telephone and Telegraph(CCITT) modem recommendations require a break signal to be at least "2m+3"bits long, where "m" is the nominal number of bit times in an asynchronouscharacter, usually 10; this means that the minimum break time is 23 bits,with no maximum specified. Usually, much more than the minimum is sent,such as 100 or 200 milliseconds (that is, hundreds of bit times at highdata rates). The timer resolution in a PC is sufficient for sending such"long" BREAK signals, but not sufficient to send exactly 23 bit times.
An application can call SetCommBreak() to initiate the BREAK signal. UseSetTimer() to set a timer and wait for the recommended duration, and thencall ClearCommBreak() to terminate the BREAK signal.
NOTE: If an application sends some data and subsequently callsSetCommBreak() before that data has had a chance to make its way throughthe transmit first in, first out algorithm (FIFO), the data will actuallybe overwritten by the SetCommBreak() and not get onto the line. To preventsuch corruption, it is recommended that you pause for a while before theSetCommBreak().
Method 2An alternative means of sending a BREAK signal of shorter duration is totemporarily change the data rate in the UART to half or 1/4 of the actualline speed and then send a single NULL byte. This is more precise thanusing SetCommBreak() and ClearCommBreak(), but it has the disadvantage ofcorrupting received data during the time the BREAK signal is being sent(because the received data rate is wrong during that time). An applicationcan change the date rate in the UART with a call to SetCommState(). The DCBstructure passed to SetCommState() specifies the new data rate.
ID d'article : 119506 - Dernière mise à jour : 11/06/1999 11:55:00 - Révision : 1.0
- kb16bitonly KB119506