Update doc/API for Type4RemoteInitiator

pull/7822/head
Donatien Garnier 2018-08-09 18:43:42 +01:00
parent b2cbdb5aa1
commit 5691a663b4
2 changed files with 32 additions and 19 deletions

View File

@ -60,6 +60,13 @@ namespace nfc {
size_t build_ndef_message(uint8_t* buffer, size_t capacity) { return 0; }
};
/**
* Set the delegate that will receive events generated by this class.
*
* @oaram[in] delegate the delegate instance to use
*/
void set_ndef_delegate(Delegate* delegate);
protected:
/**
* Parse a NDEF message.
@ -76,13 +83,6 @@ namespace nfc {
*/
void build_ndef_message(ac_buffer_builder_t& buffer_builder);
/**
* Set the delegate that will receive events generated by this class.
*
* @oaram[in] delegate the delegate instance to use
*/
void set_delegate(Delegate* delegate);
private:
Delegate* _delegate;
};

View File

@ -14,32 +14,45 @@
* limitations under the License.
*/
#ifndef MBED_TYPE4_TAG_APP_H
#define MBED_TYPE4_TAG_APP_H
#ifndef MBED_TYPE4_REMOTE_INITIATOR_H
#define MBED_TYPE4_REMOTE_INITIATOR_H
#include <stdint.h>
#include <stddef.h>
#include "IOS7816App.h"
#include "ISO7816App.h"
#include "NFCNDEFCapable.h"
#include "NFCRemoteInitiator.h"
#include "acore/buffer.h"
namespace mbed {
namespace nfc {
/**
* @addtogroup nfc
* @{
*/
class Type4TagApp : public ISO7816App, private ISO7816App::Delegate, public NFCNDEFCapable {
public:
struct Delegate {
virtual void on_selected() {}
/**
* This class is an implementation of the Type 4 tag application.
*/
class Type4RemoteInitiator : public NFCRemoteInitiator, public ISO7816App, public NFCNDEFCapable {
private:
// NFCNDEFCapable implementation
virtual bool is_ndef_supported() const;
virtual void on_deselected() {}
virtual void on_exchange(uint8_t cla, uint8_t ins, uint8_t p1, uint8_t p2,
ac_buffer_t* command, size_t max_response_sz) {}
};
// ISO7816App implementation
virtual const ac_buffer_t* get_aid() const;
virtual void on_selected();
virtual void on_deselected();
virtual void on_exchange(Exchange* exchange);
};
/**
* @}
*/
} // namespace nfc
} // namespace mbed