Mistake on this page?
Report an issue in GitHub or email us
Data Structures | Public Member Functions
NFCController Class Reference

This class represents a NFC Controller. More...

#include <NFCController.h>

Inheritance diagram for NFCController:
NFCControllerDriver::Delegate

Data Structures

struct  Delegate
 The NFCController delegate. More...
 

Public Member Functions

 NFCController (NFCControllerDriver *driver, events::EventQueue *queue, const Span< uint8_t > &ndef_buffer)
 Construct a NFCController instance. More...
 
nfc_err_t initialize ()
 Initialize the NFC controller. More...
 
void set_delegate (Delegate *delegate)
 Set the delegate that will receive events generated by this controller. More...
 
nfc_rf_protocols_bitmask_t get_supported_rf_protocols () const
 Get the list of RF protocols supported by this controller. More...
 
nfc_err_t configure_rf_protocols (nfc_rf_protocols_bitmask_t rf_protocols)
 Set the list of RF protocols to look for during discovery. More...
 
nfc_err_t start_discovery ()
 Start the discovery process using the protocols configured previously. More...
 
nfc_err_t cancel_discovery ()
 Cancel/stop a running discovery process. More...
 

Detailed Description

This class represents a NFC Controller.

A controller can be in one of three different states:

A NFCController instance needs to be initialized with a NFCControllerDriver instance which abstracts the specific controller being used. A delegate needs to be set by the user to receive discovery events.

Definition at line 53 of file NFCController.h.

Constructor & Destructor Documentation

NFCController ( NFCControllerDriver driver,
events::EventQueue queue,
const Span< uint8_t > &  ndef_buffer 
)

Construct a NFCController instance.

Parameters
[in]drivera pointer to a NFCControllerDriver instance
[in]queuea pointer to the events queue to use
[in]ndef_buffera bytes array used to store NDEF messages

Member Function Documentation

nfc_err_t cancel_discovery ( )

Cancel/stop a running discovery process.

Returns
NFC_OK
nfc_err_t configure_rf_protocols ( nfc_rf_protocols_bitmask_t  rf_protocols)

Set the list of RF protocols to look for during discovery.

Parameters
[in]rf_protocolsthe relevant bitmask
Returns
NFC_OK on success, or NFC_ERR_UNSUPPORTED if a protocol is not supported by the controller, NFC_ERR_BUSY if the discovery process is already running
nfc_rf_protocols_bitmask_t get_supported_rf_protocols ( ) const

Get the list of RF protocols supported by this controller.

Returns
a bitmask of RF protocols supported by the controller
nfc_err_t initialize ( )

Initialize the NFC controller.

This method must be called before any other method call.

Returns
NFC_OK, or an error.
void set_delegate ( Delegate delegate)

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

Parameters
[in]delegatethe delegate instance to use
nfc_err_t start_discovery ( )

Start the discovery process using the protocols configured previously.

If remote endpoints are connected when this is called, they will be disconnected.

Returns
NFC_OK on success, or NFC_ERR_BUSY if the discovery process is already running
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.