Change in simtrace2[master]: check RST/VCC/CLK line at every step of the activation

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

tsaitgaist gerrit-no-reply at lists.osmocom.org
Thu Nov 14 19:13:37 UTC 2019


tsaitgaist has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/16078 )


Change subject: check RST/VCC/CLK line at every step of the activation
......................................................................

check RST/VCC/CLK line at every step of the activation

ISO-7816 specifies a card activation sequence: VCC on, CLK active, then RST
release.
we now check for the end state at every state of the activation in case the
reader does not strictly follows the sequence.

change has been tested on OWHW slot 1.

Change-Id: Ie55505ab3a70cbd64281af40af53d5e120313228
---
M firmware/libcommon/source/card_emu.c
1 file changed, 7 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/78/16078/1

diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c
index 087867f..5298ffc 100644
--- a/firmware/libcommon/source/card_emu.c
+++ b/firmware/libcommon/source/card_emu.c
@@ -380,6 +380,13 @@
 	case ISO_S_WAIT_RST:
 		/* disable Rx and Tx of UART */
 		card_emu_uart_enable(ch->uart_chan, 0);
+		/* check end activation state (only necessary if the reader to not respect the activation sequence) */
+		if (ch->vcc_active && ch->clocked && !ch->in_reset) {
+			/* enable the TC/ETU counter once reset has been released */
+			tc_etu_enable(ch->tc_chan);
+			/* prepare to send the ATR */
+			card_set_state(ch, ISO_S_WAIT_ATR);
+		}
 		break;
 	case ISO_S_WAIT_ATR:
 		/* Reset to initial Fi / Di ratio */

-- 
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/16078
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ie55505ab3a70cbd64281af40af53d5e120313228
Gerrit-Change-Number: 16078
Gerrit-PatchSet: 1
Gerrit-Owner: tsaitgaist <kredon at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191114/cc91b861/attachment.htm>


More information about the gerrit-log mailing list