Fix : ADV_IND data is not present while le scanning 41/101641/1
authorInjun Yang <injun.yang@samsung.com>
Thu, 1 Dec 2016 11:55:43 +0000 (20:55 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 2 Dec 2016 00:16:53 +0000 (09:16 +0900)
[Problem] While LE scanning, ADV_IND data is not present
[Cause & Measure] ADV_IND data is not delivered to application
[Checking Method] LE scan

Change-Id: I5b3a535eb5cd080070e03e913dfa6669d0a28bf6
Signed-off-by: Injun Yang <injun.yang@samsung.com>
bt-service/bt-service-event-receiver.c

index 335a1ab60ec85bed9e9792b40c11273184c52a9b..1824a258fa2061e32e30188884da3c5ccb39dbbb 100644 (file)
@@ -2189,12 +2189,13 @@ void _bt_handle_device_event(GVariant *msg, const char *member, const char *path
 
                if (le_dev_info->adv_type != BT_LE_ADV_SCAN_RSP) {       /* ADV_IND */
                        adv_info = g_malloc0(sizeof(bt_le_adv_info_t));
-
                        adv_info->addr = g_strdup(le_dev_info->address);
                        adv_info->addr_type = le_dev_info->addr_type;
                        adv_info->rssi = le_dev_info->rssi;
                        adv_info->data_len = le_dev_info->adv_data_len;
                        adv_info->data = g_malloc0(le_dev_info->adv_data_len);
+                       memcpy(adv_info->data, le_dev_info->adv_data,
+                                       le_dev_info->adv_data_len);
 
                        if (__bt_add_adv_ind_info(adv_info) == 0) {
                                adv_info->timer_id = g_timeout_add(1000,