Hi Tomasz,
Thank you for your help. On 05/07/2015 02:47 PM, Tomasz Bursztyka wrote: > Hi Mylene, > > I haven't worked on this plugin but it looks like the issue a network is added > per-modem only, not really per-modem-context. yes, it is. I looked deeper and in the plugin, the network is created with the context path as identifier : http://git.kernel.org/cgit/network/connman/connman.git/tree/plugins/ofono.c#n1041 With the log : connmand[770]: src/network.c:connman_network_create() identifier /mymodem_0/context1 type 10 > >> And, in general, how would be the best way to implement a list of context ? >> Why connman, currently, handles only one internet context ? I think there >> was a reason to implement it like this. What is it ? > > Yep you saw the comment on add_cm_context(). > > That would need to be fixed yes. > My best bet would be to revert the logic when it comes to context and network: > > instead of modem->context = ... > you could have: context->modem = modem > and modem->contexts would be a list of those context (a simple GSList). Yes, this is what I have done so far. I did not create a GSList but a HashTable to have the context_path, but it is pretty the same logic. > > Then you would create the network with the context as data. > For the network, try to get a name made of the modem's name, and something > that identifies the context (is there such thing? I don't know) In fact, the network is created with the context path as identifier. So I have the information but since it is the identifier, should I create a list of networks ? do you think it could work ? If I implement a list of network, the "add_network" and "connman_network_create" would be called twice (for the two contexts). I think you have more distance than me about the code : do you think it could work like this ? > > This require to change the structures and logic accordingly, could be quite > some work. > Thanks for your advice Mylène _______________________________________________ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman