Mbed OS Reference
Loading...
Searching...
No Matches
Type4RemoteInitiator.h
1/* mbed Microcontroller Library
2 * Copyright (c) 2018 ARM Limited
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef MBED_TYPE4_REMOTE_INITIATOR_H
19#define MBED_TYPE4_REMOTE_INITIATOR_H
20
21#include <stdint.h>
22#include <stddef.h>
23
24#include "NFCNDEFCapable.h"
25#include "NFCRemoteInitiator.h"
26
31
32#include "platform/Span.h"
33
34namespace mbed {
35namespace nfc {
36
37/**
38 * @addtogroup nfc
39 * @{
40 */
41
42/**
43 * This class is an implementation of the Type 4 tag application.
44 */
46public:
47 /**
48 * Create a Type4RemoteInitiator.
49 *
50 * @param[in] controller pointer to the NFCController instance that created this object
51 * @param[in] buffer a bytes array used to store NDEF messages
52 */
54
55 /**
56 * Type4RemoteInitiator destructor.
57 */
59
60 // NFCRemoteEndpoint implementation
61 virtual nfc_err_t connect();
63 virtual bool is_connected() const;
64 virtual bool is_disconnected() const;
66
67 // NFCRemoteInitiator implementation
68 virtual nfc_tag_type_t nfc_tag_type() const;
69 virtual bool is_iso7816_supported() const;
71
72 // NFCNDEFCapable implementation
73 virtual bool is_ndef_supported() const;
74
75 // Callbacks from NFC stack
76 void disconnected_callback();
77 static void s_disconnected_callback(nfc_tech_iso7816_t *pIso7816, void *pUserData);
78
79 bool _is_connected;
80 bool _is_disconnected;
81 nfc_tech_iso7816_t _iso7816;
83};
84
85/**
86 * @}
87 */
88
89} // namespace nfc
90} // namespace mbed
91
92#endif
This class represents a NFC Controller.
Definition: NFCController.h:55
This class represents a remote NFC initiator (the local controller being in target mode).
This class is an implementation of the Type 4 tag application.
virtual nfc_err_t disconnect()
Disconnect the remote endpoint.
virtual nfc_tag_type_t nfc_tag_type() const
Retrieve the NFC tag type exposed by the controller to communicate with the initiator.
virtual nfc_rf_protocols_bitmask_t rf_protocols()
Get the list of RF protocols supported and activated over the air interface.
virtual bool is_iso7816_supported() const
Retrieve whether ISO7816 applications are supported by the underlying technology.
virtual nfc_err_t connect()
Connect the remote endpoint.
virtual bool is_ndef_supported() const
Check if this instance actually supports NDEF content.
virtual bool is_disconnected() const
Check if the endpoint is disconnected/lost.
virtual bool is_connected() const
Check if the endpoint is connected.
virtual ~Type4RemoteInitiator()
Type4RemoteInitiator destructor.
virtual void add_iso7816_application(nfc_tech_iso7816_app_t *application)
Register an ISO7816 application to be used by the initiator.
Type4RemoteInitiator(NFCController *controller, const Span< uint8_t > &buffer)
Create a Type4RemoteInitiator.
int nfc_err_t
Type for NFC errors.
Definition: nfc_errors.h:60
Nonowning view to a sequence of contiguous elements.
Definition: Span.h:215