Re: WIFI autoconnect implementation



On Wed, 2010-03-24 at 11:13 +0800, 代尔欣 wrote:
> Hi all,
>         I am trying implement an autoconnect behavior like:
>         User move outside of AP radio range. NM disconnect the AP. ---
> This should already work with original NM.
>         User move into the AP radio range again. NM autoconnect the AP
> just disconnect. -- It seems NM0.7.0 or NM0.7.2 can't do this yet. Not
> sure the NM0.8.0.

It depends on the scan results too.  As long as when you move back in
range of the AP again and another scan is done, and NM gets the AP back
in the scan list, we're OK.

> From my observe, when user move outside of AP range or just shutdown
> the AP. NM will disconnect the AP and then autoconnect the AP
> immediately. This connection definitely fail. And the connection will
> be marked as invalid and can't autoconnect again.
> 
> I can managed to clear the invalid tag of the failed connection. But
> the key is how to know when need autoconnect. Any idea implement this?

The "invalid" stuff was done so that NM wouldn't continually attempt to
reconnect to the same AP over and over again after you'd failed to
connect the first time, or if you'd gotten the password wrong and had
hit "cancel" because you didn't know the password at the time.  If the
invalid tag wasn't there, even after hitting "cancel" NM would
continuously reconnect to the AP and keep asking you for the password.

Here's what I'd do...  Any time an AP disappears from the internal scan
list for an AP, the manager should look through each wifi device's scan
list and see if there is any other AP that matches that SSID.  If all
APs of the SSID are really gone, then we clear the INVALID tag from that
NMConnection.

Need more pointers on where to put that code?  If you get it written,
please post it to the list since this seems like a very good
enhancement.

Dan




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