mmcli: print own numbers in modem info

This commit is contained in:
Aleksander Morgado
2012-03-06 14:56:44 +01:00
parent 59d8110767
commit b50c5d42e0

View File

@@ -272,6 +272,7 @@ print_modem_info (void)
gchar *supported_bands_string;
gchar *bands_string;
gchar *unlock_retries_string;
gchar *own_numbers_string;
MMModemBand *bands = NULL;
MMUnlockRetries *unlock_retries;
guint n_bands = 0;
@@ -305,6 +306,15 @@ print_modem_info (void)
unlock_retries_string = mm_unlock_retries_build_string (unlock_retries);
g_object_unref (unlock_retries);
if (mm_modem_get_own_numbers (ctx->modem)) {
own_numbers_string = g_strjoinv (", ", (gchar **)mm_modem_get_own_numbers (ctx->modem));
if (!own_numbers_string[0]) {
g_free (own_numbers_string);
own_numbers_string = NULL;
}
} else
own_numbers_string = NULL;
/* Rework possible multiline strings */
prefixed_revision = prefix_newlines (" | ",
mm_modem_get_revision (ctx->modem));
@@ -337,6 +347,11 @@ print_modem_info (void)
VALIDATE_UNKNOWN (mm_modem_get_driver (ctx->modem)),
VALIDATE_UNKNOWN (mm_modem_get_plugin (ctx->modem)));
/* Numbers related stuff */
g_print (" -------------------------\n"
" Numbers | own : '%s'\n",
VALIDATE_UNKNOWN (own_numbers_string));
/* Status related stuff */
g_print (" -------------------------\n"
" Status | lock: '%s'\n"
@@ -437,6 +452,7 @@ print_modem_info (void)
g_free (preferred_mode_string);
g_free (supported_modes_string);
g_free (unlock_retries_string);
g_free (own_numbers_string);
}
static void