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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user