Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10316 )
Change subject: cardem: add state name in trace ...................................................................... cardem: add state name in trace this helps reading the output while debugging quite a lot Change-Id: Idf301e09cf14e2412e29dcb252563bc6e4e5c630 --- M firmware/libcommon/source/card_emu.c 1 file changed, 19 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c index 14a5dd8..fa09829 100644 --- a/firmware/libcommon/source/card_emu.c +++ b/firmware/libcommon/source/card_emu.c @@ -54,6 +54,22 @@ ISO_S_IN_TPDU, /* inside a TPDU */ }; +const struct value_string iso7816_3_card_state_names[] = { + OSMO_VALUE_STRING(ISO_S_WAIT_POWER), + OSMO_VALUE_STRING(ISO_S_WAIT_CLK), + OSMO_VALUE_STRING(ISO_S_WAIT_RST), + OSMO_VALUE_STRING(ISO_S_WAIT_ATR), + OSMO_VALUE_STRING(ISO_S_IN_ATR), + OSMO_VALUE_STRING(ISO_S_IN_PTS), + OSMO_VALUE_STRING(ISO_S_WAIT_TPDU), + OSMO_VALUE_STRING(ISO_S_IN_TPDU), + { + .value = 0, + .str = NULL, + }, +}; + + /* detailed sub-states of ISO_S_IN_PTS */ enum pts_state { PTS_S_WAIT_REQ_PTSS, @@ -285,8 +301,9 @@ if (ch->state == new_state) return; - TRACE_DEBUG("%u: 7816 card state %u -> %u\r\n", ch->num, - ch->state, new_state); + TRACE_DEBUG("%u: 7816 card state %u (%s) -> %u (%s)\r\n", ch->num, + ch->state, get_value_string(iso7816_3_card_state_names, ch->state), + new_state, get_value_string(iso7816_3_card_state_names, new_state)); ch->state = new_state; switch (new_state) { -- To view, visit https://gerrit.osmocom.org/10316 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Idf301e09cf14e2412e29dcb252563bc6e4e5c630 Gerrit-Change-Number: 10316 Gerrit-PatchSet: 2 Gerrit-Owner: Kévin Redon <kre...@sysmocom.de> Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Kévin Redon <kre...@sysmocom.de>