|
M5Unit-NFC 0.0.3 git rev:59f5362
|
Common interface layer for each chip of the NFC-V reader. More...
#include <nfc_layer_v.hpp>
Public Member Functions | |
| NFCLayerV (m5::unit::UnitST25R3916 &u) | |
| NFCLayerV (m5::unit::CapST25R3916 &u) | |
| virtual uint16_t | maximum_fifo_depth () const override |
| Maximum FIFO depth. | |
| bool | isActive (const m5::nfc::v::PICC &picc) const |
| Is the specified PICC currently active? | |
| const m5::nfc::v::PICC & | activatedPICC () const |
| Retrieve the currently activated PICC. | |
| m5::nfc::v::ModulationMode | modulationMode () const |
| void | setModulationMode (const m5::nfc::v::ModulationMode mode) |
Detection and activation | |
| bool | detect (m5::nfc::v::PICC &picc, const uint32_t timeout_ms=50U) |
| Detect single ready PICC. | |
| bool | detect (std::vector< m5::nfc::v::PICC > &piccs, const uint32_t timeout_ms=1000U) |
| Detect ready PICCs. | |
| bool | activate (const m5::nfc::v::PICC &picc) |
| Activate a specific PICC. | |
| bool | reactivate (const m5::nfc::v::PICC &picc) |
| Detect single ready PICC. | |
| bool | reactivate () |
| Detect single ready PICC. | |
For activated PICC | |
| bool | deactivate () |
| Send Reset to ready to the currently selected PICC (deactivate) | |
| bool | readBlock (uint8_t rx[32], const uint16_t block) |
| Read single block. | |
| bool | writeBlock (const uint16_t block, const uint8_t *tx, const uint8_t tx_len) |
| Write single block. | |
| virtual bool | read (uint8_t *rx, uint16_t &rx_len, const uint16_t sblock) override |
| Read any bytes from user area. | |
| virtual bool | write (const uint16_t sblock, const uint8_t *tx, const uint16_t tx_len) override |
| Write any bytes to user area. | |
| bool | dump () |
| Dump all blocks. | |
| bool | dump (const uint16_t block) |
| Dump 1 block. | |
For NDEF | |
| |
| bool | ndefIsValidFormat (bool &valid) |
| Is the PICC data in NDEF format? | |
| bool | ndefReadCapabilityContainer (m5::nfc::ndef::type5::CapabilityContainer &cc) |
| Read Type5 Capability Container. | |
| bool | ndefWriteCapabilityContainer (const m5::nfc::ndef::type5::CapabilityContainer &cc) |
| Write Type5 Capability Container. | |
| bool | ndefRead (m5::nfc::ndef::TLV &msg) |
| Read NDEF Message TLV. | |
| bool | ndefWrite (const m5::nfc::ndef::TLV &msg) |
| Write NDEF message. | |
Public Member Functions inherited from m5::nfc::NFCLayerInterface | |
| virtual m5::nfc::NFCForumTag | supportsNFCTag () const |
| activePICC's NDEF type | |
| virtual file_system_feature_t | supportsFilesystem () const |
| activePICC's File system | |
| virtual m5::nfc::isodep::IsoDEP * | isoDEP () |
| ISO-DEP interface (nullptr if not supported) | |
| virtual bool | transceive (uint8_t *rx, uint16_t &rx_len, const uint8_t *tx, const uint16_t tx_len, const uint32_t timeout_ms) |
| Transceive (RF command) | |
| virtual bool | transmit (const uint8_t *tx, const uint16_t tx_len, const uint32_t timeout_ms) |
| Transmit only. | |
| virtual bool | receive (uint8_t *rx, uint16_t &rx_len, const uint32_t timeout_ms) |
| Receive only. | |
| virtual uint8_t | maximum_read_blocks () const |
| Maximum read blocks for NFC-F. | |
| virtual uint8_t | maximum_write_blocks () const |
| Maximum write blocks for NFC-F. | |
Protected Member Functions | |
| bool | dump_all () |
| bool | dump_block (const uint16_t block) |
| bool | detect_single (m5::nfc::v::PICC &picc) |
| bool | get_system_information (m5::nfc::v::PICC &picc) |
| bool | get_system_information_ext (m5::nfc::v::PICC &picc) |
| bool | read_block_ext (uint8_t rx[32], const m5::nfc::v::PICC &picc, const uint16_t block) |
| bool | write_block_ext (const m5::nfc::v::PICC &picc, const uint16_t block, const uint8_t *tx, const uint8_t tx_len) |
| bool | reset_to_ready (const m5::nfc::v::PICC *picc) |
| bool | stay_quiet (const m5::nfc::v::PICC &picc) |
| virtual uint16_t | first_user_block () const override |
| First user block. | |
| virtual uint16_t | last_user_block () const override |
| Last user block. | |
| virtual uint16_t | user_area_size () const |
| User area size (bytes) | |
| virtual uint16_t | unit_size_read () const override |
| Unit size for read. | |
| virtual uint16_t | unit_size_write () const override |
| Unit size for write. | |
Protected Attributes | |
| m5::nfc::v::PICC | _activePICC {} |
Common interface layer for each chip of the NFC-V reader.
| bool m5::nfc::NFCLayerV::activate | ( | const m5::nfc::v::PICC & | picc | ) |
Activate a specific PICC.
| picc | PICC |
|
inline |
Retrieve the currently activated PICC.
| bool m5::nfc::NFCLayerV::deactivate | ( | ) |
Send Reset to ready to the currently selected PICC (deactivate)
| bool m5::nfc::NFCLayerV::detect | ( | m5::nfc::v::PICC & | picc, |
| const uint32_t | timeout_ms = 50U ) |
Detect single ready PICC.
| [out] | picc | Detected PICC |
| timeout_ms | Polling time budget in milliseconds |
| bool m5::nfc::NFCLayerV::detect | ( | std::vector< m5::nfc::v::PICC > & | piccs, |
| const uint32_t | timeout_ms = 1000U ) |
Detect ready PICCs.
| [out] | piccs | Detected PICC PICCs |
| timeout_ms | Polling time budget in milliseconds |
| bool m5::nfc::NFCLayerV::dump | ( | ) |
Dump all blocks.
| bool m5::nfc::NFCLayerV::dump | ( | const uint16_t | block | ) |
Dump 1 block.
| block | Block address |
|
inlineoverrideprotectedvirtual |
First user block.
Implements m5::nfc::NFCLayerInterface.
|
inline |
Is the specified PICC currently active?
| picc | PICC to check |
|
inlineoverrideprotectedvirtual |
Last user block.
Implements m5::nfc::NFCLayerInterface.
|
overridevirtual |
Maximum FIFO depth.
Implements m5::nfc::NFCLayerInterface.
| bool m5::nfc::NFCLayerV::ndefIsValidFormat | ( | bool & | valid | ) |
Is the PICC data in NDEF format?
| [out] | valid | True if NDEF format |
| bool m5::nfc::NFCLayerV::ndefRead | ( | m5::nfc::ndef::TLV & | msg | ) |
Read NDEF Message TLV.
| [out] | msg | Message If it does not exist, a Null TLV is returned |
| bool m5::nfc::NFCLayerV::ndefReadCapabilityContainer | ( | m5::nfc::ndef::type5::CapabilityContainer & | cc | ) |
Read Type5 Capability Container.
| [out] | cc | Capability container |
| bool m5::nfc::NFCLayerV::ndefWrite | ( | const m5::nfc::ndef::TLV & | msg | ) |
Write NDEF message.
| msg | Message (NDEF Message) |
| bool m5::nfc::NFCLayerV::ndefWriteCapabilityContainer | ( | const m5::nfc::ndef::type5::CapabilityContainer & | cc | ) |
Write Type5 Capability Container.
| [in] | cc | Capability container |
|
inline |
Detect single ready PICC.
| [out] | picc | Detected PICC |
| timeout_ms | Polling time budget in milliseconds |
| bool m5::nfc::NFCLayerV::reactivate | ( | const m5::nfc::v::PICC & | picc | ) |
Detect single ready PICC.
| [out] | picc | Detected PICC |
| timeout_ms | Polling time budget in milliseconds |
|
overridevirtual |
Read any bytes from user area.
Continue reading only the user area from the first block of the user area until rx_len is satisfied
| rx | Buffer |
| [in/out] | rx_len in:buffer size, out:actual read size |
| sblock | Reading start block |
Implements m5::nfc::NFCLayerInterface.
| bool m5::nfc::NFCLayerV::readBlock | ( | uint8_t | rx[32], |
| const uint16_t | block ) |
Read single block.
| [out] | rx | Output buffer (At least the size of one PICC block) |
| block | Block address |
|
inlineoverrideprotectedvirtual |
Unit size for read.
Implements m5::nfc::NFCLayerInterface.
|
inlineoverrideprotectedvirtual |
Unit size for write.
Implements m5::nfc::NFCLayerInterface.
|
inlineprotectedvirtual |
User area size (bytes)
Implements m5::nfc::NFCLayerInterface.
|
overridevirtual |
Write any bytes to user area.
Continue writing only the user area from the first block of the user area until tx_len is satisfied
| sblock | Writing start block |
| tx | Buffer |
| tx_len | buffer size |
Implements m5::nfc::NFCLayerInterface.
| bool m5::nfc::NFCLayerV::writeBlock | ( | const uint16_t | block, |
| const uint8_t * | tx, | ||
| const uint8_t | tx_len ) |
Write single block.
| block | Block address |
| tx | buffer |
| tx_len | buffer size |