Unique Multi Peripheral Advertiser Names and MAC Address

Nordic Support,


My product uses the nRF52840 chip and nRF52 SDK 17.1. I have a feature request to support hosting multiple peripheral connections, each with a unique advertising name and, if possible, a distinct MAC address. This feature will enable each connection to host different services on separate peripheral connections, supporting unique applications on different iOS devices.

Is it feasible to simultaneously advertise two peripheral services, each with a unique device name? My product currently supports dynamically generating a MAC address to ensure unique connections but that's for only a single hosted peripheral connection. Can I assign a distinct MAC address to each peripheral connection?

More questions to follow based on response. Thank you for your time and attention...

Parents
  • On the nRF52840 with the nRF5 SDK and SoftDevice, you can only have one active advertiser at a time. You can shuffle between different names or services quite fast but you cannot truly broadcast two distinct names or use two separate MACs in parallel. If true multi-advertising is a hard requirement, you’d need to switch to the nRF Connect SDK SPLIT controller where the controller can handle multiple advertising sets concurrently.

    More questions to follow based on response.

    If you have different questions not related to the main description of this thread, I recommend you open a different thread to keep the thread clean.

  • Suheel,

    Thank you for your quick feedback. From your response, it appears I can advertise one connection at a time and connect my devices sequentially, renaming each device for each advertisement. This will work fine and do not have to advertise in parallel. I would like one connection to host both the HID service and NUS (Conn A), while the other connection hosts only NUS (Conn B). Utilizing HID requires pairing and bonding the connection. For Connection B, I want to avoid bonding and solely host NUS. I'm having difficulty understanding how to remove the HID service when advertising and managing Connection B. I would think I need a reverse functionality for sd_ble_gatts_service_add.

    Lastly, although I haven't tested it yet, is it possible to host two parallel connections with the HID service and send key commands to both devices simultaneously? Are there any conflicts I should be aware of? I know each connection will have to be paired and bonded.

    Thank you...

    - Matt W.

  • Matt,

    You cannot remove services at runtime without disabling/enabling the Softdevice (not recommended). 

    I think attempting to remove the services might be an overkill for this problem. Instead advertise for Conn B that only NUS is available and leave the HID in your GATT database but enforce attribute level security like for example any attempt to do read/Write on HID handles on connection B would return Not Permitted error. This you can easily do by implementing some check in BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event handling, just make sure that HID attributes have authentication enabled. For Connection A, you allow this read/Write.

    I am also not 100% sure that the BLE HID library is tested for two simultaneous connections. One of my colleagues made a blog for multiperipheral HID which might be of some use here.

Reply
  • Matt,

    You cannot remove services at runtime without disabling/enabling the Softdevice (not recommended). 

    I think attempting to remove the services might be an overkill for this problem. Instead advertise for Conn B that only NUS is available and leave the HID in your GATT database but enforce attribute level security like for example any attempt to do read/Write on HID handles on connection B would return Not Permitted error. This you can easily do by implementing some check in BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event handling, just make sure that HID attributes have authentication enabled. For Connection A, you allow this read/Write.

    I am also not 100% sure that the BLE HID library is tested for two simultaneous connections. One of my colleagues made a blog for multiperipheral HID which might be of some use here.

Children
No Data
Related