d42c6d1a16ac19e5f2837b9c5bd0b67a331c4e92
[platform/upstream/connman.git] / doc / session-overview.txt
1 Session API
2 ***********
3
4
5 Connection management algorithm basics
6 ======================================
7
8 When a session is created, a sorted list of services is added to the
9 session. The services are filtered and sorted according AllowedBearers.
10
11 There are three triggers which lead to evaluate the connect
12 algorithm:
13
14  - Session.Connect()
15  - Offline
16
17 Connect algorithm:
18
19               Session.Connect()
20                        |
21                 +------+-------+
22           +-----+ECall Session ?+-----+
23        Yes|     +--------------+      |No
24           |                           |
25         Connect to            +--------------+
26         first available   +---+AvoidHandover?+---+
27         Service           |   +--------------+   |
28                        Yes|                      |No
29                  +----------------+              |
30              +---+In service_list +---+          |
31           Yes|   |and online?     |   |No        |
32              |   +----------------+   |          |
33              |                        |          |
34          Take that one                Take first in
35                                       the service list
36
37 Disconnect algorithm
38
39  - Session.Disconnect()
40
41 Disconnect algorithm:
42
43   Session.Disconnect()
44        |
45        +--- Session.Change()
46        |
47 +-----------------+    Yes
48 |service not used +-------------+
49 |by other session?|             |
50 +------.----------+             |
51        |No                      |
52        |                        |
53     Service.Disconnect()   Do nothing
54
55 Session.Disconnect() will be blocked whenever a ongoing
56 emergency call is active.
57
58
59 Session States and Transitions
60 ==============================
61
62 There is only one state which is called Free Ride.
63
64 The Free Ride state means that a session will go online if a matching
65 service goes online without calling Service.Connect() itself. The idea
66 behind this is that a session doesn't request a connection for itself
67 instead waits until another session actively requires to go online.
68 This is comparable to piggy-backing.
69
70 Connnect()
71  +------+
72  |      v
73 +------------+
74 |  Free Ride |
75 +------------+
76   |     ^
77   +-----+
78  Disconnect()