10#ifndef M5_UNIT_NFC_NFC_LAYER_NDEF_LAYER_HPP
11#define M5_UNIT_NFC_NFC_LAYER_NDEF_LAYER_HPP
19class NFCLayerInterface;
28constexpr uint8_t NDEF_MAX_UNIT_SIZE_READ{32};
29constexpr uint8_t NDEF_MAX_CC_BLOCK_SIZE{32};
116 bool read_type4(std::vector<m5::nfc::ndef::TLV>& tlvs,
const m5::nfc::ndef::type4::FileControlTagBits fcBits);
117 bool read_type4_iso7816(std::vector<m5::nfc::ndef::TLV>& tlvs,
118 const m5::nfc::ndef::type4::FileControlTagBits fcBits);
119 bool read_type4_desfire(std::vector<m5::nfc::ndef::TLV>& tlvs,
120 const m5::nfc::ndef::type4::FileControlTagBits fcBits);
123 bool write_type2(
const std::vector<m5::nfc::ndef::TLV>& tlvs,
const bool keep);
125 bool write_type4(
const std::vector<m5::nfc::ndef::TLV>& tlvs);
130 bool write_type5(
const std::vector<m5::nfc::ndef::TLV>& tlvs,
const bool keep);
132 std::vector<m5::nfc::ndef::TLV> merge_tlv(std::vector<m5::nfc::ndef::TLV>& old_tlvs,
133 const std::vector<m5::nfc::ndef::TLV>& tlvs);
144 bool read_nfcv(uint8_t* rx,
const uint16_t offset,
const uint16_t len);
153 bool write_nfcv(
const uint16_t offset,
const uint8_t* tx,
const uint16_t len);
Common interface for NFC layer.
Definition nfc_layer.hpp:26
ISO Data Exchange Protocol.
Definition isoDEP.hpp:190
NDEF operations layer.
Definition ndef_layer.hpp:35
bool read_nfcv(uint8_t *rx, const uint16_t offset, const uint16_t len)
Read bytes from arbitrary byte offset (for NFC-V)
Definition ndef_layer.cpp:1337
bool readCapabilityContainer(m5::nfc::ndef::type2::CapabilityContainer &cc)
Read Type2 Capability Container.
Definition ndef_layer.cpp:622
bool prepare_desfire_light()
Prepare NDEF files on MIFARE DESFire Light.
Definition ndef_layer.cpp:205
bool writeCapabilityContainer(const m5::nfc::ndef::type5::CapabilityContainer &cc)
Write Type5 Capability Container.
Definition ndef_layer.cpp:776
bool write_nfcv(const uint16_t offset, const uint8_t *tx, const uint16_t len)
Write bytes to arbitrary byte offset (for NFC-V)
Definition ndef_layer.cpp:1376
bool read(const m5::nfc::NFCForumTag ftag, std::vector< m5::nfc::ndef::TLV > &tlvs, const m5::nfc::ndef::TagBits tagBits=m5::nfc::ndef::tagBitsMessage)
Read NDEF data.
Definition ndef_layer.cpp:785
bool write(const m5::nfc::NFCForumTag ftag, const std::vector< m5::nfc::ndef::TLV > &tlvs, const bool keep=true)
Write NDEF data.
Definition ndef_layer.cpp:1425
bool readAttributeBlock(m5::nfc::ndef::type3::AttributeBlock &ab)
Read Type3 Attribute Block.
Definition ndef_layer.cpp:647
bool isValidFormat(bool &valid, const m5::nfc::NFCForumTag ftag)
Check whether the tag is in NDEF format.
Definition ndef_layer.cpp:159
bool prepare_desfire(const uint32_t max_ndef_size)
Prepare NDEF files on MIFARE DESFire (EV1/EV2/EV3)
Definition ndef_layer.cpp:454
NDEF TLV container.
Definition ndef_tlv.hpp:27
Top level namespace of M5stack.
uint8_t TagBits
TLV(Tag,Length,Value) tag bit group for type2/5.
Definition ndef.hpp:55
constexpr TagBits tagBitsMessage
Message only.
Definition ndef.hpp:113
NFCForumTag
NFC Forum Tag Type.
Definition nfc.hpp:39
Common layer for NFC related units.
Capability container for Type2.
Definition ndef.hpp:183
For Type 3 tag (T3T)
Definition ndef.hpp:254
Capability container for Type4.
Definition ndef.hpp:455
Capability container for Type5.
Definition ndef.hpp:495