Mbed OS Reference
Loading...
Searching...
No Matches
NFCRemoteInitiator Class Referenceabstract

This class represents a remote NFC initiator (the local controller being in target mode). More...

#include <NFCRemoteInitiator.h>

Inheritance diagram for NFCRemoteInitiator:
NFCRemoteEndpoint NFCNDEFCapable Type4RemoteInitiator

Data Structures

struct  Delegate
 The NFCRemoteInitiator delegate. More...
 

Public Member Functions

 NFCRemoteInitiator (NFCController *controller, const Span< uint8_t > &buffer)
 Create a NFCRemoteInitiator. More...
 
void set_delegate (Delegate *delegate)
 Set the delegate that will receive events generated by the initiator. More...
 
virtual nfc_tag_type_t nfc_tag_type () const =0
 Retrieve the NFC tag type exposed by the controller to communicate with the initiator. More...
 
virtual bool is_iso7816_supported () const =0
 Retrieve whether ISO7816 applications are supported by the underlying technology. More...
 
virtual void add_iso7816_application (nfc_tech_iso7816_app_t *application)=0
 Register an ISO7816 application to be used by the initiator. More...
 
virtual nfc_err_t connect ()=0
 Connect the remote endpoint. More...
 
virtual nfc_err_t disconnect ()=0
 Disconnect the remote endpoint. More...
 
virtual bool is_connected () const =0
 Check if the endpoint is connected. More...
 
virtual bool is_disconnected () const =0
 Check if the endpoint is disconnected/lost. More...
 
virtual nfc_rf_protocols_bitmask_t rf_protocols ()=0
 Get the list of RF protocols supported and activated over the air interface. More...
 
virtual bool is_ndef_supported () const
 Check if this instance actually supports NDEF content. More...
 

Protected Member Functions

virtual void connected ()
 Mark endpoint as connected. More...
 
virtual void disconnected ()
 Mark endpoint as disconnected. More...
 
NFCControllernfc_controller ()
 Retrieve NFCController instance. More...
 
const NFCControllernfc_controller () const
 Retrieve NFCController instance. More...
 
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

This class represents a remote NFC initiator (the local controller being in target mode).

An initiator can be a NFC reader, a NFC-enabled phone or other NFC device capable of generating a RF field.

Definition at line 45 of file NFCRemoteInitiator.h.

Constructor & Destructor Documentation

◆ NFCRemoteInitiator()

NFCRemoteInitiator ( NFCController controller,
const Span< uint8_t > &  buffer 
)

Create a NFCRemoteInitiator.

Parameters
[in]controllerthe NFCController instance that detected this endpoint
[in]buffera bytes array used to store NDEF messages

Member Function Documentation

◆ set_delegate()

void set_delegate ( Delegate delegate)

Set the delegate that will receive events generated by the initiator.

Parameters
[in]delegatethe delegate instance to use

◆ nfc_tag_type()

virtual nfc_tag_type_t nfc_tag_type ( ) const
pure virtual

Retrieve the NFC tag type exposed by the controller to communicate with the initiator.

Returns
the relevant NFC tag type

Implemented in Type4RemoteInitiator.

◆ is_iso7816_supported()

virtual bool is_iso7816_supported ( ) const
pure virtual

Retrieve whether ISO7816 applications are supported by the underlying technology.

Returns
whether ISO7816 applications are supported

Implemented in Type4RemoteInitiator.

◆ add_iso7816_application()

virtual void add_iso7816_application ( nfc_tech_iso7816_app_t application)
pure virtual

Register an ISO7816 application to be used by the initiator.

Parameters
[in]applicationa pointer to an nfc_tech_iso7816_app_t instance as defined by the MuNFC stack

Implemented in Type4RemoteInitiator.

◆ connected()

virtual void connected ( )
protectedvirtual

Mark endpoint as connected.

Implements NFCRemoteEndpoint.

◆ disconnected()

virtual void disconnected ( )
protectedvirtual

Mark endpoint as disconnected.

Implements NFCRemoteEndpoint.

◆ connect()

virtual nfc_err_t connect ( )
pure virtualinherited

Connect the remote endpoint.

Returns
NFC_OK or an error code

Implemented in Type4RemoteInitiator.

◆ disconnect()

virtual nfc_err_t disconnect ( )
pure virtualinherited

Disconnect the remote endpoint.

Returns
NFC_OK or an error code

Implemented in Type4RemoteInitiator.

◆ is_connected()

virtual bool is_connected ( ) const
pure virtualinherited

Check if the endpoint is connected.

Returns
whether the endpoint is connected

Implemented in Type4RemoteInitiator.

◆ is_disconnected()

virtual bool is_disconnected ( ) const
pure virtualinherited

Check if the endpoint is disconnected/lost.

Returns
whether the endpoint has been disconnected

Implemented in Type4RemoteInitiator.

◆ rf_protocols()

virtual nfc_rf_protocols_bitmask_t rf_protocols ( )
pure virtualinherited

Get the list of RF protocols supported and activated over the air interface.

Returns
a bitmask of activated protocols

Implemented in Type4RemoteInitiator.

◆ nfc_controller() [1/2]

NFCController * nfc_controller ( )
protectedinherited

Retrieve NFCController instance.

Returns
a pointer to the NFController instance that created this endpoint.

◆ nfc_controller() [2/2]

const NFCController * nfc_controller ( ) const
protectedinherited

Retrieve NFCController instance.

Returns
a pointer to the NFController instance that created this endpoint.

◆ is_ndef_supported()

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.

◆ parse_ndef_message()

void parse_ndef_message ( const ac_buffer_t buffer)
protectedinherited

Parse a NDEF message.

Parameters
[in]buffera buffer containing a NDEF message

◆ build_ndef_message()

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.

◆ ndef_message()

ndef_msg_t * ndef_message ( )
protectedinherited

Retrieve underlying NDEF message instance.

Returns
pointer to NDEF message instance