From: Daniel Wagner <[email protected]>

---
 doc/session-overview.txt |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/doc/session-overview.txt b/doc/session-overview.txt
index a297800..e1a2bc4 100644
--- a/doc/session-overview.txt
+++ b/doc/session-overview.txt
@@ -69,3 +69,46 @@ Disconnect algorithm:
        |No                      |
        |                        |
     Service.Disconnect()   Do nothing
+
+
+Session States and Transitions
+==============================
+
+There are three main strategy for state changes.
+
+ - Free Ride
+ - Connect
+ - Disconnect
+
+The initial state for all new sessions is Free Ride.
+
+The Free Ride state means that a session will go online if a matching
+service goes online without calling Service.Connect() itself. The idea
+behind this is that a session doesn't request a connection for itself
+instead waits until another session actively requires to go online.
+This is comparable with piggy-backing.
+
+When a session is in the Connect state ConnMan tries to find a
+matching service (see Connect algorithm) and then decides either to
+connect the service or delay the request. ConnMan is allowed to
+optimize all requests, e.g. group PeriodicConnects together. The
+session will leave the Connect state when the service goes offline
+unless StayConnected is True. It will enter the Free Ride mode again.
+
+When the application calls Disconnect() the session enters the
+Disconnect state and stays there until the application calls Connect()
+again.
+
+
+                 State Change to offline & StayConnected = True
+                              +------+
+                              |      v
++-----------+                +---------+                    +------------+
+| Free Ride |-- Connect() -->| Connect |-- Disconnect() --> | Disconnect |
++-----------+                +---------+                    +------------+
+      |  ^                         |                               ^
+      |  +------------------------ +                               |
+      |   State Change to offline & StayConnected = False          |
+      |                                                            |
+      |                                                            |
+      +----------------------- Disconnect() -----------------------+
-- 
1.7.4.4

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to