New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bluetooth: Support for multiple local identity addresses #7473
Comments
@pizi-nordic and @jhn-nordic: Please detail the full requirements here so we can take a look |
Assuming that we go with the approach of supporting multiple identity addresses, I'd propose extending the settings storage in the following forward-compatible way: Currently the identity address is stored in the key The next step is to extend the bonding keys and CCCD storage. Currently these are stored in For the public API I'd propose something like:
These would fill in the bt_addr_le with the identity address, and return the identifier (index) of the identity (or a negative error number on error). The recently added For removing an identity there could be something like:
And, in the longer run, if we want to have something like was proposed by @holtmann on IRC, there could be a:
To be able to select a specific identity to advertise with, I'd extend our Thoughts? |
One thing I'm wondering, I didn't find it useful to expose the actual IRK value publicly, and perhaps we don't even need/want to expose the address itself either? I.e. all the app knows is that there's a certain set of identities or that it created a new one with a given id. |
Thanks @jhedberg for proposing this API. I think it makes sense. In general I think it is a very good proposal. Here are some comments:
|
@jhedberg why not:
If the addr/irk params are NULL, then the stack populates them. Otherwise the stack takes the values coming from the app. |
About the index:
|
Here are a description of the real life use cases that are the reason behind the need for an approach with multiple identitiesUse case A:Use case A1:I have a BT enabled keyboard that supports only one bond at the time. I am now connected and bonded to Host A and want to pair with Host B. I press the pairing button on the keyboard. This operation deletes the bond the keyboard have to Host A (in the keyboard), and the keyboard starts advertising for a new bond. If we do not change our identity Host A will connect to keyboard immediately if within range and we cannot do a succesfull pairing with Host B. Use case A2:I have a BT enabled keyboard that can support up to i.e 3 bonds. The keyboard is only connected to one Host at the time, and it has 3 buttons that selects which host it should connect to. When searching for new bonds we will run into the same problems as in Usecase A1 If we do not operate with multiple identities Use case A3:I have a BT enabled keyboard that can support up to i.e 3 bonds The keyboard is CAN BE connected to all 3 hosts simultaneously, and it has 3 buttons or a host side SW that selects which host that shall receieve the HID inputs. When searching for new bonds we will run into the same problems as in Usecase A1 and A2 If we do not operate with multiple identities. However, in this use case we must also handle having simultaneous connections using different identites. Use case B:These are basically variants of the A3 use case with similar needs for multiple identies and connections. Use case B1:I have a BT enabled remote control that supports only one bond at the time. I am now connected and bonded to Host D and want to pair with Host E. I press the pairing button on the remote to start the pairing procedure towards Host E. However I still want the remote control to be fully operation towards Host D until the moment where the remote control is fully configured and bonded to Host E. Then HID input is routed to Host E and Host D is disconnected. Use case B2:I have a BT enabled multi remote control that supports multiple bonds The remote control is CAN BE connected to multiple hosts simultaneously (i.e. TV, set-top box, Hi-Fi, media centre), Different buttons can send HID events to one or multiple hosts. I.e a global "mute"-button could send the mute HID command to several of the hosts. |
Not sure I follow. The user is the one deleting the identity, so it should know not to use that index anymore unless it creates a new one. |
In practice, this is cumbersome because one part of the app doesn't know every other part. Being told that an identity is deprecated would make some things much easier. |
@jhn-nordic: Thanks for the use cases. |
I would like to cover the following possibilities here in this issue: a) Single identity, multiple IRKs, per-peer In each of the above the public address should be an identity, only if it exists. Additionally I would like to cover pre-provisioning of bonding information. This can be done in 2 ways:
I think I'd rather concentrate on 2) to avoid polluting the APIs. |
Hi @jhedberg, @carlescufi Here you have some of my thoughts:
|
@pizi-nordic bt_gatt_attr already takes the bt_conn as parameter with that the application should be able to tell what identity it is using. Also just to be clear here, when it comes to GATT database the stack only manages the attributes of the services it has registered, the only exception being CCCD when registered with BT_GATT_CCC and Id like to keep it like that, if you want any service to have advanced control using the identity addresses I guess we would need it to be part of the stack with kconfig entry to enable it, though it may be tricky with service that do require specialized application since that probably means profile specific public API on top of GATT. |
Thanks @Vudentz. I just wanted to be sure that this feature will be easy to use from application standpoint. |
Question: we have the public Another question: how important is it to extend this support for central role APIs? We have things like the following which may be affected:
Should we break those APIs as well? Another less intrusive alternative would be to have something like |
I think we need to know which identity we unpair from. Adding id as a parameter would work. As an example if you have a BLE keyboard that supports 3 bonds that you can select with 3 buttons you can do 3 pairings with the same host using 3 different identities (if you want). If you then call bt_unpair() with only the host address as a reference you would then unpair all the 3 bonds you have. the bt_unpair() in the API is quite new and I guess the pain of changing the API now will be much less painful than doing it on later stage. Regarding central role API I do not see a use for multiple IDs at the moment from my perspective (HID). Any comments @pizi-nordic @Qbicz ? |
I agree with @jhn-nordic. Regarding central role - it is probably not suffering from the limitation described in the HID use case, as usually the central initiates the connection. Moreover if central connects to one peripheral it does not prevent it from scanning and connecting to another peripheral. So for central having multiple identities is not that important. |
At the moment I do not see any use case for multiple identities for central role. |
In order to support the HID usecase, the BLE Host needs to be able to switch its identity address on the fly.
The parts involved in order to make this possible are:
The text was updated successfully, but these errors were encountered: