From 29b9dc798d6aaa53801110ca4e9c76b16ea4db1e Mon Sep 17 00:00:00 2001 From: GOB Date: Sun, 21 Dec 2025 18:40:57 +0900 Subject: [PATCH] Add READ_SIG for emulation --- src/nfc/layer/a/emulation_layer_a.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/nfc/layer/a/emulation_layer_a.cpp b/src/nfc/layer/a/emulation_layer_a.cpp index 69c06f2..7141cf4 100644 --- a/src/nfc/layer/a/emulation_layer_a.cpp +++ b/src/nfc/layer/a/emulation_layer_a.cpp @@ -17,6 +17,7 @@ using namespace m5::nfc::a::mifare; using namespace m5::nfc::a::mifare::classic; namespace { +constexpr uint8_t dummy_signature[32] = {}; } // namespace @@ -159,6 +160,14 @@ EmulationLayerA::State EmulationLayerA::receive_callback(const uint8_t* rx, cons } } } break; + case Command::READ_SIG: + if (_picc.isNTAG() || _picc.type == Type::MIFARE_Ultralight_EV1_1 || + _picc.type == Type::MIFARE_Ultralight_EV1_2 || _picc.type == Type::MIFARE_Ultralight_Nano) { + if (rx_len == 2 && rx[1] == 0x00 /*RFU*/) { + ret = _impl->transmit(dummy_signature, sizeof(dummy_signature), 4) ? State::Active : State::None; + } + } + break; default: break;