LONG EscapeCommFunction(idComDev, nFunction) | |||||
int idComDev; | /* identifies communications device | */ | |||
int nFunction; | /* code of extended function | */ |
The EscapeCommFunction function directs the specified communications device to carry out an extended function.
idComDev
Specifies the communications device that will carry out the extended function. The OpenComm function returns this value.
nFunction
Specifies the function code of the extended function. It can be one of the following values:
Value | Meaning |
CLRDTR | Clears the DTR (data-terminal-ready) signal. |
CLRRTS | Clears the RTS (request-to-send) signal. |
GETMAXCOM | Returns the maximum COM port identifier supported by the system. This value ranges from 0x00 to 0x7F, such that 0x00 corresponds to COM1, 0x01 to COM2, 0x02 to COM3, and so on. |
GETMAXLPT | Returns the maximum LPT port identifier supported by the system. This value ranges from 0x80 to 0xFF, such that 0x80 corresponds to LPT1, 0x81 to LPT2, 0x82 to LPT3, and so on. |
RESETDEV | Resets the printer device if the idComDev parameter specifies an LPT port. No function is performed if idComDev specifies a COM port. |
SETDTR | Sends the DTR (data-terminal-ready) signal. |
SETRTS | Sends the RTS (request-to-send) signal. |
SETXOFF | Causes transmission to act as if an XOFF character has been received. |
SETXON | Causes transmission to act as if an XON character has been received. |
The return value is zero if the function is successful. Otherwise, it is less than zero.