diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2022-05-20 15:13:25 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2022-05-25 11:15:29 +0200 |
commit | 9fa1b32e34e24a710b1badece7becaa44e83fb94 (patch) | |
tree | 6a7b12d2ba86288e3b687fc12a842d847631d257 /cli/mmcli-output.c | |
parent | 63d02f9da251f8e83c837ed7fc7358bd4ea339a4 (diff) |
cli: don't print signal quality unless modem is enabled
We don't have a clear way to report "unknown" signal quality, so for
now just skip printing it altogether in the mmcli human output if the
modem is not yet enabled.
Diffstat (limited to 'cli/mmcli-output.c')
-rw-r--r-- | cli/mmcli-output.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cli/mmcli-output.c b/cli/mmcli-output.c index 14367bf5..ff0dd23a 100644 --- a/cli/mmcli-output.c +++ b/cli/mmcli-output.c @@ -594,13 +594,17 @@ mmcli_output_listitem (MmcF field, /* (Custom) Signal quality output */ void -mmcli_output_signal_quality (guint value, - gboolean recent) +mmcli_output_signal_quality (MMModemState state, + guint value, + gboolean recent) { /* Merge value and recent flag in a single item in human output */ if (selected_type == MMC_OUTPUT_TYPE_HUMAN) { - output_item_new_take_single (MMC_F_STATUS_SIGNAL_QUALITY_VALUE, - g_strdup_printf ("%u%% (%s)", value, recent ? "recent" : "cached")); + if (state >= MM_MODEM_STATE_ENABLED) + output_item_new_take_single (MMC_F_STATUS_SIGNAL_QUALITY_VALUE, + g_strdup_printf ("%u%% (%s)", value, recent ? "recent" : "cached")); + else + output_item_new_take_single (MMC_F_STATUS_SIGNAL_QUALITY_VALUE, NULL); return; } |