Fix issue where autowifi would associate with ssid equal to locally known AP ssid.

This commit is contained in:
Wouter R 2014-05-01 16:14:36 +02:00
parent 05b4f00a48
commit ca25ab0487
1 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ local function setupAutoWifiMode()
local netName, netMode = wifiState.ssid, wifiState.mode
local apSsid = wifi.getSubstitutedSsid(settings.get('network.ap.ssid'))
local apMode = (apSsid == netName) and netMode == 'ap'
local apMode = (apSsid == netName) and (netMode == 'ap')
local scanList,msg = wifi.getScanInfo()
local knownSsids = wifi.getConfigs()
@ -80,7 +80,7 @@ local function setupAutoWifiMode()
local connectWith = nil
for _,kn in ipairs(knownSsids) do
if kn.mode == 'ap' and kn.ssid == apSsid then break end
if findSsidInList(scanList, kn.ssid) then
if findSsidInList(scanList, kn.ssid) and kn.mode == 'sta' then
connectWith = kn.ssid
break
end