friedrith / node-wifi

📶 NodeJS tool to manage wifi (connections, scans)
MIT License
395 stars 161 forks source link

Airport data parsing fails when a channel >99 is used #53

Open matthiaslau opened 5 years ago

matthiaslau commented 5 years ago

When there is a wifi in reach using a channel >99 the parsing the airport output with the title indexOf will result in faulty data. E.g.

                       A Wifi 58:b8:f3:85:55:0e -84  44      Y  DE WPA2(PSK/AES/AES)
                 Another Wifi 5 GHz 58:5e:12:48:35:24 -53  100,+1  Y  DE WPA2(PSK/AES/AES)

will result in

ssid: "Another Wifi 5 GHz 58"
bssid: ":5e:12:48:35:24 -5"
signal_level: "3 10"

It could be fixed using a regexp like this: https://github.com/ancasicolica/node-wifi-scanner/blob/master/lib/airport.js#L10

friedrith commented 5 years ago

Hi, Sorry for the delay. Thank for noticing this bug. I will fix it next week. I am trying to improve the stability of node-wifi and for that I need outputs from different OS. Could you please send a airport output relating to your situation ?

matthiaslau commented 5 years ago

I am sorry, I don´t have the tested wifi around me any more. It was a 5GHz only wifi with a channel >100.