It will allow to change security from external profile, for example in hog implementation. --- android/gatt.c | 11 +++++++++++ android/gatt.h | 1 + 2 files changed, 12 insertions(+) diff --git a/android/gatt.c b/android/gatt.c index 31558d0..49ca2b6 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -2860,6 +2860,17 @@ static bool set_security(struct gatt_device *device, int req_sec_level) return true; } +bool bt_gatt_set_security(const bdaddr_t *bdaddr, int sec_level) +{ + struct gatt_device *device; + + device = find_device_by_addr(bdaddr); + if (!device) + return false; + + return set_security(device, sec_level); +} + static bool set_auth_type(struct gatt_device *device, int auth_type) { int sec_level; diff --git a/android/gatt.h b/android/gatt.h index 5ba9161..027dda3 100644 --- a/android/gatt.h +++ b/android/gatt.h @@ -38,3 +38,4 @@ bool bt_gatt_unregister_app(unsigned int id); bool bt_gatt_connect_app(unsigned int id, const bdaddr_t *addr); bool bt_gatt_disconnect_app(unsigned int id, const bdaddr_t *addr); +bool bt_gatt_set_security(const bdaddr_t *bdaddr, int sec_level); -- 1.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html