0
0
mirror of https://github.com/Doodle3D/doodle3d-firmware.git synced 2024-12-22 02:53:49 +01:00

Fixed scan error handling issue

The getScanInfo could return a false, which wasn’t handled properly
resulting in a error and the box sticking into connecting mode.
This commit is contained in:
peteruithoven 2014-04-28 16:41:31 +02:00
parent 2669ca2135
commit d1e35c1a69

View File

@ -344,9 +344,13 @@ function M.associateSsid(ssid, passphrase, recreate)
-- if not, or if newly created configuration is requested, create a new configuration
if cfg == nil or recreate ~= nil then
local scanResult = wifi.getScanInfo(ssid)
local scanResult, msg = wifi.getScanInfo(ssid)
if scanResult ~= nil then
wifi.createConfigFromScanInfo(scanResult, passphrase)
elseif scanResult == false then
--check for error
M.setStatus(M.CONNECTING_FAILED,msg);
return nil,msg
else
--check for error
local msg = "Wireless network "..ssid.." is not available"