Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
NFCTarget Class Reference
[Nfc]
This class represents a NFC target (either a remote target when the local controller in in initiator mode, or a target connected through a wired connection). More...
#include <NFCTarget.h>
Inherits mbed::nfc::NFCNDEFCapable.
Inherited by NFCEEPROM.
Public Member Functions | |
| NFCTarget (const Span< uint8_t > &buffer) | |
| Create a NFCTarget. | |
| virtual | ~NFCTarget () |
| NFCTarget destructor. | |
| virtual void | write_ndef_message ()=0 |
| Write a NDEF message to the target. | |
| virtual void | read_ndef_message ()=0 |
| Read a NDEF message from the target. | |
| virtual void | erase_ndef_message ()=0 |
| Erase the NDEF message in the target. | |
| virtual bool | is_ndef_supported () const |
| Check if this instance actually supports NDEF content. | |
Protected Member Functions | |
| 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 NFC target (either a remote target when the local controller in in initiator mode, or a target connected through a wired connection).
A target can be a NFC tag/card, a NFC-enabled phone or other NFC device capable of modulating a RF field.
Definition at line 40 of file NFCTarget.h.
Constructor & Destructor Documentation
Create a NFCTarget.
- Parameters:
-
[in] buffer a bytes array used to store NDEF messages
Definition at line 22 of file NFCTarget.cpp.
| ~NFCTarget | ( | ) | [virtual] |
NFCTarget destructor.
Definition at line 28 of file NFCTarget.cpp.
Member Function Documentation
| void build_ndef_message | ( | ac_buffer_builder_t & | buffer_builder ) | [protected, inherited] |
Build NDEF message.
- Parameters:
-
[in,out] buffer_builder a 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 void erase_ndef_message | ( | ) | [pure virtual] |
Erase the NDEF message in the target.
on_ndef_message_erased() will be called on completion.
Implemented in NFCEEPROM.
| 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.
| void parse_ndef_message | ( | const ac_buffer_t & | buffer ) | [protected, inherited] |
Parse a NDEF message.
- Parameters:
-
[in] buffer a buffer containing a NDEF message
Definition at line 33 of file NFCNDEFCapable.cpp.
| virtual void read_ndef_message | ( | ) | [pure virtual] |
Read a NDEF message from the target.
on_ndef_message_read() will be called on completion.
Implemented in NFCEEPROM.
| virtual void write_ndef_message | ( | ) | [pure virtual] |
Write a NDEF message to the target.
on_ndef_message_written() will be called on completion.
Implemented in NFCEEPROM.
Generated on Tue Aug 9 2022 00:37:39 by
1.7.2