Expected Behavior
In Windows, when we scan for networks, the "ssid" and "mac" for first network should come as expected instead of the "Network type" and "Signal" parameter respectively.
Current Behavior
In Windows, when we scan for networks, the "ssid" for first network comes as "Network type" parameter and "mac" comes as "Signal" parameter which is breaking the handling and interpretation of the network ssid and other values.
Affected features
Possible Solution
Issue is with the slicing of the scanResults we obtain.
Current Code snippet in windows-scan.js:
scanResults = scanResults
.toString('utf8')
.split('\r')
.join('')
.split('\n')
.slice(5, scanResults.length);
Solution/Fix which resolves the issue:
scanResults = scanResults
.toString('utf8')
.split('\r')
.join('')
.split('\n')
.slice(4, scanResults.length);
Steps to Reproduce (for bugs)
- Call scan wifi api in windows.
- The first network output values will be wrong.
Following is the sample output from when command run from command line and when run from code. We will notice in the output from code has its parameters(ssid, mac etc) as wrong values.
In windows-scan.js file, we are using the command "netsh wlan show networks mode=Bssid" to list down all the networks.
Sample Output when run from command line:
Interface name : Wi-Fi
There are 1 networks currently visible.
SSID 1 : Home-wifi
Network type : Infrastructure
Authentication : WPA2-Personal
Encryption : CCMP
BSSID 1 : b8:c1:a2:41:f1:8c
Signal : 46%
Radio type : 802.11n
Channel : 3
Basic rates (Mbps) : 1 2 5.5 11
Other rates (Mbps) : 6 9 12 18 24 36 48 54
Output from the code:
[ { mac: '46% ',
bssid: '46% ',
ssid: 'Infrastructure',
channel: 1,
frequency: 2412,
signal_level: 301.055,
quality: 802.11,
security: 'CCMP ',
security_flags: 'b8:c1:a2:41:f1:8c',
mode: 'Unknown' } ]
Context
It leads to a production bug due to wrong first network values.
Your Environment
- OS: Microsoft windows 10
- node-wifi version: 2.0.13
- wifi card: Intel(R) Dual Band Wireless-AC 8265
Expected Behavior
In Windows, when we scan for networks, the "ssid" and "mac" for first network should come as expected instead of the "Network type" and "Signal" parameter respectively.
Current Behavior
In Windows, when we scan for networks, the "ssid" for first network comes as "Network type" parameter and "mac" comes as "Signal" parameter which is breaking the handling and interpretation of the network ssid and other values.
Affected features
Possible Solution
Issue is with the slicing of the scanResults we obtain.
Current Code snippet in windows-scan.js:
scanResults = scanResults
.toString('utf8')
.split('\r')
.join('')
.split('\n')
.slice(5, scanResults.length);
Solution/Fix which resolves the issue:
scanResults = scanResults
.toString('utf8')
.split('\r')
.join('')
.split('\n')
.slice(4, scanResults.length);
Steps to Reproduce (for bugs)
Following is the sample output from when command run from command line and when run from code. We will notice in the output from code has its parameters(ssid, mac etc) as wrong values.
In windows-scan.js file, we are using the command "netsh wlan show networks mode=Bssid" to list down all the networks.
Sample Output when run from command line:
Interface name : Wi-Fi
There are 1 networks currently visible.
SSID 1 : Home-wifi
Network type : Infrastructure
Authentication : WPA2-Personal
Encryption : CCMP
BSSID 1 : b8:c1:a2:41:f1:8c
Signal : 46%
Radio type : 802.11n
Channel : 3
Basic rates (Mbps) : 1 2 5.5 11
Other rates (Mbps) : 6 9 12 18 24 36 48 54
Output from the code:
[ { mac: '46% ',
bssid: '46% ',
ssid: 'Infrastructure',
channel: 1,
frequency: 2412,
signal_level: 301.055,
quality: 802.11,
security: 'CCMP ',
security_flags: 'b8:c1:a2:41:f1:8c',
mode: 'Unknown' } ]
Context
It leads to a production bug due to wrong first network values.
Your Environment