[Bugs] #2187 UNSP: Sugar Ad-hoc network: reconnect after suspend

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Wed Sep 15 04:15:51 EDT 2010

#2187: Sugar Ad-hoc network: reconnect after suspend
    Reporter:  erikos                     |          Owner:  erikos     
        Type:  enhancement                |         Status:  new        
    Priority:  Unspecified by Maintainer  |      Milestone:  0.90       
   Component:  sugar                      |        Version:  Unspecified
    Severity:  Major                      |       Keywords:  r?         
Distribution:  Unspecified                |   Status_field:  Assigned   
Changes (by erikos):

  * keywords:  => r?


 When we came out from suspend the method autoconnect was called [1]. Which
 is invoked when the wireless device is being announced by NM. However, our
 state was still set to NM_DEVICE_STATE_UNMANAGED [2]. Hence we returned
 from the autoconnect method without doing anything [3]. The state does
 change a few seconds after this, either to NM_DEVICE_STATE_DISCONNECTED
 when there is no predefined connection or when connecting was successful

 So my first fix included to have a timer that waits a few seconds, then
 checks if the state is disconnected and if not connects to an Ad-hoc
 network. Dealing with the moment the device is announced and when it gets
 out of the unmanaged state was rather complicated so I decided to just go
 for the timer.

 So the timer would handle the cases where the device is still unmanaged or
 when we have an connection we were previously connected to. Left is the
 case where we want to directly connect. This has the issue that we might
 not wait for other Sugar Ad-hoc networks that are in the area (here is our
 logic [4]). If there is another learner around that uses channel 11 we
 want to connect to channel eleven too. So in this case we want to wait a
 moment to check whether we have other Sugar Ad-hoc networks around.

 Result: the patch above. That always waits for 30 seconds, then checks if
 we are in the state disconnected and if yes applies the autoconnect logic.
 Simple, but handle all the cases :)

 [2] http://projects.gnome.org/NetworkManager/developers/spec-07.html#type-

Ticket URL: <http://bugs.sugarlabs.org/ticket/2187#comment:1>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system

More information about the Bugs mailing list