NCS multiple connection and save bond information

If there have a peripheral sample support for multiple central?

How NCS realize saving bonding information and distinguish different devices that bond with my board?

Whether NCS have a manager method like peer_id and I can get conn_handle by it?

I want to create a application that support multiple phones connect with.

At mean while,the application need to support pairing and bonding.Besides,I need a method like peer_id to manage.

I don't know the method need realized by myself or it already exit in NCS.

  • Hi,

    I know how it work by you explain.But it still a question of the detail to operation.

    In my understanding,I can save the address that using now and it can be used in next time that the connection have been established.

    But there should be some functions to change or resolute because it will return false that compare the two address directly.

    If it as I said above,which functions need I used?

  • After bonding (when the IRK) is exchanged, the API's will always give you the same address even if the random resolvable address on air changes. (There are helper functions you can use to check address type if needed, bt_addr_le_is_rpa(), andbt_addr_le_is_identity()).

    You can see this if you experiment with an example that log the addresses, like the Bluetooth peripheral UART sample. This address you can save and it will always be a "handle" to that devices (until the bond is deleted). I suggest you experiment a bit with that to see, as there are no other APIs for this but it is also not needed, but it may be unfamiliar as it is handled differently here than in the old nRF5 SDK.

  • Hi,

    I test about address and find as follow.

    If it mean that board connect with bonded device using the public address so that I can realize whether a device bonded by the address type?If it is random,it mean the device is new bonding?

  • Hi,

    Chaoyue Ying said:
    If it mean that board connect with bonded device using the public address so that I can realize whether a device bonded by the address type?

    Not per se. But the Bluteooth host will resolve the address basedon the IRK that was transfered during bonding and the random resolvlable address that is used when connecting. And from that will know which peer device it is, and always use the public address for the APIs. You can see this if you wait and re-connect with the phone that the public address you see on the nRF for that device will be the same. And if you use a sniffer you will see that the adress used on air is the random resolvable address.

    Chaoyue Ying said:
    If it is random,it mean the device is new bonding?

    Not nesesarily. It could be that the peer always us a non-resolvable random address, for instance. There is no specific API for thecking if a bond exists (though it has been discussed).  But it is possible to iterate through all bonds with bt_foreach_bond().

  • Hi,

    I think I understand about address.

    Now I want know how to use flash to save some extra information that in relation to the autosaved bond information,which document I can reference.

Related