cli: show hardware revision property of Modem interface

This commit is contained in:
Ben Chan
2017-09-17 20:08:42 -07:00
committed by Aleksander Morgado
parent 9c6a1ebb1e
commit 4a5a73eb1e

View File

@@ -250,6 +250,7 @@ print_modem_info (void)
{ {
gchar *drivers_string; gchar *drivers_string;
gchar *prefixed_revision; gchar *prefixed_revision;
gchar *prefixed_hardware_revision;
gchar *supported_capabilities_string; gchar *supported_capabilities_string;
MMModemCapability *capabilities = NULL; MMModemCapability *capabilities = NULL;
guint n_capabilities = 0; guint n_capabilities = 0;
@@ -340,6 +341,12 @@ print_modem_info (void)
else else
prefixed_revision = NULL; prefixed_revision = NULL;
if (mm_modem_get_hardware_revision (ctx->modem))
prefixed_hardware_revision = mmcli_prefix_newlines (" | ",
mm_modem_get_hardware_revision (ctx->modem));
else
prefixed_hardware_revision = NULL;
if (supported_modes_string) { if (supported_modes_string) {
gchar *prefixed; gchar *prefixed;
@@ -381,12 +388,14 @@ print_modem_info (void)
" Hardware | manufacturer: '%s'\n" " Hardware | manufacturer: '%s'\n"
" | model: '%s'\n" " | model: '%s'\n"
" | revision: '%s'\n" " | revision: '%s'\n"
" | H/W revision: '%s'\n"
" | supported: '%s'\n" " | supported: '%s'\n"
" | current: '%s'\n" " | current: '%s'\n"
" | equipment id: '%s'\n", " | equipment id: '%s'\n",
VALIDATE_UNKNOWN (mm_modem_get_manufacturer (ctx->modem)), VALIDATE_UNKNOWN (mm_modem_get_manufacturer (ctx->modem)),
VALIDATE_UNKNOWN (mm_modem_get_model (ctx->modem)), VALIDATE_UNKNOWN (mm_modem_get_model (ctx->modem)),
VALIDATE_UNKNOWN (prefixed_revision), VALIDATE_UNKNOWN (prefixed_revision),
VALIDATE_UNKNOWN (prefixed_hardware_revision),
VALIDATE_UNKNOWN (supported_capabilities_string), VALIDATE_UNKNOWN (supported_capabilities_string),
VALIDATE_UNKNOWN (current_capabilities_string), VALIDATE_UNKNOWN (current_capabilities_string),
VALIDATE_UNKNOWN (mm_modem_get_equipment_identifier (ctx->modem))); VALIDATE_UNKNOWN (mm_modem_get_equipment_identifier (ctx->modem)));
@@ -533,6 +542,7 @@ print_modem_info (void)
g_free (supported_capabilities_string); g_free (supported_capabilities_string);
g_free (current_capabilities_string); g_free (current_capabilities_string);
g_free (prefixed_revision); g_free (prefixed_revision);
g_free (prefixed_hardware_revision);
g_free (allowed_modes_string); g_free (allowed_modes_string);
g_free (preferred_mode_string); g_free (preferred_mode_string);
g_free (supported_modes_string); g_free (supported_modes_string);