Has anyone worked with HID Api in CW so far? Any wrapper or anything available? I have a custom microphone made which supports HID and I found a small app for windows that works perfectly for detecting button press and everything but I would prefer making this little app in CW and have more functions and control over it.
Not personally, but if its this you are refering too…
You might find the below useful for keeping an eye on the drivers related to HID.
Yes. The hard part is enumerating the devices. Once you do that you need the report ID from the relative input or output capability and then you can use ReadFile/WriteFile to send data to/from the device just like a serial port. But that also assumes you have documentation about the device and know what commands to send and responses to receive.
Enumeration is done using SetupDiGetClassDevsA API using DIGCF_PRESENT to only get devices that are currently attached, using GUID_DEVINTERFACE_HID to only collect HID devices.
GUID_DEVINTERFACE_HID Equate(‘4D1E55B2-F16F-11CF-88CB-001111000030’)
By the time you’re done you end up with something that might look like the picture below.
But its also entirely possible this is overkill for exactly what you’re trying to do. So you’d probably have to know more about what the current app does before you can try and replicate it in Clarion.
