GSList *connections; /* Connected devices */
GSList *devices; /* Devices structure pointers */
GSList *connect_list; /* Devices to connect when found */
+ bool passive_scanning; /* Passive (LE) scanning enabled */
sdp_list_t *services; /* Services associated to adapter */
bool toggle_discoverable; /* discoverable needs to be changed */
if (status == MGMT_STATUS_SUCCESS) {
adapter->discovery_type = rp->type;
adapter->discovery_enable = 0x01;
+ adapter->passive_scanning = true;
}
}
adapter->discovery_type = ev->type;
adapter->discovery_enable = ev->discovering;
+ if (!adapter->discovery_enable)
+ adapter->passive_scanning = false;
+
/*
* Check for existing discoveries triggered by client applications
* and ignore all others.
dev);
done:
+ /* Don't trigger LE connections through normal discovery */
+ if (!adapter->passive_scanning)
+ return;
+
if (device_is_le(dev) && !device_is_connected(dev) &&
g_slist_find(adapter->connect_list, dev)) {
err = device_connect_le(dev);