ComReset
This call resets the specified port's buffers or modem. ComReset is used to flush transmit or receive buffers, reset the transmitter flow control state (useful when the port received an XOFF, but no corresponding XON), or reset the modem connected to the port.
- Syntax: err_t far ComReset(handle_t Handle, int Option)
- Parameters: handle_ t Handle - The handle returned via a successful ComOpen.
int Option - The logical OR of any of the following reset options:
COM_RESET_LINE indicates no operation (included for HP
95LX compatibility only).
COM_RESET_TXB flushes the transmit buffer. Any characters
in the UART buffers will still be transmitted.
COM_RESET_TXFLOW (for XON/XOFF flow control) forces the
transmitter into an "unflow controlled" state, i.e. assumes
an XON was received. This option is useful when there
is a possibility of a lost XON after an XOFF.
This parameter is ignored when hardware based flow control
is selected.
COM_RESET_RXB flushes the receive buffer.
COM_RESET_MODEM issues the modem's escape sequence
(DELAY, "+++", DELAY) to place the modem in
command mode, then issues an "ATZ" command to
reset the modem, and wait the prescribed modem
"settling time" (.75 seconds?) before returning.
(Included for HP 95LX compatibility only.)
- Returns: 0 - if successful
Any other value indicates an error condition.
ENOTYOURS - The specified port has not been acquired by the calling
application.
- Comments: ComOpen() must first be called in order to get a valid handle to the
communications port.