Re: nm_ap_get_strength question



On Wed, 2010-07-07 at 10:38 -0300, Franco Miceli wrote:
> Bastien, thanks for your answer.
> 
> I've seen the code and read the "wireless_stats_to_percent" method.
> The thing is that I'm asking about the "nm_ap_get_strength" method,
> that seems not to be linked with the aforementioned method.  At least
> I've tracked the file where it comes from (NetworkManagerAP.c) and
> there it seems to be related to the glib library. That's as far as I
> got.
> 
> Maybe the value it reports is the same as the one you mention, but I
> wanted some confirmation since I don't know if I can trust the quality
> reported by the driver as a strength measurement.

NM keeps an internal scan list with a 0 - 100% "quality" derived from
the driver's reported scan results.  NM also updates the associated AP
with the more accurate measurements taken from the current association
(scan results aren't as accurate since you cant' take time to measure
noise floor, and you have no information about missing ACKs from APs
you're not associated with).

NM provides that information over D-Bus.

libnm-glib (from which nm_ap_get_strength() comes) is a thin proxy over
the D-Bus interface that NM provides, so what you're going to get is the
same 0 - 100% "quality" measurement that NM is internally using.

Dan

> Cheers,
> 
> 2010/7/7 Bastien Nocera <hadess hadess net>
>         On Wed, 2010-07-07 at 10:12 -0300, Franco Miceli wrote:
>         > I have a question about the method nm_ap_get_strength. The
>         method
>         > reports values of 88 - 90 for signal levels of -50 dBm (as
>         reported by
>         > iwlist sc).
>         > My question is, what does strength report?
>         
>         
>         A "percentage" of strength.
>         
>         >  A quality measurement? If so, what is the math behind its
>         > calculation?
>         
>         
>         All the code lives in NetworkManager and is quite involved, as
>         you can
>         see:
>         http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/src/nm-device-wifi.c#n1548
>         
>         > The reason I'm asking this is because while iwlist reports
>         differences
>         > in signal level of 20 dB, strength reports differences of
>         only 4 (unit
>         > missing).
>         
>         
>         It's a difference of 20dBm, not 20dB. The unit is percentages.
>         The
>         percentage is used to present the quality of the link to
>         users, and
>         shouldn't really be used for anything else.
>         
>         Cheers
>         
> 
> 
> 
> -- 
> Ing. Franco Miceli
> CITS - Plan Ceibal - Investigación & Desarrollo
> Av. Italia 6201 - Montevideo, Uruguay
> CP: 11500
> Tel: (598 2) 601 5773 int.: 2227




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]