From 6b12b07e143a8f48eafee8608fa0d0414055e377 Mon Sep 17 00:00:00 2001 From: Ayush Garg Date: Tue, 19 Jan 2021 10:27:26 +0530 Subject: [PATCH] [GATT] Send prepare_authorize parameter to HAL layer. In GATT Server role, prepare_authorize parameter will be used to ask authorization permission from the application when ATT_PREPARE_WRITE_REQUEST PDU receive for the first time in case of long write. This patchset should be merged with the following bluetooth-frwk's patchset in order to match API and avoid crash: bluetooth-frwk Change-Id: Ic4397ae86760177e08ccd283e80d4526bd32e0c4 Change-Id: I93bc46151ebbe695c74b224c3a3579c6e5d0de14 Signed-off-by: Ayush Garg --- src/gatt-database.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gatt-database.c b/src/gatt-database.c index 5f94576..927224e 100644 --- a/src/gatt-database.c +++ b/src/gatt-database.c @@ -2615,6 +2615,7 @@ static void write_setup_cb(DBusMessageIter *iter, void *user_data) char dst_addr[18] = { 0 }; char *addr_value = dst_addr; gboolean response_needed = FALSE; + gboolean prep_auth = FALSE; if (device_get_rpa_exist(op->device) == true) { ba2str(device_get_rpa(op->device), dst_addr); @@ -2628,6 +2629,9 @@ static void write_setup_cb(DBusMessageIter *iter, void *user_data) if (op->opcode == BT_ATT_OP_WRITE_REQ) response_needed = TRUE; dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &response_needed); + if (op->prep_authorize) + prep_auth = TRUE; + dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &prep_auth); #endif dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "y", &array); -- 2.7.4