Hi:
You can just read "section Methodology".
Auto-connect need to go through favorite sequence. And a little complicated, I
worked out the overview as the design doc.
Could you please have a look! So I can write patch using the doc.
If you do not have time to go through all the doc, Please just read section
Methodology
Auto Connection Overview
Policy is "auto" and "multi-connection"
Design Target:
Automatically connect to services according to the favorite sequence, when
system
booting, flight-mode off, services state changing.
**********************************************************************
Methodology:
1. Go through sequence from high order to low order
2. Try to connect the service if no higher service is connected
3. Try to connect the service if any of the higher connected service does not
share device with the service.
4. Before Drag and Drop, disconnect the service firstly.
5. Handle of failed connected service.
1) Failed connect leads "workable" flag to "(f)"
2) The (f) service will be ignored
3) The (f) flag can be cleared, so service can be go through again
*************************************************************************
Below is the sample of Auto Connecting
Assume S3,,S4,S5 share device. Connect with one service will make other service
disconnected automatically.
Booting/Flight Mode off Process:
The favorite services sequence is scanned and created.
1. S1 is created(normally load from storage). This service is connected(S1->C1),
because it is the only favorite service
+-------------------------------------+
| S1->C1 |
+-------------------------------------+
2. S2 is created. This service is the first in sequence. Try to connect it. But
connection failed. Set its state f. So it will be ignored. User can
select to remove the "f" flag, and it can be tried to connect again.
+-------------------------------------+
| S2(f) |
+-------------------------------------+
| C1 |
+-------------------------------------+
3.S3 is created. Go through the favorite sequence. Ignore S2 because of the "f"
state; Ignore the connected S1(C1); Check whether S3 share the same device
with C1; S3 does not share same device with C1; Connect it, S3->C3.
+-------------------------------------+
| S2(f) |
+-------------------------------------+
| C1 |
+-------------------------------------+
| S3->C3 |
+-------------------------------------+
4. S4 is created. Go through favorite sequence Ignore the S2 for the "f" state;
Ignore connected S1(C1),and S3(C3). Check whether S4 has same device with C1
or C3. And find that S4 and C3 has the same device, so ignore S4.
+-------------------------------------+
| S2(f) |
+-------------------------------------+
| C1 |
+-------------------------------------+
| C3 |
+-------------------------------------+
| S4 |
+-------------------------------------+
5. S5 is created. Go through favorite sequence Ignore the S2 for the "f" state;
Ignore C1; S5 and C1 does not share the same device, connect S5, S5->C5;
C3 will automatically be disconnected for it share the same device with S5.
C3->S3
+-------------------------------------+
| S2(f) |
+-------------------------------------+
| C1 |
+-------------------------------------+
| S5->C5 |
+-------------------------------------+
| C3->S3 |
+-------------------------------------+
| S4 |
+-------------------------------------+
Drag/Drop Process:
In order to make process simple, before D/D, the service should be disconnected.
6. Drag S4 to top. Go through favorite sequence. Connect S4, S4->C4; Ignore
S2("f"); Ignore C1; S4 share device with C5, C5->S5 automatically; S3 share
same device
with C4, ignore it.
+-------------------------------------+
| S4->C4 |
+-------------------------------------+
| S2(f) |
+-------------------------------------+
| C1 |
+-------------------------------------+
| C5->S5 |
+-------------------------------------+
| S3 |
+-------------------------------------+
7. Drag S4 to bottom. Disconnect it firstly. Go through favorite sequence.
Ignore S2(f); Ignore C1; S5->C5, because it does not share device with C1;
S3,S4 is ignored because it share device with C5.
+-------------------------------------+
| S2(f) |
+-------------------------------------+
| C1 |
+-------------------------------------+
| S5->C5 |
+-------------------------------------+
| S3 |
+-------------------------------------+
| S4 |
+-------------------------------------+
Select Non-favorite Service
Assume S6 which shares device with S3,S4,S5.
8. If S6 connected successfully, S6 should be set as favorite with the highest
Order, C5->S5 automatically, for its sharing device with S6.
+-------------------------------------+
| S6->C6 |
+-------------------------------------+
| S2(f) |
+-------------------------------------+
| C1 |
+-------------------------------------+
| C5->S6 |
+-------------------------------------+
| S3 |
+-------------------------------------+
| S4 |
+-------------------------------------+
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman