Hi,
On 08/31/2018 07:00 AM, Måns Zigher wrote:
According to the comments for BackgroundScanning
# Enable background scanning. Default is true.
# Background scanning will start every 5 minutes unless
# the scan list is empty. In that case, a simple backoff
# mechanism starting from 10s up to 5 minutes will run.
I would assume that connman should detect when the list is empty and
trigger a scan but what we are experiencing is that it will only trigger
a scan every 5 minute no mater if the list is empty or not. Is this how
it is intended?
This sounds like a bug.
As Julien explained, the code for stearing the scan behavior of
wpa_supplicant is ugly and really complex. It's a constant source of pain.
I see that whenever ssid_init() is called it will overwrite the
setting from setup_autoscan().
static void setup_autoscan(struct wifi_data *wifi)
{
/*
* If BackgroundScanning is enabled, setup exponential
* autoscanning if it has not been previously done.
*/
if (connman_setting_get_bool("BackgroundScanning")) {
wifi->autoscan = parse_autoscan_params(AUTOSCAN_EXPONENTIAL);
return;
}
[...]
}
static void ssid_init(GSupplicantSSID *ssid, struct connman_network
*network)
{
[...]
if (connman_setting_get_bool("BackgroundScanning"))
ssid->bgscan = BGSCAN_DEFAULT;
[...]
}
The ssid_init() was added by 631bcaaed684 ("wifi: Add support for
default background scanning parameters"). Not sure if that bit is still
relevant after many changes we had for scanning. This needs some proper
testing: Can you ssid_init() overwrites the exponential settings?
Thanks,
Daniel