This second patch of this serie implements the use of simultaneous APNS
(and so internet contexts).
It removes the restriction about one Internet context per modem and
inverts the logic of the GetContexts function reply (which exited on first 
context).
---
 plugins/ofono.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/plugins/ofono.c b/plugins/ofono.c
index 485608a..8f0f146 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -1188,14 +1188,6 @@ static int add_cm_context(struct modem_data *modem, 
const char *context_path,
 
        DBG("%s context path %s", modem->path, context_path);
 
-       if (modem->context) {
-               /*
-                * We have already assigned a context to this modem
-                * and we do only support one Internet context.
-                */
-               return -EALREADY;
-       }
-
        context = network_context_alloc(context_path);
        if (!context)
                return -ENOMEM;
@@ -1454,7 +1446,7 @@ static void cm_get_contexts_reply(DBusPendingCall *call, 
void *user_data)
                dbus_message_iter_next(&entry);
                dbus_message_iter_recurse(&entry, &value);
 
-               if (add_cm_context(modem, context_path, &value) == 0)
+               if (add_cm_context(modem, context_path, &value) != 0)
                        break;
 
                dbus_message_iter_next(&dict);
-- 
2.1.4

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to