The SetWiring method sets connection type depending on parameters passed to this method


BOOL SetWiring(

      LONG Dtr,     // Transmit line signal

      LONG Rts,     // Receive line signal

      LONG Out1,     // Output line signal

      LONG Out2,     // Input line signal

);

 

Parameters:

  • Dtr, Rst, Out1, Out2 [in] : line signals may have following values depending on which port you want connect to:
ValueMeaningHex
WIRED_TO_DCDsetting connection to remote DCD line0x80
WIRED_TO_RIsetting connection to remote RI line0x40
WIRED_TO_DSRsetting connection to remote DSR line0x20
WIRED_TO_CTSsetting connection to remote CTS line0x10

  

Return Values : If the function succeeds, the return value is TRUE, alternatively, the return value is FALSE.

Note: Method is available for Windows NT4/2000/XP/2003/Vista only.

The default pinout is the following:

default pinout

Note: DCD signal is connected to DTR signal by default and you are not able to manage them separately. To resolve this problem, please, execute the following command: SetWiring (WIRED_TO_DSR, WIRED_TO_CTS, 0,0). Besides, SetWiring method is actual till virtual port is not deleted from system.