Store EIR Manufacturer specific data into the device information 23/270223/1 accepted/tizen/unified/20220206.211909 submit/tizen/20220127.054201
authordh79pyun <dh79.pyun@samsung.com>
Thu, 27 Jan 2022 00:44:26 +0000 (09:44 +0900)
committerdh79pyun <dh79.pyun@samsung.com>
Thu, 27 Jan 2022 00:44:26 +0000 (09:44 +0900)
Change-Id: Ia3d9d62db972f394d30b9db934bbceee6977098f
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
bt-oal/bluez_hal/src/bt-hal-device-dbus-handler.c
bt-oal/common/oal-common.c
bt-oal/include/oal-manager.h
bt-oal/oal-device-mgr.c

index a42671d..4b6037b 100644 (file)
@@ -937,6 +937,8 @@ static gboolean __bt_device_bonded_device_info_cb(gpointer user_data)
                        data_len = g_variant_get_uint16(value);
                        DBG("LegacyManufacturerDataLen [%d]", data_len);
                } else if (!g_strcmp0(key, "LegacyManufacturerData")) {
+                       DBG("LegacyManufacturerData");
+
                        manufacturer_data = g_byte_array_new();
                        g_variant_get(value, "ay", &char_value_iter);
                        while (g_variant_iter_loop(char_value_iter, "y", &char_value))
@@ -947,7 +949,7 @@ static gboolean __bt_device_bonded_device_info_cb(gpointer user_data)
                        if (manufacturer_data) {
                                if (manufacturer_data->len > 0) {
                                        size += __bt_insert_hal_properties(
-                                                       buf + size, HAL_PROP_DEVICE_BLE_ADV_DATA,
+                                                       buf + size, HAL_PROP_DEVICE_MANUFACTURER_DATA,
                                                        manufacturer_data->len, manufacturer_data->data);
                                        ev->num_props++;
                                }
index 4119ac8..4800357 100644 (file)
@@ -127,6 +127,7 @@ void parse_device_properties(int num_properties, bt_property_t *properties,
                        dev_info->type = dev_type - 1;//OAL enum starts with 0 and Bluedroid with 1
                        break;
                }
+               case BT_PROPERTY_REMOTE_DEVICE_MANUFACTURER_DATA:
                case BT_PROPERTY_REMOTE_BLE_ADV_DATA: {
                        if (adv_info) {
                                adv_info->adv_data = properties[i].val;
index 8a1ab7d..abcbb7f 100755 (executable)
@@ -44,7 +44,7 @@ extern "C" {
 
 #define BLUETOOTH_UUID_STRING_MAX       50
 
-#define BT_DEVICE_MANUFACTURER_DATA_LEN_MAX 31 /**<This specifies the Maximum manufacturer data Length>*/
+#define BT_DEVICE_MANUFACTURER_DATA_LEN_MAX 62 /**<This specifies the Maximum manufacturer data Length>*/
 
 typedef void (*oal_event_callback)(int event, gpointer event_data, gsize size);
 
index d0d9d35..c192336 100755 (executable)
@@ -705,9 +705,25 @@ void cb_device_properties(bt_status_t status, bt_bdaddr_t *bd_addr,
                        memcpy(&dev_props_event->device_info,
                                dev_info, sizeof(remote_device_t));
                } else {
+                       int i;
+
                        BT_DBG("BREDR type Device");
+
+                       /* Legacy Manufacturer data */
+                       if (adv_info.len > 0) {
+                               dev_props_event->adv_len = adv_info.len;
+                               if (dev_props_event->adv_len > 0)
+                                       memcpy(dev_props_event->adv_data,
+                                               adv_info.adv_data, adv_info.len);
+
+                               for (i = 0; i < dev_props_event->adv_len; i++)
+                                       BT_DBG("Adv Data[%d] = [0x%x]",
+                                               i, dev_props_event->adv_data[i]);
+                       }
+
                        memcpy(&dev_props_event->device_info,
                                dev_info, sizeof(remote_device_t));
+
                }
 
                event_data = dev_props_event;