mmcli: abort certain operations if modem is unlocked

Do not try to perform feature/capability specific actions if we're still
unlocked, as the modem didn't yet export the feature/capability specific
interface.

The only interfaces expected while modem is unlocked are the Modem and Simple
interfaces, as well as the SIM interface in the SIM object, of course.
This commit is contained in:
Aleksander Morgado
2012-03-26 13:00:07 +02:00
parent d10780dcf5
commit 28f13c09ec
6 changed files with 65 additions and 28 deletions

View File

@@ -125,11 +125,12 @@ context_free (Context *ctx)
static void
ensure_modem_simple (void)
{
if (ctx->modem_simple)
return;
if (!ctx->modem_simple) {
g_printerr ("error: modem has no Simple capabilities\n");
exit (EXIT_FAILURE);
}
g_printerr ("error: modem has no Simple capabilities\n");
exit (EXIT_FAILURE);
/* Success */
}
void