Displays the connected devices that can be used by libusbK.
- show-device example:
- Initializes a new LstK (device list) handle.
- Gets the number of devices contained in the device list.
- Demonstrates using LstK_FindByVidPid to locate the example VID/PID.
- Demonstrates using LstK_MoveReset and LstK_MoveNext to locate the example VID/PID.
- Demonstrates using LstK_Enumerate for printing a single line description of each device list element.
- Frees the LstK (device list) handle created in step #1.
- Console Output
USB\VID_04D8&PID_FA2E\LUSBW1: Benchmark Device (Travis Robinson)
Example device connected!
PVOID MyContext)
{
printf("%04X:%04X (%s): %s - %s\n",
deviceInfo->
Common.
InstanceID,
return TRUE;
}
DWORD __cdecl main(int argc, char* argv[])
{
DWORD errorCode = ERROR_SUCCESS;
ULONG count = 0;
{
errorCode = GetLastError();
printf("An error occured getting the device list. errorCode=%08Xh\n", errorCode);
return errorCode;
}
if (!count)
{
printf("No devices connected.\n");
return ERROR_DEVICE_NOT_CONNECTED;
}
printf("LstK_FindByVidPid: Example device connected!\n");
else
printf("Example device not found.\n");
if (deviceInfo)
{
if (success)
{
printf("MyContextValue = %u\n", myValue);
}
}
errorCode = ERROR_NO_MATCH;
{
{
errorCode = ERROR_SUCCESS;
break;
}
}
if (deviceInfo)
printf("LstK_MoveNext: Example device connected!\n");
else
printf("Example device not found.\n");
return errorCode;
}