[PATCH] cli: show a nicer modem description if manufacturer or model is unknown
Ben Chan
benchan at chromium.org
Wed May 28 23:12:30 PDT 2014
diff --git a/cli/mmcli-manager.c b/cli/mmcli-manager.c
index 3278367..a420e64 100644
--- a/cli/mmcli-manager.c
+++ b/cli/mmcli-manager.c
@@ -190,10 +190,15 @@ scan_devices_ready (MMManager *manager,
static void
print_modem_short_info (MMObject *modem)
{
+ const gchar *manufacturer, *model;
+
+ manufacturer = mm_modem_get_manufacturer (mm_object_peek_modem (modem));
+ model = mm_modem_get_model (mm_object_peek_modem (modem));
+
g_print ("\t%s [%s] %s\n",
mm_object_get_path (modem),
- mm_modem_get_manufacturer (mm_object_peek_modem (modem)),
- mm_modem_get_model (mm_object_peek_modem (modem)));
+ manufacturer ? manufacturer : "unknown",
+ model ? model : "unknown");
}
static void
--
1.9.1.423.g4596e3a
More information about the ModemManager-devel
mailing list