Comm API contains two functions, SetCommBreak() and ClearCommBreak(), to assist in sending a BREAK signal. Merely calling these two functions in sequence will not cause a BREAK signal to be sent. Use one of the two methods 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 asynchronous character, 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 high data 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. Use SetTimer() to set a timer and wait for the recommended duration, and then call ClearCommBreak() to terminate the BREAK signal.
NOTE: If an application sends some data and subsequently calls SetCommBreak() before that data has had a chance to make its way through the transmit first in, first out algorithm (FIFO), the data will actually be overwritten by the SetCommBreak() and not get onto the line. To prevent such corruption, it is recommended that you pause for a while before the SetCommBreak().
Method 2An alternative means of sending a BREAK signal of shorter duration is to temporarily change the data rate in the UART to half or 1/4 of the actual line speed and then send a single NULL byte. This is more precise than using SetCommBreak() and ClearCommBreak(), but it has the disadvantage of corrupting received data during the time the BREAK signal is being sent (because the received data rate is wrong during that time). An application can change the date rate in the UART with a call to SetCommState(). The DCB structure passed to SetCommState() specifies the new data rate.
Article ID: 119506 - Last Review: Nov 6, 1999 - Revision: 1