Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

NFCEEPROM Class Reference

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

#include <NFCEEPROM.h>

Inherits mbed::nfc::NFCTarget, and mbed::nfc::NFCEEPROMDriver::Delegate.

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.

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 45 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

Definition at line 23 of file NFCEEPROM.cpp.


Member Function Documentation

void build_ndef_message ( ac_buffer_builder_t &  buffer_builder ) [protected, inherited]

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.

Definition at line 44 of file NFCNDEFCapable.cpp.

void erase_ndef_message (  ) [virtual]

Erase the NDEF message in the target.

on_ndef_message_erased() will be called on completion.

Implements NFCTarget.

Definition at line 104 of file NFCEEPROM.cpp.

nfc_err_t initialize (  )

Initialize the NFC EEPROM.

This method must be called before any other method call.

Returns:
NFC_OK, or an error.

Definition at line 31 of file NFCEEPROM.cpp.

virtual bool is_ndef_supported (  ) const [virtual, inherited]

Check if this instance actually supports NDEF content.

Returns:
whether NDEF content is supported

Reimplemented in Type4RemoteInitiator.

Definition at line 55 of file NFCNDEFCapable.h.

ndef_msg_t * ndef_message (  ) [protected, inherited]

Retrieve underlying NDEF message instance.

Returns:
pointer to NDEF message instance

Definition at line 77 of file NFCNDEFCapable.cpp.

void parse_ndef_message ( const ac_buffer_t &  buffer ) [protected, inherited]

Parse a NDEF message.

Parameters:
[in]buffera buffer containing a NDEF message

Definition at line 33 of file NFCNDEFCapable.cpp.

void read_ndef_message (  ) [virtual]

Read a NDEF message from the target.

on_ndef_message_read() will be called on completion.

Implements NFCTarget.

Definition at line 81 of file NFCEEPROM.cpp.

void set_delegate ( NFCEEPROM::Delegate delegate )

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

Parameters:
[in]delegatethe delegate instance to use

Definition at line 41 of file NFCEEPROM.cpp.

void write_ndef_message (  ) [virtual]

Write a NDEF message to the target.

on_ndef_message_written() will be called on completion.

Implements NFCTarget.

Definition at line 46 of file NFCEEPROM.cpp.