SERIAL_GetControlLines
This function reads the current state of the control lines, and writes a bitmap into the address pointed to by 'val'. Only the input bits (CTS, DSR, DCD, RI) reflect the current status of control lines.
Synopsis
int SERIAL_GetControlLines( int port,
unsigned char *bitmap);
Parameter | Description |
---|---|
port
|
Serial port number (0 based). Specify port 0 to redirect the output to the hsmtrace log. |
bitmap
|
Pointer to a character, which will have the resulting bitmap |
Return Code
0
: The function succeeded
-1
: The function failed. The value in the bitmap is not valid
Comments
#define MCL_DSR 0x01
#define MCL_DTR 0x02
#define MCL_RTS 0x04
#define MCL_CTS 0x08
#define MCL_DCD 0x10
#define MCL_RI 0x20
#define MCL_OP_SET 1
#define MCL_OP_CLEAR 2