From 6f0cf99c92b09b5b779db05c565a87a3f79d8d83 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Mon, 12 Aug 2019 19:49:36 +0300 Subject: [PATCH] PPS implementation --- targets/stm32l432/src/nfc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/targets/stm32l432/src/nfc.c b/targets/stm32l432/src/nfc.c index cdcaa8f..5bd19e9 100644 --- a/targets/stm32l432/src/nfc.c +++ b/targets/stm32l432/src/nfc.c @@ -700,7 +700,14 @@ void nfc_process_block(uint8_t * buf, unsigned int len) if (IS_PPSS_CMD(buf[0])) { - printf1(TAG_NFC, "NFC_CMD_PPSS\r\n"); + printf1(TAG_NFC, "NFC_CMD_PPSS [%d] 0x%02x %02x\r\n", len, (len > 2) ? buf[2] : 0); + + if (buf[1] == 0x11 && (buf[2] & 0x0f) == 0x00) { + nfc_write_frame(buf, 1); // ack with correct start byte + } else { + printf1(TAG_NFC, "NFC_CMD_PPSS ERROR!!!\r\n"); + nfc_write_frame("\x00", 1); // this should not happend. but iso14443-4 dont have NACK here, so just 0x00 + } } else if (IS_IBLOCK(buf[0])) {