aboutsummaryrefslogtreecommitdiff
path: root/cli/mmcli-modem-cdma.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli/mmcli-modem-cdma.c')
-rw-r--r--cli/mmcli-modem-cdma.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/mmcli-modem-cdma.c b/cli/mmcli-modem-cdma.c
index 5726b46e..7ef5fce3 100644
--- a/cli/mmcli-modem-cdma.c
+++ b/cli/mmcli-modem-cdma.c
@@ -105,6 +105,16 @@ context_free (Context *ctx)
g_free (ctx);
}
+static void
+ensure_modem_cdma (void)
+{
+ if (ctx->modem_cdma)
+ return;
+
+ g_printerr ("error: modem has no CDMA capabilities");
+ exit (EXIT_FAILURE);
+}
+
void
mmcli_modem_cdma_shutdown (void)
{
@@ -146,6 +156,8 @@ get_modem_ready (GObject *source,
ctx->object = mmcli_get_modem_finish (result, &ctx->manager);
ctx->modem_cdma = mm_object_get_modem_cdma (ctx->object);
+ ensure_modem_cdma ();
+
/* Request to activate the modem? */
if (activate_str) {
g_debug ("Asynchronously activating the modem...");
@@ -189,6 +201,8 @@ mmcli_modem_cdma_run_synchronous (GDBusConnection *connection)
&ctx->manager);
ctx->modem_cdma = mm_object_get_modem_cdma (ctx->object);
+ ensure_modem_cdma ();
+
/* Request to activate the modem? */
if (activate_str) {
gboolean result;