1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 20:49:49 +04:00

formatting

This commit is contained in:
MX
2024-07-15 20:02:45 +03:00
parent deeb9dcb15
commit 726cb770d0
488 changed files with 3301 additions and 3288 deletions

View File

@@ -8,7 +8,7 @@
#define SWAPENDIAN(x) \
((x) = ((x) >> 8 & 0xff00ff) | ((x) & 0xff00ff) << 8, (x) = (x) >> 16 | (x) << 16)
#define LF_POLY_ODD (0x29CE5C)
#define LF_POLY_ODD (0x29CE5C)
#define LF_POLY_EVEN (0x870804)
#define BEBIT(x, n) FURI_BIT(x, (n) ^ 24)

View File

@@ -2,9 +2,9 @@
#include <core/check.h>
#define ISO13239_CRC_INIT_DEFAULT (0xFFFFU)
#define ISO13239_CRC_INIT_DEFAULT (0xFFFFU)
#define ISO13239_CRC_INIT_PICOPASS (0xE012U)
#define ISO13239_CRC_POLY (0x8408U)
#define ISO13239_CRC_POLY (0x8408U)
static uint16_t
iso13239_crc_calculate(Iso13239CrcType type, const uint8_t* data, size_t data_size) {

View File

@@ -2,21 +2,21 @@
#include <furi.h>
#define ISO14443_4_BLOCK_PCB (1U << 1)
#define ISO14443_4_BLOCK_PCB (1U << 1)
#define ISO14443_4_BLOCK_PCB_I (0U)
#define ISO14443_4_BLOCK_PCB_R (5U << 5)
#define ISO14443_4_BLOCK_PCB_S (3U << 6)
#define ISO14443_4_BLOCK_PCB_I_ (0U << 6)
#define ISO14443_4_BLOCK_PCB_R_ (2U << 6)
#define ISO14443_4_BLOCK_PCB_I_ (0U << 6)
#define ISO14443_4_BLOCK_PCB_R_ (2U << 6)
#define ISO14443_4_BLOCK_PCB_TYPE_MASK (3U << 6)
#define ISO14443_4_BLOCK_PCB_S_DESELECT (0U << 4)
#define ISO14443_4_BLOCK_PCB_S_WTX (3U << 4)
#define ISO14443_4_BLOCK_PCB_S_DESELECT (0U << 4)
#define ISO14443_4_BLOCK_PCB_S_WTX (3U << 4)
#define ISO14443_4_BLOCK_PCB_BLOCK_NUMBER (1U << 0)
#define ISO14443_4_BLOCK_PCB_NAD (1U << 2)
#define ISO14443_4_BLOCK_PCB_CID (1U << 3)
#define ISO14443_4_BLOCK_PCB_NAD (1U << 2)
#define ISO14443_4_BLOCK_PCB_CID (1U << 3)
#define ISO14443_4_BLOCK_PCB_CHAINING (1U << 4)
struct Iso14443_4Layer {

View File

@@ -45,4 +45,4 @@ void nfc_util_odd_parity(const uint8_t* src, uint8_t* dst, uint8_t len) {
if(bit) {
*dst = parity;
}
}
}

View File

@@ -9,13 +9,13 @@ extern "C" {
#endif
/* NFC file format version which changed ATQA format. Deprecated. */
#define NFC_LSB_ATQA_FORMAT_VERSION (2)
#define NFC_LSB_ATQA_FORMAT_VERSION (2)
/* NFC file format version which is still supported as backwards compatible. */
#define NFC_MINIMUM_SUPPORTED_FORMAT_VERSION NFC_LSB_ATQA_FORMAT_VERSION
/* NFC file format version which implemented the unified loading process. */
#define NFC_UNIFIED_FORMAT_VERSION (4)
#define NFC_UNIFIED_FORMAT_VERSION (4)
/* Current NFC file format version. */
#define NFC_CURRENT_FORMAT_VERSION NFC_UNIFIED_FORMAT_VERSION
#define NFC_CURRENT_FORMAT_VERSION NFC_UNIFIED_FORMAT_VERSION
#ifdef __cplusplus
}

View File

@@ -6,10 +6,10 @@
#include "nfc_common.h"
#include "protocols/nfc_device_defs.h"
#define NFC_FILE_HEADER "Flipper NFC device"
#define NFC_FILE_HEADER "Flipper NFC device"
#define NFC_DEV_TYPE_ERROR "Protocol type mismatch"
#define NFC_DEVICE_UID_KEY "UID"
#define NFC_DEVICE_UID_KEY "UID"
#define NFC_DEVICE_TYPE_KEY "Device type"
#define NFC_DEVICE_UID_MAX_LEN (10U)

View File

@@ -213,4 +213,4 @@ Iso14443_4aData* emv_get_base_data(const EmvData* data) {
furi_assert(data);
return data->iso14443_4a_data;
}
}

View File

@@ -12,44 +12,44 @@ extern "C" {
#define UNKNOWN_TAG 0x0B
#define EMV_TAG_AID 0x4F
#define EMV_TAG_PRIORITY 0x87
#define EMV_TAG_AID 0x4F
#define EMV_TAG_PRIORITY 0x87
#define EMV_TAG_APPL_INTERCHANGE_PROFILE 0x82
#define EMV_TAG_PDOL 0x9F38
#define EMV_TAG_APPL_LABEL 0x50
#define EMV_TAG_APPL_NAME 0x9F12
#define EMV_TAG_APPL_EFFECTIVE 0x5F25
#define EMV_TAG_PIN_TRY_COUNTER 0x9F17
#define EMV_TAG_LOG_ENTRY 0x9F4D
#define EMV_TAG_LOG_FMT 0x9F4F
#define EMV_TAG_PDOL 0x9F38
#define EMV_TAG_APPL_LABEL 0x50
#define EMV_TAG_APPL_NAME 0x9F12
#define EMV_TAG_APPL_EFFECTIVE 0x5F25
#define EMV_TAG_PIN_TRY_COUNTER 0x9F17
#define EMV_TAG_LOG_ENTRY 0x9F4D
#define EMV_TAG_LOG_FMT 0x9F4F
#define EMV_TAG_LAST_ONLINE_ATC 0x9F13
#define EMV_TAG_ATC 0x9F36
#define EMV_TAG_LOG_AMOUNT 0x9F02
#define EMV_TAG_LOG_COUNTRY 0x9F1A
#define EMV_TAG_LOG_CURRENCY 0x5F2A
#define EMV_TAG_LOG_DATE 0x9A
#define EMV_TAG_LOG_TIME 0x9F21
#define EMV_TAG_ATC 0x9F36
#define EMV_TAG_LOG_AMOUNT 0x9F02
#define EMV_TAG_LOG_COUNTRY 0x9F1A
#define EMV_TAG_LOG_CURRENCY 0x5F2A
#define EMV_TAG_LOG_DATE 0x9A
#define EMV_TAG_LOG_TIME 0x9F21
#define EMV_TAG_TRACK_1_EQUIV 0x56
#define EMV_TAG_TRACK_2_EQUIV 0x57
#define EMV_TAG_PAN 0x5A
#define EMV_TAG_AFL 0x94
#define EMV_TAG_EXP_DATE 0x5F24
#define EMV_TAG_COUNTRY_CODE 0x5F28
#define EMV_TAG_CURRENCY_CODE 0x9F42
#define EMV_TAG_CARDHOLDER_NAME 0x5F20
#define EMV_TAG_TRACK_1_EQUIV 0x56
#define EMV_TAG_TRACK_2_EQUIV 0x57
#define EMV_TAG_PAN 0x5A
#define EMV_TAG_AFL 0x94
#define EMV_TAG_EXP_DATE 0x5F24
#define EMV_TAG_COUNTRY_CODE 0x5F28
#define EMV_TAG_CURRENCY_CODE 0x9F42
#define EMV_TAG_CARDHOLDER_NAME 0x5F20
#define EMV_TAG_CARDHOLDER_NAME_EXTENDED 0x9F0B
#define EMV_TAG_TRACK_2_DATA 0x9F6B
#define EMV_TAG_GPO_FMT1 0x80
#define EMV_TAG_TRACK_2_DATA 0x9F6B
#define EMV_TAG_GPO_FMT1 0x80
#define EMV_TAG_RESP_BUF_SIZE 0x6C
#define EMV_TAG_RESP_BUF_SIZE 0x6C
#define EMV_TAG_RESP_BYTES_AVAILABLE 0x61
// Not used tags
#define EMV_TAG_FORM_FACTOR 0x9F6E
#define EMV_TAG_APP_TEMPLATE 0x61
#define EMV_TAG_FCI 0xBF0C
#define EMV_TAG_FORM_FACTOR 0x9F6E
#define EMV_TAG_APP_TEMPLATE 0x61
#define EMV_TAG_FCI 0xBF0C
#define EMV_TAG_DEPOSIT_LOG_ENTRY 0xDF4D
typedef struct {

View File

@@ -203,4 +203,4 @@ const NfcPollerBase emv_poller = {
.run = (NfcPollerRun)emv_poller_run,
.detect = (NfcPollerDetect)emv_poller_detect,
.get_data = (NfcPollerGetData)emv_poller_get_data,
};
};

View File

@@ -56,4 +56,4 @@ EmvError emv_poller_get_last_online_atc(EmvPoller* instance);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -2,4 +2,4 @@
#include <nfc/protocols/nfc_poller_base.h>
extern const NfcPollerBase emv_poller;
extern const NfcPollerBase emv_poller;

View File

@@ -5,10 +5,10 @@
#include <nfc/nfc_common.h>
#define FELICA_PROTOCOL_NAME "FeliCa"
#define FELICA_DEVICE_NAME "FeliCa"
#define FELICA_DEVICE_NAME "FeliCa"
#define FELICA_DATA_FORMAT_VERSION "Data format version"
#define FELICA_MANUFACTURE_ID "Manufacture id"
#define FELICA_DATA_FORMAT_VERSION "Data format version"
#define FELICA_MANUFACTURE_ID "Manufacture id"
#define FELICA_MANUFACTURE_PARAMETER "Manufacture parameter"
static const uint32_t felica_data_format_version = 1;
@@ -353,4 +353,4 @@ void felica_calculate_mac_write(
memcpy(session_swapped, session_key + 8, 8);
memcpy(session_swapped + 8, session_key, 8);
felica_calculate_mac(ctx, session_swapped, rc, first_block, data, FELICA_DATA_BLOCK_SIZE, mac);
}
}

View File

@@ -8,44 +8,44 @@
extern "C" {
#endif
#define FELICA_IDM_SIZE (8U)
#define FELICA_PMM_SIZE (8U)
#define FELICA_IDM_SIZE (8U)
#define FELICA_PMM_SIZE (8U)
#define FELICA_DATA_BLOCK_SIZE (16U)
#define FELICA_CMD_READ_WITHOUT_ENCRYPTION (0x06U)
#define FELICA_CMD_READ_WITHOUT_ENCRYPTION (0x06U)
#define FELICA_CMD_WRITE_WITHOUT_ENCRYPTION (0x08U)
#define FELICA_SERVICE_RW_ACCESS (0x0009U)
#define FELICA_SERVICE_RO_ACCESS (0x000BU)
#define FELICA_BLOCKS_TOTAL_COUNT (28U)
#define FELICA_BLOCK_INDEX_REG (0x0EU)
#define FELICA_BLOCK_INDEX_RC (0x80U)
#define FELICA_BLOCK_INDEX_MAC (0x81U)
#define FELICA_BLOCK_INDEX_ID (0x82U)
#define FELICA_BLOCK_INDEX_D_ID (0x83U)
#define FELICA_BLOCK_INDEX_SER_C (0x84U)
#define FELICA_BLOCK_INDEX_SYS_C (0x85U)
#define FELICA_BLOCK_INDEX_CKV (0x86U)
#define FELICA_BLOCK_INDEX_CK (0x87U)
#define FELICA_BLOCK_INDEX_MC (0x88U)
#define FELICA_BLOCK_INDEX_WCNT (0x90U)
#define FELICA_BLOCK_INDEX_MAC_A (0x91U)
#define FELICA_BLOCK_INDEX_STATE (0x92U)
#define FELICA_BLOCKS_TOTAL_COUNT (28U)
#define FELICA_BLOCK_INDEX_REG (0x0EU)
#define FELICA_BLOCK_INDEX_RC (0x80U)
#define FELICA_BLOCK_INDEX_MAC (0x81U)
#define FELICA_BLOCK_INDEX_ID (0x82U)
#define FELICA_BLOCK_INDEX_D_ID (0x83U)
#define FELICA_BLOCK_INDEX_SER_C (0x84U)
#define FELICA_BLOCK_INDEX_SYS_C (0x85U)
#define FELICA_BLOCK_INDEX_CKV (0x86U)
#define FELICA_BLOCK_INDEX_CK (0x87U)
#define FELICA_BLOCK_INDEX_MC (0x88U)
#define FELICA_BLOCK_INDEX_WCNT (0x90U)
#define FELICA_BLOCK_INDEX_MAC_A (0x91U)
#define FELICA_BLOCK_INDEX_STATE (0x92U)
#define FELICA_BLOCK_INDEX_CRC_CHECK (0xA0U)
#define FELICA_GUARD_TIME_US (20000U)
#define FELICA_FDT_POLL_FC (10000U)
#define FELICA_GUARD_TIME_US (20000U)
#define FELICA_FDT_POLL_FC (10000U)
#define FELICA_POLL_POLL_MIN_US (1280U)
#define FELICA_FDT_LISTEN_FC (1172)
#define FELICA_SYSTEM_CODE_CODE (0xFFFFU)
#define FELICA_TIME_SLOT_1 (0x00U)
#define FELICA_TIME_SLOT_2 (0x01U)
#define FELICA_TIME_SLOT_4 (0x03U)
#define FELICA_TIME_SLOT_8 (0x07U)
#define FELICA_TIME_SLOT_16 (0x0FU)
#define FELICA_TIME_SLOT_1 (0x00U)
#define FELICA_TIME_SLOT_2 (0x01U)
#define FELICA_TIME_SLOT_4 (0x03U)
#define FELICA_TIME_SLOT_8 (0x07U)
#define FELICA_TIME_SLOT_16 (0x0FU)
/** @brief Type of possible Felica errors */
typedef enum {
@@ -174,8 +174,8 @@ typedef struct {
typedef struct {
uint8_t service_code : 4;
uint8_t access_mode : 3;
uint8_t length : 1;
uint8_t access_mode : 3;
uint8_t length : 1;
uint8_t block_number;
} FelicaBlockListElement;

View File

@@ -4,8 +4,8 @@
#include <nfc/helpers/felica_crc.h>
#include <furi_hal_nfc.h>
#define FELICA_LISTENER_MAX_BUFFER_SIZE (128)
#define FELICA_LISTENER_RESPONSE_CODE_READ (0x07)
#define FELICA_LISTENER_MAX_BUFFER_SIZE (128)
#define FELICA_LISTENER_RESPONSE_CODE_READ (0x07)
#define FELICA_LISTENER_RESPONSE_CODE_WRITE (0x09)
#define TAG "FelicaListener"
@@ -207,4 +207,4 @@ const NfcListenerBase nfc_listener_felica = {
.set_callback = (NfcListenerSetCallback)felica_listener_set_callback,
.get_data = (NfcListenerGetData)felica_listener_get_data,
.run = (NfcListenerRun)felica_listener_run,
};
};

View File

@@ -11,4 +11,4 @@ typedef struct FelicaListener FelicaListener;
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -2,25 +2,25 @@
#include <nfc/helpers/felica_crc.h>
#define FELICA_WCNT_MC2_FF_MAX_VALUE (0x00FFFFFFU)
#define FELICA_WCNT_MC2_00_MAX_VALUE (0x00FFFE00U)
#define FELICA_WCNT_MC2_FF_MAX_VALUE (0x00FFFFFFU)
#define FELICA_WCNT_MC2_00_MAX_VALUE (0x00FFFE00U)
#define FELICA_WCNT_MC2_00_WARNING_BEGIN_VALUE (0x00001027U)
#define FELICA_WCNT_MC2_00_WARNING_END_VALUE (0x00FFFDFFU)
#define FELICA_WCNT_MC2_00_WARNING_END_VALUE (0x00FFFDFFU)
#define FELICA_MC_SP_REG_ALL_RW_BYTES_0_1 (0U)
#define FELICA_MC_ALL_BYTE (2U)
#define FELICA_MC_SYS_OP (3U)
#define FELICA_MC_RF_PRM (4U)
#define FELICA_MC_CKCKV_W_MAC_A (5U)
#define FELICA_MC_SP_REG_R_RESTR_BYTES_6_7 (6U)
#define FELICA_MC_SP_REG_W_RESTR_BYTES_8_9 (8U)
#define FELICA_MC_SP_REG_ALL_RW_BYTES_0_1 (0U)
#define FELICA_MC_ALL_BYTE (2U)
#define FELICA_MC_SYS_OP (3U)
#define FELICA_MC_RF_PRM (4U)
#define FELICA_MC_CKCKV_W_MAC_A (5U)
#define FELICA_MC_SP_REG_R_RESTR_BYTES_6_7 (6U)
#define FELICA_MC_SP_REG_W_RESTR_BYTES_8_9 (8U)
#define FELICA_MC_SP_REG_W_MAC_A_BYTES_10_11 (10U)
#define FELICA_MC_STATE_W_MAC_A (12U)
#define FELICA_MC_RESERVED_13 (13U)
#define FELICA_MC_RESERVED_14 (14U)
#define FELICA_MC_RESERVED_15 (15U)
#define FELICA_MC_STATE_W_MAC_A (12U)
#define FELICA_MC_RESERVED_13 (13U)
#define FELICA_MC_RESERVED_14 (14U)
#define FELICA_MC_RESERVED_15 (15U)
#define FELICA_MC_BYTE_GET(data, byte) (data->data.fs.mc.data[byte])
#define FELICA_MC_BYTE_GET(data, byte) (data->data.fs.mc.data[byte])
#define FELICA_SYSTEM_BLOCK_RO_ACCESS(data) (FELICA_MC_BYTE_GET(data, FELICA_MC_ALL_BYTE) == 0x00)
#define FELICA_SYSTEM_BLOCK_RW_ACCESS(data) (FELICA_MC_BYTE_GET(data, FELICA_MC_ALL_BYTE) == 0xFF)
@@ -735,4 +735,4 @@ FelicaError
} while(false);
return ret;
}
}

View File

@@ -2,8 +2,8 @@
#include <nfc/protocols/nfc_generic_event.h>
#define FELICA_LISTENER_READ_BLOCK_COUNT_MAX (4U)
#define FELICA_LISTENER_READ_BLOCK_COUNT_MIN (1U)
#define FELICA_LISTENER_READ_BLOCK_COUNT_MAX (4U)
#define FELICA_LISTENER_READ_BLOCK_COUNT_MIN (1U)
#define FELICA_LISTENER_WRITE_BLOCK_COUNT_MAX (2U)
#define FELICA_LISTENER_WRITE_BLOCK_COUNT_MIN (1U)

View File

@@ -11,7 +11,7 @@ extern "C" {
#define FELICA_POLLER_POLLING_FWT (200000U)
#define FELICA_POLLER_CMD_POLLING_REQ_CODE (0x00U)
#define FELICA_POLLER_CMD_POLLING_REQ_CODE (0x00U)
#define FELICA_POLLER_CMD_POLLING_RESP_CODE (0x01U)
typedef enum {

View File

@@ -67,4 +67,4 @@ FelicaError felica_poller_sync_read(Nfc* nfc, FelicaData* data, const FelicaCard
}
return poller_context.error;
}
}

View File

@@ -6,11 +6,11 @@
#define ISO14443A_ATS_BIT (1U << 5)
#define ISO14443_3A_PROTOCOL_NAME_LEGACY "UID"
#define ISO14443_3A_PROTOCOL_NAME "ISO14443-3A"
#define ISO14443_3A_DEVICE_NAME "ISO14443-3A (Unknown)"
#define ISO14443_3A_PROTOCOL_NAME "ISO14443-3A"
#define ISO14443_3A_DEVICE_NAME "ISO14443-3A (Unknown)"
#define ISO14443_3A_ATQA_KEY "ATQA"
#define ISO14443_3A_SAK_KEY "SAK"
#define ISO14443_3A_SAK_KEY "SAK"
const NfcDeviceBase nfc_device_iso14443_3a = {
.protocol_name = ISO14443_3A_PROTOCOL_NAME,

View File

@@ -7,16 +7,16 @@
extern "C" {
#endif
#define ISO14443_3A_UID_4_BYTES (4U)
#define ISO14443_3A_UID_7_BYTES (7U)
#define ISO14443_3A_UID_4_BYTES (4U)
#define ISO14443_3A_UID_7_BYTES (7U)
#define ISO14443_3A_UID_10_BYTES (10U)
#define ISO14443_3A_MAX_UID_SIZE ISO14443_3A_UID_10_BYTES
#define ISO14443_3A_GUARD_TIME_US (5000)
#define ISO14443_3A_FDT_POLL_FC (1620)
#define ISO14443_3A_FDT_LISTEN_FC (1172)
#define ISO14443_3A_GUARD_TIME_US (5000)
#define ISO14443_3A_FDT_POLL_FC (1620)
#define ISO14443_3A_FDT_LISTEN_FC (1172)
#define ISO14443_3A_POLLER_MASK_RX_FS ((ISO14443_3A_FDT_LISTEN_FC) / 2)
#define ISO14443_3A_POLL_POLL_MIN_US (1100)
#define ISO14443_3A_POLL_POLL_MIN_US (1100)
typedef enum {
Iso14443_3aErrorNone,

View File

@@ -47,7 +47,7 @@ Iso14443_3aError iso14443_3a_listener_tx_with_custom_parity(
}
return ret;
};
}
Iso14443_3aError iso14443_3a_listener_send_standard_frame(
Iso14443_3aListener* instance,

View File

@@ -12,7 +12,7 @@ extern "C" {
#define ISO14443_3A_POLLER_SEL_CMD(cascade_lvl) (0x93 + 2 * (cascade_lvl))
#define ISO14443_3A_POLLER_SEL_PAR(bytes, bits) (((bytes) << 4 & 0xf0U) | ((bits) & 0x0fU))
#define ISO14443_3A_POLLER_SDD_CL (0x88U)
#define ISO14443_3A_POLLER_SDD_CL (0x88U)
typedef enum {
Iso14443_3aPollerColResStateStateIdle,

View File

@@ -55,4 +55,4 @@ Iso14443_3aError iso14443_3a_poller_sync_read(Nfc* nfc, Iso14443_3aData* iso1444
}
return poller_context.error;
}
}

View File

@@ -7,9 +7,9 @@
#include <nfc/helpers/iso14443_crc.h>
#define ISO14443_3B_PROTOCOL_NAME "ISO14443-3B"
#define ISO14443_3B_DEVICE_NAME "ISO14443-3B (Unknown)"
#define ISO14443_3B_DEVICE_NAME "ISO14443-3B (Unknown)"
#define ISO14443_3B_APP_DATA_KEY "Application data"
#define ISO14443_3B_APP_DATA_KEY "Application data"
#define ISO14443_3B_PROTOCOL_INFO_KEY "Protocol info"
#define ISO14443_3B_FDT_POLL_DEFAULT_FC (ISO14443_3B_FDT_POLL_FC)

View File

@@ -2,20 +2,20 @@
#include "iso14443_3b.h"
#define ISO14443_3B_UID_SIZE (4U)
#define ISO14443_3B_UID_SIZE (4U)
#define ISO14443_3B_APP_DATA_SIZE (4U)
#define ISO14443_3B_GUARD_TIME_US (5000U)
#define ISO14443_3B_FDT_POLL_FC (9000U)
#define ISO14443_3B_GUARD_TIME_US (5000U)
#define ISO14443_3B_FDT_POLL_FC (9000U)
#define ISO14443_3B_POLL_POLL_MIN_US (1280U)
#define ISO14443_3B_BIT_RATE_BOTH_106KBIT (0U << 0)
#define ISO14443_3B_BIT_RATE_PCD_TO_PICC_212KBIT (1U << 0)
#define ISO14443_3B_BIT_RATE_PCD_TO_PICC_424KBIT (1U << 1)
#define ISO14443_3B_BIT_RATE_PCD_TO_PICC_848KBIT (1U << 2)
#define ISO14443_3B_BIT_RATE_PICC_TO_PCD_212KBIT (1U << 4)
#define ISO14443_3B_BIT_RATE_PICC_TO_PCD_424KBIT (1U << 5)
#define ISO14443_3B_BIT_RATE_PICC_TO_PCD_848KBIT (1U << 6)
#define ISO14443_3B_BIT_RATE_BOTH_106KBIT (0U << 0)
#define ISO14443_3B_BIT_RATE_PCD_TO_PICC_212KBIT (1U << 0)
#define ISO14443_3B_BIT_RATE_PCD_TO_PICC_424KBIT (1U << 1)
#define ISO14443_3B_BIT_RATE_PCD_TO_PICC_848KBIT (1U << 2)
#define ISO14443_3B_BIT_RATE_PICC_TO_PCD_212KBIT (1U << 4)
#define ISO14443_3B_BIT_RATE_PICC_TO_PCD_424KBIT (1U << 5)
#define ISO14443_3B_BIT_RATE_PICC_TO_PCD_848KBIT (1U << 6)
#define ISO14443_3B_BIT_RATE_BOTH_SAME_COMPULSORY (1U << 7)
#define ISO14443_3B_FRAME_OPTION_NAD (1U << 1)
@@ -23,11 +23,11 @@
typedef struct {
uint8_t bit_rate_capability;
uint8_t protocol_type : 4;
uint8_t protocol_type : 4;
uint8_t max_frame_size : 4;
uint8_t fo : 2;
uint8_t adc : 2;
uint8_t fwi : 4;
uint8_t fo : 2;
uint8_t adc : 2;
uint8_t fwi : 4;
} Iso14443_3bProtocolInfo;
struct Iso14443_3bData {

View File

@@ -3,12 +3,12 @@
#include <furi.h>
#define ISO14443_4A_PROTOCOL_NAME "ISO14443-4A"
#define ISO14443_4A_DEVICE_NAME "ISO14443-4A (Unknown)"
#define ISO14443_4A_DEVICE_NAME "ISO14443-4A (Unknown)"
#define ISO14443_4A_T0_KEY "T0"
#define ISO14443_4A_TA1_KEY "TA(1)"
#define ISO14443_4A_TB1_KEY "TB(1)"
#define ISO14443_4A_TC1_KEY "TC(1)"
#define ISO14443_4A_T0_KEY "T0"
#define ISO14443_4A_TA1_KEY "TA(1)"
#define ISO14443_4A_TB1_KEY "TB(1)"
#define ISO14443_4A_TC1_KEY "TC(1)"
#define ISO14443_4A_T1_TK_KEY "T1...Tk"
#define ISO14443_4A_FDT_DEFAULT_FC ISO14443_3A_FDT_POLL_FC

View File

@@ -9,13 +9,13 @@
#define ISO14443_4A_ATS_T0_TB1 (1U << 5)
#define ISO14443_4A_ATS_T0_TC1 (1U << 6)
#define ISO14443_4A_ATS_TA1_BOTH_106KBIT (0U << 0)
#define ISO14443_4A_ATS_TA1_PCD_TO_PICC_212KBIT (1U << 0)
#define ISO14443_4A_ATS_TA1_PCD_TO_PICC_424KBIT (1U << 1)
#define ISO14443_4A_ATS_TA1_PCD_TO_PICC_848KBIT (1U << 2)
#define ISO14443_4A_ATS_TA1_PICC_TO_PCD_212KBIT (1U << 4)
#define ISO14443_4A_ATS_TA1_PICC_TO_PCD_424KBIT (1U << 5)
#define ISO14443_4A_ATS_TA1_PICC_TO_PCD_848KBIT (1U << 6)
#define ISO14443_4A_ATS_TA1_BOTH_106KBIT (0U << 0)
#define ISO14443_4A_ATS_TA1_PCD_TO_PICC_212KBIT (1U << 0)
#define ISO14443_4A_ATS_TA1_PCD_TO_PICC_424KBIT (1U << 1)
#define ISO14443_4A_ATS_TA1_PCD_TO_PICC_848KBIT (1U << 2)
#define ISO14443_4A_ATS_TA1_PICC_TO_PCD_212KBIT (1U << 4)
#define ISO14443_4A_ATS_TA1_PICC_TO_PCD_424KBIT (1U << 5)
#define ISO14443_4A_ATS_TA1_PICC_TO_PCD_848KBIT (1U << 6)
#define ISO14443_4A_ATS_TA1_BOTH_SAME_COMPULSORY (1U << 7)
#define ISO14443_4A_ATS_TC1_NAD (1U << 0)

View File

@@ -6,12 +6,12 @@
#define TAG "Iso14443_4aPoller"
#define ISO14443_4A_FSDI_256 (0x8U)
#define ISO14443_4A_FSDI_256 (0x8U)
#define ISO14443_4A_SEND_BLOCK_MAX_ATTEMPTS (20)
#define ISO14443_4A_FWT_MAX (4096UL << 14)
#define ISO14443_4A_WTXM_MASK (0x3FU)
#define ISO14443_4A_WTXM_MAX (0x3BU)
#define ISO14443_4A_SWTX (0xF2U)
#define ISO14443_4A_FWT_MAX (4096UL << 14)
#define ISO14443_4A_WTXM_MASK (0x3FU)
#define ISO14443_4A_WTXM_MAX (0x3BU)
#define ISO14443_4A_SWTX (0xF2U)
Iso14443_4aError iso14443_4a_poller_halt(Iso14443_4aPoller* instance) {
furi_check(instance);
@@ -163,4 +163,4 @@ Iso14443_4aError iso14443_4a_poller_send_block_pwt_ext(
} while(true);
return error;
}
}

View File

@@ -4,7 +4,7 @@
#include <nfc/protocols/nfc_device_base_i.h>
#define ISO14443_4B_PROTOCOL_NAME "ISO14443-4B"
#define ISO14443_4B_DEVICE_NAME "ISO14443-4B (Unknown)"
#define ISO14443_4B_DEVICE_NAME "ISO14443-4B (Unknown)"
const NfcDeviceBase nfc_device_iso14443_4b = {
.protocol_name = ISO14443_4B_PROTOCOL_NAME,

View File

@@ -3,21 +3,21 @@
#include <nfc/nfc_common.h>
#define ISO15693_3_PROTOCOL_NAME "ISO15693-3"
#define ISO15693_3_PROTOCOL_NAME "ISO15693-3"
#define ISO15693_3_PROTOCOL_NAME_LEGACY "ISO15693"
#define ISO15693_3_DEVICE_NAME "ISO15693-3 (Unknown)"
#define ISO15693_3_DEVICE_NAME "ISO15693-3 (Unknown)"
#define ISO15693_3_LOCK_DSFID_LEGACY (1U << 0)
#define ISO15693_3_LOCK_AFI_LEGACY (1U << 1)
#define ISO15693_3_LOCK_AFI_LEGACY (1U << 1)
#define ISO15693_3_DSFID_KEY "DSFID"
#define ISO15693_3_AFI_KEY "AFI"
#define ISO15693_3_IC_REF_KEY "IC Reference"
#define ISO15693_3_BLOCK_COUNT_KEY "Block Count"
#define ISO15693_3_BLOCK_SIZE_KEY "Block Size"
#define ISO15693_3_DATA_CONTENT_KEY "Data Content"
#define ISO15693_3_LOCK_DSFID_KEY "Lock DSFID"
#define ISO15693_3_LOCK_AFI_KEY "Lock AFI"
#define ISO15693_3_DSFID_KEY "DSFID"
#define ISO15693_3_AFI_KEY "AFI"
#define ISO15693_3_IC_REF_KEY "IC Reference"
#define ISO15693_3_BLOCK_COUNT_KEY "Block Count"
#define ISO15693_3_BLOCK_SIZE_KEY "Block Size"
#define ISO15693_3_DATA_CONTENT_KEY "Data Content"
#define ISO15693_3_LOCK_DSFID_KEY "Lock DSFID"
#define ISO15693_3_LOCK_AFI_KEY "Lock AFI"
#define ISO15693_3_SECURITY_STATUS_KEY "Security Status"
const NfcDeviceBase nfc_device_iso15693_3 = {

View File

@@ -10,9 +10,9 @@ extern "C" {
#define ISO15693_3_UID_SIZE (8U)
#define ISO15693_3_GUARD_TIME_US (5000U)
#define ISO15693_3_FDT_POLL_FC (4202U)
#define ISO15693_3_FDT_LISTEN_FC (4320U)
#define ISO15693_3_GUARD_TIME_US (5000U)
#define ISO15693_3_FDT_POLL_FC (4202U)
#define ISO15693_3_FDT_LISTEN_FC (4320U)
#define ISO15693_3_POLL_POLL_MIN_US (1500U)
#define ISO15693_3_REQ_FLAG_SUBCARRIER_1 (0U << 0)
@@ -21,59 +21,59 @@ extern "C" {
#define ISO15693_3_REQ_FLAG_DATA_RATE_HI (1U << 1)
#define ISO15693_3_REQ_FLAG_INVENTORY_T4 (0U << 2)
#define ISO15693_3_REQ_FLAG_INVENTORY_T5 (1U << 2)
#define ISO15693_3_REQ_FLAG_EXTENSION (1U << 3)
#define ISO15693_3_REQ_FLAG_EXTENSION (1U << 3)
#define ISO15693_3_REQ_FLAG_T4_SELECTED (1U << 4)
#define ISO15693_3_REQ_FLAG_T4_SELECTED (1U << 4)
#define ISO15693_3_REQ_FLAG_T4_ADDRESSED (1U << 5)
#define ISO15693_3_REQ_FLAG_T4_OPTION (1U << 6)
#define ISO15693_3_REQ_FLAG_T4_OPTION (1U << 6)
#define ISO15693_3_REQ_FLAG_T5_AFI_PRESENT (1U << 4)
#define ISO15693_3_REQ_FLAG_T5_N_SLOTS_16 (0U << 5)
#define ISO15693_3_REQ_FLAG_T5_N_SLOTS_1 (1U << 5)
#define ISO15693_3_REQ_FLAG_T5_OPTION (1U << 6)
#define ISO15693_3_REQ_FLAG_T5_N_SLOTS_16 (0U << 5)
#define ISO15693_3_REQ_FLAG_T5_N_SLOTS_1 (1U << 5)
#define ISO15693_3_REQ_FLAG_T5_OPTION (1U << 6)
#define ISO15693_3_RESP_FLAG_NONE (0U)
#define ISO15693_3_RESP_FLAG_ERROR (1U << 0)
#define ISO15693_3_RESP_FLAG_NONE (0U)
#define ISO15693_3_RESP_FLAG_ERROR (1U << 0)
#define ISO15693_3_RESP_FLAG_EXTENSION (1U << 3)
#define ISO15693_3_RESP_ERROR_NOT_SUPPORTED (0x01U)
#define ISO15693_3_RESP_ERROR_FORMAT (0x02U)
#define ISO15693_3_RESP_ERROR_OPTION (0x03U)
#define ISO15693_3_RESP_ERROR_UNKNOWN (0x0FU)
#define ISO15693_3_RESP_ERROR_BLOCK_UNAVAILABLE (0x10U)
#define ISO15693_3_RESP_ERROR_NOT_SUPPORTED (0x01U)
#define ISO15693_3_RESP_ERROR_FORMAT (0x02U)
#define ISO15693_3_RESP_ERROR_OPTION (0x03U)
#define ISO15693_3_RESP_ERROR_UNKNOWN (0x0FU)
#define ISO15693_3_RESP_ERROR_BLOCK_UNAVAILABLE (0x10U)
#define ISO15693_3_RESP_ERROR_BLOCK_ALREADY_LOCKED (0x11U)
#define ISO15693_3_RESP_ERROR_BLOCK_LOCKED (0x12U)
#define ISO15693_3_RESP_ERROR_BLOCK_WRITE (0x13U)
#define ISO15693_3_RESP_ERROR_BLOCK_LOCK (0x14U)
#define ISO15693_3_RESP_ERROR_CUSTOM_START (0xA0U)
#define ISO15693_3_RESP_ERROR_CUSTOM_END (0xDFU)
#define ISO15693_3_RESP_ERROR_BLOCK_LOCKED (0x12U)
#define ISO15693_3_RESP_ERROR_BLOCK_WRITE (0x13U)
#define ISO15693_3_RESP_ERROR_BLOCK_LOCK (0x14U)
#define ISO15693_3_RESP_ERROR_CUSTOM_START (0xA0U)
#define ISO15693_3_RESP_ERROR_CUSTOM_END (0xDFU)
#define ISO15693_3_CMD_MANDATORY_START (0x01U)
#define ISO15693_3_CMD_INVENTORY (0x01U)
#define ISO15693_3_CMD_STAY_QUIET (0x02U)
#define ISO15693_3_CMD_MANDATORY_RFU (0x03U)
#define ISO15693_3_CMD_OPTIONAL_START (0x20U)
#define ISO15693_3_CMD_READ_BLOCK (0x20U)
#define ISO15693_3_CMD_WRITE_BLOCK (0x21U)
#define ISO15693_3_CMD_LOCK_BLOCK (0x22U)
#define ISO15693_3_CMD_READ_MULTI_BLOCKS (0x23U)
#define ISO15693_3_CMD_WRITE_MULTI_BLOCKS (0x24U)
#define ISO15693_3_CMD_SELECT (0x25U)
#define ISO15693_3_CMD_RESET_TO_READY (0x26U)
#define ISO15693_3_CMD_WRITE_AFI (0x27U)
#define ISO15693_3_CMD_LOCK_AFI (0x28U)
#define ISO15693_3_CMD_WRITE_DSFID (0x29U)
#define ISO15693_3_CMD_LOCK_DSFID (0x2AU)
#define ISO15693_3_CMD_GET_SYS_INFO (0x2BU)
#define ISO15693_3_CMD_MANDATORY_START (0x01U)
#define ISO15693_3_CMD_INVENTORY (0x01U)
#define ISO15693_3_CMD_STAY_QUIET (0x02U)
#define ISO15693_3_CMD_MANDATORY_RFU (0x03U)
#define ISO15693_3_CMD_OPTIONAL_START (0x20U)
#define ISO15693_3_CMD_READ_BLOCK (0x20U)
#define ISO15693_3_CMD_WRITE_BLOCK (0x21U)
#define ISO15693_3_CMD_LOCK_BLOCK (0x22U)
#define ISO15693_3_CMD_READ_MULTI_BLOCKS (0x23U)
#define ISO15693_3_CMD_WRITE_MULTI_BLOCKS (0x24U)
#define ISO15693_3_CMD_SELECT (0x25U)
#define ISO15693_3_CMD_RESET_TO_READY (0x26U)
#define ISO15693_3_CMD_WRITE_AFI (0x27U)
#define ISO15693_3_CMD_LOCK_AFI (0x28U)
#define ISO15693_3_CMD_WRITE_DSFID (0x29U)
#define ISO15693_3_CMD_LOCK_DSFID (0x2AU)
#define ISO15693_3_CMD_GET_SYS_INFO (0x2BU)
#define ISO15693_3_CMD_GET_BLOCKS_SECURITY (0x2CU)
#define ISO15693_3_CMD_OPTIONAL_RFU (0x2DU)
#define ISO15693_3_CMD_CUSTOM_START (0xA0U)
#define ISO15693_3_CMD_OPTIONAL_RFU (0x2DU)
#define ISO15693_3_CMD_CUSTOM_START (0xA0U)
#define ISO15693_3_MANDATORY_COUNT (ISO15693_3_CMD_MANDATORY_RFU - ISO15693_3_CMD_MANDATORY_START)
#define ISO15693_3_OPTIONAL_COUNT (ISO15693_3_CMD_OPTIONAL_RFU - ISO15693_3_CMD_OPTIONAL_START)
#define ISO15693_3_OPTIONAL_COUNT (ISO15693_3_CMD_OPTIONAL_RFU - ISO15693_3_CMD_OPTIONAL_START)
#define ISO15693_3_SYSINFO_FLAG_DSFID (1U << 0)
#define ISO15693_3_SYSINFO_FLAG_AFI (1U << 1)
#define ISO15693_3_SYSINFO_FLAG_DSFID (1U << 0)
#define ISO15693_3_SYSINFO_FLAG_AFI (1U << 1)
#define ISO15693_3_SYSINFO_FLAG_MEMORY (1U << 2)
#define ISO15693_3_SYSINFO_FLAG_IC_REF (1U << 3)

View File

@@ -6,27 +6,27 @@
extern "C" {
#endif
#define MF_CLASSIC_CMD_AUTH_KEY_A (0x60U)
#define MF_CLASSIC_CMD_AUTH_KEY_B (0x61U)
#define MF_CLASSIC_CMD_READ_BLOCK (0x30U)
#define MF_CLASSIC_CMD_WRITE_BLOCK (0xA0U)
#define MF_CLASSIC_CMD_VALUE_DEC (0xC0U)
#define MF_CLASSIC_CMD_VALUE_INC (0xC1U)
#define MF_CLASSIC_CMD_VALUE_RESTORE (0xC2U)
#define MF_CLASSIC_CMD_AUTH_KEY_A (0x60U)
#define MF_CLASSIC_CMD_AUTH_KEY_B (0x61U)
#define MF_CLASSIC_CMD_READ_BLOCK (0x30U)
#define MF_CLASSIC_CMD_WRITE_BLOCK (0xA0U)
#define MF_CLASSIC_CMD_VALUE_DEC (0xC0U)
#define MF_CLASSIC_CMD_VALUE_INC (0xC1U)
#define MF_CLASSIC_CMD_VALUE_RESTORE (0xC2U)
#define MF_CLASSIC_CMD_VALUE_TRANSFER (0xB0U)
#define MF_CLASSIC_CMD_HALT_MSB (0x50)
#define MF_CLASSIC_CMD_HALT_LSB (0x00)
#define MF_CLASSIC_CMD_ACK (0x0A)
#define MF_CLASSIC_CMD_NACK (0x00)
#define MF_CLASSIC_CMD_NACK_TRANSFER_INVALID (0x04)
#define MF_CLASSIC_CMD_HALT_MSB (0x50)
#define MF_CLASSIC_CMD_HALT_LSB (0x00)
#define MF_CLASSIC_CMD_ACK (0x0A)
#define MF_CLASSIC_CMD_NACK (0x00)
#define MF_CLASSIC_CMD_NACK_TRANSFER_INVALID (0x04)
#define MF_CLASSIC_CMD_NACK_TRANSFER_CRC_ERROR (0x01)
#define MF_CLASSIC_TOTAL_SECTORS_MAX (40)
#define MF_CLASSIC_TOTAL_BLOCKS_MAX (256)
#define MF_CLASSIC_READ_MASK_SIZE (MF_CLASSIC_TOTAL_BLOCKS_MAX / 32)
#define MF_CLASSIC_BLOCK_SIZE (16)
#define MF_CLASSIC_KEY_SIZE (6)
#define MF_CLASSIC_TOTAL_BLOCKS_MAX (256)
#define MF_CLASSIC_READ_MASK_SIZE (MF_CLASSIC_TOTAL_BLOCKS_MAX / 32)
#define MF_CLASSIC_BLOCK_SIZE (16)
#define MF_CLASSIC_KEY_SIZE (6)
#define MF_CLASSIC_ACCESS_BYTES_SIZE (4)
#define MF_CLASSIC_NT_SIZE (4)

View File

@@ -8,26 +8,26 @@
extern "C" {
#endif
#define MF_DESFIRE_CMD_GET_VERSION (0x60)
#define MF_DESFIRE_CMD_GET_FREE_MEMORY (0x6E)
#define MF_DESFIRE_CMD_GET_KEY_SETTINGS (0x45)
#define MF_DESFIRE_CMD_GET_KEY_VERSION (0x64)
#define MF_DESFIRE_CMD_GET_VERSION (0x60)
#define MF_DESFIRE_CMD_GET_FREE_MEMORY (0x6E)
#define MF_DESFIRE_CMD_GET_KEY_SETTINGS (0x45)
#define MF_DESFIRE_CMD_GET_KEY_VERSION (0x64)
#define MF_DESFIRE_CMD_GET_APPLICATION_IDS (0x6A)
#define MF_DESFIRE_CMD_SELECT_APPLICATION (0x5A)
#define MF_DESFIRE_CMD_GET_FILE_IDS (0x6F)
#define MF_DESFIRE_CMD_GET_FILE_SETTINGS (0xF5)
#define MF_DESFIRE_CMD_SELECT_APPLICATION (0x5A)
#define MF_DESFIRE_CMD_GET_FILE_IDS (0x6F)
#define MF_DESFIRE_CMD_GET_FILE_SETTINGS (0xF5)
#define MF_DESFIRE_CMD_READ_DATA (0xBD)
#define MF_DESFIRE_CMD_GET_VALUE (0x6C)
#define MF_DESFIRE_CMD_READ_DATA (0xBD)
#define MF_DESFIRE_CMD_GET_VALUE (0x6C)
#define MF_DESFIRE_CMD_READ_RECORDS (0xBB)
#define MF_DESFIRE_MAX_KEYS (14)
#define MF_DESFIRE_MAX_KEYS (14)
#define MF_DESFIRE_MAX_FILES (32)
#define MF_DESFIRE_UID_SIZE (7)
#define MF_DESFIRE_BATCH_SIZE (5)
#define MF_DESFIRE_UID_SIZE (7)
#define MF_DESFIRE_BATCH_SIZE (5)
#define MF_DESFIRE_APP_ID_SIZE (3)
#define MF_DESFIRE_VALUE_SIZE (4)
#define MF_DESFIRE_VALUE_SIZE (4)
typedef struct {
uint8_t hw_vendor;

View File

@@ -11,15 +11,15 @@
MF_DESFIRE_FFF_PICC_PREFIX " " \
"Free Memory"
#define MF_DESFIRE_FFF_CHANGE_KEY_ID_KEY "Change Key ID"
#define MF_DESFIRE_FFF_CONFIG_CHANGEABLE_KEY "Config Changeable"
#define MF_DESFIRE_FFF_CHANGE_KEY_ID_KEY "Change Key ID"
#define MF_DESFIRE_FFF_CONFIG_CHANGEABLE_KEY "Config Changeable"
#define MF_DESFIRE_FFF_FREE_CREATE_DELETE_KEY "Free Create Delete"
#define MF_DESFIRE_FFF_FREE_DIR_LIST_KEY "Free Directory List"
#define MF_DESFIRE_FFF_KEY_CHANGEABLE_KEY "Key Changeable"
#define MF_DESFIRE_FFF_FLAGS_KEY "Flags"
#define MF_DESFIRE_FFF_MAX_KEYS_KEY "Max Keys"
#define MF_DESFIRE_FFF_FREE_DIR_LIST_KEY "Free Directory List"
#define MF_DESFIRE_FFF_KEY_CHANGEABLE_KEY "Key Changeable"
#define MF_DESFIRE_FFF_FLAGS_KEY "Flags"
#define MF_DESFIRE_FFF_MAX_KEYS_KEY "Max Keys"
#define MF_DESFIRE_FFF_KEY_SUB_PREFIX "Key"
#define MF_DESFIRE_FFF_KEY_SUB_PREFIX "Key"
#define MF_DESFIRE_FFF_KEY_VERSION_KEY "Version"
#define MF_DESFIRE_FFF_APPLICATION_COUNT_KEY \
@@ -33,15 +33,15 @@
#define MF_DESFIRE_FFF_FILE_IDS_KEY \
MF_DESFIRE_FFF_FILE_SUB_PREFIX " " \
"IDs"
#define MF_DESFIRE_FFF_FILE_TYPE_KEY "Type"
#define MF_DESFIRE_FFF_FILE_TYPE_KEY "Type"
#define MF_DESFIRE_FFF_FILE_COMM_SETTINGS_KEY "Communication Settings"
#define MF_DESFIRE_FFF_FILE_ACCESS_RIGHTS_KEY "Access Rights"
#define MF_DESFIRE_FFF_FILE_SIZE_KEY "Size"
#define MF_DESFIRE_FFF_FILE_HI_LIMIT_KEY "Hi Limit"
#define MF_DESFIRE_FFF_FILE_LO_LIMIT_KEY "Lo Limit"
#define MF_DESFIRE_FFF_FILE_LIMIT_CREDIT_VALUE_KEY "Limited Credit Value"
#define MF_DESFIRE_FFF_FILE_HI_LIMIT_KEY "Hi Limit"
#define MF_DESFIRE_FFF_FILE_LO_LIMIT_KEY "Lo Limit"
#define MF_DESFIRE_FFF_FILE_LIMIT_CREDIT_VALUE_KEY "Limited Credit Value"
#define MF_DESFIRE_FFF_FILE_LIMIT_CREDIT_ENABLED_KEY "Limited Credit Enabled"
#define MF_DESFIRE_FFF_FILE_MAX_KEY "Max"
@@ -78,12 +78,12 @@ bool mf_desfire_free_memory_parse(MfDesfireFreeMemory* data, const BitBuffer* bu
bool mf_desfire_key_settings_parse(MfDesfireKeySettings* data, const BitBuffer* buf) {
typedef struct FURI_PACKED {
bool is_master_key_changeable : 1;
bool is_free_directory_list : 1;
bool is_free_create_delete : 1;
bool is_config_changeable : 1;
uint8_t change_key_id : 4;
uint8_t max_keys : 4;
uint8_t flags : 4;
bool is_free_directory_list : 1;
bool is_free_create_delete : 1;
bool is_config_changeable : 1;
uint8_t change_key_id : 4;
uint8_t max_keys : 4;
uint8_t flags : 4;
} MfDesfireKeySettingsLayout;
const bool can_parse = bit_buffer_get_size_bytes(buf) == sizeof(MfDesfireKeySettingsLayout);
@@ -164,8 +164,8 @@ bool mf_desfire_file_settings_parse(MfDesfireFileSettings* data, const BitBuffer
typedef struct FURI_PACKED {
uint32_t size : 3 * BITS_IN_BYTE;
uint32_t max : 3 * BITS_IN_BYTE;
uint32_t cur : 3 * BITS_IN_BYTE;
uint32_t max : 3 * BITS_IN_BYTE;
uint32_t cur : 3 * BITS_IN_BYTE;
} MfDesfireFileSettingsRecord;
typedef struct FURI_PACKED {

View File

@@ -3,53 +3,53 @@
#include "mf_desfire.h"
#define MF_DESFIRE_FFF_PICC_PREFIX "PICC"
#define MF_DESFIRE_FFF_APP_PREFIX "Application"
#define MF_DESFIRE_FFF_APP_PREFIX "Application"
// Successful operation
#define MF_DESFIRE_STATUS_OPERATION_OK (0x00)
#define MF_DESFIRE_STATUS_OPERATION_OK (0x00)
// No changes done to backup files, CommitTransaction / AbortTransaction not necessary
#define MF_DESFIRE_STATUS_NO_CHANGES (0x0C)
#define MF_DESFIRE_STATUS_NO_CHANGES (0x0C)
// Insufficient NV-Memory to complete command
#define MF_DESFIRE_STATUS_OUT_OF_EEPROM_ERROR (0x0E)
#define MF_DESFIRE_STATUS_OUT_OF_EEPROM_ERROR (0x0E)
// Command code not supported
#define MF_DESFIRE_STATUS_ILLEGAL_COMMAND_CODE (0x1C)
#define MF_DESFIRE_STATUS_ILLEGAL_COMMAND_CODE (0x1C)
// CRC or MAC does not match data Padding bytes not valid
#define MF_DESFIRE_STATUS_INTEGRITY_ERROR (0x1E)
#define MF_DESFIRE_STATUS_INTEGRITY_ERROR (0x1E)
// Invalid key number specified
#define MF_DESFIRE_STATUS_NO_SUCH_KEY (0x40)
#define MF_DESFIRE_STATUS_NO_SUCH_KEY (0x40)
// Length of command string invalid
#define MF_DESFIRE_STATUS_LENGTH_ERROR (0x7E)
#define MF_DESFIRE_STATUS_LENGTH_ERROR (0x7E)
// Current configuration / status does not allow the requested command
#define MF_DESFIRE_STATUS_PERMISSION_DENIED (0x9D)
#define MF_DESFIRE_STATUS_PERMISSION_DENIED (0x9D)
// Value of the parameter(s) invalid
#define MF_DESFIRE_STATUS_PARAMETER_ERROR (0x9E)
#define MF_DESFIRE_STATUS_PARAMETER_ERROR (0x9E)
// Requested AID not present on PICC
#define MF_DESFIRE_STATUS_APPLICATION_NOT_FOUND (0xA0)
// Unrecoverable error within application, application will be disabled
#define MF_DESFIRE_STATUS_APPL_INTEGRITY_ERROR (0xA1)
#define MF_DESFIRE_STATUS_APPL_INTEGRITY_ERROR (0xA1)
// Current authentication status does not allow the requested command
#define MF_DESFIRE_STATUS_AUTHENTICATION_ERROR (0xAE)
#define MF_DESFIRE_STATUS_AUTHENTICATION_ERROR (0xAE)
// Additional data frame is expected to be sent
#define MF_DESFIRE_STATUS_ADDITIONAL_FRAME (0xAF)
#define MF_DESFIRE_STATUS_ADDITIONAL_FRAME (0xAF)
// Attempt to read/write data from/to beyond the file's/record's limits
// Attempt to exceed the limits of a value file.
#define MF_DESFIRE_STATUS_BOUNDARY_ERROR (0xBE)
#define MF_DESFIRE_STATUS_BOUNDARY_ERROR (0xBE)
// Unrecoverable error within PICC, PICC will be disabled
#define MF_DESFIRE_STATUS_PICC_INTEGRITY_ERROR (0xC1)
#define MF_DESFIRE_STATUS_PICC_INTEGRITY_ERROR (0xC1)
// Previous Command was not fully completed. Not all Frames were requested or provided by the PCD
#define MF_DESFIRE_STATUS_COMMAND_ABORTED (0xCA)
#define MF_DESFIRE_STATUS_COMMAND_ABORTED (0xCA)
// PICC was disabled by an unrecoverable error
#define MF_DESFIRE_STATUS_PICC_DISABLED_ERROR (0xCD)
#define MF_DESFIRE_STATUS_PICC_DISABLED_ERROR (0xCD)
// Number of Applications limited to 28, no additional CreateApplication possible
#define MF_DESFIRE_STATUS_COUNT_ERROR (0xCE)
#define MF_DESFIRE_STATUS_COUNT_ERROR (0xCE)
// Creation of file/application failed because file/application with same number already exists
#define MF_DESFIRE_STATUS_DUBLICATE_ERROR (0xDE)
#define MF_DESFIRE_STATUS_DUBLICATE_ERROR (0xDE)
// Could not complete NV-write operation due to loss of power, internal backup/rollback mechanism activated
#define MF_DESFIRE_STATUS_EEPROM_ERROR (0xEE)
#define MF_DESFIRE_STATUS_EEPROM_ERROR (0xEE)
// Specified file number does not exist
#define MF_DESFIRE_STATUS_FILE_NOT_FOUND (0xF0)
#define MF_DESFIRE_STATUS_FILE_NOT_FOUND (0xF0)
// Unrecoverable error within file, file will be disabled
#define MF_DESFIRE_STATUS_FILE_INTEGRITY_ERROR (0xF1)
#define MF_DESFIRE_STATUS_FILE_INTEGRITY_ERROR (0xF1)
// SimpleArray configurations

View File

@@ -6,7 +6,7 @@
#define TAG "MfDesfirePoller"
#define MF_DESFIRE_BUF_SIZE (64U)
#define MF_DESFIRE_BUF_SIZE (64U)
#define MF_DESFIRE_RESULT_BUF_SIZE (512U)
typedef NfcCommand (*MfDesfirePollerReadHandler)(MfDesfirePoller* instance);

View File

@@ -177,4 +177,4 @@ Iso14443_4aData* mf_plus_get_base_data(const MfPlusData* data) {
furi_check(data);
return data->iso14443_4a_data;
}
}

View File

@@ -7,7 +7,7 @@ extern "C" {
#endif
#define MF_PLUS_UID_SIZE_MAX (7)
#define MF_PLUS_BATCH_SIZE (5)
#define MF_PLUS_BATCH_SIZE (5)
#define MF_PLUS_CMD_GET_VERSION (0x60)
@@ -112,4 +112,4 @@ Iso14443_4aData* mf_plus_get_base_data(const MfPlusData* data);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -7,8 +7,8 @@
#define MF_PLUS_T1_TK_VALUE_LEN 7
#define MF_PLUS_FFF_SECURITY_LEVEL_KEY "Security Level"
#define MF_PLUS_FFF_CARD_TYPE_KEY "Card Type"
#define MF_PLUS_FFF_MEMORY_SIZE_KEY "Memory Size"
#define MF_PLUS_FFF_CARD_TYPE_KEY "Card Type"
#define MF_PLUS_FFF_MEMORY_SIZE_KEY "Memory Size"
#define TAG "MfPlus"

View File

@@ -7,7 +7,7 @@
#define TAG "MfPlusPoller"
#define MF_PLUS_BUF_SIZE (64U)
#define MF_PLUS_BUF_SIZE (64U)
#define MF_PLUS_RESULT_BUF_SIZE (512U)
typedef NfcCommand (*MfPlusPollerReadHandler)(MfPlusPoller* instance);

View File

@@ -52,4 +52,4 @@ MfPlusError mf_plus_poller_read_version(MfPlusPoller* instance, MfPlusVersion* d
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -5,15 +5,15 @@
#define MF_ULTRALIGHT_PROTOCOL_NAME "NTAG/Ultralight"
#define MF_ULTRALIGHT_FORMAT_VERSION_KEY "Data format version"
#define MF_ULTRALIGHT_TYPE_KEY MF_ULTRALIGHT_PROTOCOL_NAME " type"
#define MF_ULTRALIGHT_SIGNATURE_KEY "Signature"
#define MF_ULTRALIGHT_MIFARE_VERSION_KEY "Mifare version"
#define MF_ULTRALIGHT_COUNTER_KEY "Counter"
#define MF_ULTRALIGHT_TEARING_KEY "Tearing"
#define MF_ULTRALIGHT_PAGES_TOTAL_KEY "Pages total"
#define MF_ULTRALIGHT_PAGES_READ_KEY "Pages read"
#define MF_ULTRALIGHT_PAGE_KEY "Page"
#define MF_ULTRALIGHT_FORMAT_VERSION_KEY "Data format version"
#define MF_ULTRALIGHT_TYPE_KEY MF_ULTRALIGHT_PROTOCOL_NAME " type"
#define MF_ULTRALIGHT_SIGNATURE_KEY "Signature"
#define MF_ULTRALIGHT_MIFARE_VERSION_KEY "Mifare version"
#define MF_ULTRALIGHT_COUNTER_KEY "Counter"
#define MF_ULTRALIGHT_TEARING_KEY "Tearing"
#define MF_ULTRALIGHT_PAGES_TOTAL_KEY "Pages total"
#define MF_ULTRALIGHT_PAGES_READ_KEY "Pages read"
#define MF_ULTRALIGHT_PAGE_KEY "Page"
#define MF_ULTRALIGHT_FAILED_ATTEMPTS_KEY "Failed authentication attempts"
typedef struct {
@@ -730,4 +730,4 @@ void mf_ultralight_3des_decrypt(
mbedtls_des3_set2key_dec(ctx, ck);
mbedtls_des3_crypt_cbc(ctx, MBEDTLS_DES_DECRYPT, length, (uint8_t*)iv, input, out);
}
}

View File

@@ -9,44 +9,44 @@ extern "C" {
#define MF_ULTRALIGHT_TEARING_FLAG_DEFAULT (0xBD)
#define MF_ULTRALIGHT_CMD_GET_VERSION (0x60)
#define MF_ULTRALIGHT_CMD_READ_PAGE (0x30)
#define MF_ULTRALIGHT_CMD_FAST_READ (0x3A)
#define MF_ULTRALIGHT_CMD_GET_VERSION (0x60)
#define MF_ULTRALIGHT_CMD_READ_PAGE (0x30)
#define MF_ULTRALIGHT_CMD_FAST_READ (0x3A)
#define MF_ULTRALIGHT_CMD_SECTOR_SELECT (0xC2)
#define MF_ULTRALIGHT_CMD_COMP_WRITE (0xA0)
#define MF_ULTRALIGHT_CMD_WRITE_PAGE (0xA2)
#define MF_ULTRALIGHT_CMD_FAST_WRITE (0xA6)
#define MF_ULTRALIGHT_CMD_READ_SIG (0x3C)
#define MF_ULTRALIGHT_CMD_READ_CNT (0x39)
#define MF_ULTRALIGHT_CMD_INCR_CNT (0xA5)
#define MF_ULTRALIGHT_CMD_COMP_WRITE (0xA0)
#define MF_ULTRALIGHT_CMD_WRITE_PAGE (0xA2)
#define MF_ULTRALIGHT_CMD_FAST_WRITE (0xA6)
#define MF_ULTRALIGHT_CMD_READ_SIG (0x3C)
#define MF_ULTRALIGHT_CMD_READ_CNT (0x39)
#define MF_ULTRALIGHT_CMD_INCR_CNT (0xA5)
#define MF_ULTRALIGHT_CMD_CHECK_TEARING (0x3E)
#define MF_ULTRALIGHT_CMD_PWD_AUTH (0x1B)
#define MF_ULTRALIGHT_CMD_AUTH (0x1A)
#define MF_ULTRALIGHT_CMD_VCSL (0x4B)
#define MF_ULTRALIGHT_CMD_PWD_AUTH (0x1B)
#define MF_ULTRALIGHT_CMD_AUTH (0x1A)
#define MF_ULTRALIGHT_CMD_VCSL (0x4B)
#define MF_ULTRALIGHT_CMD_ACK (0x0A)
#define MF_ULTRALIGHT_CMD_NACK (0x00)
#define MF_ULTRALIGHT_CMD_ACK (0x0A)
#define MF_ULTRALIGHT_CMD_NACK (0x00)
#define MF_ULTRALIGHT_CMD_AUTH_NAK (0x04)
#define MF_ULTRALIGHT_MAX_CNTR_VAL (0x00FFFFFF)
#define MF_ULTRALIGHT_MAX_PAGE_NUM (510)
#define MF_ULTRALIGHT_PAGE_SIZE (4U)
#define MF_ULTRALIGHT_SIGNATURE_SIZE (32)
#define MF_ULTRALIGHT_COUNTER_SIZE (3)
#define MF_ULTRALIGHT_COUNTER_NUM (3)
#define MF_ULTRALIGHT_TEARING_FLAG_SIZE (1)
#define MF_ULTRALIGHT_TEARING_FLAG_NUM (3)
#define MF_ULTRALIGHT_MAX_CNTR_VAL (0x00FFFFFF)
#define MF_ULTRALIGHT_MAX_PAGE_NUM (510)
#define MF_ULTRALIGHT_PAGE_SIZE (4U)
#define MF_ULTRALIGHT_SIGNATURE_SIZE (32)
#define MF_ULTRALIGHT_COUNTER_SIZE (3)
#define MF_ULTRALIGHT_COUNTER_NUM (3)
#define MF_ULTRALIGHT_TEARING_FLAG_SIZE (1)
#define MF_ULTRALIGHT_TEARING_FLAG_NUM (3)
#define MF_ULTRALIGHT_AUTH_PASSWORD_SIZE (4)
#define MF_ULTRALIGHT_AUTH_PACK_SIZE (2)
#define MF_ULTRALIGHT_AUTH_PACK_SIZE (2)
#define MF_ULTRALIGHT_C_AUTH_RESPONSE_SIZE (9)
#define MF_ULTRALIGHT_C_AUTH_DES_KEY_SIZE (16)
#define MF_ULTRALIGHT_C_AUTH_DATA_SIZE (MF_ULTRALIGHT_C_AUTH_DES_KEY_SIZE)
#define MF_ULTRALIGHT_C_AUTH_IV_BLOCK_SIZE (8)
#define MF_ULTRALIGHT_C_AUTH_RND_BLOCK_SIZE (8)
#define MF_ULTRALIGHT_C_AUTH_RESPONSE_SIZE (9)
#define MF_ULTRALIGHT_C_AUTH_DES_KEY_SIZE (16)
#define MF_ULTRALIGHT_C_AUTH_DATA_SIZE (MF_ULTRALIGHT_C_AUTH_DES_KEY_SIZE)
#define MF_ULTRALIGHT_C_AUTH_IV_BLOCK_SIZE (8)
#define MF_ULTRALIGHT_C_AUTH_RND_BLOCK_SIZE (8)
#define MF_ULTRALIGHT_C_AUTH_RND_A_BLOCK_OFFSET (0)
#define MF_ULTRALIGHT_C_AUTH_RND_B_BLOCK_OFFSET (8)
#define MF_ULTRALIGHT_C_ENCRYPTED_PACK_SIZE (MF_ULTRALIGHT_C_AUTH_DATA_SIZE + 1)
#define MF_ULTRALIGHT_C_ENCRYPTED_PACK_SIZE (MF_ULTRALIGHT_C_AUTH_DATA_SIZE + 1)
typedef enum {
MfUltralightErrorNone,
@@ -147,10 +147,10 @@ typedef struct FURI_PACKED {
union {
uint8_t value;
struct {
uint8_t rfui1 : 2;
bool strg_mod_en : 1;
bool rfui2 : 1;
uint8_t mirror_byte : 2;
uint8_t rfui1 : 2;
bool strg_mod_en : 1;
bool rfui2 : 1;
uint8_t mirror_byte : 2;
MfUltralightMirrorConf mirror_conf : 2;
};
} mirror;
@@ -160,12 +160,12 @@ typedef struct FURI_PACKED {
union {
uint8_t value;
struct {
uint8_t authlim : 3;
uint8_t authlim : 3;
bool nfc_cnt_pwd_prot : 1;
bool nfc_cnt_en : 1;
bool nfc_dis_sec1 : 1; // NTAG I2C Plus only
bool cfglck : 1;
bool prot : 1;
bool nfc_cnt_en : 1;
bool nfc_dis_sec1 : 1; // NTAG I2C Plus only
bool cfglck : 1;
bool prot : 1;
};
} access;
uint8_t vctid;

View File

@@ -38,7 +38,7 @@ static void mf_ultralight_listener_send_short_resp(MfUltralightListener* instanc
bit_buffer_set_size(instance->tx_buffer, 4);
bit_buffer_set_byte(instance->tx_buffer, 0, data);
iso14443_3a_listener_tx(instance->iso14443_3a_listener, instance->tx_buffer);
};
}
static void mf_ultralight_listener_perform_read(
MfUltralightPage* pages,

View File

@@ -2,13 +2,13 @@
#include <furi.h>
#define MF_ULTRALIGHT_STATIC_BIT_LOCK_OTP_CC 0
#define MF_ULTRALIGHT_STATIC_BIT_LOCK_BL_9_4 1
#define MF_ULTRALIGHT_STATIC_BIT_LOCK_OTP_CC 0
#define MF_ULTRALIGHT_STATIC_BIT_LOCK_BL_9_4 1
#define MF_ULTRALIGHT_STATIC_BIT_LOCK_BL_15_10 2
#define MF_ULTRALIGHT_BIT_ACTIVE(lock_bits, bit) (((lock_bits) & (1U << (bit))) != 0)
#define MF_ULTRALIGHT_BITS_SET(lock_bits, mask) ((lock_bits) |= (mask))
#define MF_ULTRALIGHT_BITS_CLR(lock_bits, mask) ((lock_bits) &= ~(mask))
#define MF_ULTRALIGHT_BITS_SET(lock_bits, mask) ((lock_bits) |= (mask))
#define MF_ULTRALIGHT_BITS_CLR(lock_bits, mask) ((lock_bits) &= ~(mask))
#define MF_ULTRALIGHT_PAGE_LOCKED(lock_bits, page) MF_ULTRALIGHT_BIT_ACTIVE(lock_bits, page)
@@ -35,7 +35,7 @@
#define MF_ULTRALIGHT_I2C_PAGE_ON_MIRRORED_SESSION_REG(page) \
MF_ULTRALIGHT_PAGE_IN_BOUNDS(page, 0x00F8, 0x00F9)
#define MF_ULTRALIGHT_AUTH_RESET_ATTEMPTS(instance) (instance->data->auth_attempts = 0)
#define MF_ULTRALIGHT_AUTH_RESET_ATTEMPTS(instance) (instance->data->auth_attempts = 0)
#define MF_ULTRALIGHT_AUTH_INCREASE_ATTEMPTS(instance) (instance->data->auth_attempts++)
static MfUltralightMirrorConf mf_ultralight_mirror_check_mode(
@@ -634,4 +634,4 @@ bool mf_ultralight_c_check_access(
} while(false);
return access_success;
}
}

View File

@@ -9,7 +9,7 @@ extern "C" {
#endif
#define MF_ULTRALIGHT_POLLER_STANDARD_FWT_FC (60000)
#define MF_ULTRALIGHT_MAX_BUFF_SIZE (64)
#define MF_ULTRALIGHT_MAX_BUFF_SIZE (64)
#define MF_ULTRALIGHT_DEFAULT_PASSWORD (0xffffffffUL)

View File

@@ -5,36 +5,36 @@
#include <nfc/nfc_common.h>
#define SLIX_PROTOCOL_NAME "SLIX"
#define SLIX_DEVICE_NAME "SLIX"
#define SLIX_DEVICE_NAME "SLIX"
#define SLIX_TYPE_SLIX_SLIX2 (0x01U)
#define SLIX_TYPE_SLIX_S (0x02U)
#define SLIX_TYPE_SLIX_L (0x03U)
#define SLIX_TYPE_SLIX_S (0x02U)
#define SLIX_TYPE_SLIX_L (0x03U)
#define SLIX_TYPE_INDICATOR_SLIX (0x02U)
#define SLIX_TYPE_INDICATOR_SLIX (0x02U)
#define SLIX_TYPE_INDICATOR_SLIX2 (0x01U)
#define SLIX_CAPABILITIES_KEY "Capabilities"
#define SLIX_PASSWORD_READ_KEY "Password Read"
#define SLIX_PASSWORD_WRITE_KEY "Password Write"
#define SLIX_PASSWORD_PRIVACY_KEY "Password Privacy"
#define SLIX_PASSWORD_DESTROY_KEY "Password Destroy"
#define SLIX_PASSWORD_EAS_KEY "Password EAS"
#define SLIX_SIGNATURE_KEY "Signature"
#define SLIX_PRIVACY_MODE_KEY "Privacy Mode"
#define SLIX_PROTECTION_POINTER_KEY "Protection Pointer"
#define SLIX_CAPABILITIES_KEY "Capabilities"
#define SLIX_PASSWORD_READ_KEY "Password Read"
#define SLIX_PASSWORD_WRITE_KEY "Password Write"
#define SLIX_PASSWORD_PRIVACY_KEY "Password Privacy"
#define SLIX_PASSWORD_DESTROY_KEY "Password Destroy"
#define SLIX_PASSWORD_EAS_KEY "Password EAS"
#define SLIX_SIGNATURE_KEY "Signature"
#define SLIX_PRIVACY_MODE_KEY "Privacy Mode"
#define SLIX_PROTECTION_POINTER_KEY "Protection Pointer"
#define SLIX_PROTECTION_CONDITION_KEY "Protection Condition"
#define SLIX_LOCK_EAS_KEY "Lock EAS"
#define SLIX_LOCK_PPL_KEY "Lock PPL"
#define SLIX_LOCK_EAS_KEY "Lock EAS"
#define SLIX_LOCK_PPL_KEY "Lock PPL"
typedef struct {
uint8_t iso15693_3[2];
uint8_t icode_type;
union {
struct {
uint8_t unused_1 : 3;
uint8_t unused_1 : 3;
uint8_t type_indicator : 2;
uint8_t unused_2 : 3;
uint8_t unused_2 : 3;
};
uint8_t serial_num[5];
};

View File

@@ -6,7 +6,7 @@
extern "C" {
#endif
#define SLIX_BLOCK_SIZE (4U)
#define SLIX_BLOCK_SIZE (4U)
#define SLIX_SIGNATURE_SIZE (32U)
#define SLIX_COUNTER_BLOCK_NUM (79U)
@@ -16,27 +16,27 @@ extern "C" {
#define SLIX_PP_CONDITION_RH (1U << 4)
#define SLIX_PP_CONDITION_WH (1U << 5)
#define SLIX_FEATURE_FLAG_UM_PP (1UL << 0)
#define SLIX_FEATURE_FLAG_COUNTER (1UL << 1)
#define SLIX_FEATURE_FLAG_EAS_ID (1UL << 2)
#define SLIX_FEATURE_FLAG_EAS_PP (1UL << 3)
#define SLIX_FEATURE_FLAG_AFI_PP (1UL << 4)
#define SLIX_FEATURE_FLAG_UM_PP (1UL << 0)
#define SLIX_FEATURE_FLAG_COUNTER (1UL << 1)
#define SLIX_FEATURE_FLAG_EAS_ID (1UL << 2)
#define SLIX_FEATURE_FLAG_EAS_PP (1UL << 3)
#define SLIX_FEATURE_FLAG_AFI_PP (1UL << 4)
#define SLIX_FEATURE_FLAG_INVENTORY_READ_EXT (1UL << 5)
#define SLIX_FEATURE_FLAG_EAS_IR (1UL << 6)
#define SLIX_FEATURE_FLAG_ORIGINALITY_SIG (1UL << 8)
#define SLIX_FEATURE_FLAG_EAS_IR (1UL << 6)
#define SLIX_FEATURE_FLAG_ORIGINALITY_SIG (1UL << 8)
#define SLIX_FEATURE_FLAG_ORIGINALITY_SIG_PP (1UL << 9)
#define SLIX_FEATURE_FLAG_PERSISTENT_QUIET (1UL << 10)
#define SLIX_FEATURE_FLAG_PRIVACY (1UL << 12)
#define SLIX_FEATURE_FLAG_DESTROY (1UL << 13)
#define SLIX_FEATURE_EXT (1UL << 31)
#define SLIX_FEATURE_FLAG_PERSISTENT_QUIET (1UL << 10)
#define SLIX_FEATURE_FLAG_PRIVACY (1UL << 12)
#define SLIX_FEATURE_FLAG_DESTROY (1UL << 13)
#define SLIX_FEATURE_EXT (1UL << 31)
#define SLIX_TYPE_FEATURE_READ (1U << 0)
#define SLIX_TYPE_FEATURE_WRITE (1U << 1)
#define SLIX_TYPE_FEATURE_PRIVACY (1U << 2)
#define SLIX_TYPE_FEATURE_DESTROY (1U << 3)
#define SLIX_TYPE_FEATURE_EAS (1U << 4)
#define SLIX_TYPE_FEATURE_SIGNATURE (1U << 5)
#define SLIX_TYPE_FEATURE_PROTECTION (1U << 6)
#define SLIX_TYPE_FEATURE_READ (1U << 0)
#define SLIX_TYPE_FEATURE_WRITE (1U << 1)
#define SLIX_TYPE_FEATURE_PRIVACY (1U << 2)
#define SLIX_TYPE_FEATURE_DESTROY (1U << 3)
#define SLIX_TYPE_FEATURE_EAS (1U << 4)
#define SLIX_TYPE_FEATURE_SIGNATURE (1U << 5)
#define SLIX_TYPE_FEATURE_PROTECTION (1U << 6)
#define SLIX_TYPE_FEATURE_NFC_SYSTEM_INFO (1U << 7)
typedef uint32_t SlixTypeFeatures;

View File

@@ -11,33 +11,33 @@ extern "C" {
#define SLIX_NXP_MANUFACTURER_CODE (0x04U)
#define SLIX_LOCK_BITS_AFI (1U << 0)
#define SLIX_LOCK_BITS_EAS (1U << 1)
#define SLIX_LOCK_BITS_AFI (1U << 0)
#define SLIX_LOCK_BITS_EAS (1U << 1)
#define SLIX_LOCK_BITS_DSFID (1U << 2)
#define SLIX_LOCK_BITS_PPL (1U << 3)
#define SLIX_LOCK_BITS_PPL (1U << 3)
#define SLIX_CMD_CUSTOM_START (0xA2U)
#define SLIX_CMD_SET_EAS (0xA2U)
#define SLIX_CMD_RESET_EAS (0xA3U)
#define SLIX_CMD_LOCK_EAS (0xA4U)
#define SLIX_CMD_EAS_ALARM (0xA5U)
#define SLIX_CMD_PASSWORD_PROTECT_EAS_AFI (0xA6U)
#define SLIX_CMD_WRITE_EAS_ID (0xA7U)
#define SLIX_CMD_GET_NXP_SYSTEM_INFORMATION (0xABU)
#define SLIX_CMD_INVENTORY_PAGE_READ (0xB0U)
#define SLIX_CMD_INVENTORY_PAGE_READ_FAST (0xB1U)
#define SLIX_CMD_GET_RANDOM_NUMBER (0xB2U)
#define SLIX_CMD_SET_PASSWORD (0xB3U)
#define SLIX_CMD_WRITE_PASSWORD (0xB4U)
#define SLIX_CMD_64_BIT_PASSWORD_PROTECTION (0xB5U)
#define SLIX_CMD_PROTECT_PAGE (0xB6U)
#define SLIX_CMD_CUSTOM_START (0xA2U)
#define SLIX_CMD_SET_EAS (0xA2U)
#define SLIX_CMD_RESET_EAS (0xA3U)
#define SLIX_CMD_LOCK_EAS (0xA4U)
#define SLIX_CMD_EAS_ALARM (0xA5U)
#define SLIX_CMD_PASSWORD_PROTECT_EAS_AFI (0xA6U)
#define SLIX_CMD_WRITE_EAS_ID (0xA7U)
#define SLIX_CMD_GET_NXP_SYSTEM_INFORMATION (0xABU)
#define SLIX_CMD_INVENTORY_PAGE_READ (0xB0U)
#define SLIX_CMD_INVENTORY_PAGE_READ_FAST (0xB1U)
#define SLIX_CMD_GET_RANDOM_NUMBER (0xB2U)
#define SLIX_CMD_SET_PASSWORD (0xB3U)
#define SLIX_CMD_WRITE_PASSWORD (0xB4U)
#define SLIX_CMD_64_BIT_PASSWORD_PROTECTION (0xB5U)
#define SLIX_CMD_PROTECT_PAGE (0xB6U)
#define SLIX_CMD_LOCK_PAGE_PROTECTION_CONDITION (0xB7U)
#define SLIX_CMD_DESTROY (0xB9U)
#define SLIX_CMD_ENABLE_PRIVACY (0xBAU)
#define SLIX_CMD_STAY_QUIET_PERSISTENT (0xBCU)
#define SLIX_CMD_READ_SIGNATURE (0xBDU)
#define SLIX_CMD_CUSTOM_END (0xBEU)
#define SLIX_CMD_CUSTOM_COUNT (SLIX_CMD_CUSTOM_END - SLIX_CMD_CUSTOM_START)
#define SLIX_CMD_DESTROY (0xB9U)
#define SLIX_CMD_ENABLE_PRIVACY (0xBAU)
#define SLIX_CMD_STAY_QUIET_PERSISTENT (0xBCU)
#define SLIX_CMD_READ_SIGNATURE (0xBDU)
#define SLIX_CMD_CUSTOM_END (0xBEU)
#define SLIX_CMD_CUSTOM_COUNT (SLIX_CMD_CUSTOM_END - SLIX_CMD_CUSTOM_START)
#define SLIX_TYPE_FEATURES_SLIX (SLIX_TYPE_FEATURE_EAS)
#define SLIX_TYPE_FEATURES_SLIX_S \

View File

@@ -6,9 +6,9 @@
#include <nfc/nfc_common.h>
#include <nfc/helpers/iso14443_crc.h>
#define ST25TB_PROTOCOL_NAME "ST25TB"
#define ST25TB_TYPE_KEY "ST25TB Type"
#define ST25TB_BLOCK_KEY "Block %d"
#define ST25TB_PROTOCOL_NAME "ST25TB"
#define ST25TB_TYPE_KEY "ST25TB Type"
#define ST25TB_BLOCK_KEY "Block %d"
#define ST25TB_SYSTEM_BLOCK_KEY "System OTP Block"
typedef struct {

View File

@@ -9,13 +9,13 @@ extern "C" {
#define ST25TB_UID_SIZE (8U)
//#define ST25TB_FDT_FC (4205U)
#define ST25TB_FDT_FC (8494U)
#define ST25TB_GUARD_TIME_US (5000U)
#define ST25TB_FDT_FC (8494U)
#define ST25TB_GUARD_TIME_US (5000U)
#define ST25TB_POLL_POLL_MIN_US (1280U)
#define ST25TB_MAX_BLOCKS (128U)
#define ST25TB_MAX_BLOCKS (128U)
#define ST25TB_SYSTEM_OTP_BLOCK (0xFFU)
#define ST25TB_BLOCK_SIZE (4U)
#define ST25TB_BLOCK_SIZE (4U)
typedef enum {
St25tbErrorNone,

View File

@@ -211,4 +211,4 @@ St25tbError st25tb_poller_sync_read(Nfc* nfc, St25tbData* data) {
nfc_poller_free(poller);
return poller_context.error;
}
}

View File

@@ -17,4 +17,4 @@ St25tbError st25tb_poller_sync_read(Nfc* nfc, St25tbData* data);
#ifdef __cplusplus
}
#endif
#endif