- 1 year ago
Cannot read from HID device after migrating from fileapi.h ReadFile in windows to hidapi hid_read in Ubuntu
The reason why you cannot read from the HID device after migrating from ReadFile
in Windows to hid_read
in Ubuntu might be due to the differences in the HID API implementations between the two operating systems.
In Windows, the ReadFile
function is used to read data from a file or input/output (I/O) device, such as an HID device. The function reads data from the device into a buffer that is specified by the caller.
On the other hand, in Ubuntu, the hid_read
function is part of the HIDAPI library, which provides a cross-platform API for interacting with HID devices. The function reads data from the device into a buffer that is specified by the caller.
The issue may be that the HIDAPI library on Ubuntu is not configured to work with your specific HID device. To resolve this, you may need to install additional drivers or modify the HIDAPI library configuration.
You may also want to verify that the HID device is properly connected to the Ubuntu system and that it is recognized by the operating system. You can use the lsusb
command to list all USB devices that are currently connected to the system.
If you are still having issues with reading from the HID device, you can try using a different HIDAPI library or API, or consult the documentation or support resources for your specific HID device to troubleshoot the issue.