From: Marcel Holtmann Date: Sun, 13 Sep 2009 15:34:20 +0000 (+0200) Subject: Fix issue with missing scanning after disconnect X-Git-Tag: 2.0_alpha~3251 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e89ac1c011a9204353f31669846a807fa4bcc8d9;p=framework%2Fconnectivity%2Fconnman.git Fix issue with missing scanning after disconnect --- diff --git a/src/device.c b/src/device.c index bc78513..c7efa1d 100644 --- a/src/device.c +++ b/src/device.c @@ -106,6 +106,14 @@ static void reset_scan_trigger(struct connman_device *device) } } +static void force_scan_trigger(struct connman_device *device) +{ + clear_scan_trigger(device); + + device->scan_timeout = g_timeout_add_seconds(5, + device_scan_trigger, device); +} + static const char *type2description(enum connman_device_type type) { switch (type) { @@ -1277,6 +1285,8 @@ int __connman_device_scan(struct connman_device *device) if (device->powered == FALSE) return -ENOLINK; + reset_scan_trigger(device); + return device->driver->scan(device); } @@ -1518,6 +1528,9 @@ int connman_device_set_disconnected(struct connman_device *device, device->disconnected = disconnected; + if (disconnected == TRUE) + force_scan_trigger(device); + return 0; }