Hi Tomasz,

On Tue, Nov 4, 2014 at 11:49 PM, Tomasz Bursztyka
<[email protected]> wrote:
> If so, then this is a bug in plugins/wifi.c and that should be fixed. Look
> closer to wifi_scan():
> line 1843: if the current wifi is connected you could skip this. So it would
> not look for known networks,
> when wifi is already connected.
>
> The logic behind is: if not connected and if there are known networks, it
> will first do an active scan on those,
> and then autoscan will do a passive scan. But since your recent patch: if
> connected, autoscan won't start.

Makes sense, and I think it is appropriate to scan the known networks
first, especially when searching for a connection.

> I did not check thoroughly but I think it's the right place to fix this is
> line 1842:
> instead of: } else { try a: } else if (!wifi->connected) {
>
> That should do the trick I believe.

I tried something like your suggestion and
g_supplicant_interface_scan() does not actually trigger a scan when
scan_params is allocated, but not filled in, so I did something like
this:

diff --git a/plugins/wifi.c b/plugins/wifi.c
index 5ef4520..6b70f0e 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -1842,6 +1842,9 @@ static int wifi_scan(enum connman_service_type type,

                        return 0;
                }
+       } else if (wifi->connected) {
+               g_supplicant_free_scan_params(scan_params);
+               return wifi_scan_simple(device);
        } else {
                ret = get_latest_connections(driver_max_ssids, scan_params);
                if (ret <= 0) {

and that does make the dbus requested scans cover all channels when connected.

However, when not connected, a dbus scan request will return after
scanning only the known networks, and then autoscan will handle
scanning all channels.  I would have expected that scans requested via
dbus would scan all channels before returning.

I agree that scanning known networks first is a good feature, so I am
a bit concerned that sending a patch like the hunk above will make
finding known networks slower.

If you prefer a patch like that hunk above, I am happy to send out a
patch or you can, though I had a preference for something that would
either:

1. Scan the known networks first, then the remaining channels (or all
channels once), then return from the dbus call.
2. Clarify the dbus api in some fashion to allow dbus clients to know
whether they are scanning some or all channels, preferably as
specified by the client.

Thanks for the quick review and feedback so far, much appreciated

Jason
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to