gatt client adaptation feature changes on HAL
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / bluez_hal / src / bt-hal-gatt-server.c
index 97529fd..a3c3a18 100644 (file)
@@ -234,8 +234,9 @@ static const gchar characteristics_introspection_xml[] =
 "        </method>"
 "        <method name='WriteValue'>"
 "               <arg type='s' name='address' direction='in'/>"
-"               <arg type='y' name='id' direction='in'/>"
+"               <arg type='u' name='id' direction='in'/>"
 "               <arg type='q' name='offset' direction='in'/>"
+"               <arg type='b' name='response_needed' direction='in'/>"
 "               <arg type='ay' name='value' direction='in'/>"
 "        </method>"
 "        <method name='StartNotify'>"
@@ -1089,6 +1090,7 @@ static void __bt_gatt_char_method_call(GDBusConnection *connection,
                gboolean response_needed = FALSE;
                struct hal_ev_gatt_server_write_req ev;
                int char_hdl = -1;
+               int len;
 
                struct gatt_service_info *svc_info = NULL;
                struct gatt_req_info *req_info = NULL;
@@ -1116,6 +1118,14 @@ static void __bt_gatt_char_method_call(GDBusConnection *connection,
                        return;
                }
 
+               len = g_variant_get_size(var);
+               if (len > 0) {
+                       char *data;
+                       data = (char *)g_variant_get_data(var);
+                       memcpy(ev.value, data, len);
+                       ev.length = len;
+               }
+
                if (response_needed) {
                        /* Store requets information */
                        req_info = g_new0(struct gatt_req_info, 1);