mirror of https://github.com/ARMmbed/mbed-os.git
Add doc/update API for NFCTarget
parent
2246535a9f
commit
b2cbdb5aa1
|
|
@ -26,24 +26,73 @@
|
||||||
namespace mbed {
|
namespace mbed {
|
||||||
namespace nfc {
|
namespace nfc {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup 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).
|
||||||
|
*
|
||||||
|
* A target can be a NFC tag/card, a NFC-enabled phone or other NFC device capable of modulating a RF field.
|
||||||
|
*/
|
||||||
class NFCTarget : public NFCNDEFCapable {
|
class NFCTarget : public NFCNDEFCapable {
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* Create a NFCTarget.
|
||||||
|
*/
|
||||||
NFCTarget();
|
NFCTarget();
|
||||||
virtual ~NFCTarget();
|
virtual ~NFCTarget();
|
||||||
|
|
||||||
struct Delegate {
|
struct Delegate {
|
||||||
|
/**
|
||||||
|
* The NDEF message erasing request completed.
|
||||||
|
*
|
||||||
|
* @param[in] result NFC_OK or an error code on failure
|
||||||
|
*/
|
||||||
virtual void on_ndef_message_erased(nfc_err_t result) {}
|
virtual void on_ndef_message_erased(nfc_err_t result) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The NDEF message writing request completed.
|
||||||
|
*
|
||||||
|
* @param[in] result NFC_OK or an error code on failure
|
||||||
|
*/
|
||||||
virtual void on_ndef_message_written(nfc_err_t result) {}
|
virtual void on_ndef_message_written(nfc_err_t result) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The NDEF message reading request completed.
|
||||||
|
*
|
||||||
|
* @param[in] result NFC_OK or an error code on failure
|
||||||
|
*/
|
||||||
virtual void on_ndef_message_read(nfc_err_t result) {}
|
virtual void on_ndef_message_read(nfc_err_t result) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
void set_delegate(Delegate* delegate);
|
/**
|
||||||
|
* Write a NDEF message to the target.
|
||||||
|
*
|
||||||
|
* on_ndef_message_written() will be called on completion.
|
||||||
|
*/
|
||||||
|
virtual void write_ndef_message() = 0;
|
||||||
|
|
||||||
void write_ndef_message();
|
/**
|
||||||
void read_ndef_message();
|
* Read a NDEF message from the target.
|
||||||
void erase_ndef_message();
|
*
|
||||||
|
* on_ndef_message_read() will be called on completion.
|
||||||
|
*/
|
||||||
|
virtual void read_ndef_message() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Erase the NDEF message in the target.
|
||||||
|
*
|
||||||
|
* on_ndef_message_erased() will be called on completion.
|
||||||
|
*/
|
||||||
|
virtual void erase_ndef_message() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
} // namespace nfc
|
} // namespace nfc
|
||||||
} // namespace mbed
|
} // namespace mbed
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue