Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion firmware/application/src/rfid/nfctag/hf/nfc_14a.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ void nfc_tag_14a_data_process(uint8_t *p_data) {
// The trigger conditions are: REQA response in non -Halt mode
// Temporary through: Wupa response in non -choice state, no matter what state is in the state, you can use the Wupa instruction to wake up
if ((szDataBits == 7) && ((isREQA && m_tag_state_14a != NFC_TAG_STATE_14A_HALTED) || isWUPA)) {
// Received 7-bit command (REQA or WUPA) while the tag is active — reset state machine
if (m_tag_state_14a != NFC_TAG_STATE_14A_IDLE && m_tag_state_14a != NFC_TAG_STATE_14A_HALTED) {
m_tag_state_14a = NFC_TAG_STATE_14A_IDLE;
return;
}
// The receiver of the 14A communication is notified, the internal state machine is reset
if (m_tag_handler.cb_reset != NULL) {
m_tag_handler.cb_reset();
Expand Down Expand Up @@ -517,8 +522,16 @@ void nfc_tag_14a_data_process(uint8_t *p_data) {
// No processing is successful, it may be some other data. You need to re-post processing
if (m_tag_handler.cb_state != NULL) { //Activation status, transfer the message to other registered processor processing
m_tag_handler.cb_state(p_data, szDataBits);
break;
}
break;
}
case NFC_TAG_STATE_14A_PROPRIETARY: {
if (m_tag_handler.cb_state != NULL) {
m_tag_handler.cb_state(p_data, szDataBits);
} else {
m_tag_state_14a = NFC_TAG_STATE_14A_IDLE;
}
break;
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions firmware/application/src/rfid/nfctag/hf/nfc_14a.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@

// ISO14443-A Universal state machine
typedef enum {
NFC_TAG_STATE_14A_IDLE, // Leisure, you can wait for any instructions
NFC_TAG_STATE_14A_READY, // Select card status, currently the standard 14A anti -rushing collision
NFC_TAG_STATE_14A_ACTIVE, // Select cards or other instructions to enter the working status, which can receive all data
NFC_TAG_STATE_14A_HALTED, // The label stops working status and can only be awakened by Halt or other special instructions (non -labels)
NFC_TAG_STATE_14A_IDLE, // Leisure, you can wait for any instructions
NFC_TAG_STATE_14A_READY, // Select card status, currently the standard 14A anti -rushing collision
NFC_TAG_STATE_14A_ACTIVE, // Select cards or other instructions to enter the working status, which can receive all data
NFC_TAG_STATE_14A_HALTED, // The label stops working status and can only be awakened by Halt or other special instructions (non -labels)
NFC_TAG_STATE_14A_PROPRIETARY, // Card is in proprietary state; all commands handled only by state_handler
} nfc_tag_14a_state_t;

// UID of the length in the enumeration specification
Expand Down
Loading
Loading