From c21c706a50c50ab97ad266e9e33044eba4f26e04 Mon Sep 17 00:00:00 2001 From: Lukasz Rymanowski Date: Thu, 12 Feb 2015 18:00:07 +0100 Subject: [PATCH] shared/gatt-client: Expose API to set/get security level on att --- src/shared/gatt-client.c | 17 +++++++++++++++++ src/shared/gatt-client.h | 3 +++ 2 files changed, 20 insertions(+) diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c index a7c52dc92..5a3939b54 100644 --- a/src/shared/gatt-client.c +++ b/src/shared/gatt-client.c @@ -2644,3 +2644,20 @@ bool bt_gatt_client_unregister_notify(struct bt_gatt_client *client, complete_unregister_notify(notify_data); return true; } + +bool bt_gatt_client_set_sec_level(struct bt_gatt_client *client, + int level) +{ + if (!client) + return false; + + return bt_att_set_sec_level(client->att, level); +} + +int bt_gatt_client_get_sec_level(struct bt_gatt_client *client) +{ + if (!client) + return -1; + + return bt_att_get_sec_level(client->att); +} diff --git a/src/shared/gatt-client.h b/src/shared/gatt-client.h index b84fa13e7..d4358cf31 100644 --- a/src/shared/gatt-client.h +++ b/src/shared/gatt-client.h @@ -117,3 +117,6 @@ unsigned int bt_gatt_client_register_notify(struct bt_gatt_client *client, bt_gatt_client_destroy_func_t destroy); bool bt_gatt_client_unregister_notify(struct bt_gatt_client *client, unsigned int id); + +bool bt_gatt_client_set_sec_level(struct bt_gatt_client *client, int level); +int bt_gatt_client_get_sec_level(struct bt_gatt_client *client); -- 2.47.3