A simple mbed OS application providing an example of asynchronous access to the X-NUCLEO_NFC01A1 Dynamic NFC Tag board.

Dependencies:   NDefLib X_NUCLEO_NFC01A1

Fork of mbed-os-example-NFC01A1 by Nicola Capovilla

Embed: (wiki syntax)

« Back to documentation index

ReadUriCallbacks Class Reference

ReadUriCallbacks Class Reference

Chain of callback that will read a NDef Message and print all the record of type URI. More...

#include <ReadUriCallbacks.h>

Public Member Functions

 ReadUriCallbacks (DigitalOut &onOpenSession, DigitalOut &onRead, DigitalOut &onCloseSession)
 create the callback chain
virtual void on_session_open (NDefLib::NDefNfcTag *tag, bool success)
 crate the new message and write it
virtual void on_message_read (NDefLib::NDefNfcTag *tag, bool success, const NDefLib::Message *)
 request to close the session
virtual void on_session_close (NDefLib::NDefNfcTag *, bool success)
 switch on the led

Detailed Description

Chain of callback that will read a NDef Message and print all the record of type URI.

After each operation the class will switch on a led

Definition at line 43 of file ReadUriCallbacks.h.


Constructor & Destructor Documentation

ReadUriCallbacks ( DigitalOut &  onOpenSession,
DigitalOut &  onRead,
DigitalOut &  onCloseSession 
)

create the callback chain

Parameters:
onOpenSessionled to switch on when the session open
onWriteled to switch on when the write end
onCloseSessionled to switch on when the session end

Definition at line 59 of file ReadUriCallbacks.h.


Member Function Documentation

virtual void on_message_read ( NDefLib::NDefNfcTag *  tag,
bool  success,
const NDefLib::Message *   
) [virtual]

request to close the session

Parameters:
tagtag where close the session
successtrue if the message is correctly wrote
messagewrote

Definition at line 86 of file ReadUriCallbacks.h.

virtual void on_session_close ( NDefLib::NDefNfcTag *  ,
bool  success 
) [virtual]

switch on the led

Parameters:
tagwhere the session is closed
successtrue if the session is correctly close

Definition at line 113 of file ReadUriCallbacks.h.

virtual void on_session_open ( NDefLib::NDefNfcTag *  tag,
bool  success 
) [virtual]

crate the new message and write it

Parameters:
tagtag where write the message
successtrue if the session correctly open

Definition at line 68 of file ReadUriCallbacks.h.