diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-07-25 09:25:18 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-07-25 11:43:45 +0200 |
commit | 001f35234e16d7aeb2ed1282ba3b57aea73c5a9e (patch) | |
tree | 8eef7185f09135bf4f012587713e59cfe6b3d9f4 | |
parent | c6c1e0fb50569b9eafd92ba170a8dba42c4948be (diff) |
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.
-rw-r--r-- | cli/mmcli-modem-3gpp.c | 4 | ||||
-rw-r--r-- | cli/mmcli-modem-cdma.c | 4 | ||||
-rw-r--r-- | cli/mmcli-modem-location.c | 4 | ||||
-rw-r--r-- | cli/mmcli-modem-messaging.c | 4 | ||||
-rw-r--r-- | cli/mmcli-modem-time.c | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/cli/mmcli-modem-3gpp.c b/cli/mmcli-modem-3gpp.c index 75b8ee14..22323eda 100644 --- a/cli/mmcli-modem-3gpp.c +++ b/cli/mmcli-modem-3gpp.c @@ -161,8 +161,8 @@ context_free (Context *ctx) static void ensure_modem_3gpp (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); } diff --git a/cli/mmcli-modem-cdma.c b/cli/mmcli-modem-cdma.c index 00979a42..77df70cf 100644 --- a/cli/mmcli-modem-cdma.c +++ b/cli/mmcli-modem-cdma.c @@ -108,8 +108,8 @@ context_free (Context *ctx) static void ensure_modem_cdma (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); } diff --git a/cli/mmcli-modem-location.c b/cli/mmcli-modem-location.c index 51382538..ed2b2f77 100644 --- a/cli/mmcli-modem-location.c +++ b/cli/mmcli-modem-location.c @@ -184,8 +184,8 @@ context_free (Context *ctx) static void ensure_modem_location (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); } 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); } diff --git a/cli/mmcli-modem-time.c b/cli/mmcli-modem-time.c index 7bc277c6..d17c1dee 100644 --- a/cli/mmcli-modem-time.c +++ b/cli/mmcli-modem-time.c @@ -108,8 +108,8 @@ context_free (Context *ctx) static void ensure_modem_time (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); } |