Remove unnecessary logic on LE scan 89/221489/2
authorinjun.yang <injun.yang@samsung.com>
Fri, 3 Jan 2020 04:25:23 +0000 (13:25 +0900)
committerYang <injun.yang@samsung.com>
Mon, 6 Jan 2020 06:10:09 +0000 (06:10 +0000)
Change-Id: I6631717785498099dfbe1b9e60043888d6ad49ae

bt-oal/bluez_hal/src/bt-hal-event-receiver.c

index 2b08001..4da1bf2 100644 (file)
@@ -669,6 +669,8 @@ static gboolean __bt_hal_parse_device_properties(GVariant *item)
        gchar *key;
        GVariant *val;
        gsize len = 0;
+       gboolean is_bredr_dev = FALSE;
+
        if (!item)
                return FALSE;
        DBG("+");
@@ -685,7 +687,6 @@ static gboolean __bt_hal_parse_device_properties(GVariant *item)
        while (g_variant_iter_loop(&iter, "{sv}", &key, &val)) {
 
                if (strcasecmp(key, "Address") == 0)  {
-
                        char * address = NULL;
                        address = g_variant_dup_string(val, &len);
                        uint8_t bdaddr[6];
@@ -697,12 +698,18 @@ static gboolean __bt_hal_parse_device_properties(GVariant *item)
                        ev->num_props++;
                        DBG("Device address [%s] property Num [%d]", address, ev->num_props);
                        g_free(address);
+               } else if (strcasecmp(key, "AddressType") == 0) {
+                       char *addresstype = g_variant_dup_string(val, &len);
+                       if (addresstype)
+                               DBG("AddressType [%s]", addresstype);
+                       g_free(addresstype);
                } else if (strcasecmp(key, "Class") == 0) {
                        unsigned int class = g_variant_get_uint32(val);
                        size += __bt_insert_hal_properties(buf + size, HAL_PROP_DEVICE_CLASS,
                                        sizeof(unsigned int), &class);
                        ev->num_props++;
                        DBG("Device class [%d] Property num [%d]", class, ev->num_props);
+                       is_bredr_dev = TRUE;
                } else if (strcasecmp(key, "name") == 0) {
                        char *name = g_variant_dup_string(val, &len);
                        if (name) {
@@ -793,7 +800,7 @@ static gboolean __bt_hal_parse_device_properties(GVariant *item)
        }
        DBG("-");
 
-       if (size > 1) {
+       if (size > 1 && is_bredr_dev) {
                DBG("Send Device found event to HAL user, Num Prop [%d] total size [%zd]", ev->num_props, size);
                event_cb(HAL_EV_DEVICE_FOUND, (void*) buf, size);
        }