![]() |
Mbed OS Reference
|
The NFC EEPROM class represents a NFC target device connected using a wired link (I2C, SPI, etc). More...
#include <NFCEEPROM.h>
Data Structures | |
struct | Delegate |
The NFCEEPROM delegate. More... | |
Public Member Functions | |
NFCEEPROM (NFCEEPROMDriver *driver, events::EventQueue *queue, const Span< uint8_t > &ndef_buffer) | |
Construct a NFCEEPROM instance. | |
nfc_err_t | initialize () |
Initialize the NFC EEPROM. | |
void | set_delegate (Delegate *delegate) |
Set the delegate that will receive events generated by this EEPROM. | |
virtual void | write_ndef_message () |
Write a NDEF message to the target. | |
virtual void | read_ndef_message () |
Read a NDEF message from the target. | |
virtual void | erase_ndef_message () |
Erase the NDEF message in the target. | |
virtual bool | is_ndef_supported () const |
Check if this instance actually supports NDEF content. | |
Protected Member Functions | |
void | parse_ndef_message (const ac_buffer_t &buffer) |
Parse a NDEF message. | |
void | build_ndef_message (ac_buffer_builder_t &buffer_builder) |
Build NDEF message. | |
ndef_msg_t * | ndef_message () |
Retrieve underlying NDEF message instance. | |
The NFC EEPROM class represents a NFC target device connected using a wired link (I2C, SPI, etc).
These EEPROMs essentially provide addressable memory that can be accessed using either a wired or NFC interface.
In NFC mode these most often conform to one of the NFC tag types defined by the NFC Forum, therefore encoding NDEF data in these EEPROMs will ensure that it is understandable by a NFC reader.
Definition at line 46 of file NFCEEPROM.h.
NFCEEPROM | ( | NFCEEPROMDriver * | driver, |
events::EventQueue * | queue, | ||
const Span< uint8_t > & | ndef_buffer | ||
) |
Construct a NFCEEPROM instance.
[in] | driver | a pointer to a NFCEEPROMDriver instance |
[in] | queue | a pointer to the events queue to use |
[in] | ndef_buffer | a bytes array used to store NDEF messages |
nfc_err_t initialize | ( | ) |
Initialize the NFC EEPROM.
This method must be called before any other method call.
void set_delegate | ( | Delegate * | delegate | ) |
Set the delegate that will receive events generated by this EEPROM.
[in] | delegate | the delegate instance to use |
|
virtual |
Write a NDEF message to the target.
on_ndef_message_written() will be called on completion.
Implements NFCTarget.
|
virtual |
Read a NDEF message from the target.
on_ndef_message_read() will be called on completion.
Implements NFCTarget.
|
virtual |
Erase the NDEF message in the target.
on_ndef_message_erased() will be called on completion.
Implements NFCTarget.
|
virtualinherited |
Check if this instance actually supports NDEF content.
Reimplemented in Type4RemoteInitiator.
Definition at line 56 of file NFCNDEFCapable.h.
|
protectedinherited |
Parse a NDEF message.
[in] | buffer | a buffer containing a NDEF message |
|
protectedinherited |
Build NDEF message.
[in,out] | buffer_builder | a buffer builder in which to create the NDEF message. The backing buffer is guaranteed to be continuous. |
|
protectedinherited |
Retrieve underlying NDEF message instance.