guint le_discovery_idle_timeout; /* timeout between le discovery runs */
#endif
guint passive_scan_timeout; /* timeout between passive scans */
- guint temp_devices_timeout; /* timeout for temporary devices */
guint pairable_timeout_id; /* pairable timeout id */
guint auth_idle_id; /* Pending authorization dequeue */
device_set_tx_power(dev, 127);
}
-static gboolean remove_temp_devices(gpointer user_data)
-{
- struct btd_adapter *adapter = user_data;
- GSList *l, *next;
-
- DBG("%s", adapter->path);
-
- adapter->temp_devices_timeout = 0;
-
- for (l = adapter->devices; l != NULL; l = next) {
- struct btd_device *dev = l->data;
-
- next = g_slist_next(l);
-
- if (device_is_temporary(dev) && !btd_device_is_connected(dev))
- btd_adapter_remove_device(adapter, dev);
- }
-
- return FALSE;
-}
-
static void discovery_cleanup(struct btd_adapter *adapter, int timeout)
{
GSList *l, *next;
adapter->discovery_idle_timeout = 0;
}
- if (adapter->temp_devices_timeout > 0) {
- g_source_remove(adapter->temp_devices_timeout);
- adapter->temp_devices_timeout = 0;
- }
-
g_slist_free_full(adapter->discovery_found,
invalidate_rssi_and_tx_power);
adapter->discovery_found = NULL;
btd_adapter_remove_device(adapter, dev);
}
-
- adapter->temp_devices_timeout = g_timeout_add_seconds(timeout,
- remove_temp_devices, adapter);
}
static void discovery_free(void *user_data)
adapter->discovery_type = 0x00;
#endif
- if (adapter->discovery_idle_timeout > 0) {
- g_source_remove(adapter->discovery_idle_timeout);
- adapter->discovery_idle_timeout = 0;
- }
-
- if (adapter->temp_devices_timeout > 0) {
- g_source_remove(adapter->temp_devices_timeout);
- adapter->temp_devices_timeout = 0;
- }
-
discovery_cleanup(adapter, 0);
- adapter->temp_devices_timeout = g_timeout_add_seconds(TEMP_DEV_TIMEOUT,
- remove_temp_devices, adapter);
}
static void discovery_disconnect(DBusConnection *conn, void *user_data)
adapter->discovery_idle_timeout = 0;
}
- if (adapter->temp_devices_timeout > 0) {
- g_source_remove(adapter->temp_devices_timeout);
- adapter->temp_devices_timeout = 0;
- }
-
discovery_cleanup(adapter, 0);
}
adapter->discovery_idle_timeout = 0;
}
- if (adapter->temp_devices_timeout > 0) {
- g_source_remove(adapter->temp_devices_timeout);
- adapter->temp_devices_timeout = 0;
- }
-
discovery_cleanup(adapter, 0);
g_slist_free(adapter->connect_list);