Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 2 tasks
lixin59 opened this issue Jun 13, 2022 · 0 comments

Comments

@lixin59
Copy link

lixin59 commented Jun 13, 2022

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] == '是') {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant