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 

    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

  • Hi,

    I'm using my nrf device as a peripheral medical device.

    When bonding to my phone, I'm starting advertise, the mobile app sends a connection request, connection is established and we are bonded. That happens when the mobile app is running.

    After disconnection, I want to connect again when specific conditions occur. So my nrf device starts advertise with whitelist. Am I doing it correctly from peripheral side?

    On mobile side - app isn't running, so I can't scan and send a connection request.

    Can you please tell me what do you think?

    Thanks!

  • Hi 

    This article discusses some different ways of having your app looking for a BLE device in the background, even if the uses closes the app on the phone side. 

    The best method is to use a foreground service, which will show a persistent message on the notification bar informing the user that your app is still looking for BLE devices in the background. 

    Similar functionality should also be possible on iOS, as discussed here

    Best regards
    Torbjørn

Related