mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-25 03:29:58 -07:00
[FL-3706], [FL-3674] NFC NTAG and ISO14443-3b reading fix (#3285)
* mf ultralight poller: reset field after reading tearing flags * iso14443-3b poller: change cid comparison in ATTRIB cmd Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -117,12 +117,13 @@ Iso14443_3bError iso14443_3b_poller_activate(Iso14443_3bPoller* instance, Iso144
|
||||
bit_buffer_reset(instance->rx_buffer);
|
||||
|
||||
// Send ATTRIB
|
||||
uint8_t cid = 0;
|
||||
bit_buffer_append_byte(instance->tx_buffer, 0x1d);
|
||||
bit_buffer_append_bytes(instance->tx_buffer, data->uid, ISO14443_3B_UID_SIZE);
|
||||
bit_buffer_append_byte(instance->tx_buffer, 0x00);
|
||||
bit_buffer_append_byte(instance->tx_buffer, ISO14443_3B_ATTRIB_FRAME_SIZE_256);
|
||||
bit_buffer_append_byte(instance->tx_buffer, 0x01);
|
||||
bit_buffer_append_byte(instance->tx_buffer, 0x00);
|
||||
bit_buffer_append_byte(instance->tx_buffer, cid);
|
||||
|
||||
ret = iso14443_3b_poller_frame_exchange(
|
||||
instance, instance->tx_buffer, instance->rx_buffer, iso14443_3b_get_fwt_fc_max(data));
|
||||
@@ -138,11 +139,10 @@ Iso14443_3bError iso14443_3b_poller_activate(Iso14443_3bPoller* instance, Iso144
|
||||
bit_buffer_get_size_bytes(instance->rx_buffer));
|
||||
}
|
||||
|
||||
if(bit_buffer_get_byte(instance->rx_buffer, 0) != 0) {
|
||||
FURI_LOG_D(
|
||||
TAG,
|
||||
"Incorrect CID in ATTRIB response: %02X",
|
||||
bit_buffer_get_byte(instance->rx_buffer, 0));
|
||||
uint8_t cid_received = bit_buffer_get_byte(instance->rx_buffer, 0);
|
||||
// 15 bit is RFU
|
||||
if((cid_received & 0x7f) != cid) {
|
||||
FURI_LOG_D(TAG, "Incorrect CID in ATTRIB response: %02X", cid_received);
|
||||
instance->state = Iso14443_3bPollerStateActivationFailed;
|
||||
ret = Iso14443_3bErrorCommunication;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user