Hi Mohamed,

On Mon, Dec 13, 2010 at 02:37:40PM -0800, mohamed abbas wrote:
> Hi Samuel
> 
> > On Wed, Dec 08, 2010 at 04:37:17PM -0800, Mohamed Abbas wrote:
> > > Call onnman_device_set_disconnected in connect_timeout if
> > > service failed to connect to allow for auto connect from scan
> > > to work.
> > > ---
> > >  src/service.c |    8 +++++++-
> > >  1 files changed, 7 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/src/service.c b/src/service.c
> > > index f417a80..fcb1141 100644
> > > --- a/src/service.c
> > > +++ b/src/service.c
> > > @@ -2206,15 +2206,21 @@ static void reply_pending(struct connman_service 
> > > *service, int error)
> > >  static gboolean connect_timeout(gpointer user_data)
> > >  {
> > >   struct connman_service *service = user_data;
> > > + struct connman_device *device;
> > >   connman_bool_t autoconnect = FALSE;
> > >  
> > >   DBG("service %p", service);
> > >  
> > >   service->timeout = 0;
> > >  
> > > - if (service->network != NULL)
> > > + if (service->network != NULL) {
> > >           __connman_network_disconnect(service->network);
> > >  
> > > +         device = connman_network_get_device(service->network);
> > > +         if (device != NULL)
> > > +                 connman_device_set_disconnected(device, FALSE);
> > Don't you want connman_device_set_disconnected(device, TRUE); instead ?
> > 
> Not really it is already set to TRUE this will cause not calling
> auto_connect on scan finish, We set this true to make sure we dont
> call auto_connect during we switch to a new network but if we timeout
> because the network gone, we need to set to FALSE so we can auto
> _connect on next scan.
Setting the disconnected flag to FALSE on a connection timeout sounds wrong to
me, doesn't it ? We seem to be using the disconnected flag to actually show
that a connection is in progress, in order to avoid autoconnecting at the same
time.

One question: If we remove the if (device->disconnected == TRUE) check from
connman_device_set_scanning() and check for network->connecting in
service.c:is_connecting(), wouldn't we achieve the same goal ?

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to