Updates implementation of device.scanWiFiNetworks() to use CTRL_REQUEST_WIFI_SCAN_NETWORKS (506) rather that CTRL_REQUEST_WIFI_SCAN = 112, which does not work on current version of Device OS (see it commented out in system_contro.h). New implementation continues on the path set by previous pull request by using sendProtobufRequest instead of sendRequest. Increased test coverage of wifi-device.js from 42% to 57%.
Introduces joinNewWifiNetwork(). Increases test coverage of wifi-device.js from 57% to 70%
These new methods have been validated in this mfg-cli PR via 2.1.0-x prereleases. After this PR is merged, we'll cut 2.1.0 proper (non prerelease) and use that to finish out the mfg-cli work.
Known limitation: joinNewWifiNetwork may not work when for open wifi networks that don't have a password. ( This is not a blocker for mfg-cli reasons, would prefer to merge without validating this, and enqueue follow on work to handle this, or perhaps reviewers can test this)
How to test?
Observe new wifi-device.test.js file and the tests passing, all new code with 100% coverage
Plug in a P2 running Device 3.x
Scan networks with node demo.js below
Modify the joinNewWifiNetworkScan demo.js with your SSID and run node demo.js. Observe output { pass: true }
Overview
Updates implementation of
device.scanWiFiNetworks()
to useCTRL_REQUEST_WIFI_SCAN_NETWORKS (506)
rather thatCTRL_REQUEST_WIFI_SCAN = 112
, which does not work on current version of Device OS (see it commented out in system_contro.h). New implementation continues on the path set by previous pull request by usingsendProtobufRequest
instead ofsendRequest
. Increased test coverage of wifi-device.js from 42% to 57%.Introduces
joinNewWifiNetwork()
. Increases test coverage of wifi-device.js from 57% to 70%These new methods have been validated in this mfg-cli PR via
2.1.0-x
prereleases. After this PR is merged, we'll cut 2.1.0 proper (non prerelease) and use that to finish out the mfg-cli work.See sc-95533 for more details.
Known limitation: joinNewWifiNetwork may not work when for open wifi networks that don't have a password. ( This is not a blocker for mfg-cli reasons, would prefer to merge without validating this, and enqueue follow on work to handle this, or perhaps reviewers can test this)
How to test?
wifi-device.test.js
file and the tests passing, all new code with 100% coveragenode demo.js
belowjoinNewWifiNetworkScan
demo.js with your SSID and runnode demo.js
. Observe output{ pass: true }
scanWifiNetworks()
demo.js
joinNewWifiNetwork()
demo.js