You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For instance in case of following code, the hid device (mouse) freeze after the program exits. Please change the VendorID and ProductID in the code during testing.
#ifdef WIN32
#include <windows.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <hidapi/hidapi.h>
#define MAX_STR 255
int main(int argc, char* argv[])
{
int res;
unsigned char buf[65];
wchar_t wstr[MAX_STR];
hid_device *handle;
int i;
// Initialize the hidapi library
res = hid_init();
if (res==0)
wprintf(L"HID Initialized.\n");
// Open the device using the VID, PID,
// and optionally the Serial number.
handle = hid_open(0x46d, 0xc534, NULL);
if (handle != NULL)
wprintf(L"Device Opened with handle %d\n", handle);
else{
wprintf(L"Device not Opened.\n", handle);
exit(1);
}
// Read the Manufacturer String
res = hid_get_manufacturer_string(handle, wstr, MAX_STR);
wprintf(L"Manufacturer String: %ls\n", wstr);
// Read the Product String
res = hid_get_product_string(handle, wstr, MAX_STR);
wprintf(L"Product String: %ls\n", wstr);
// Read the Serial Number String
res = hid_get_serial_number_string(handle, wstr, MAX_STR);
if(res==0)
wprintf(L"Serial Number String: (%d) %ls\n", wstr[0], wstr);
hid_close(handle);
// Finalize the hidapi library
res = hid_exit();
return 0;
}
Compiling the program with -lhdiapi-libusb result in frozen device after program run (no issue found with -lhdiapi-hidraw). Same issue (link) was filed for signal11/hidapi.
The text was updated successfully, but these errors were encountered:
For instance in case of following code, the hid device (mouse) freeze after the program exits. Please change the VendorID and ProductID in the code during testing.
Compiling the program with
-lhdiapi-libusb
result in frozen device after program run (no issue found with-lhdiapi-hidraw
). Same issue (link) was filed for signal11/hidapi.The text was updated successfully, but these errors were encountered: