takashi kadono / Mbed OS Nucleo_446

Dependencies:   ssd1331

Embed: (wiki syntax)

« Back to documentation index

NFCRemoteInitiator Class Reference

NFCRemoteInitiator Class Reference
[Nfc]

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

#include <NFCRemoteInitiator.h>

Inherits mbed::nfc::NFCRemoteEndpoint, and mbed::nfc::NFCNDEFCapable.

Inherited by Type4RemoteInitiator.

Data Structures

struct  Delegate
 The NFCRemoteInitiator delegate. More...

Public Member Functions

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

Protected Member Functions

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

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 44 of file NFCRemoteInitiator.h.


Constructor & Destructor Documentation

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

Definition at line 22 of file NFCRemoteInitiator.cpp.


Member Function Documentation

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.

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.

virtual nfc_err_t connect (  ) [pure virtual, inherited]

Connect the remote endpoint.

Returns:
NFC_OK or an error code

Implemented in Type4RemoteInitiator.

void connected (  ) [protected, virtual]

Mark endpoint as connected.

Implements NFCRemoteEndpoint.

Definition at line 38 of file NFCRemoteInitiator.cpp.

virtual nfc_err_t disconnect (  ) [pure virtual, inherited]

Disconnect the remote endpoint.

Returns:
NFC_OK or an error code

Implemented in Type4RemoteInitiator.

void disconnected (  ) [protected, virtual]

Mark endpoint as disconnected.

Implements NFCRemoteEndpoint.

Definition at line 45 of file NFCRemoteInitiator.cpp.

virtual bool is_connected (  ) const [pure virtual, inherited]

Check if the endpoint is connected.

Returns:
whether the endpoint is connected

Implemented in Type4RemoteInitiator.

virtual bool is_disconnected (  ) const [pure virtual, inherited]

Check if the endpoint is disconnected/lost.

Returns:
whether the endpoint has been disconnected

Implemented in Type4RemoteInitiator.

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.

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.

const NFCController * nfc_controller (  ) const [protected, inherited]

Retrieve NFCController instance.

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

Definition at line 56 of file NFCRemoteEndpoint.cpp.

NFCController * nfc_controller (  ) [protected, inherited]

Retrieve NFCController instance.

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

Definition at line 51 of file NFCRemoteEndpoint.cpp.

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.

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.

nfc_rf_protocols_bitmask_t rf_protocols (  ) [pure virtual, inherited]

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

Returns:
a bitmask of activated protocols

Implemented in Type4RemoteInitiator.

Definition at line 39 of file NFCRemoteEndpoint.cpp.

void set_delegate ( Delegate *  delegate )

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

Parameters:
[in]delegatethe delegate instance to use

Definition at line 33 of file NFCRemoteInitiator.cpp.