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.
This commit is contained in:
Aleksander Morgado
2012-07-25 11:43:45 +02:00
parent c6c1e0fb50
commit 001f35234e
5 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -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);
}