Results 1 to 1 of 1
I now currently working on a project to perform network switching according to the received signal strength. From the manual of iwconfig, the explanation for signal level is
Received signal ...
- 12-20-2008 #1Just Joined!
- Join Date
- Nov 2008
- Posts
- 25
Relationship between the signal level get from iwconfig and /proc/net/wireless?
I now currently working on a project to perform network switching according to the received signal strength. From the manual of iwconfig, the explanation for signal level is
but how they interpret? For example, when the signal strength value(=a)i get from /proc/net/wireless is 202, the signal level(=b) in iwconfig is -54dbm. When i look into the source code of iwcommon.c, i found out that the logic behind isReceived signal strength (RSSI - how strong the received signal is). May be arbitrary units or dBm, iwconfig uses driver meta information to interpret the raw value given by /proc/net/wireless and display the proper unit or maximum value (using 8 bit arithmetic). In Ad-Hoc mode, this may be undefined and you should use iwspy.
here is the part of code in iwcommon.c:Code:b = a - 0x100 (= a - 16^2)
can anyone please explain to me the logic behind these code? I cannot figure out how they come out with this conversion. Besides that, where the raw value given in /proc/net/wireless come from?PHP Code:/********************** STATISTICS SUBROUTINES **********************/
/*------------------------------------------------------------------*/
/*
* Output the link statistics, taking care of formating
*/
void
print_stats(FILE * stream,
iwqual * qual,
iwrange * range,
int has_range)
{
/* Just do it */
if(has_range && (qual->level != 0))
{
/* If the statistics are in dBm */
if(qual->level > range->max_qual.level)
{
/* Statistics are in dBm (absolute power measurement) */
fprintf(stream,
"Quality:%d/%d Signal level:%d dBm Noise level:%d dBm%s\n",
qual->qual, range->max_qual.qual,
qual->level - 0x100, qual->noise - 0x100,
(qual->updated & 0x7) ? " (updated)" : "");
}
else
{
/* Statistics are relative values (0 -> max) */
fprintf(stream,
"Quality:%d/%d Signal level:%d/%d Noise level:%d/%d%s\n",
qual->qual, range->max_qual.qual,
qual->level, range->max_qual.level,
qual->noise, range->max_qual.noise,
(qual->updated & 0x7) ? " (updated)" : "");
}
}
else
{
/* We can't read the range, so we don't know... */
fprintf(stream, "Quality:%d Signal level:%d Noise level:%d%s\n",
qual->qual, qual->level, qual->noise,
(qual->updated & 0x7) ? " (updated)" : "");
}
}
Thanks a lot!!!


Reply With Quote