BLE - HID profile

Hi,

I understand that the HID profile can be part of my BLE implementation. Can you please tell me how to implement that?

Thanks

Parents Reply Children
  • Hi 

    In the nRF5 SDK we have two examples showing how to run HID over BLE (also called HID over GATT), the ble_app_hids_keyboard and the ble_app_hids_mouse examples. 

    I would suggest starting with one of these, and make any modifications that you might need based on the standard example. 

    If you are starting a new design I would also recommend looking into the nRF Connect SDK instead. This is a more future proof software platform which is the one being used for all new Nordic products, and at some point in the future it will not be possible to qualify new products based on the nRF5 SDK. 

    There are examples for HID keyboard and mouse using Bluetooth in this SDK also. 

    Best regards
    Torbjørn 

  • Hi,

    I've reviewed those examples and I didn't see any special BLE implementations, except for the direct advertising. Am I missing something?

    Thanks!!

  • Hi 

    That sounds odd. Most of the HID related BLE configuration, such as the setup of the HID service, is handled by the ble_hids.c file. Did you take a look at this one?

    There is also a lot of BLE handling in the main file, such as the SoftDevice initialization, gap and gatt init, configuration of advertising and services, and init of the conn params and peer manager modules which are also used to service the BLE functionality. 

    For more information about these examples you can also have a look at the example documentation

    Best regards
    Torbjørn

  • Hi,

    I will tell you what exactly is my requirement.

    I'm using BLE to connect to a mobile phone. After bonding - I want to reconnect again. When I start advertising - I'm able to connect to the mobile again only when mobile app is open. When it's closed - no connection is established.

    I understand that HID profile implementation may solve that issue, and allow me to establish connection when starting advertising and mobile app isn't open.

    Are you familiar with that?

    Thanks!

  • Hi 

    It is true that HID devices connects to phones on a system level, rather than through a specific app, since HID devices like keyboards, mice and gamepads usually work across all apps on the phone. 

    That being said it should be possible for an app to connect to your device even if the app is not active, as long as it is running in the background. Most phones allow you to do so called background scanning, which means an app can look for a device in the background and connect to it when it comes into range. 

    Can you let me know what you are planning to use your device for? 

    Depending on what kind of data or services you need I am not sure HID is the best option. 

    Best regards
    Torbjørn

Related