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:
Luiz Augusto von Dentz 2019-09-17 16:50:51 +03:00 committed by Johan Hedberg
commit 4f3892c0eb
5 changed files with 92 additions and 61 deletions

View file

@ -334,6 +334,12 @@ typedef enum __packed {
*/
int bt_conn_set_security(struct bt_conn *conn, bt_security_t sec);
/** @brief Get security level for a connection.
*
* @return Connection security level
*/
bt_security_t bt_conn_get_security(struct bt_conn *conn);
static inline int __deprecated bt_conn_security(struct bt_conn *conn,
bt_security_t sec)
{