Fixed the event for Gatt char changed value 59/187859/1
authorAmit Purwar <amit.purwar@samsung.com>
Tue, 28 Aug 2018 11:45:23 +0000 (17:15 +0530)
committerAmit Purwar <amit.purwar@samsung.com>
Wed, 29 Aug 2018 04:12:11 +0000 (09:42 +0530)
Change-Id: If2626bc9503ba3b9a4d87ac5adc3cff8c1b347df
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
src/bluetooth-common.c

index 9b5110b..b1ca464 100644 (file)
@@ -1173,6 +1173,9 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
        bt_pxp_property_changed_params_t *bt_pxp_property_info = NULL;
        bluetooth_tds_activation_req_t *tds_act_req_info = NULL;
 
+#ifdef TIZEN_GATT_CLIENT
+       bt_gatt_char_property_t *char_prop = NULL;
+#endif
        if (!__bt_need_to_handle(event))
                return;
 
@@ -2204,15 +2207,29 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
        }
 #endif
        case BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED:
+               BT_INFO("BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED");
+#ifdef TIZEN_GATT_CLIENT
+               char_prop = (bt_gatt_char_property_t*)(param->param_data);
+
+               if (char_prop == NULL)
+                       return;
+               BT_INFO("Address [%s]", char_prop->address);
+               BT_INFO("Val len [%d]", char_prop->val_len);
+               BT_INFO("Event index [%d]", event_index);
+
+               ((_bt_gatt_client_val_changed_cb)bt_event_slot_container[event_index].callback)
+                       (char_prop->prop.uuid, char_prop->address, char_prop->value, char_prop->val_len,
+                       bt_event_slot_container[event_index].user_data);
+#else
                char_val = (bt_gatt_char_value_t *)(param->param_data);
 
                if (char_val == NULL)
                        return;
 
                ((_bt_gatt_client_value_changed_cb)bt_event_slot_container[event_index].callback)
-                (char_val->char_handle, char_val->char_value, char_val->val_len,
-                 bt_event_slot_container[event_index].user_data);
-
+                       (char_val->char_handle, char_val->char_value, char_val->val_len,
+                       bt_event_slot_container[event_index].user_data);
+#endif
                break;
 #ifdef TIZEN_GATT_CLIENT
        case BLUETOOTH_EVENT_GATT_READ_CHAR: