Hi Martin, > 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
so we have all services pre-sorted in a GSequence. If the first service is in a state different than IDLE, then stop right here. The first service in that list is always the default gateway. No need to go further. We just can trigger that process if something changes later. It should be save to run this at any time. > 3. Try to connect the service if any of the higher connected service does not > share device with the service. I wouldn't make it that complicated. Just try the services in the order of the GSequence one by one. Obviously all services with state FAILURE need to be skipped. > 4. Before Drag and Drop, disconnect the service firstly. Only if you move the service to the top (becoming default connection), then you need to disconnect the other one. However for now, I prefer if we just return an error in that case. Something like "not connected". > 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 We do have service->state = FAILURE for this. And service->error gives you a detailed error code. Regards Marcel _______________________________________________ connman mailing list [email protected] http://lists.connman.net/listinfo/connman
