0

I am using OCB mode based on ath9k driver for my wireless connections between different nodes. I need to know the signal strength of received packets in my user-space application to do some calculation based on that. In order to communicate I am using socket APIs and udp packets.

So, here is the question: Is there any function or API in C to get signal strength of a received packet in a user-space application?

Majid
  • 49
  • 4

2 Answers2

1

I don't know if the signal strengh "of a received packet" really makes sense, but you can get some information on the wifi signal where you are connected by reading /proc/net/wireless

$ cat /proc/net/wireless 
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
 wlan0: 0000   69.  -41.  -256        0      0      0      1    274        0

Generally speaking, /proc provides runtime information about your system. Technically speaking, if you wish to read this from a C program you should probably try to find if there is an API for this, otherwise read/open/close the file and parse its content. See this thread for details about reading the /proc filesystem.

Community
  • 1
  • 1
Emilien
  • 2,385
  • 16
  • 24
  • In cantrast to AP or Ad-hoc mode, in OCB mode we don't connect to a network, I mean in OCB we are outside of BSS and have no associated connection to be searched we have to find the signal strength of received packet. – Majid Jun 14 '16 at 13:49
0

You should use cfg80211, see http://www.linuxwireless.org/en/developers/Documentation/cfg80211/

fedterzi
  • 1,105
  • 7
  • 17