Request and process network capability messages
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 18 Sep 2009 07:10:40 +0000 (00:10 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 18 Sep 2009 07:10:40 +0000 (00:10 -0700)
plugins/mbm.c

index db14dd3286d0f923c519a406c51951981357ab3d..3acd9c1f820d61caca08303d02c721aba0e94001 100644 (file)
@@ -67,9 +67,6 @@ static void mbm_debug(const char *str, void *user_data)
 
 static void emrdy_notifier(GAtResult *result, gpointer user_data)
 {
-       GAtResultIter iter;
-
-       g_at_result_iter_init(&iter, result);
 }
 
 static void erinfo_notifier(GAtResult *result, gpointer user_data)
@@ -89,6 +86,15 @@ static void erinfo_notifier(GAtResult *result, gpointer user_data)
        connman_info("network capability: GSM %d UMTS %d", gsm, umts);
 }
 
+static void erinfo_callback(gboolean ok, GAtResult *result,
+                                               gpointer user_data)
+{
+       if (ok == FALSE)
+               return;
+
+       erinfo_notifier(result, user_data);
+}
+
 static void cgdcont_callback(gboolean ok, GAtResult *result,
                                                gpointer user_data)
 {
@@ -217,11 +223,14 @@ static void network_ready(struct connman_device *device)
 {
        struct mbm_data *data = connman_device_get_data(device);
 
-       g_at_chat_send(data->chat, "AT*ERINFO?", NULL, NULL, NULL, NULL);
        g_at_chat_send(data->chat, "AT*E2NAP=1", NULL, NULL, NULL, NULL);
+       g_at_chat_send(data->chat, "AT*ERINFO=1", NULL, NULL, NULL, NULL);
 
        g_at_chat_send(data->chat, "AT+COPS=3,2;+COPS?;+COPS=3,0;+COPS?",
                                cops_prefix, network_callback, device, NULL);
+
+       g_at_chat_send(data->chat, "AT*ERINFO?", NULL, erinfo_callback,
+                                                               device, NULL);
 }
 
 static void creg_callback(gboolean ok, GAtResult *result,