Bluetooth: GATT: Use check_perm to check CCC permission
This moves check_perm code under GAT and make use of it to check if CCC write permission can be attended by the connection security level or if it needs to be increased. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
03b9ce487c
commit
4f3892c0eb
5 changed files with 92 additions and 61 deletions
|
@ -1085,6 +1085,16 @@ int bt_conn_set_security(struct bt_conn *conn, bt_security_t sec)
|
|||
|
||||
return err;
|
||||
}
|
||||
|
||||
bt_security_t bt_conn_get_security(struct bt_conn *conn)
|
||||
{
|
||||
return conn->sec_level;
|
||||
}
|
||||
#else
|
||||
bt_security_t bt_conn_get_security(struct bt_conn *conn)
|
||||
{
|
||||
return BT_SECURITY_L1;
|
||||
}
|
||||
#endif /* CONFIG_BT_SMP */
|
||||
|
||||
void bt_conn_cb_register(struct bt_conn_cb *cb)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue