GATT: Handle prepare_authorize parameter in WriteValue DBUS API
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / bluez_hal / src / bt-hal-gatt-server.c
index 2f093c3..a028010 100644 (file)
@@ -262,6 +262,7 @@ static const gchar characteristics_introspection_xml[] =
 "               <arg type='u' name='id' direction='in'/>"
 "               <arg type='q' name='offset' direction='in'/>"
 "               <arg type='b' name='response_needed' direction='in'/>"
+"               <arg type='b' name='prep_authorize' direction='in'/>"
 "               <arg type='ay' name='value' direction='in'/>"
 "        </method>"
 "       <method name ='AcquireWrite'>"
@@ -320,6 +321,7 @@ static const gchar descriptor_introspection_xml[] =
 "               <arg type='u' name='id' direction='in'/>"
 "               <arg type='q' name='offset' direction='in'/>"
 "               <arg type='b' name='response_needed' direction='in'/>"
+"               <arg type='b' name='prep_authorize' direction='in'/>"
 "               <arg type='ay' name='value' direction='in'/>"
 "        </method>"
 "  </interface>"
@@ -1116,6 +1118,7 @@ static void __bt_gatt_desc_method_call(GDBusConnection *connection,
                guint req_id = 0;
                guint16 offset = 0;
                gboolean response_needed = FALSE;
+               gboolean prep_authorize = FALSE;
                struct hal_ev_gatt_server_write_req ev;
                int desc_hdl = -1;
                int len;
@@ -1130,10 +1133,13 @@ static void __bt_gatt_desc_method_call(GDBusConnection *connection,
                DBG("Application path = %s", object_path);
                DBG("Sender = %s", sender);
 
-               g_variant_get(parameters, "(&suqb@ay)",
-                               &addr, &req_id, &offset, &response_needed, &var);
+               g_variant_get(parameters, "(&suqbb@ay)",
+                               &addr, &req_id, &offset, &response_needed, &prep_authorize, &var);
                DBG("Request id = %u, Offset = %u", req_id, offset);
 
+               if (prep_authorize)
+                       DBG("prep_authorize = true");
+
                /* Check if device is already in connected list */
                conn_info = __bt_find_remote_gatt_client_info(addr);
 
@@ -1261,6 +1267,7 @@ static void __bt_gatt_char_method_call(GDBusConnection *connection,
                guint req_id = 0;
                guint16 offset = 0;
                gboolean response_needed = FALSE;
+               gboolean prep_authorize = FALSE;
                struct hal_ev_gatt_server_write_req ev;
                int char_hdl = -1;
                int len;
@@ -1273,10 +1280,13 @@ static void __bt_gatt_char_method_call(GDBusConnection *connection,
 
                DBG("WriteValue : Application path %s, sender %s", object_path, sender);
 
-               g_variant_get(parameters, "(&suqb@ay)",
-                               &addr, &req_id, &offset, &response_needed, &var);
+               g_variant_get(parameters, "(&suqbb@ay)",
+                               &addr, &req_id, &offset, &response_needed, &prep_authorize, &var);
                DBG("Request id = %u, Offset = %u", req_id, offset);
 
+               if (prep_authorize)
+                       DBG("prep_authorize = true");
+
                svc_info = __bt_gatt_find_gatt_service_from_char(object_path, &char_hdl);
 
                /* Check if device is already in connected list */