summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-01-21 22:51:23 +0100
committerMarcel Holtmann <marcel@holtmann.org>2009-01-21 22:51:23 +0100
commitfe697fea5b178b866d566e78d83e793f5aa7d862 (patch)
tree69a5937edf387f0149f279baa5b8b267f19f05f3
parentfc12c78cc7d2a442a52c96d1c0c1912bff309a43 (diff)
downloadconnman-fe697fea5b178b866d566e78d83e793f5aa7d862.tar.gz
connman-fe697fea5b178b866d566e78d83e793f5aa7d862.tar.bz2
connman-fe697fea5b178b866d566e78d83e793f5aa7d862.zip
Reset scan trigger when scanning was performed
-rw-r--r--src/device.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index 69604ddd..8427a2c9 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1253,6 +1253,17 @@ int connman_device_set_scanning(struct connman_device *device,
g_dbus_send_message(connection, signal);
if (scanning == TRUE) {
+ if (device->scan_timeout > 0) {
+ g_source_remove(device->scan_timeout);
+ device->scan_timeout = 0;
+ }
+
+ if (device->scan_interval > 0) {
+ guint interval = device->scan_interval;
+ device->scan_timeout = g_timeout_add_seconds(interval,
+ device_scan_trigger, device);
+ }
+
g_hash_table_foreach(device->networks,
mark_network_unavailable, NULL);
return 0;