This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to set VID and PID on a BLE HID device?

Hello,

I am developing a composite HID peripheral based on the nRF52840 that can connect to a PC either via USB or BLE.

I am using SDK 15.0.0.

Regardless of the connection type (BLE or USB), the device is supposed to have exactly the same functionality (keyboard + mouse).

Our company has some assistive PC software that relies on identifying the device based on its VID and PID, in order to access the correct functionalities.

We would like to have that both interfaces (USB, BLE) expose the same VID / PID pair.

My problem is: how / where can VID and PID be configured on BLE?

While it was quite easy to find where to define the VID and PID for the USB connection (APP_USBD_VID and APP_USBD_PID respectively in sdk_config.h), I couldn't find where the same values are defined for BLE.

In the Device Manager of the PC I see that when connected over BLE, the device exposes VID = 0x40C8, PID = 0x0000.

But I could find no place where these values are defined, in order to modify them.

Can anyone kindly let me know where these values are stored and a code example on how to personalize them?

Many thanks!

Parents Reply Children
  • Hi,

    I see. I do not recognise all the numbers from the SDK example, but this is from the device information service. It makes sense to put your product ID there. If you refer to the HID keyboard (and mose) example in the SDK you will see this set of defines:

    #define PNP_ID_VENDOR_ID_SOURCE             0x02                                       /**< Vendor ID Source. */
    #define PNP_ID_VENDOR_ID                    0x1915                                     /**< Vendor ID. */
    #define PNP_ID_PRODUCT_ID                   0xEEEE                                     /**< Product ID. */
    #define PNP_ID_PRODUCT_VERSION              0x0001                                     /**< Product Version. */

    And these are used in dis_init() where the Device Information Service is initialized.

  • Thank you Einar!

    Seeing your code snippet helped me find where these #defines are located.

    Stupidly, I didn't find them because I searched for "VID" or "PID" respectively (in the USB examples, this is the way they are called).

    I should have searched for "VENDOR_ID" / "PRODUCT_ID" instead!Wink

Related