From: Amit Purwar Date: Tue, 28 Aug 2018 11:45:23 +0000 (+0530) Subject: Fixed the event for Gatt char changed value X-Git-Tag: accepted/tizen/unified/20180904.062826~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=326122da8376c5378f33313faa18bbec5b655fbe;p=platform%2Fcore%2Fapi%2Fbluetooth.git Fixed the event for Gatt char changed value Change-Id: If2626bc9503ba3b9a4d87ac5adc3cff8c1b347df Signed-off-by: Amit Purwar --- diff --git a/src/bluetooth-common.c b/src/bluetooth-common.c index 9b5110b..b1ca464 100644 --- a/src/bluetooth-common.c +++ b/src/bluetooth-common.c @@ -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: