ofono: Discover already online modems
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Wed, 21 Dec 2011 13:40:02 +0000 (14:40 +0100)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Thu, 22 Dec 2011 10:10:15 +0000 (11:10 +0100)
If a modem is already online there will be no updates
on the interfaces and therefore no triggers to do the
complete discovering.

plugins/ofono.c

index bdb9b15..4906dc5 100644 (file)
@@ -1846,6 +1846,20 @@ static void sim_properties_reply(struct modem_data *modem,
                         * modem_enable() callback.
                         */
                        create_device(modem);
+
+                       if (modem->online == FALSE)
+                               return;
+
+                       /*
+                        * The modem is already online and we have the CM interface.
+                        * There will be no interface update and therefore our
+                        * state machine will not go to next step. We have to
+                        * trigger it from here.
+                        */
+                       if (has_interface(modem->interfaces, OFONO_API_CM) == TRUE) {
+                               cm_get_properties(modem);
+                               cm_get_contexts(modem);
+                       }
                        return;
                }