This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to simulate two different peripherals in single device

I need to have two different peripheral profiles (with different addresses and so) that will be advertising at same time and that can be connected by different centrals at same time. I checked the multilink example however it doesn't handle this use case. Firstly, is this possible with nrf52840? Secondly, is there any example that i can check for it? Any guidance would be much appreciated. Thanks!

Parents Reply Children
  • I guess one could have it alternate between two profiles ... ?

  • Yes, but then you would have to reinitialize the stack everytime you switch the peripheral profile. Any connections would then have to be torn down and reestablished. My impression is that Ata wanted to the nRF to be connected to two centrals concurrently and each central is connected to different peripherals.

    Best regards

    Bjørn

  • Yes that is correct, each central to be connected to different peripheral of same device. I just wanted to separate concerns and thought it would be easier. In my use case one connection needs to be secure/bonded, this will be used to manage the device, dfu etc.. and the other connection needs not to secure and i want to expose as few services as possible because i am afraid of service discovery time for non-secure connection which is critical for the use case(i might be saying something nonsensical here but it happened before and created some issues, don't know exact reason though) . Given this input what would you suggest? Can i have mixed connections secure/unsecure to same peripheral? And would it be possible to hide some services from non-secure connection?   

  • ataii said:
    Can i have mixed connections secure/unsecure to same peripheral?

    Yes, a nRF device can be connected to multiple centrals and the security used on each link can be different. 

    ataii said:
    And would it be possible to hide some services from non-secure connection? 

     You cannot hide services and characteristics , but you can restrict access to the characterics by requiring the link to be secure before allowing centrals to read and write to them. 

    ataii said:
    Given this input what would you suggest

     I would add all the services needed by both centrals to the GATT table and then set the security requirements of the characteristics that should not be accessible without an encrypted link.

    Best regards

    Bjørn

Related