diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2018-10-26 17:30:52 +0200 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2018-10-27 02:48:31 +0000 |
commit | b5858d724b61d42a67f814ad0c19dabd35d05b17 (patch) | |
tree | 5476bc9a6d3231450a9b65c7064ea26f2197d11b | |
parent | ee639201ab51d8bcc6c558e8488070753e6a54d0 (diff) |
qmicli,uim: consolidate slot/app indices starting at 1
We have other methods referring to the slot index as a number starting
at 1 (e.g. --uim-sim-power-on), so we should also report slot indices
in the same way in the --uim-get-card-status output.
And we do the same for the app index, just to follow the same logic.
-rw-r--r-- | src/qmicli/qmicli-uim.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/qmicli/qmicli-uim.c b/src/qmicli/qmicli-uim.c index 7e29e55..7965c95 100644 --- a/src/qmicli/qmicli-uim.c +++ b/src/qmicli/qmicli-uim.c @@ -785,29 +785,29 @@ get_card_status_ready (QmiClientUim *client, g_print ("\tPrimary GW: session doesn't exist\n"); else g_print ("\tPrimary GW: slot '%u', application '%u'\n", - ((index_gw_primary & 0xFF00) >> 8), - ((index_gw_primary & 0x00FF))); + ((index_gw_primary & 0xFF00) >> 8) + 1, + ((index_gw_primary & 0x00FF)) + 1); if (index_1x_primary == 0xFFFF) g_print ("\tPrimary 1X: session doesn't exist\n"); else g_print ("\tPrimary 1X: slot '%u', application '%u'\n", - ((index_1x_primary & 0xFF00) >> 8), - ((index_1x_primary & 0x00FF))); + ((index_1x_primary & 0xFF00) >> 8) + 1, + ((index_1x_primary & 0x00FF)) + 1); if (index_gw_secondary == 0xFFFF) g_print ("\tSecondary GW: session doesn't exist\n"); else g_print ("\tSecondary GW: slot '%u', application '%u'\n", - ((index_gw_secondary & 0xFF00) >> 8), - ((index_gw_secondary & 0x00FF))); + ((index_gw_secondary & 0xFF00) >> 8) + 1, + ((index_gw_secondary & 0x00FF)) + 1); if (index_1x_secondary == 0xFFFF) g_print ("\tSecondary 1X: session doesn't exist\n"); else g_print ("\tSecondary 1X: slot '%u', application '%u'\n", - ((index_1x_secondary & 0xFF00) >> 8), - ((index_1x_secondary & 0x00FF))); + ((index_1x_secondary & 0xFF00) >> 8) + 1, + ((index_1x_secondary & 0x00FF)) + 1); for (i = 0; i < cards->len; i++) { QmiMessageUimGetCardStatusOutputCardStatusCardsElement *card; @@ -815,7 +815,7 @@ get_card_status_ready (QmiClientUim *client, card = &g_array_index (cards, QmiMessageUimGetCardStatusOutputCardStatusCardsElement, i); - g_print ("Card [%u]:\n", i); + g_print ("Slot [%u]:\n", i + 1); if (card->card_state != QMI_UIM_CARD_STATE_ERROR) g_print ("\tCard state: '%s'\n", @@ -845,7 +845,7 @@ get_card_status_ready (QmiClientUim *client, "\t\tApplication state: '%s'\n" "\t\tApplication ID:\n" "\t\t\t%s", - j, + j + 1, VALIDATE_UNKNOWN (qmi_uim_card_application_type_get_string (app->type)), app->type, qmi_uim_card_application_state_get_string (app->state), str); |