mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-23 13:03:13 +00:00
14_4a poller: send block max attempts increased
This commit is contained in:
parent
c35f258ab8
commit
c24625fae8
1 changed files with 5 additions and 2 deletions
|
@ -7,6 +7,7 @@
|
|||
#define TAG "Iso14443_4aPoller"
|
||||
|
||||
#define ISO14443_4A_FSDI_256 (0x8U)
|
||||
#define ISO14443_4A_SEND_BLOCK_MAX_ATTEMPTS (20)
|
||||
|
||||
Iso14443_4aError iso14443_4a_poller_halt(Iso14443_4aPoller* instance) {
|
||||
furi_assert(instance);
|
||||
|
@ -88,7 +89,7 @@ Iso14443_4aError iso14443_4a_poller_send_block_pwt_ext(
|
|||
BitBuffer* rx_buffer) {
|
||||
furi_assert(instance);
|
||||
|
||||
uint8_t retry = 5;
|
||||
uint8_t attempts_left = ISO14443_4A_SEND_BLOCK_MAX_ATTEMPTS;
|
||||
bit_buffer_reset(instance->tx_buffer);
|
||||
iso14443_4_layer_encode_block(instance->iso14443_4_layer, tx_buffer, instance->tx_buffer);
|
||||
|
||||
|
@ -103,6 +104,8 @@ Iso14443_4aError iso14443_4a_poller_send_block_pwt_ext(
|
|||
iso14443_4a_get_fwt_fc_max(instance->data));
|
||||
|
||||
if(iso14443_3a_error != Iso14443_3aErrorNone) {
|
||||
FURI_LOG_T(
|
||||
TAG, "Attempt: %u", ISO14443_4A_SEND_BLOCK_MAX_ATTEMPTS + 1 - attempts_left);
|
||||
FURI_LOG_RAW_T("RAW RX(%d):", bit_buffer_get_size_bytes(instance->rx_buffer));
|
||||
for(size_t x = 0; x < bit_buffer_get_size_bytes(instance->rx_buffer); x++) {
|
||||
FURI_LOG_RAW_T("%02X ", bit_buffer_get_byte(instance->rx_buffer, x));
|
||||
|
@ -116,7 +119,7 @@ Iso14443_4aError iso14443_4a_poller_send_block_pwt_ext(
|
|||
error = iso14443_4_layer_decode_block_pwt_ext(
|
||||
instance->iso14443_4_layer, rx_buffer, instance->rx_buffer);
|
||||
if(error == Iso14443_4aErrorSendExtra) {
|
||||
if(--retry == 0) break;
|
||||
if(--attempts_left == 0) break;
|
||||
// Send response for Control message
|
||||
if(bit_buffer_get_size_bytes(rx_buffer))
|
||||
bit_buffer_copy(instance->tx_buffer, rx_buffer);
|
||||
|
|
Loading…
Reference in a new issue