From 39fb19a6dcd22f4db8a3c5f4a3ecc0d4ecb5d3b1 Mon Sep 17 00:00:00 2001 From: "paul@conbox.tv" Date: Fri, 11 Dec 2015 12:56:54 +0100 Subject: [PATCH 1/2] fixed linux wlan scan --- lib/wifi-control.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/wifi-control.js b/lib/wifi-control.js index 4bb41b4..52b95a6 100644 --- a/lib/wifi-control.js +++ b/lib/wifi-control.js @@ -242,11 +242,11 @@ if (process.platform === "linux") { scanResults = execSync("nmcli -m multiline device wifi list"); networks = []; - ref = scanResults.split('*:'); + ref = scanResults.split('\nSSID:'); for (c = j = 0, len = ref.length; j < len; c = ++j) { nwk = ref[c]; - if (c === 0) { - continue; + if (c != 0) { + nwk = "SSID:" + ref[c]; } _network = {}; ref1 = nwk.split('\n'); From 1f71e474c71837c5c75970d8d8fad6c7564d11b7 Mon Sep 17 00:00:00 2001 From: "paul@conbox.tv" Date: Fri, 11 Dec 2015 13:15:55 +0100 Subject: [PATCH 2/2] fixed example code --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a02406..4e02cb8 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Maybe you have a SoftAP-based IoT toy, and you just need to make a thin download // Try scanning for access points: WiFiControl.scanForWiFi( function(err, response) { - if (err) console.log(error); + if (err) console.log(err); console.log(response); }); ```