Mistake on this page?
Report an issue in GitHub or email us
Data Structures | Public Member Functions | Protected Member Functions
NFCEEPROM Class Reference

The NFC EEPROM class represents a NFC target device connected using a wired link (I2C, SPI, etc). More...

#include <NFCEEPROM.h>

Inheritance diagram for NFCEEPROM:
NFCTarget NFCEEPROMDriver::Delegate NFCNDEFCapable

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. More...
 
nfc_err_t initialize ()
 Initialize the NFC EEPROM. More...
 
void set_delegate (Delegate *delegate)
 Set the delegate that will receive events generated by this EEPROM. More...
 
virtual void write_ndef_message ()
 Write a NDEF message to the target. More...
 
virtual void read_ndef_message ()
 Read a NDEF message from the target. More...
 
virtual void erase_ndef_message ()
 Erase the NDEF message in the target. More...
 
virtual bool is_ndef_supported () const
 Check if this instance actually supports NDEF content. More...
 

Protected Member Functions

void parse_ndef_message (const ac_buffer_t &buffer)
 Parse a NDEF message. More...
 
void build_ndef_message (ac_buffer_builder_t &buffer_builder)
 Build NDEF message. More...
 
ndef_msg_tndef_message ()
 Retrieve underlying NDEF message instance. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

NFCEEPROM ( NFCEEPROMDriver driver,
events::EventQueue queue,
const Span< uint8_t > &  ndef_buffer 
)

Construct a NFCEEPROM instance.

Parameters
[in]drivera pointer to a NFCEEPROMDriver instance
[in]queuea pointer to the events queue to use
[in]ndef_buffera bytes array used to store NDEF messages

Member Function Documentation

void build_ndef_message ( ac_buffer_builder_t buffer_builder)
protectedinherited

Build NDEF message.

Parameters
[in,out]buffer_buildera buffer builder in which to create the NDEF message. The backing buffer is guaranteed to be continuous.
virtual void erase_ndef_message ( )
virtual

Erase the NDEF message in the target.

on_ndef_message_erased() will be called on completion.

Implements NFCTarget.

nfc_err_t initialize ( )

Initialize the NFC EEPROM.

This method must be called before any other method call.

Returns
NFC_OK, or an error.
virtual bool is_ndef_supported ( ) const
virtualinherited

Check if this instance actually supports NDEF content.

Returns
whether NDEF content is supported

Reimplemented in Type4RemoteInitiator.

Definition at line 56 of file NFCNDEFCapable.h.

ndef_msg_t* ndef_message ( )
protectedinherited

Retrieve underlying NDEF message instance.

Returns
pointer to NDEF message instance
void parse_ndef_message ( const ac_buffer_t buffer)
protectedinherited

Parse a NDEF message.

Parameters
[in]buffera buffer containing a NDEF message
virtual void read_ndef_message ( )
virtual

Read a NDEF message from the target.

on_ndef_message_read() will be called on completion.

Implements NFCTarget.

void set_delegate ( Delegate delegate)

Set the delegate that will receive events generated by this EEPROM.

Parameters
[in]delegatethe delegate instance to use
virtual void write_ndef_message ( )
virtual

Write a NDEF message to the target.

on_ndef_message_written() will be called on completion.

Implements NFCTarget.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.