Change in simtrace2[master]: card_emu: Initialize PTSS state every time we start PTS

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/.

laforge gerrit-no-reply at lists.osmocom.org
Sun Dec 15 16:26:00 UTC 2019


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


Change subject: card_emu: Initialize PTSS state every time we start PTS
......................................................................

card_emu: Initialize PTSS state every time we start PTS

Let's shift the responsibility from the caller side to the calee side.

Change-Id: I39661ca93c87b2e2071765f69578eec5aaf90ce4
---
M firmware/libcommon/source/card_emu.c
1 file changed, 2 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/01/16601/1

diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c
index 9ea500d..f53b3df 100644
--- a/firmware/libcommon/source/card_emu.c
+++ b/firmware/libcommon/source/card_emu.c
@@ -536,8 +536,6 @@
 		/* update waiting time (see ISO 7816-3 10.2) */
 		ch->waiting_time = ch->wi * 960 * ch->fi;
 		tc_etu_set_wtime(ch->tc_chan, ch->waiting_time);
-		/* reset PTS to initial state */
-		set_pts_state(ch, PTS_S_WAIT_REQ_PTSS);
 		/* go to next state */
 		card_set_state(ch, ISO_S_WAIT_TPDU);
 		return 0;
@@ -703,7 +701,6 @@
 		emu_update_fidi(ch);
 		/* Wait for the next TPDU */
 		card_set_state(ch, ISO_S_WAIT_TPDU);
-		set_pts_state(ch, PTS_S_WAIT_REQ_PTSS);
 		break;
 	default:
 		/* calculate the next state and set it */
@@ -981,6 +978,8 @@
 	switch (ch->state) {
 	case ISO_S_WAIT_TPDU:
 		if (byte == 0xff) {
+			/* reset PTS to initial state */
+			set_pts_state(ch, PTS_S_WAIT_REQ_PTSS);
 			new_state = process_byte_pts(ch, byte);
 			ch->stats.pps++;
 			goto out_silent;

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I39661ca93c87b2e2071765f69578eec5aaf90ce4
Gerrit-Change-Number: 16601
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191215/3fb770b3/attachment.htm>


More information about the gerrit-log mailing list