From b703dc845fadbe8a5827585e802f9b3c425cff52 Mon Sep 17 00:00:00 2001 From: "h.sandeep" Date: Mon, 14 Nov 2016 14:25:42 +0530 Subject: [PATCH] iBeacon: Remove the ibeacon report signal handling The iBeacon report shall be extracted from AdvReport signal at CAPI layer as part of LE Device Found Updated callback Revert the below patch ==================================================== iBeacon: Add support for handling iBeacon reports. Change-Id: Ib0658eb8e610da76a588bb7f2cb21d580759626a Signed-off-by: h.sandeep ===================================================== Change-Id: I394a018271166af60c8bf28c981124e63606c820 Signed-off-by: h.sandeep --- bt-api/bt-event-handler.c | 49 ------------------------------ bt-service/bt-service-adapter-le.c | 30 ------------------ bt-service/bt-service-event-receiver.c | 19 ------------ bt-service/bt-service-event-sender.c | 3 -- bt-service/include/bt-service-adapter-le.h | 2 -- bt-service/include/bt-service-common.h | 13 -------- include/bluetooth-api.h | 15 --------- include/bt-internal-types.h | 1 - 8 files changed, 132 deletions(-) diff --git a/bt-api/bt-event-handler.c b/bt-api/bt-event-handler.c index 993eea4..ca129f0 100644 --- a/bt-api/bt-event-handler.c +++ b/bt-api/bt-event-handler.c @@ -370,43 +370,6 @@ done: return le_dev_info; } -static bluetooth_ibeacon_device_info_t *__bt_get_ibeacon_device_info_in_message(GVariant *parameters, int *ret) -{ - bluetooth_ibeacon_device_info_t *ibeacon_dev_info = NULL; - const char *address = NULL; - short addr_type = 0; - int company_id = 0; - int ibeacon_type = 0; - int major_id = 0; - int minor_id = 0; - int measured_power = 0; - const char *uuid = NULL; - int result = BLUETOOTH_ERROR_NONE; - - g_variant_get(parameters, "(i&snnn&snnn)", &result, &address, - &addr_type, &company_id, &ibeacon_type, &uuid, &major_id, &minor_id, &measured_power); - ibeacon_dev_info = g_malloc0(sizeof(bluetooth_ibeacon_device_info_t)); - if (ibeacon_dev_info == NULL) { - result = BLUETOOTH_ERROR_MEMORY_ALLOCATION; - goto done; - } - - _bt_convert_addr_string_to_type(ibeacon_dev_info->device_address.addr, address); - ibeacon_dev_info->addr_type = addr_type; - ibeacon_dev_info->company_id = company_id; - ibeacon_dev_info->ibeacon_type = ibeacon_type; - ibeacon_dev_info->major_id = major_id; - ibeacon_dev_info->minor_id = minor_id; - ibeacon_dev_info->measured_power = measured_power; - ibeacon_dev_info->uuid_len = strlen(uuid); - memcpy(ibeacon_dev_info->uuid, uuid, ibeacon_dev_info->uuid_len); -done: - - *ret = result; - - return ibeacon_dev_info; -} - gboolean __bt_reliable_disable_cb(gpointer user_data) { BT_DBG("+"); @@ -786,18 +749,6 @@ void __bt_adapter_le_event_filter(GDBusConnection *connection, } g_free(le_device_info); - } else if (strcasecmp(signal_name, BT_IBEACON_DEVICE_FOUND) == 0) { - bluetooth_ibeacon_device_info_t *ibeacon_device_info; - BT_DBG("BT_IBEACON_DEVICE_FOUND"); - ibeacon_device_info = __bt_get_ibeacon_device_info_in_message(parameters, - &result); - ret_if(ibeacon_device_info == NULL); - - _bt_common_event_cb(BLUETOOTH_EVENT_REMOTE_IBEACON_DEVICE_FOUND, - result, ibeacon_device_info, - event_info->cb, event_info->user_data); - - g_free(ibeacon_device_info); } } diff --git a/bt-service/bt-service-adapter-le.c b/bt-service/bt-service-adapter-le.c index e124352..02a97db 100644 --- a/bt-service/bt-service-adapter-le.c +++ b/bt-service/bt-service-adapter-le.c @@ -1945,36 +1945,6 @@ void _bt_send_scan_result_event(const bt_remote_le_dev_info_t *le_dev_info, } } -void _bt_send_ibeacon_scan_result_event(const bt_remote_ibeacon_dev_info_t *ibeacon_dev_info) -{ - int result = BLUETOOTH_ERROR_NONE; - GSList *l; - GVariant *param; - bt_adapter_le_scanner_t *scanner = NULL; - - ret_if(ibeacon_dev_info == NULL); - BT_DBG("_bt_send_ibeacon_scan_result_event"); - - for (l = scanner_list; l != NULL; l = g_slist_next(l)) { - scanner = l->data; - if (scanner->is_scanning == FALSE) - continue; - - param = g_variant_new("(isnnnsnnn)", - result, - ibeacon_dev_info->address, - ibeacon_dev_info->addr_type, - ibeacon_dev_info->company_id, - ibeacon_dev_info->ibeacon_type, - ibeacon_dev_info->uuid, - ibeacon_dev_info->major_id, - ibeacon_dev_info->minor_id, - ibeacon_dev_info->measured_power); - - _bt_send_event(BT_LE_ADAPTER_EVENT, BLUETOOTH_EVENT_REMOTE_IBEACON_DEVICE_FOUND, param); - } -} - int _bt_add_white_list(bluetooth_device_address_t *device_address, bluetooth_device_address_type_t address_type) { GDBusProxy *proxy; diff --git a/bt-service/bt-service-event-receiver.c b/bt-service/bt-service-event-receiver.c index 428e5f3..48b83da 100644 --- a/bt-service/bt-service-event-receiver.c +++ b/bt-service/bt-service-event-receiver.c @@ -2261,25 +2261,6 @@ void _bt_handle_device_event(GVariant *msg, const char *member, const char *path event, param); g_free(address); - } else if (strcasecmp(member, "iBeaconReport") == 0) { - bt_remote_ibeacon_dev_info_t *ibeacon_dev_info = NULL; - - ret_if(_bt_is_le_scanning() == FALSE); - - ibeacon_dev_info = g_malloc0(sizeof(bt_remote_ibeacon_dev_info_t)); - if (ibeacon_dev_info == NULL) - return; - - g_variant_get(msg, "(syuusuuy)", &ibeacon_dev_info->address, - &ibeacon_dev_info->addr_type, - &ibeacon_dev_info->company_id, - &ibeacon_dev_info->ibeacon_type, - &ibeacon_dev_info->uuid, - &ibeacon_dev_info->major_id, - &ibeacon_dev_info->minor_id, - &ibeacon_dev_info->measured_power); - _bt_send_ibeacon_scan_result_event(ibeacon_dev_info); - g_free(ibeacon_dev_info); } } diff --git a/bt-service/bt-service-event-sender.c b/bt-service/bt-service-event-sender.c index d269e75..40c19d3 100644 --- a/bt-service/bt-service-event-sender.c +++ b/bt-service/bt-service-event-sender.c @@ -421,9 +421,6 @@ int _bt_send_event(int event_type, int event, GVariant *param) case BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED: signal = BT_LE_DATA_LENGTH_CHANGED; break; - case BLUETOOTH_EVENT_REMOTE_IBEACON_DEVICE_FOUND: - signal = BT_IBEACON_DEVICE_FOUND; - break; case BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED: signal = BT_PXP_PROPERTY_CHANGED; break; diff --git a/bt-service/include/bt-service-adapter-le.h b/bt-service/include/bt-service-adapter-le.h index 6c79a6e..124a270 100644 --- a/bt-service/include/bt-service-adapter-le.h +++ b/bt-service/include/bt-service-adapter-le.h @@ -115,8 +115,6 @@ bt_le_scan_type_t _bt_get_le_scan_type(void); void _bt_send_scan_result_event(const bt_remote_le_dev_info_t *le_dev_info, const bt_le_adv_info_t *adv_info); -void _bt_send_ibeacon_scan_result_event(const bt_remote_ibeacon_dev_info_t *ibeacon_dev_info); - int _bt_add_white_list(bluetooth_device_address_t *device_address, bluetooth_device_address_type_t address_type); int _bt_remove_white_list(bluetooth_device_address_t *device_address, bluetooth_device_address_type_t address_type); diff --git a/bt-service/include/bt-service-common.h b/bt-service/include/bt-service-common.h index 2753d13..814a620 100644 --- a/bt-service/include/bt-service-common.h +++ b/bt-service/include/bt-service-common.h @@ -304,19 +304,6 @@ typedef struct { } bt_remote_le_dev_info_t; typedef struct { - char *address; - int addr_type; - int rssi; - int adv_type; - int company_id; - int ibeacon_type; - int major_id; - int minor_id; - int measured_power; - char *uuid; -} bt_remote_ibeacon_dev_info_t; - -typedef struct { int rssi; int class; char *address; diff --git a/include/bluetooth-api.h b/include/bluetooth-api.h index 20cfd24..1b5e7b8 100644 --- a/include/bluetooth-api.h +++ b/include/bluetooth-api.h @@ -531,7 +531,6 @@ typedef enum { BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */ BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */ BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */ - BLUETOOTH_EVENT_REMOTE_IBEACON_DEVICE_FOUND, /**< Bluetooth event remote ibeacon device found (iBeacon LE dev) */ BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/ BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */ BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED, /**< Bluetooth event bonding removed */ @@ -1011,20 +1010,6 @@ typedef struct { } bluetooth_le_device_info_t; typedef struct { - bluetooth_device_address_t device_address; /**< device address */ - int addr_type; /**< address type*/ - int rssi; /**< received strength signal*/ - int adv_type; - int company_id; /** */ - int ibeacon_type; /** */ - int major_id; /** */ - int minor_id; /** */ - int measured_power; /** */ - int uuid_len; /** */ - char uuid[BLUETOOTH_UUID_STRING_MAX]; /** */ -} bluetooth_ibeacon_device_info_t; - -typedef struct { int slot_id; bluetooth_le_scan_filter_feature_t added_features; /**< added features */ bluetooth_device_address_t device_address; /**< device address */ diff --git a/include/bt-internal-types.h b/include/bt-internal-types.h index 878a19d..c9ccce9 100644 --- a/include/bt-internal-types.h +++ b/include/bt-internal-types.h @@ -522,7 +522,6 @@ typedef struct { #define BT_IPSP_CONNECTED "IpspConnected" #define BT_IPSP_DISCONNECTED "IpspDisconnected" #define BT_LE_DATA_LENGTH_CHANGED "LEDataLengthChanged" -#define BT_IBEACON_DEVICE_FOUND "iBeaconDeviceFound" #define BT_PXP_PROPERTY_CHANGED "PxpValueChanged" #ifdef __cplusplus -- 2.7.4