How can I display the Bluetooth HID Mouse Battery Level Status Icon next to device name in Mac OS Bluetooth Preferences list?

System Details:

  • Chip: nRF52840
  • nRF5 SDK: Version 16.0.0
  • mdk version: 8.46.0
  • nrfjprog version: 10.15.4 external
  • nrfutil version: 6.1.3
  • JLinkARM.dll version: 7.64d

Hello,

I have a working nRF52840 custom device that supports the HID Mouse service via BLE and it is working great so far. As part of the nRF HID implementation, our code also support BAS. I want to view my custom device's battery level in my Macbook Pro's Bluetooth Preferences Drop-Down Menu, which lists all my connected BLE devices. In this Drop-Down menu, I can not only see my devices, but I can conveniently view the battery level status icon next to the device name. This gives a quick, high-level battery status update to the user.

Part of me was hoping that setting up the BAS service would simply do the trick, but sadly that is not the case. I tried searching around online for this topic, but had a hard time finding anything specific. What else do I need to set up in my firmware to enable this battery level status icon to appear next to my device's name in my Bluetooth menu? Is this possible? I am happy to share any code if it helps

Thank you for your time & help,
Corten

Parents Reply Children
  • Hey, no worries on the delay. Thanks for the link to the spec, that makes sense.
    Regarding the behavior or CoreBluetooth, that would make sense about bonding....and eventually, we will support bonding for our devices that we make for users, but our development devices perform Pairing w/o Bonding because its just a simple/more convenient process.

    In any event, this sort of confirms what I was reaching for, at least for the time being. Until I am able to explore the bonding behavior in greater depth, I may stop trying to get this battery level indication to work on my Mac. I have already seen that the battery level indication that I seek is working perfectly on a PC, so it does seem Mac-specific and likely it needs Bonding.

  • Thanks for the update. I tested the ble_app_hid_mouse example today with and without bonding, and it turns out my assumption was wrong - CoreBluetooth starts subscribing to the battery service even if I just pair without bonding.

    Despite this, the battery level only gets displayed when I pair with the bonding flag set.

    Sniffer captures for reference:

    - ble_app_hid_mouse_w_bonding.pcapng

    - ble_app_hid_mouse_wo_bonding.pcapng

Related