MCP2200
2.3.1.11
Function:
GetDeviceInfo
String^ SimpleIOClass::GetDeviceInfo (unsigned int uiDeviceNo)
Summary:
Returns the path name for one of the connected devices.
The function will return the path name for the given device ID.
Description:
Precondition: At least one call to the InitMCP2200()is required in order to initiate a DLL search for the compatible
devices.
VID and PID must be previously set via a call to InitMCP2200(VID, PID).
Parameters:
Returns:
uiDeviceNo: The device ID for which the path information is needed. Can have a value between 0
and the number of devices minus 1.
This function returns a string containing the path name of the given device id.
• In the case the given ID is out of range, the function will return the “Device Index Error” string.
• In the case the device for which the path name is required is not connected anymore, the return
string will be “Device Not Connected”.
Remarks:
None.
EXAMPLE 2-11:
lblStatusBar->Text = SimpleIOClass::GetDeviceInfo(0);
2.3.1.12
Function:
GetNoOfDevices
unsigned int SimpleIOClass::GetNoOfDevices(void)
Summary:
The function returns the number of available devices present in the system.
The function returns the number of HID devices (with the given VID/PID) connected to the system.
Description:
Precondition: At least one call to the InitMCP2200()is required in order to initiate a DLL search for the compatible
devices. Also, in order to know the actual number of devices connected to the system, call the
SimpleIOClass::IsConnected()function. VID and PID must be previously set via a call to
InitMCP2200(VID, PID).
Parameters:
Returns:
None.
This function returns the number of HID devices with the given VID/PID (as parameters of
SimpleIOClass::InitMCP2200()function).
Remarks:
Call the SimpleIOClass::IsConnected()prior to the call of this function in order to have the most
recent number of devices that are present in the system.
EXAMPLE 2-12:
SimpleIOClass::IsConnected(); //call this function to refresh the number of
//the devices present in the system
lblStatusBar->Text = SimpleIOClass::GetNoOfDevices();
2.3.1.13
Function:
GetSelectedDevice
int SimpleIOClass::GetSelectedDevice(void)
Summary:
Returns the ID of the selected device
Description:
The function returns the ID of the current selected device.
Precondition: At least one call to the InitMCP2200()is required in order to initiate a DLL search for the compatible
devices. VID and PID must be previously set via a call to InitMCP2200(VID, PID).
Parameters:
Returns:
None.
This function returns the ID of the current selected device. Its value can range from 0 to the number of
devices minus 1.
Remarks:
None.
2011 Microchip Technology Inc.
DS22228B-page 17