version 5.5.5
fix PIHIDevice enumeration for Windows
This commit is contained in:
@@ -6,7 +6,7 @@ endif()
|
||||
project(PIP)
|
||||
set(PIP_MAJOR 5)
|
||||
set(PIP_MINOR 5)
|
||||
set(PIP_REVISION 4)
|
||||
set(PIP_REVISION 5)
|
||||
set(PIP_SUFFIX )
|
||||
set(PIP_COMPANY SHS)
|
||||
set(PIP_DOMAIN org.SHS)
|
||||
|
||||
@@ -122,6 +122,10 @@ bool PIHIDevice::open(const PIHIDeviceInfo & device) {
|
||||
return false;
|
||||
}
|
||||
HidD_GetPreparsedData(PRIVATE->deviceHandle, &PRIVATE->preparsed);
|
||||
if (!PRIVATE->preparsed) {
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
@@ -524,6 +528,7 @@ PIVector<PIHIDeviceInfo> PIHIDevice::allDevices(bool try_open) {
|
||||
PHIDP_PREPARSED_DATA preparsed = nullptr;
|
||||
if (HidD_GetPreparsedData(deviceHandle, &preparsed) == FALSE) {
|
||||
piCout << "HidD_GetPreparsedData error:" << errorString();
|
||||
CloseHandle(deviceHandle);
|
||||
continue;
|
||||
}
|
||||
// auto pp = PIByteArray(preparsed, 64);
|
||||
|
||||
Reference in New Issue
Block a user