--- include/device.h | 2 ++ src/device.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/include/device.h b/include/device.h index 5da48bc..c98c022 100644 --- a/include/device.h +++ b/include/device.h @@ -89,6 +89,8 @@ int connman_device_set_carrier(struct connman_device *device, connman_bool_t carrier); int connman_device_set_scanning(struct connman_device *device, connman_bool_t scanning); +int connman_device_cleanup_scanning(struct connman_device *device); + int connman_device_set_disconnected(struct connman_device *device, connman_bool_t disconnected); connman_bool_t connman_device_get_disconnected(struct connman_device *device); diff --git a/src/device.c b/src/device.c index 17bd652..7bc00ac 100644 --- a/src/device.c +++ b/src/device.c @@ -1468,6 +1468,30 @@ static int scanning_changed(struct connman_device *device) return 0; } +static void mark_network_available(gpointer key, gpointer value, + gpointer user_data) +{ + struct connman_network *network = value; + + connman_network_set_available(network, TRUE); +} + +int connman_device_cleanup_scanning(struct connman_device *device) +{ + int err; + + device->scanning = FALSE; + + err = scanning_changed(device); + if (err < 0) + return err; + + g_hash_table_foreach(device->networks, + mark_network_available, NULL); + + return 0; +} + /** * connman_device_set_scanning: * @device: device structure -- 1.6.1.3 _______________________________________________ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman