mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
card_emu: Avoid PTS related race-condition
We should not set the new Fi/Di values before we actually transmitted the PTSS PCK at the old baud rate first.
This commit is contained in:
@@ -440,8 +440,6 @@ static int tx_byte_pts(struct card_handle *ch)
|
||||
break;
|
||||
case PTS_S_WAIT_RESP_PCK:
|
||||
byte = ch->pts.resp[_PCK];
|
||||
/* update baud rate generator with Fi/Di */
|
||||
emu_update_fidi(ch);
|
||||
break;
|
||||
default:
|
||||
TRACE_ERROR("get_byte_pts() in invalid state %u\r\n",
|
||||
@@ -456,6 +454,8 @@ static int tx_byte_pts(struct card_handle *ch)
|
||||
|
||||
switch (ch->pts.state) {
|
||||
case PTS_S_WAIT_RESP_PCK:
|
||||
/* update baud rate generator with Fi/Di */
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user