resolving merge conflict with StartNotify 43/188243/1
authorAvichal Agarwal <avichal.a@samsung.com>
Mon, 3 Sep 2018 09:03:18 +0000 (14:33 +0530)
committerAvichal Agarwal <avichal.a@samsung.com>
Mon, 3 Sep 2018 09:03:18 +0000 (14:33 +0530)
Using same structure as defined for
signal BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED

Change-Id: Iac3a18c7b76105e765892ba0e8d6d33115cd1e68

bt-api/bt-gatt-client.c

index 8f79ce3..7e9c2e7 100755 (executable)
@@ -2192,17 +2192,17 @@ static gboolean  bluetooth_gatt_client_notify_channel_watch_cb(GIOChannel *gio,
                        return FALSE;
                }
 
-               if (len > 0) {
+               if (len > 0 && len < chr_info->mtu) {
 
-                       bt_gatt_notify_req_t char_val;
+                       bt_gatt_char_property_t char_val;
                        BT_INFO("FD io sending  value changed %s %d \ni", buffer, len);
 
                        char_val.val = g_malloc0(len + 1);
 
-                       memcpy(char_val.UUID, chr_info->UUID, 16);
+                       memcpy(char_val.prop.uuid, chr_info->UUID, 16);
                        memcpy(char_val.val, buffer, len);
-                       char_val.len = len;
-                       memcpy(char_val.adress, chr_info->adress, 18);
+                       char_val.val_len = len;
+                       memcpy(char_val.address, chr_info->adress, 18);
 
                        event_info = _bt_event_get_cb_data(BT_GATT_CLIENT_EVENT);
 
@@ -2217,12 +2217,12 @@ static gboolean  bluetooth_gatt_client_notify_channel_watch_cb(GIOChannel *gio,
 
                        g_free(char_val.val);
 
-               }
+               } else
+                       BT_ERR("Packet corrupted");
                g_free(buffer);
 
                return TRUE;
        }
-
        if (cond & (G_IO_NVAL | G_IO_HUP | G_IO_ERR)) {
                BT_ERR("Error : GIOCondition %d, [%s]", cond, chr_info->UUID);
                g_io_channel_shutdown(gio, TRUE, NULL);