-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Description
Is your feature request related to a problem? Please describe.
It is desirable for the app to dynamically filter pairing requests on the AuthReq content, in this case the Bonding_Flags, to decide whether to accept or reject an attempt. It can be extended with information on IO Caps, OOB, Max Encryption Key Size and Key Distribution fields.
This feature request is a dynamic solution opposing the static proposal in PR#21002 and with optionally much more information.
Describe the solution you'd like
Add a function to the SMP API such as bt_smp_get_pairing_info(const struct bt_conn *conn, struct bt_smp_pairing_info *info) that returns information including, but not limited to, AuthReq parameters for a connection. It can also include the rest of the fields available during pairing.
It will be the callers responsibility to call this function at the right time e.g. during pairing_confirm. In case the SMP should not expose a public API it can be called from conn.c instead.
This feature can be implemented as an addition to the current API and is functionally non-intrusive.
Describe alternatives you've considered
Besides the static solution in PR#21002 there is currently no way for the app to detect this parameter.
Alternatively, for this particular case, the pairing_confirm callback could be extended with a bond_flag parameter similar to pairing_complete. This implies an API change.
Second alternative could be to add void (*pairing_info)(struct bt_conn *conn, struct bt_conn_pairing_info *info) to bt_conn_auth_cb providing additional information during pairing_req, pairing_rsp and security_req.