diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-24 13:28:22 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-24 13:34:51 +0200 |
commit | 0436b3e45753a166fea18d6c1463aef5a38fd1ee (patch) | |
tree | 5317581a8f5e85be45ba9cec8cd03be90c717fb8 /cli/mmcli-modem.c | |
parent | a595912d2d70fce7a8370b194c230331fee605a7 (diff) |
api,introspection: report list of drivers, not just one
Different ports of the same modem may get handled by different drivers. We
therefore need to provide a list of drivers (new `Modem.Drivers' property with
signature 'as') instead of just one (removed `Modem.Driver' property with
signature 's').
$ sudo mmcli -m 0 | grep drivers
| drivers: 'qcserial, qmi_wwan'
Diffstat (limited to 'cli/mmcli-modem.c')
-rw-r--r-- | cli/mmcli-modem.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cli/mmcli-modem.c b/cli/mmcli-modem.c index 3be15da2..7fff7d30 100644 --- a/cli/mmcli-modem.c +++ b/cli/mmcli-modem.c @@ -220,6 +220,7 @@ print_bearer_short_info (MMBearer *bearer) static void print_modem_info (void) { + gchar *drivers_string; gchar *prefixed_revision; gchar *capabilities_string; gchar *access_technologies_string; @@ -272,6 +273,15 @@ print_modem_info (void) } else own_numbers_string = NULL; + if (mm_modem_get_drivers (ctx->modem)) { + drivers_string = g_strjoinv (", ", (gchar **)mm_modem_get_drivers (ctx->modem)); + if (!drivers_string[0]) { + g_free (drivers_string); + drivers_string = NULL; + } + } else + drivers_string = NULL; + /* Rework possible multiline strings */ prefixed_revision = mmcli_prefix_newlines (" | ", mm_modem_get_revision (ctx->modem)); @@ -298,10 +308,10 @@ print_modem_info (void) /* System related stuff */ g_print (" -------------------------\n" " System | device: '%s'\n" - " | driver: '%s'\n" + " | drivers: '%s'\n" " | plugin: '%s'\n", VALIDATE_UNKNOWN (mm_modem_get_device (ctx->modem)), - VALIDATE_UNKNOWN (mm_modem_get_driver (ctx->modem)), + VALIDATE_UNKNOWN (drivers_string), VALIDATE_UNKNOWN (mm_modem_get_plugin (ctx->modem))); /* Numbers related stuff */ @@ -410,6 +420,7 @@ print_modem_info (void) g_free (supported_modes_string); g_free (unlock_retries_string); g_free (own_numbers_string); + g_free (drivers_string); } static void |