blob: 55412b338a17da6c0a37da7e55461b310de9836f [file] [log] [blame]
nxpandroidc7611652015-09-23 16:42:05 +05301/******************************************************************************
2 *
3 * Copyright (C) 2010-2014 Broadcom Corporation
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 ******************************************************************************/
nxpandroidc7611652015-09-23 16:42:05 +053018
19/******************************************************************************
20 *
21 * NFA card emulation API functions
22 *
23 ******************************************************************************/
24#ifndef NFA_CE_API_H
25#define NFA_CE_API_H
26
nxpandroidc7611652015-09-23 16:42:05 +053027#include "nfa_api.h"
nxf24591c1cbeab2018-02-21 17:32:26 +053028#include "nfc_target.h"
nxpandroidc7611652015-09-23 16:42:05 +053029
30/*****************************************************************************
31** Constants and data types
32*****************************************************************************/
33
34/*****************************************************************************
35** External Function Declarations
36*****************************************************************************/
nxpandroidc7611652015-09-23 16:42:05 +053037
38/*******************************************************************************
39**
40** Function NFA_CeConfigureLocalTag
41**
42** Description Configure local NDEF tag.
43**
44** Tag events will be notifed using the tNFA_CONN_CBACK
45** (registered during NFA_Enable)
46**
nxpandroid8f6d0532017-07-12 18:25:30 +053047** The NFA_CE_LOCAL_TAG_CONFIGURED_EVT reports the status of
48** the operation.
nxpandroidc7611652015-09-23 16:42:05 +053049**
50** Activation and deactivation are reported using the
51** NFA_ACTIVATED_EVT and NFA_DEACTIVATED_EVT events
52**
53** If a write-request is received to update the tag memory,
nxpandroid8f6d0532017-07-12 18:25:30 +053054** an NFA_CE_NDEF_WRITE_CPLT_EVT will notify the application,
55** along with a buffer containing the updated contents.
nxpandroidc7611652015-09-23 16:42:05 +053056**
57** To disable the local NDEF tag, set protocol_mask=0
58**
59** The NDEF data provided by p_ndef_data must be persistent
nxpandroid8f6d0532017-07-12 18:25:30 +053060** as long as the local NDEF tag is enabled. Also, Input
61** parameters p_uid and uid_len are reserved for future use.
nxpandroidc7611652015-09-23 16:42:05 +053062**
63**
nxpandroid8f6d0532017-07-12 18:25:30 +053064** Note: If RF discovery is started,
65** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
66** happen before calling this function.
nxpandroidc7611652015-09-23 16:42:05 +053067**
68** Returns:
69** NFA_STATUS_OK, if command accepted
70** NFA_STATUS_INVALID_PARAM,
71** if protocol_maks is not 0 and p_ndef_data is NULL
72** (or) uid_len is not 0
73** (or) if protocol mask is set for Type 1 or Type 2
74**
75** NFA_STATUS_FAILED: otherwise
76**
77*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +053078extern tNFA_STATUS NFA_CeConfigureLocalTag(tNFA_PROTOCOL_MASK protocol_mask,
79 uint8_t* p_ndef_data,
80 uint16_t ndef_cur_size,
81 uint16_t ndef_max_size,
82 bool read_only, uint8_t uid_len,
83 uint8_t* p_uid);
nxpandroidc7611652015-09-23 16:42:05 +053084
85/*******************************************************************************
86**
87** Function NFA_CeConfigureUiccListenTech
88**
89** Description Configure listening for the UICC, using the specified
90** technologies.
91**
92** Events will be notifed using the tNFA_CONN_CBACK
93** (registered during NFA_Enable)
94**
nxpandroid8f6d0532017-07-12 18:25:30 +053095** The NFA_CE_UICC_LISTEN_CONFIGURED_EVT reports the status of
96** the operation.
nxpandroidc7611652015-09-23 16:42:05 +053097**
98** Activation and deactivation are reported using the
99** NFA_ACTIVATED_EVT and NFA_DEACTIVATED_EVT events
100**
nxpandroid8f6d0532017-07-12 18:25:30 +0530101** Note: If RF discovery is started,
102** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
103** happen before calling this function
nxpandroidc7611652015-09-23 16:42:05 +0530104**
105** Returns:
106** NFA_STATUS_OK, if command accepted
107** NFA_STATUS_FAILED: otherwise
108**
109*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530110extern tNFA_STATUS NFA_CeConfigureUiccListenTech(
111 tNFA_HANDLE ee_handle, tNFA_TECHNOLOGY_MASK tech_mask);
nxpandroidc7611652015-09-23 16:42:05 +0530112
nxpandroidc7611652015-09-23 16:42:05 +0530113/*******************************************************************************
114**
115** Function NFA_CeRegisterFelicaSystemCodeOnDH
116**
117** Description Register listening callback for Felica system code
118**
119** The NFA_CE_REGISTERED_EVT reports the status of the
120** operation.
121**
nxpandroid8f6d0532017-07-12 18:25:30 +0530122** Note: If RF discovery is started,
123** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
124** happen before calling this function
nxpandroidc7611652015-09-23 16:42:05 +0530125**
126** Returns:
127** NFA_STATUS_OK, if command accepted
128** NFA_STATUS_FAILED: otherwise
129**
130*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530131extern tNFA_STATUS NFA_CeRegisterFelicaSystemCodeOnDH(
132 uint16_t system_code, uint8_t nfcid2[NCI_RF_F_UID_LEN],
nxf24591c1cbeab2018-02-21 17:32:26 +0530133 uint8_t t3tPmm[NCI_T3T_PMM_LEN], tNFA_CONN_CBACK* p_conn_cback);
nxpandroidc7611652015-09-23 16:42:05 +0530134
135/*******************************************************************************
136**
137** Function NFA_CeDeregisterFelicaSystemCodeOnDH
138**
139** Description Deregister listening callback for Felica
nxpandroid8f6d0532017-07-12 18:25:30 +0530140** (previously registered using
141** NFA_CeRegisterFelicaSystemCodeOnDH)
nxpandroidc7611652015-09-23 16:42:05 +0530142**
143** The NFA_CE_DEREGISTERED_EVT reports the status of the
144** operation.
145**
nxpandroid8f6d0532017-07-12 18:25:30 +0530146** Note: If RF discovery is started,
147** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
148** happen before calling this function
nxpandroidc7611652015-09-23 16:42:05 +0530149**
150** Returns NFA_STATUS_OK if successfully initiated
151** NFA_STATUS_BAD_HANDLE if invalid handle
152** NFA_STATUS_FAILED otherwise
153**
154*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530155extern tNFA_STATUS NFA_CeDeregisterFelicaSystemCodeOnDH(tNFA_HANDLE handle);
nxpandroidc7611652015-09-23 16:42:05 +0530156
157/*******************************************************************************
158**
159** Function NFA_CeRegisterAidOnDH
160**
161** Description Register listening callback for the specified ISODEP AID
162**
163** The NFA_CE_REGISTERED_EVT reports the status of the
164** operation.
165**
166** If no AID is specified (aid_len=0), then p_conn_cback will
167** will get notifications for any AIDs routed to the DH. This
168** over-rides callbacks registered for specific AIDs.
169**
nxpandroid8f6d0532017-07-12 18:25:30 +0530170** Note: If RF discovery is started,
171** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
172** happen before calling this function
nxpandroidc7611652015-09-23 16:42:05 +0530173**
174** Returns:
175** NFA_STATUS_OK, if command accepted
176** NFA_STATUS_FAILED: otherwise
177**
178*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530179extern tNFA_STATUS NFA_CeRegisterAidOnDH(uint8_t aid[NFC_MAX_AID_LEN],
180 uint8_t aid_len,
181 tNFA_CONN_CBACK* p_conn_cback);
nxpandroidc7611652015-09-23 16:42:05 +0530182
183/*******************************************************************************
184**
185** Function NFA_CeDeregisterAidOnDH
186**
187** Description Deregister listening callback for ISODEP AID
188** (previously registered using NFA_CeRegisterAidOnDH)
189**
190** The NFA_CE_DEREGISTERED_EVT reports the status of the
191** operation.
192**
nxpandroid8f6d0532017-07-12 18:25:30 +0530193** Note: If RF discovery is started,
194** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
195** happen before calling this function
nxpandroidc7611652015-09-23 16:42:05 +0530196**
197** Returns NFA_STATUS_OK if successfully initiated
198** NFA_STATUS_BAD_HANDLE if invalid handle
199** NFA_STATUS_FAILED otherwise
200**
201*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530202extern tNFA_STATUS NFA_CeDeregisterAidOnDH(tNFA_HANDLE handle);
nxpandroidc7611652015-09-23 16:42:05 +0530203
204/*******************************************************************************
205**
206** Function NFA_CeSetIsoDepListenTech
207**
208** Description Set the technologies (NFC-A and/or NFC-B) to listen for when
nxpandroid8f6d0532017-07-12 18:25:30 +0530209** NFA_CeConfigureLocalTag or NFA_CeDeregisterAidOnDH are
210** called.
nxpandroidc7611652015-09-23 16:42:05 +0530211**
212** By default (if this API is not called), NFA will listen
213** for both NFC-A and NFC-B for ISODEP.
214**
215** Note: If listening for ISODEP on UICC, the DH listen callbacks
nxpandroid8f6d0532017-07-12 18:25:30 +0530216** may still get activate notifications for ISODEP if the
217** reader/writer selects an AID that is not routed to the UICC
218** (regardless of whether A or B was disabled using
219** NFA_CeSetIsoDepListenTech)
nxpandroidc7611652015-09-23 16:42:05 +0530220**
nxpandroid8f6d0532017-07-12 18:25:30 +0530221** Note: If RF discovery is started,
222** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
223** happen before calling this function
nxpandroidc7611652015-09-23 16:42:05 +0530224**
225** Returns:
226** NFA_STATUS_OK, if command accepted
227** NFA_STATUS_FAILED: otherwise
228**
229*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530230extern tNFA_STATUS NFA_CeSetIsoDepListenTech(tNFA_TECHNOLOGY_MASK tech_mask);
nxpandroidc7611652015-09-23 16:42:05 +0530231
nxpandroidc7611652015-09-23 16:42:05 +0530232#endif /* NFA_CE_API_H */