From 001f35234e16d7aeb2ed1282ba3b57aea73c5a9e Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 25 Jul 2012 09:25:18 +0200 Subject: cli: ensure modem is enabled when performing actions Don't rely on the lock status, as the modem may say it requires SIM PIN 2, but we're allowed to run most operations even with that unlock required. --- cli/mmcli-modem-messaging.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/mmcli-modem-messaging.c') diff --git a/cli/mmcli-modem-messaging.c b/cli/mmcli-modem-messaging.c index f717552c..3c62408b 100644 --- a/cli/mmcli-modem-messaging.c +++ b/cli/mmcli-modem-messaging.c @@ -120,8 +120,8 @@ context_free (Context *ctx) static void ensure_modem_messaging (void) { - if (mm_modem_get_unlock_required (mm_object_peek_modem (ctx->object)) != MM_MODEM_LOCK_NONE) { - g_printerr ("error: modem not unlocked yet\n"); + if (mm_modem_get_state (mm_object_peek_modem (ctx->object)) < MM_MODEM_STATE_ENABLED) { + g_printerr ("error: modem not enabled yet\n"); exit (EXIT_FAILURE); } -- cgit v1.2.3-70-g09d2