On 01/15/2014 11:59 AM, Patrik Flykt wrote: > On Tue, 2014-01-14 at 15:16 +0100, Daniel Wagner wrote: >> On 01/09/2014 02:21 PM, Patrik Flykt wrote: >>> On Fri, 2013-12-13 at 09:34 +0100, Daniel Wagner wrote: >>>> From: Daniel Wagner <[email protected]> >>>> >>>> We need to change the behavior for the AutoConnect=true case >>>> with sessions. The use case is that we have only sessions users. >>>> When no session asks for a connection the system should stay idle. >>>> Currently when the system is idle, ConnMan will attempt immedidatly >>>> to auto connect. When sessions are used, we can defer this until >>>> an user/application does a Session.Connect(). >>> >>> I don't think this is what is needed. >> >> What you mean is not needed? The behavior as such or the variable? >> >>> On a generic system there is no >>> way to distinguish between a case where only session users exist where >>> none have either yet requested a session wrt the case where there are >>> none. >> >> The current auto connect tries to stay connected. As I explained several >> times for my uses cases it should behave here differently. An idle >> system (no session wants a connection) needs to go and stay offline. >> That wont happen with the current behavior. I agree it is not possible >> to know if there are users with or without session etc. >> >> In short I need a different auto connect behavior. > > In order to keep it as simple as possible, the session auto connect > should be checked already in __connman_service_auto_connect(). The > reason for autoconnect would then be either 'session' or 'user' and that > needs to be recorded to "service->connected_by" or similar. So that we > can get rid of the connections connected by sessions (on a normal > system).
The problem this flags solves is not to go online not to go offline in the first place. __auto_connect_service() wants to stay online with AutoConnect=true services. Sure we can add this information to the service. But how should it help to know when auto connect should it help here not to stop the auto connect algorithm? >>> We already have almost too many variables in main.conf... >> >> I agree. >> >>> >>>> Unfortunatly AutoConnect can't be changed at this point (we would need >>>> a tristate boolean) we add a global flag which allows to change >>>> the behavior of the auto connect state machine. >>> >>> Enums for > 2 values can be used, can you elaborate what the thing is >>> that can't be changed. >> >> I consider AutoConnect as part of the stable API guarantees. Hmm, we >> could though do following. Instead using g_key_file_get_boolean() we >> implement your own parser which supports the current boolean values but >> also 'SessionMode'. That avoids introducing another main.conf flag. > > No, the save file format is not changed, only the time-based knowledge > why the service was connected at this instance of time. The services > that are to be connected need to have the autconnect flag enabled > anyway. Is your argumentation that the user has to set AutoConnect flag in the first place? If yes, then how can we stop then __auto_connect_service() not to auto connect immediately? I don't follow you here how time-based knowledge helps at all. daniel _______________________________________________ connman mailing list [email protected] https://lists.connman.net/mailman/listinfo/connman
