friedrith / node-wifi

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

Suggestion for Issue 184 #192

Open eltoroit opened 10 months ago

eltoroit commented 10 months ago

This code fixes issue 184 where the wrong value was being returned. The problem is that the format has changed and the code assumed some specific format. I have written code that is more generic.

Description

Rewrote function named parseShowInterfaces without assuming a specific format in the output generated

Motivation and Context

Fixes issue #184

Usage examples

I did not change the original output, so same usage.

How Has This Been Tested?

I have a Windows 11 machine where the problem was occurring, and I have dual network card so I tested the output works for both interfaces.

Types of changes

max-sistemich-kisters commented 4 months ago

Unfortunately, this would break parsing on non-english machines, because the output of netsh is localized, for example like this on my german windows 10:

PS C:\> netsh wlan show interfaces

Es ist 1 Schnittstelle auf dem System vorhanden:

    Name                   : WLAN
    Beschreibung           : Intel(R) Wi-Fi 6E AX211 160MHz
    GUID                   : 3d16b69e-860c-41ec-bc9b-e684b51665ee
    Physische Adresse      : 00:d4:9e:5c:61:ba
    Status                 : Verbunden
    SSID                   : TP-Link_Guest_AEB7_5G
    BSSID                  : b2:be:76:77:ae:b6
    Netzwerktyp            : Infrastruktur
    Funktyp                   : 802.11ac
    Authentifizierung   : WPA2-Personal
    Verschlüsselung        : CCMP
    Verbindungsmodus          : Automat. Verbindung
    Kanal               : 36
    Empfangsrate (MBit/s)  : 780
    Übertragungsrate (MBit/s) : 780
    Signal              : 72%
    Profil                 : TP-Link_Guest_AEB7_5G

    Status des gehosteten Netzwerks  : Nicht verfügbar