Add doc for NFCRemoteInitiator

pull/7822/head
Donatien Garnier 2018-08-08 14:56:21 +01:00
parent b14e18d170
commit 2db8f8607d
1 changed files with 51 additions and 4 deletions

View File

@ -25,26 +25,73 @@
namespace mbed {
namespace nfc {
/**
* @addtogroup nfc
* @{
*/
/**
* 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.
*/
class NFCRemoteInitiator : public NFCEndpoint, public NFCNDEFCapable {
public:
/**
* Create a NFCRemoteInitiator.
*/
NFCRemoteInitiator();
virtual ~NFCRemoteInitiator();
struct Delegate : NFCEndpoint::Delegate {
/**
* The NFCRemoteInitiator delegate. Users of the NFCRemoteInitiator class need to implement this delegate's methods to receive events.
*/
struct Delegate : NFCEndpoint::Delegate, NFCNDEFCapable::Delegate {
/**
* The controller was selected by the initiator.
*/
virtual void on_selected() {}
virtual void on_deselected() {}
virtual void on_before_ndef_message_read() {}
virtual void on_after_ndef_message_write() {}
/**
* The controller was deselected by the initiator.
*/
virtual void on_deselected() {}
};
/**
* Set the delegate that will receive events generated by the initiator.
*
* @oaram[in] delegate the delegate instance to use
*/
void set_delegate(Delegate* delegate);
/**
* Retrieve the NFC tag type exposed by the controller to communicate with the initiator.
*
* @return the relevant NFC tag type
*/
nfc_tag_type_t nfc_tag_type() const;
/**
* Retrieve whether ISO7816 applications are supported by the underlying technology.
*
* @return whether ISO7816 applications are supported
*/
bool is_iso7816_supported() const;
/**
* Register an ISO7816 application to be used by the initiator.
*
* @param[in] application a pointer to an ISO7816App instance
*/
void add_iso7816_application(ISO7816App* application);
};
/**
* @}
*/
} // namespace nfc
} // namespace mbed