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

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.