This class represents a NFC Controller. More...
#include <NFCController.h>
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... | |
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.
NFCController | ( | NFCControllerDriver * | driver, |
events::EventQueue * | queue, | ||
const Span< uint8_t > & | ndef_buffer | ||
) |
Construct a NFCController instance.
[in] | driver | a pointer to a NFCControllerDriver instance |
[in] | queue | a pointer to the events queue to use |
[in] | ndef_buffer | a bytes array used to store NDEF messages |
nfc_err_t cancel_discovery | ( | ) |
Cancel/stop a running discovery process.
nfc_err_t configure_rf_protocols | ( | nfc_rf_protocols_bitmask_t | rf_protocols | ) |
Set the list of RF protocols to look for during discovery.
[in] | rf_protocols | the relevant bitmask |
nfc_rf_protocols_bitmask_t get_supported_rf_protocols | ( | ) | const |
Get the list of RF protocols supported by this controller.
nfc_err_t initialize | ( | ) |
Initialize the NFC controller.
This method must be called before any other method call.
void set_delegate | ( | Delegate * | delegate | ) |
Set the delegate that will receive events generated by this controller.
[in] | delegate | the 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.