com_OpenDevice
This function opens a device for further access by Serial Port. Please use this
function to open USB_14ADDA or USB_16ADDA.
Declaration
HANDLE com_OpenDevice ( DWORD device_type,
DWORD device_id,
DWORD port_num );
Parameters
device_type
The type of the device to open.
device_id
Device's id on the board.
For more information, please see “Device Type Table & ID Table” following
below.
port_num
Com Port Num to open.
Return value
A valid handle representing the device, or INVALID_HANDLE_VALUE (-1) if an error occurred.
Example
HANDLE hDevice = com_OpenDevice(Device Type, Device Index, 1); if (hDevice == INVALID_
HANDLE_VALUE)
MessageBox (NULL,“Open Failed!“,“Error“,MB_OK);