|
M5Unit-NFC 0.1.1 git rev:9bb1360
|
NFC-A definitions. More...
#include "nfc/nfc.hpp"#include "mifare.hpp"#include <cstdint>#include <string>#include <cstring>Go to the source code of this file.
Classes | |
| struct | m5::nfc::a::ATS |
| Answer to request. More... | |
| struct | m5::nfc::a::PICC |
| PICC for NFC-A. More... | |
| struct | m5::nfc::a::config_t |
| NFC-A activation configuration (RATS parameters) More... | |
| struct | m5::nfc::a::st25ta::SystemFile |
| ST25TA series system file. More... | |
Namespaces | |
| namespace | m5 |
| Top level namespace of M5Stack. | |
| namespace | a |
| NFC-A definitions. | |
| namespace | st25ta |
| For ST25TA series. | |
Functions | |
| m5::nfc::NFCForumTag | m5::nfc::a::get_nfc_forum_tag_type (const Type t) |
| Get NFC Forum Tag Type from PICC type. | |
| bool | m5::nfc::a::is_mifare_classic (const Type t) |
| Is type MIFARE Classic? | |
| bool | m5::nfc::a::is_mifare_ultralight (const Type t) |
| Is type MIFARE Ultralight series? | |
| bool | m5::nfc::a::is_ntag2 (const Type t) |
| Is type NTAG2xx? | |
| bool | m5::nfc::a::is_ntag4 (const Type t) |
| Is type NTAG4xx? | |
| bool | m5::nfc::a::is_mifare_plus (const Type t) |
| Is type MIFARE Plus? | |
| bool | m5::nfc::a::is_mifare_classic_compatible (const Type t, const uint8_t sl) |
| Is type MIFARE classic compatible? (Plus SL1) | |
| bool | m5::nfc::a::is_mifare_desfire (const Type t) |
| Is type MIFARE DESFire? | |
| bool | m5::nfc::a::is_mifare (const Type t) |
| Is type MIFARE? | |
| bool | m5::nfc::a::is_st25ta (const Type t) |
| Is ST25TA series? | |
| bool | m5::nfc::a::is_iso14443_4 (const Type t) |
| Is ISO 14443-4? | |
| bool | m5::nfc::a::is_iso14443_3 (const Type t) |
| Is ISO 14443-3? | |
| bool | m5::nfc::a::supports_NFC (const Type t) |
| Does the specified type function as NFC? | |
| bool | m5::nfc::a::has_fast_read (const Type t) |
| Has FAST_READ command? | |
| bool | m5::nfc::a::has_sak_dependent_bit (const uint8_t sak) |
| SAK incomplete? | |
| bool | m5::nfc::a::is_sak_completed_14443_4 (const uint8_t sak) |
| SAK completed? (Complies with ISO/IEC 14443-4) | |
| bool | m5::nfc::a::is_sak_completed (const uint8_t sak) |
| SAK completed? (Does not comply with ISO/IEC 14443-4) | |
| Type | m5::nfc::a::sak_to_type (const uint8_t sak) |
| Inferring the type from SAK. | |
| Type | m5::nfc::a::version3_to_type (const uint8_t info[8]) |
| Inferring the type from GetVersion L3. | |
| Type | m5::nfc::a::version4_to_type (uint8_t &sub, const uint8_t info[8]) |
| Inferring the type from GetVersion L4. | |
| Type | m5::nfc::a::historical_bytes_to_type (uint8_t &sub, const uint16_t atqa, const uint8_t sak, const uint8_t *bytes, const uint8_t len) |
| Historical bytes to type. | |
| uint16_t | m5::nfc::a::get_number_of_blocks (const Type t) |
| Gets the number of blocks. | |
| uint16_t | m5::nfc::a::get_number_of_user_blocks (const Type t) |
| Gets the number of user blocks. | |
| uint16_t | m5::nfc::a::get_user_area_size (const Type t) |
| Gets the user area bytes. | |
| uint16_t | m5::nfc::a::get_unit_size (const Type t) |
| Get the unit size of 1 block / 1 page. | |
| uint16_t | m5::nfc::a::get_number_of_sectors (const Type t) |
| Gets the number of sectors. | |
| uint16_t | m5::nfc::a::get_first_user_block (const Type t) |
| Gets the first user area block. | |
| uint16_t | m5::nfc::a::get_last_user_block (const Type t) |
| Gets the last user area block. | |
| bool | m5::nfc::a::is_user_block (const Type t, const uint16_t block) |
| Is block user area? | |
| file_system_feature_t | m5::nfc::a::get_file_system_feature (const Type t) |
| Get file system feature bits. | |
| bool | m5::nfc::a::is_file_system_memory (const Type t) |
| Memory file system? | |
| bool | m5::nfc::a::is_file_system_file (const Type t) |
| File base file system? | |
| uint8_t | m5::nfc::a::calculate_bcc8 (const uint8_t *data, const uint32_t len) |
| Calculate bcc8. | |
| const uint8_t * | m5::nfc::a::get_version3_response (const Type t) |
| Gets the GET_VERSION(L3) response for emulation. | |
| bool | m5::nfc::a::operator== (const PICC &a, const PICC &b) |
| Equal? | |
| bool | m5::nfc::a::operator!= (const PICC &a, const PICC &b) |
| Not equal? | |
| uint8_t | m5::nfc::a::make_rats_param (const uint8_t fsdi, const uint8_t cid) |
| Build the RATS PARAM byte (ISO/IEC 14443-4) | |
| Type | m5::nfc::a::st25ta::get_type (const uint8_t ic_ref_or_product_code) |
| Gets the type from IC reference or product code. | |
NFC-A definitions.
|
strong |
ISO-14443-3/4,MIFARE,NTAG commands.
| Enumerator | |
|---|---|
| REQA | Request. |
| WUPA | Wake-up. |
| HLTA | Halt. |
| SELECT_CL1 | Anticollision/Select CL1. |
| SELECT_CL2 | Anticollision/Select CL2. |
| SELECT_CL3 | Anticollision/Select CL3. |
| SELECT_CL1_OPT | Select CL1 and switch bit rate to fc/64 after receive SAK. |
| SELECT_CL2_OPT | Select CL2 and switch bit rate to fc/64 after receive SAK. |
| SELECT_CL3_OPT | Select CL3 and switch bit rate to fc/64 after receive SAK. |
| SELCT_CL1_OPT |
|
| SELCT_CL2_OPT |
|
| SELCT_CL3_OPT |
|
| READ | Read. |
| RATS | Request for Answer to Select. |
| DESELECT | DESELECT. |
| AUTH_WITH_KEY_A | MIFARE Classic. Authentication with Key A. |
| AUTH_WITH_KEY_B | MIFARE Classic. Authentication with Key B. |
| AUTHENTICATE_1 | MIFARE UltralightC. Authentication 1st. |
| AUTHENTICATE_2 | MIFARE UltralightC. Authentication 2nd. |
| WRITE_BLOCK | MIFARE Classic. write. |
| DECREMENT | MIFARE Classic. decrement value block. |
| INCREMENT | MIFARE Classic. increment value block. |
| RESTORE | MIFARE Classic. reads the contents of a value block into the internal Transfer Buffer. |
| TRANSFER | MIFARE Classic. writes the contents of the internal Transfer Buffer to a block. |
| PERSONALIZE_UID_USAGE | MIFARE Classic Personalize UID Usage. |
| SET_MOD_TYPE | MIFARE Classic SET_MOD_TYPE. |
| WRITE_PERSO | MIFARE Plus. WritePerso. |
| COMMIT_PERSO | MIFARE Plus. CommitPerso. |
| WRITE_PAGE | MIFARE Ultralight/C and NTAG write. |
| GET_VERSION | NTAG 21x/UL EV1,Nano Gets the version information. |
| FAST_READ | NTAG 21x. excluding 210u. Read multiple pages. |
| READ_CNT | NTAG 213/5/6. Read counter value. |
| PWD_AUTH | NTAG 21x excluding 210u. Authentication for protected area. |
| READ_SIG | NTAG 21x Read NXP ECC signature. |
| WRITE_SIG | NTAG 210u Write custom signature. |
| LOCK_SIG | NTAG 210u Lock/Unlock signature. |
|
strong |
Type of the PICC.
| Enumerator | |
|---|---|
| Unknown | Unknown type. |
| MIFARE_Classic_Mini | Also known as MIFARE Standard mini. |
| MIFARE_Classic_1K | Also known as MIFARE Standard 1K. |
| MIFARE_Classic_2K | Also known as MIFARE Standard 2K. |
| MIFARE_Classic_4K | Also known as MIFARE Standard 4K. |
| MIFARE_Ultralight | MIFARE Ultralight. |
| MIFARE_Ultralight_EV1_1 | MIFARE Ultralight EV1 MF0UL11. |
| MIFARE_Ultralight_EV1_2 | MIFARE Ultralight EV1 MF0UL21. |
| MIFARE_Ultralight_Nano | MIFARE Ultralight Nano. |
| MIFARE_UltralightC | MIFARE UltralightC. |
| NTAG_203 | NTAG 203. |
| NTAG_210u | NTAG 210μ |
| NTAG_210 | NTAG 210. |
| NTAG_212 | NTAG 212. |
| NTAG_213 | NTAG 213. |
| NTAG_215 | NTAG 215. |
| NTAG_216 | NTAG 216. |
| ST25TA_512B | ST25TA512B. |
| ST25TA_2K | ST25TA02K. |
| ST25TA_16K | ST25TA16K. |
| ST25TA_64K | ST25TA64K. |
| ISO_14443_4 | PICC compliant with ISO/IEC 14443-4. |
| MIFARE_Plus_2K | MIFARE Plus 2K. |
| MIFARE_Plus_4K | MIFARE Plus 4K. |
| MIFARE_Plus_SE | MIFARE Plus SE 1K. |
| MIFARE_DESFire_2K | MIFARE DESFire 2K. |
| MIFARE_DESFire_4K | MIFARE DESFire 4K. |
| MIFARE_DESFire_8K | MIFARE DESFire 8K. |
| MIFARE_DESFire_Light | MIFARE DESFire Light. |
| NTAG_4XX | NTAG 4XX. |
| ISO_18092 | PICC compliant with ISO/IEC 18092. |
| uint8_t m5::nfc::a::calculate_bcc8 | ( | const uint8_t * | data, |
| const uint32_t | len ) |
Calculate bcc8.
| data | Input data |
| len | Input data length |
| file_system_feature_t m5::nfc::a::get_file_system_feature | ( | const Type | t | ) |
Get file system feature bits.
| t | PICC type |
| uint16_t m5::nfc::a::get_first_user_block | ( | const Type | t | ) |
Gets the first user area block.
| t | PICC type |
| uint16_t m5::nfc::a::get_last_user_block | ( | const Type | t | ) |
Gets the last user area block.
| t | PICC type |
| m5::nfc::NFCForumTag m5::nfc::a::get_nfc_forum_tag_type | ( | const Type | t | ) |
Get NFC Forum Tag Type from PICC type.
| t | PICC type |
| uint16_t m5::nfc::a::get_number_of_blocks | ( | const Type | t | ) |
Gets the number of blocks.
| t | PICC type |
| uint16_t m5::nfc::a::get_number_of_sectors | ( | const Type | t | ) |
Gets the number of sectors.
| t | PICC type |
| uint16_t m5::nfc::a::get_number_of_user_blocks | ( | const Type | t | ) |
Gets the number of user blocks.
| t | PICC type |
| uint16_t m5::nfc::a::get_unit_size | ( | const Type | t | ) |
Get the unit size of 1 block / 1 page.
| t | PICC type |
| != | 0 Unit size |
| == | 0 Does not have a unit size |
| uint16_t m5::nfc::a::get_user_area_size | ( | const Type | t | ) |
Gets the user area bytes.
| t | PICC type |
| const uint8_t * m5::nfc::a::get_version3_response | ( | const Type | t | ) |
Gets the GET_VERSION(L3) response for emulation.
| t | PICC type |
|
inline |
Has FAST_READ command?
| t | PICC type |
|
inline |
SAK incomplete?
| sak | SAK byte |
| Type m5::nfc::a::historical_bytes_to_type | ( | uint8_t & | sub, |
| const uint16_t | atqa, | ||
| const uint8_t | sak, | ||
| const uint8_t * | bytes, | ||
| const uint8_t | len ) |
Historical bytes to type.
| [out] | sub | Inferred subtype value |
| atqa | ATQA value | |
| sak | SAK byte | |
| bytes | Historical bytes | |
| len | Historical byte length |
|
inline |
File base file system?
| t | PICC type |
|
inline |
Memory file system?
| t | PICC type |
|
inline |
Is ISO 14443-3?
| t | PICC type |
|
inline |
Is ISO 14443-4?
| t | PICC type |
|
inline |
Is type MIFARE?
| t | PICC type |
|
inline |
Is type MIFARE Classic?
| t | PICC type |
|
inline |
Is type MIFARE classic compatible? (Plus SL1)
| t | PICC type |
| sl | Security level |
|
inline |
Is type MIFARE DESFire?
| t | PICC type |
|
inline |
Is type MIFARE Plus?
| t | PICC type |
|
inline |
Is type MIFARE Ultralight series?
| t | PICC type |
|
inline |
Is type NTAG2xx?
| t | PICC type |
|
inline |
Is type NTAG4xx?
| t | PICC type |
|
inline |
SAK completed? (Does not comply with ISO/IEC 14443-4)
| sak | SAK byte |
|
inline |
SAK completed? (Complies with ISO/IEC 14443-4)
| sak | SAK byte |
|
inline |
Is ST25TA series?
| t | PICC type |
| bool m5::nfc::a::is_user_block | ( | const Type | t, |
| const uint16_t | block ) |
Is block user area?
| t | PICC type |
| block | Block/page number |
|
inline |
Build the RATS PARAM byte (ISO/IEC 14443-4)
| fsdi | PCD's max receive frame size index (0..8). Lower 4 bits are used |
| cid | Card IDentifier (0..14). Lower 4 bits are used |
| Type m5::nfc::a::sak_to_type | ( | const uint8_t | sak | ) |
Inferring the type from SAK.
| sak | SAK byte |
|
inline |
Does the specified type function as NFC?
| t | PICC type |
| Type m5::nfc::a::version3_to_type | ( | const uint8_t | info[8] | ) |
Inferring the type from GetVersion L3.
| info | GET_VERSION response bytes |
| Type m5::nfc::a::version4_to_type | ( | uint8_t & | sub, |
| const uint8_t | info[8] ) |
Inferring the type from GetVersion L4.
| [out] | sub | Inferred subtype value |
| info | GET_VERSION response bytes |