cancel
Showing results for 
Search instead for 
Did you mean: 

Custom HID device

Nickelgrass
Senior

Hello,

I am planning to use the Custom HID device from CUBEIDE on an STM32F103 (I do not want to use CDC). I would like to use this in order to transfer simple packets of 20 bytes to and from the PC in a reasonable speed. I already set up some keyboard, mouse and gamepad collections wich work fine. But how do I interface with the custom device on Windows? I need the device not to need any specific drivers. I need to interface with this in python and java. Are the any guides on how to do this?

The second question is how to identify my device prior to sending data to see if it is physically connected. Can I use a string descriptor to identifie it in my PC application?

Thanks

Kind regards

1 REPLY 1
Pavel A.
Evangelist III

For the old good Win32 API, read this :

Handling HID Reports Topics - Windows drivers | Microsoft Docs

Python and Java have various libraries, please google.

> how to identify my device prior to sending data to see if it is physically connected. 

A simple example with Win32 C API is here.

Once you have the device handle, you can call HidD_GetManufacturerString, HidD_GetProductString, HidD_GetSerialNumberString and so on.

For more modern languages you can ask on the Microsoft forums or Stack Overflow (or again, google).

-- pa