Skip to content

[Bug]: In ubuntu22.04, the return value is an empty array when i use getCurrentConnections method #182

Open

Description

@lixin59

Expected behavior

I tried to call the getCurrentConnections method to get WiFi information, but I got an empty array。

Current behavior

I tried to call the getCurrentConnections method to get WiFi information, but I got an empty array。

wifi.init({
      iface: null // network interface, choose a random wifi interface if set to null
    });
    wifi.getCurrentConnections((error, networks) => {
      if (error) {
        console.log(error);
      } 
   console.log(networks); // the networks is an empty array
    });

Which are the affected features

  • node API
  • CLI

Which is your operating system?

Linux

Environment

Ubuntu 22.04 中文

Version of node-wifi

2.0.16

Steps to Reproduce

See the output of netsh wlan show interfaces
See the output of .getCurrentConnections()

Solutions

I fixed this problem by modifying the code in line 33 of the "src/linux current connection.js" file.

if (fields[0] == 'yes' || fields[0] == '是') {}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions