summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-10-28 17:12:05 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2011-11-07 15:12:17 +0100
commitc733d18fe10ed24858046fe184facfe8efe9b81a (patch)
tree6d78e9a07c080f7d5940ac3f0655d0e3f00f1d0a /doc
parent2697ff7089a4bfe33db6ffe8159d133e8f696653 (diff)
downloadconnman-c733d18fe10ed24858046fe184facfe8efe9b81a.tar.gz
connman-c733d18fe10ed24858046fe184facfe8efe9b81a.tar.bz2
connman-c733d18fe10ed24858046fe184facfe8efe9b81a.zip
session doc: Document state transitions
Diffstat (limited to 'doc')
-rw-r--r--doc/session-overview.txt47
1 files changed, 47 insertions, 0 deletions
diff --git a/doc/session-overview.txt b/doc/session-overview.txt
index a2978001..05e4a8d6 100644
--- a/doc/session-overview.txt
+++ b/doc/session-overview.txt
@@ -69,3 +69,50 @@ Disconnect algorithm:
|No |
| |
Service.Disconnect() Do nothing
+
+
+Session States and Transitions
+==============================
+
+There are three main strategies 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 to 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
+connect to the service or to delay it, 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
++-----------+ +---------+ -- Disconnect() --> +------------+
+| Free Ride |-- Connect() -->| Connect | | Disconnect |
++-----------+ +---------+ <-- Connect() --- +------------+
+ | ^ | ^
+ | +------------------------ + |
+ | State Change to offline & StayConnected = False |
+ | |
+ | |
+ +----------------------- Disconnect() -----------------------+
+
+Note: this documents the current behavior it is likely to change in near
+future.