Multiperipheral service definition without array. Define a peripheral service without defining an array of services. All connected peripherals access the same service data.

Okay, I've run into an interesting scenario.

SDK 17.0.2

NRF 52840 (DK)

I am coding a multiperipharal service on a multiperipheral ble device.

My attempt at updating all connected peers with for a notifiable characteristic has failed as my service is designed to be BLE handle aware (based off the NUS Example) and I did not define an array of those services. Basically I fail past the first connected peer, most likely as a disconnect/connect changes the ble handle assigned to the instantiated service.


I did not define an array of services, and then iterate over interacting with them. I defined one and the existing service is based of the NUS service which has a connection handle assigned and deassigned from the service.

Is there an example of a way to remove the handle associated with a service, and give the same service interaction to all connected devices regardless of handle?

Does this makes sense?

I really don't have need to define an array of services, since the data and manipulation will be the same 1 to many interaction.

Are there any example multiperipheral services that exhibit this kind of behavior or will I need to modify my current one.

My options as I see them write now:

1) Define an array of services. Exactly as the NUS service does this. However, then all my current interactions with the service will need to seemingly iterates of handles.

2) Modify the existing service to somehow ignore device handle checks, and treat all service updates somehow for all connection handles.

Parents
  • Hi,

    I'm a little confused by your description as it is not always clear to me if you are disusing attribute handles or connection handles. But If you have multiple subscribers to a single service/characteristic you have to iterate through the connection handles to notify all the peers, it's not possible to change this behavior as each peer might have different behavior. so one could subscribe to notifications while another might not, but instead subscribe to another attribute.

    Also, there is an example in our SDK that might be of interest, see: BLE Multi-link Example -> nRF5_SDK_17.1.0_ddde560\nRF5_SDK_17.1.0_ddde560\examples\ble_central\ble_app_multilink_central.

  • Thanks for the reply. You and me both! All my "handle" terms were in reference to BLE connection handles.

    Attempting to be better with my understanding of terminology.

    I've referenced your example and it's worked very well so far for a multi connection central device. 1 central to multiple peripherals. That's working so far.

    Now I'm looking to do the same thing on the peripheral side, but am not as clear about how to do that right now. 1 peripheral to multiple centrals.

    Long story long: How do I write services and instantiate them//handle them in a multiperipheral scenario.

    Do you use the BLE Link Context Manager to do this? The NUS service definition macro hints me in this direction.

    I guess I need a solid example on how to do this.

Reply
  • Thanks for the reply. You and me both! All my "handle" terms were in reference to BLE connection handles.

    Attempting to be better with my understanding of terminology.

    I've referenced your example and it's worked very well so far for a multi connection central device. 1 central to multiple peripherals. That's working so far.

    Now I'm looking to do the same thing on the peripheral side, but am not as clear about how to do that right now. 1 peripheral to multiple centrals.

    Long story long: How do I write services and instantiate them//handle them in a multiperipheral scenario.

    Do you use the BLE Link Context Manager to do this? The NUS service definition macro hints me in this direction.

    I guess I need a solid example on how to do this.

Children
Related