Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get wifi signal strength using Qt?

Tags:

c++

qt

So far I am able to scan all the available wifi using QNetworkConfigurationManager::allConfigurations(), but the QNetworkConfiguration data for each of them does not have the wifi signal strength. Can you point me into how to get this data? Thanks!

like image 487
aaa Avatar asked Oct 29 '13 06:10

aaa


People also ask

How can I measure my WiFi signal strength?

You'll want to look for the universal WiFi symbol in the upper right-hand corner of your device to gauge your current signal strength. Generally, this indicator appears as four to five curved bars stacked on top of each other- the more bars that are filled in, the stronger your connection.

Is there an app to test WiFi strength?

iWifi is your ultimate network diagnostic tool, you can quickly test your internet speed, detect networked devices and view all kinds of network information, and there is also an analysis tool to visualize the nearby Wi-Fi signal.


2 Answers

You could use QProcess and run command line commands to scan for wifi networks. Use regular expressions to parse the command line output which contains all details of the wifi network.

If you are using linux then the command is "iwlist scan"

like image 72
gfernandes Avatar answered Nov 03 '22 19:11

gfernandes


I am not sure you even can do this on normal desktop anyway(i mean just using Qt). Qt just dont have common interface with device to get such things. I am not sure what OS you are using, but the best hit for you is linking with OS and getting info from it or talking to device directly via driver. Both methods are difficult, especially because you need documentations, and moreover:

  • For the first method, linking via driver - this will work only for specific driver unless signal strenght is reported in way common to many drivers.
  • For the second method, linking via system - there may be slight difference between linux distros that can make you unable to make app portable between them. Same goes for Windows an linux, there is no guarantee(i would even say "way" but I am not sure so...) that both systems uses those same methods to report signal strength for user.

whatever you decide to do, you can use standard OS features to complete the goal. For example in windows you can use WlanGetAvailableNetworkList(). As far as I remember it will will provide something called IRSSI which is direct signal strength indicator :)

enjoy :)

like image 36
esavier Avatar answered Nov 03 '22 18:11

esavier