John F. Smith
John F. Smith

Reputation: 21

Get Wi-Fi signal strength via libnl?

I want to read the Wi-Fi signal strength from a userspace program on Linux.

As /proc/net/wireless is not available on the system, I have found out that libnl should be used to acquire the information.

Compared to just reading a value in /proc, communication via libnl seems to be very complicated. I have read various documentation, but I'm still not sure exactly what to do.

Can anyone give an example on how to read the Wi-Fi signal strength via libnl?

Upvotes: 2

Views: 1017

Answers (1)

Denys Petryshyn
Denys Petryshyn

Reputation: 21

If you already have iw library https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git. You can type sudo iw dev wlan0 scan (instead of 'wlan0' interface you can type the one you need) in your terminal. There is signal line that I think you are interested in. All the work for getting this information to user is made in scan.c file of iw library. So you can just check the source code and get some tips from there.

Upvotes: 2

Related Questions