18#ifndef MBED_NFC_EEPROM_H
19#define MBED_NFC_EEPROM_H
22#include "events/EventQueue.h"
24#include "NFCDefinitions.h"
26#include "NFCEEPROMDriver.h"
109 virtual void on_session_started(
bool success);
110 virtual void on_session_ended(
bool success);
111 virtual void on_bytes_read(
size_t count);
112 virtual void on_bytes_written(
size_t count);
113 virtual void on_size_written(
bool success);
114 virtual void on_size_read(
bool success,
size_t size);
115 virtual void on_bytes_erased(
size_t count);
118 void continue_write();
119 void continue_read();
120 void continue_erase();
125 enum nfc_eeprom_operation_t {
128 nfc_eeprom_write_start_session,
129 nfc_eeprom_write_write_size,
130 nfc_eeprom_write_write_bytes,
131 nfc_eeprom_write_end_session,
133 nfc_eeprom_read_start_session,
134 nfc_eeprom_read_read_size,
135 nfc_eeprom_read_read_bytes,
136 nfc_eeprom_read_end_session,
138 nfc_eeprom_erase_start_session,
139 nfc_eeprom_erase_write_max_size,
140 nfc_eeprom_erase_erase_bytes,
141 nfc_eeprom_erase_write_0_size,
142 nfc_eeprom_erase_end_session
150 nfc_eeprom_operation_t _current_op;
152 size_t _ndef_buffer_read_sz;
153 uint32_t _eeprom_address;
The abstraction for a NFC EEPROM driver.
The NFC EEPROM class represents a NFC target device connected using a wired link (I2C,...
virtual void erase_ndef_message()
Erase the NDEF message in the target.
virtual void read_ndef_message()
Read a NDEF message from the target.
virtual void write_ndef_message()
Write a NDEF message to the target.
nfc_err_t initialize()
Initialize the NFC EEPROM.
void set_delegate(Delegate *delegate)
Set the delegate that will receive events generated by this EEPROM.
NFCEEPROM(NFCEEPROMDriver *driver, events::EventQueue *queue, const Span< uint8_t > &ndef_buffer)
Construct a NFCEEPROM instance.
This class represents a NFC target (either a remote target when the local controller in in initiator ...
int nfc_err_t
Type for NFC errors.
Nonowning view to a sequence of contiguous elements.
virtual void on_ndef_message_read(nfc_err_t result)
The NDEF message reading request completed.
virtual void on_ndef_message_erased(nfc_err_t result)
The NDEF message erasing request completed.
virtual void on_ndef_message_written(nfc_err_t result)
The NDEF message writing request completed.
The NFCEEPROMDriver delegate.