4

I can get the value of Wifi RSSI. but don't know how to convert it into level of Wifi strength as we can see in the menubar in Mac OSX (If I receive a strong Wifi, the wifi status will be bold black on all 4 lines of wifi icon).

Is there any methods or library that I can use to do this? Thx in advance.

Chanok
  • 790
  • 6
  • 23

2 Answers2

1

I don't think you'll find anything in the API to do this.

I think you might have to Use Scienceā„¢ and do a manual check, literally walking away from your WiFi access point with laptop in hand, noting down the RSSI values at which the WiFi signal indicator icon changes. Do this a few times and you'll likely find a correlation. I can't imagine it would take more than ten or fifteen minutes to get a good range of sample values.

It's probably worth trying it with more than one type of Mac, if possible.

Rob Keniger
  • 45,830
  • 6
  • 101
  • 134
1

There is no public API for this. You'll have to figure it out yourself. You might be able to use something simple like (RSSI+100)/8 and then clamp the result between 0 and 4 bars. Also, you'll want to use a rolling average over a few seconds to keep the bars from jumping around if the signal ends up at a boundary case or jumps around. PS: AFAIK, Apple uses a more complex algorithm which takes Transmit Rate into consideration.

Ken Aspeslagh
  • 11,484
  • 2
  • 36
  • 42