Re: nm api to get essid, freq, qual ...



On Fri, 2008-05-02 at 15:43 -0400, tyuoustwo three wrote:
> 
> 
> On Fri, May 2, 2008 at 12:10 PM, Dan Williams <dcbw redhat com> wrote:
>         On Fri, 2008-05-02 at 04:03 -0400, tyuoustwo three wrote:
>         > Hi,
>         >
>         > I have already looked at
>         >
>         http://lists.shmoo.com/pipermail/hostap/2007-December/016761.html
>         > message.
>         >
>         > I would like to know, if  api's in
>         nm-device-802-11-wireless.c in
>         > NetworkManager/src or nm-device-802-11-wireless.c in
>         > NetworkManager/libnm-glib can be used to get essid,
>         frequency and
>         > quality.
>         
>         
>         They are accessible both from libnm-glib and from D-Bus, since
>         libnm-glib is really just a client-side wrapper around the
>         D-Bus
>         interface that NM exposes.
>         
>         You can also query wpa_supplicant for this information
>         directly.
>         
>         Are you looking for information about which AP the machine is
>         _currently_ associated with, or information about some random
>         known AP
>         that the machine is _not_ currently associated with?
> 
> I am looking for information about AP that the machine can
> "scan" (just as in "iwlist ath0 scan"). 

Ok...

>         
>         
>         > I am trying to overlay network information (essid, freq ...)
>         on a live
>         > video stream.
>         > Using "system(iwlist ath0 scan | grep ESSID >
>         net_info.txt)"  and
>         > then
>         
>         
>         This is going to just kill you, because you're scanning for
>         networks,
>         which can take more than 10 seconds on cards that support both
>         the A and
>         B/G frequency bands, using a passive scan (which is the
>         default).  You
>         really, really don't want to trigger a scan every frame.
> 
> Yes, I will have to try to introduce delay between each scan.

So instead of using system("iwlist scan...") you should probably be
calling the ioctls directly.  Basically do what iwlist does, but do it
in your program without calling out to iwlist and blocking.  That way
you can keep everything asynchronous.
 
>         
>         
>         So first I'll need to know if you want info about the current
>         associated
>         AP or a known but not currently associated AP.  That makes a
>         big
>         difference in the approach you should take.
> 
> I am looking for an output similar to "iwlist ath0 scan", but I need
> only certain information like essid, freq, qual.
> Also, we do not need every possible AP that the card can scan. But,
> only the top 3 or 4 AP (this can be less or more), based on the
> quality or signal. 

Be aware that not every AP shows up in every scan, so to get a good
picture of what's really around you'll want to build up a list of the
last 2 or 3 scans and age the scan results accordingly.  That's just the
way wireless works; it's not completely reliable.  Drivers are also
implemented differently (some use passive scans, some use active scans)
and that also affects the results.

> 
>         
>         
>         Dan
>         
>         > reading the file each millisecond or less takes a lot of
>         time. (For
>         > each single video frame using "system" command to get
>         network
>         > parameters and then overlaying text makes the live video
>         really
>         > slow).
>         >
>         > So, looking for an api that directly provides the required
>         wireless
>         > network parameters.
>         >
>         > Thanks,
>         >
>         > Ash
>         
>         > _______________________________________________
>         > NetworkManager-list mailing list
>         > NetworkManager-list gnome org
>         > http://mail.gnome.org/mailman/listinfo/networkmanager-list
>         
> 



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