summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGrzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>2018-05-29 10:32:18 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2018-05-29 14:06:34 +0300
commitf2638d131e0cf0b0a9cb2d2077352b21e719107f (patch)
tree9a0caa3dcfdbcd6c36ad48c5b648b2003458f3f3 /src
parent1e32752f38447d301d9cfe877c784c14f0364c6f (diff)
downloadbluez-f2638d131e0cf0b0a9cb2d2077352b21e719107f.tar.gz
gatt: Don't require prepare write authorization for trusted devices
This patch adds possibility to ommit prepare write authorization request from trusted devices.
Diffstat (limited to 'src')
-rw-r--r--src/gatt-database.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gatt-database.c b/src/gatt-database.c
index 22c78e840..99c8ea231 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
@@ -2569,7 +2569,8 @@ static void desc_write_cb(struct gatt_db_attribute *attrib,
}
if (opcode == BT_ATT_OP_PREP_WRITE_REQ) {
- if (!desc->prep_authorized && desc->req_prep_authorization)
+ if (!device_is_trusted(device) && !desc->prep_authorized &&
+ desc->req_prep_authorization)
send_write(device, attrib, desc->proxy,
desc->pending_writes, id, value, len,
offset, bt_att_get_link_type(att),
@@ -2672,7 +2673,8 @@ static void chrc_write_cb(struct gatt_db_attribute *attrib,
queue = NULL;
if (opcode == BT_ATT_OP_PREP_WRITE_REQ) {
- if (!chrc->prep_authorized && chrc->req_prep_authorization)
+ if (!device_is_trusted(device) && !chrc->prep_authorized &&
+ chrc->req_prep_authorization)
send_write(device, attrib, chrc->proxy, queue,
id, value, len, offset,
bt_att_get_link_type(att), true, true);