Skip to content

Commit f8abfc0

Browse files
committed
hf 14a simaid: ignore premature HALT until RATS is reached
1 parent 9933034 commit f8abfc0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

armsrc/iso14443a.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4009,6 +4009,7 @@ void SimulateIso14443aTagAID(uint8_t tagType, uint16_t flags, uint8_t *data,
40094009

40104010
// main loop
40114011
bool finished = false;
4012+
bool got_rats = false;
40124013
while (finished == false) {
40134014
// BUTTON_PRESS check done in GetIso14443aCommandFromReader
40144015
WDT_HIT();
@@ -4046,9 +4047,12 @@ void SimulateIso14443aTagAID(uint8_t tagType, uint16_t flags, uint8_t *data,
40464047
} else if (receivedCmd[0] == ISO14443A_CMD_HALT && len == 4) { // Received a HALT
40474048
LogTrace(receivedCmd, Uart.len, Uart.startTime * 16 - DELAY_AIR2ARM_AS_TAG, Uart.endTime * 16 - DELAY_AIR2ARM_AS_TAG, Uart.parity, true);
40484049
p_response = NULL;
4049-
finished = true;
4050+
if (got_rats) {
4051+
finished = true;
4052+
}
40504053
} else if (receivedCmd[0] == ISO14443A_CMD_RATS && len == 4) { // Received a RATS request
40514054
p_response = &responses[RESP_INDEX_RATS];
4055+
got_rats = true;
40524056
} else {
40534057
// clear old dynamic responses
40544058
dynamic_response_info.response_n = 0;

0 commit comments

Comments
 (0)