Skip to main content

Secondary page

  1. Function Explanation:

3.1) General Function:

3.1.1) AutoOpenComPort():

Function description:

This function is used to automatically detect the communication port unoccupied by other application and attached with a reader. The function try to establish the connection between them. The protocol parameters are 57600bps, 8 data bits, 1 start bit, 1 stop bit, no parity bit.

If the connection is established successfully, the function will open the communication port and return a valid handle, otherwise the function will return an error code with a invalid handle(value as -1).

Usage:

Int AutoOpenComPort(int * Port, unsigned char *ComAdr, unsigned char Baud, int * FrmHandle);

Parameter:

Port: Pointed to the communication port number (COM1~COM9) that the reader is detected and connected.

ComAdr: Pointed to the address of the reader.