aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/fibocom/mm-broadband-bearer-fibocom-ecm.c42
1 files changed, 36 insertions, 6 deletions
diff --git a/plugins/fibocom/mm-broadband-bearer-fibocom-ecm.c b/plugins/fibocom/mm-broadband-bearer-fibocom-ecm.c
index 551fa7e4..0cad0003 100644
--- a/plugins/fibocom/mm-broadband-bearer-fibocom-ecm.c
+++ b/plugins/fibocom/mm-broadband-bearer-fibocom-ecm.c
@@ -87,23 +87,53 @@ dial_3gpp_finish (MMBroadbandBearer *self,
}
static void
-gtrndis_activate_ready (MMBaseModem *modem,
- GAsyncResult *res,
- GTask *task)
+gtrndis_verify_ready (MMBaseModem *modem,
+ GAsyncResult *res,
+ GTask *task)
{
DialContext *ctx;
GError *error = NULL;
+ const gchar *response;
ctx = g_task_get_task_data (task);
+ response = mm_base_modem_at_command_finish (modem, res, &error);
- if (!mm_base_modem_at_command_finish (modem, res, &error))
+ if (!response)
g_task_return_error (task, error);
- else
- g_task_return_pointer (task, g_object_ref (ctx->data), g_object_unref);
+ else {
+ response = mm_strip_tag (response, "+GTRNDIS:");
+ if (strtol (response, NULL, 10) != 1)
+ g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
+ "Connection status verification failed");
+ else
+ g_task_return_pointer (task, g_object_ref (ctx->data), g_object_unref);
+ }
+
g_object_unref (task);
}
static void
+gtrndis_activate_ready (MMBaseModem *modem,
+ GAsyncResult *res,
+ GTask *task)
+{
+ GError *error = NULL;
+
+ if (!mm_base_modem_at_command_finish (modem, res, &error)) {
+ g_task_return_error (task, error);
+ g_object_unref (task);
+ return;
+ }
+
+ mm_base_modem_at_command (modem,
+ "+GTRNDIS?",
+ 6, /* timeout [s] */
+ FALSE, /* allow_cached */
+ (GAsyncReadyCallback) gtrndis_verify_ready,
+ task);
+}
+
+static void
dial_3gpp (MMBroadbandBearer *self,
MMBaseModem *modem,
MMPortSerialAt *primary,