Hi Daniel, > >> Instead of only having Offline and Online, report 4 states > >> online, offline, connecting and suspended. > >> --- > >> doc/session-api.txt | 45 +++++++++++++++++++++++++++++++++++---------- > >> 1 files changed, 35 insertions(+), 10 deletions(-) > >> > >> diff --git a/doc/session-api.txt b/doc/session-api.txt > >> index 3a0c9ca..600f057 100644 > >> --- a/doc/session-api.txt > >> +++ b/doc/session-api.txt > >> @@ -90,20 +90,45 @@ Settings string Bearer [readonly] > >> for this session. Or an empty string if no bearer > >> is available. > >> > >> - boolean Online [readonly] > >> + string State [readonly] > >> > >> - This indicates if the connection is online or > >> - offline. > >> + This indicates the state of the session. > >> > >> - This maps to the online service state. And it is > >> + Valid states are "offline", "connecting", > >> + "online" and "suspended". > >> + > >> + This maps to the service states. And it is > >> only valid for the selected bearer configuration. > >> - Otherwise it will be reported as offline even if > >> - the global state would be online. > >> > >> - In addition the Online settings notification might > >> - not happen right away. Notifications of online state > >> - can be delayed based on the speed of the bearer. It > >> - is done to avoid congestion on bearers like 3G etc. > >> + The "offline" state indicates that no services for > >> + a given session are online. "connecting" is indicating > >> + that the session has called Service.Connect() > >> + and if this call is successful the next state > >> + indicated is "online". The application could > >> + use the "connecting" state for starting to draw an > >> + animation. > >> + > >> + If the Service.Connect() is not successful > >> + the next state will be "offline". If the > >> + application has started to draw an animation on > >> + the "connecting" state it should stop drawing when > >> + "offline". > > > > I have two questions: > > > > 1. How to deal with service.State = 'ready', in which state > > Service.Connect() returns successfully? > > 2. State here is different than State in ' Session States and Transitions', > > is it possible to use another name? > > As you already pointed out, the Session.State is not the same as > Service.State. Essentially the session state is one logic layer above > the service layer. If you look into the session code you see, that we > already monitor all service states. Changing the setting from 'Online' > to 'State' allows the session code to notify the application with some > more state transitions then only 'Online' <-> 'Offline'.
and why would an application care? Please do not complicate this too much. So we have 99% of application that should only be notified when they are really online. Telling them that we are ready, but not online, just wakes them up for no real reason. The only 1% that might care about link local connections are the DLNA type of application for your home entertainment. Similar to what Apple does with AirPlay. However we already have Avahi for this stuff. Why would we need another set of notifications? Regards Marcel _______________________________________________ connman mailing list [email protected] http://lists.connman.net/listinfo/connman
