blob: 964eb81eceb53b6163a9cd835408de39c7ee48b3 [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 ******************************************************************************/
18/******************************************************************************
19 *
nxf24591c1cbeab2018-02-21 17:32:26 +053020 * The original Work has been changed by NXP.
nxpandroidc7611652015-09-23 16:42:05 +053021 *
22 * Licensed under the Apache License, Version 2.0 (the "License");
23 * you may not use this file except in compliance with the License.
24 * You may obtain a copy of the License at
25 *
26 * http://www.apache.org/licenses/LICENSE-2.0
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
nxf24591c1cbeab2018-02-21 17:32:26 +053034 * Copyright 2018 NXP
35 *
nxpandroidc7611652015-09-23 16:42:05 +053036 ******************************************************************************/
37/******************************************************************************
38 *
39 * NFA interface to NFCEE
40 *
41 ******************************************************************************/
42#ifndef NFA_EE_API_H
43#define NFA_EE_API_H
44
nxpandroidc7611652015-09-23 16:42:05 +053045#include "nfa_api.h"
46#include "nfc_api.h"
nxf24591c1cbeab2018-02-21 17:32:26 +053047#include "nfc_target.h"
nxpandroidc7611652015-09-23 16:42:05 +053048
49/*****************************************************************************
50** Constants and data types
51*****************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +053052/* 16 per ISO 7816 specification */
53#define NFA_MAX_AID_LEN NFC_MAX_AID_LEN
nxpandroid8f6d0532017-07-12 18:25:30 +053054#if (NXP_EXTNS == TRUE)
Suraj Uday Kotharkar11ae20f2018-07-20 23:29:36 +053055#define NFA_MAX_APDU_DATA_LEN NFC_MAX_APDU_DATA_LEN
56#define NFA_MAX_APDU_MASK_LEN NFC_MAX_APDU_MASK_LEN
nxf24591c1cbeab2018-02-21 17:32:26 +053057#define NFA_EE_HANDLE_DH (NFA_HANDLE_GROUP_EE | NFC_DH_ID)
nxpandroid8f6d0532017-07-12 18:25:30 +053058extern uint8_t NFA_REMOVE_ALL_AID[];
59#define NFA_REMOVE_ALL_AID_LEN (0x08)
nxpandroidc7611652015-09-23 16:42:05 +053060#endif
nxpandroidc7611652015-09-23 16:42:05 +053061/* NFA EE callback events */
nxpandroid8f6d0532017-07-12 18:25:30 +053062enum {
63 NFA_EE_DISCOVER_EVT, /* The status for NFA_EeDiscover () */
64 NFA_EE_REGISTER_EVT, /* The status for NFA_EeRegister () */
65 NFA_EE_DEREGISTER_EVT, /* The status for NFA_EeDeregister () */
66 NFA_EE_MODE_SET_EVT, /* The status for activating or deactivating an NFCEE */
67 NFA_EE_ADD_AID_EVT, /* The status for adding an AID to a routing table entry
Suraj Uday Kotharkar6f7757b2018-05-10 15:58:29 +053068 */
69 NFA_EE_REMOVE_AID_EVT, /* The status for removing an AID from a routing table
70 */
71 NFA_EE_ADD_SYSCODE_EVT, /* The status for adding an System Code to a routing
72 table entry */
73 NFA_EE_REMOVE_SYSCODE_EVT, /* The status for removing an System Code from
74 routing table */
nxpandroid8f6d0532017-07-12 18:25:30 +053075 NFA_EE_REMAINING_SIZE_EVT, /* The remaining size of the Listen Mode Routing
76 Table */
77 NFA_EE_SET_TECH_CFG_EVT, /* The status for setting the routing based on RF
78 tech. */
79 NFA_EE_SET_PROTO_CFG_EVT, /* The status for setting the routing based on
80 protocols */
81 NFA_EE_UPDATED_EVT, /* The status for NFA_EeUpdateNow */
82 NFA_EE_CONNECT_EVT, /* Result of NFA_EeConnect */
83 NFA_EE_DATA_EVT, /* Received data from NFCEE. */
84 NFA_EE_DISCONNECT_EVT, /* NFCEE connection closed. */
85 NFA_EE_NEW_EE_EVT, /* A new NFCEE is discovered */
86 NFA_EE_ACTION_EVT, /* An action happened in NFCEE */
87 NFA_EE_DISCOVER_REQ_EVT, /* NFCEE Discover Request Notification */
nxpandroid8f6d0532017-07-12 18:25:30 +053088 NFA_EE_NO_MEM_ERR_EVT, /* Error - out of GKI buffers */
89 NFA_EE_NO_CB_ERR_EVT, /* Error - Can not find control block or wrong state */
nxpandroid65a02602017-01-13 19:13:19 +053090#if (NXP_EXTNS == TRUE)
nxpandroid8f6d0532017-07-12 18:25:30 +053091 NFA_EE_SET_MODE_INFO_EVT,
nxpandroid9d47b702017-07-12 21:25:17 +053092 NFA_EE_PWR_LINK_CTRL_EVT, /* NFCEE Pwr and link cotnrol command Evt */
Suraj Uday Kotharkar11ae20f2018-07-20 23:29:36 +053093 NFA_EE_ADD_APDU_EVT, /* The status for adding an APDU pattern to a routing table entry*/
94 NFA_EE_REMOVE_APDU_EVT /* The status for removing an APDU pattern from a routing table */
nxpandroid3e4012e2016-08-01 19:09:55 +053095#endif
nxpandroidc7611652015-09-23 16:42:05 +053096};
nxpandroid8f6d0532017-07-12 18:25:30 +053097typedef uint8_t tNFA_EE_EVT;
nxpandroidc7611652015-09-23 16:42:05 +053098
99/* tNFA_NFCEE_INTERFACE values */
nxpandroid8f6d0532017-07-12 18:25:30 +0530100/* HCI Access Interface*/
101#define NFA_EE_INTERFACE_HCI_ACCESS NFC_NFCEE_INTERFACE_HCI_ACCESS
nxpandroid8f6d0532017-07-12 18:25:30 +0530102typedef uint8_t tNFA_EE_INTERFACE;
nxpandroidc7611652015-09-23 16:42:05 +0530103
nxpandroid8f6d0532017-07-12 18:25:30 +0530104typedef uint8_t tNFA_EE_TAG;
nxpandroidc7611652015-09-23 16:42:05 +0530105
106/* for NFA_EeModeSet () */
nxpandroid8f6d0532017-07-12 18:25:30 +0530107#define NFA_EE_MD_ACTIVATE NFC_MODE_ACTIVATE
108#define NFA_EE_MD_DEACTIVATE NFC_MODE_DEACTIVATE
109typedef uint8_t tNFA_EE_MD;
nxpandroidc7611652015-09-23 16:42:05 +0530110
nxpandroid8f6d0532017-07-12 18:25:30 +0530111/* The device is on */
112#define NFA_EE_PWR_STATE_ON 0x01
113/* The device is switched off */
114#define NFA_EE_PWR_STATE_SWITCH_OFF 0x02
115/* The device's battery is removed */
116#define NFA_EE_PWR_STATE_BATT_OFF 0x04
nxpandroid8f6d0532017-07-12 18:25:30 +0530117typedef uint8_t tNFA_EE_PWR_STATE;
nxpandroidc7611652015-09-23 16:42:05 +0530118
nxpandroid8f6d0532017-07-12 18:25:30 +0530119/* NFCEE connected and inactive */
120#define NFA_EE_STATUS_INACTIVE NFC_NFCEE_STATUS_INACTIVE
121/* NFCEE connected and active */
122#define NFA_EE_STATUS_ACTIVE NFC_NFCEE_STATUS_ACTIVE
123/* NFCEE removed */
124#define NFA_EE_STATUS_REMOVED NFC_NFCEE_STATUS_REMOVED
125/* waiting for response from NFCC */
126#define NFA_EE_STATUS_PENDING 0x10
nxpandroid8f6d0532017-07-12 18:25:30 +0530127typedef uint8_t tNFA_EE_STATUS;
nxpandroidc7611652015-09-23 16:42:05 +0530128
nxpandroidc7611652015-09-23 16:42:05 +0530129/* additional NFCEE Info */
nxpandroid8f6d0532017-07-12 18:25:30 +0530130typedef struct {
131 tNFA_EE_TAG tag;
132 uint8_t len;
133 uint8_t info[NFC_MAX_EE_INFO];
nxpandroidc7611652015-09-23 16:42:05 +0530134} tNFA_EE_TLV;
135
nxpandroid8f6d0532017-07-12 18:25:30 +0530136typedef struct {
137 tNFA_HANDLE ee_handle; /* handle for NFCEE oe DH */
138 tNFA_EE_STATUS ee_status; /* The NFCEE status */
139 uint8_t num_interface; /* number of NFCEE interface*/
140 tNFA_EE_INTERFACE
141 ee_interface[NFC_MAX_EE_INTERFACE]; /* NFCEE supported interface */
142 uint8_t num_tlvs; /* number of TLVs */
143 tNFA_EE_TLV ee_tlv[NFC_MAX_EE_TLVS]; /* the TLV */
nxf24591c1cbeab2018-02-21 17:32:26 +0530144 uint8_t ee_power_supply_status; /* The NFCEE Power supply */
nxpandroid8f6d0532017-07-12 18:25:30 +0530145#if (NXP_EXTNS == TRUE)
nxf24591c1cbeab2018-02-21 17:32:26 +0530146 uint8_t hci_enable_state;
nxpandroid8f6d0532017-07-12 18:25:30 +0530147 tNFA_NFC_PROTOCOL la_protocol; /* Listen A protocol */
148 tNFA_NFC_PROTOCOL lb_protocol; /* Listen B protocol */
149 tNFA_NFC_PROTOCOL lf_protocol; /* Listen F protocol */
150 tNFA_NFC_PROTOCOL lbp_protocol; /* Listen B' protocol */
nxpandroidc7611652015-09-23 16:42:05 +0530151#endif
152} tNFA_EE_INFO;
153
nxpandroid8f6d0532017-07-12 18:25:30 +0530154typedef struct {
155 tNFA_STATUS status; /* NFA_STATUS_OK is successful */
156 uint8_t num_ee; /* number of NFCEEs found */
157 tNFA_EE_INFO ee_info[NFA_EE_MAX_EE_SUPPORTED]; /*NFCEE information */
nxpandroidc7611652015-09-23 16:42:05 +0530158} tNFA_EE_DISCOVER;
159
nxpandroid8f6d0532017-07-12 18:25:30 +0530160typedef struct {
161 tNFA_HANDLE ee_handle; /* Handle of NFCEE */
162 tNFA_STATUS status; /* NFA_STATUS_OK is successful */
163 tNFA_EE_INTERFACE
164 ee_interface; /* NFCEE interface associated with this connection */
nxpandroidc7611652015-09-23 16:42:05 +0530165} tNFA_EE_CONNECT;
166
nxpandroidc7611652015-09-23 16:42:05 +0530167typedef tNFC_EE_TRIGGER tNFA_EE_TRIGGER;
168
169/* Union of NFCEE action parameter depending on the associated trigger */
nxpandroid8f6d0532017-07-12 18:25:30 +0530170typedef union {
171 tNFA_NFC_PROTOCOL protocol; /* NFA_EE_TRGR_RF_PROTOCOL: the protocol that
172 triggers this event */
173 tNFC_RF_TECH technology; /* NFA_EE_TRGR_RF_TECHNOLOGY:the technology that
174 triggers this event */
175 tNFC_AID aid; /* NFA_EE_TRGR_SELECT : the AID in the received SELECT AID
176 command */
177 tNFC_APP_INIT app_init; /* NFA_EE_TRGR_APP_INIT: The information for the
178 application initiated trigger */
nxpandroidc7611652015-09-23 16:42:05 +0530179} tNFA_EE_ACTION_PARAM;
180
nxpandroid8f6d0532017-07-12 18:25:30 +0530181typedef struct {
182 tNFA_HANDLE ee_handle; /* Handle of NFCEE */
183 tNFA_EE_TRIGGER trigger; /* the trigger of this event */
184 tNFA_EE_ACTION_PARAM param;
nxpandroidc7611652015-09-23 16:42:05 +0530185} tNFA_EE_ACTION;
186
nxpandroid8f6d0532017-07-12 18:25:30 +0530187typedef struct {
188 tNFA_HANDLE ee_handle; /* Handle of NFCEE */
189 tNFA_STATUS status; /* NFA_STATUS_OK is successful */
190 tNFA_EE_STATUS ee_status; /* The NFCEE status */
nxpandroidc7611652015-09-23 16:42:05 +0530191} tNFA_EE_MODE_SET;
192
nxpandroid65a02602017-01-13 19:13:19 +0530193#if (NXP_EXTNS == TRUE)
nxpandroid8f6d0532017-07-12 18:25:30 +0530194typedef struct {
195 tNFA_STATUS status;
196 uint8_t nfcee_id;
197} tNFA_EE_SET_MODE_INFO;
nxpandroid8f6d0532017-07-12 18:25:30 +0530198typedef struct {
199 tNFA_STATUS status; /* NFA_STATUS_OK is successful */
200 tNFA_EE_STATUS ee_status; /* The NFCEE status */
nxpandroid3e4012e2016-08-01 19:09:55 +0530201} tNFA_EE_PWR_LNK_CTRL;
202#endif
nxpandroid8f6d0532017-07-12 18:25:30 +0530203typedef struct {
204 tNFA_HANDLE ee_handle; /* Handle of MFCEE */
205 tNFA_NFC_PROTOCOL la_protocol; /* Listen A protocol */
206 tNFA_NFC_PROTOCOL lb_protocol; /* Listen B protocol */
207 tNFA_NFC_PROTOCOL lf_protocol; /* Listen F protocol */
208 tNFA_NFC_PROTOCOL lbp_protocol; /* Listen B' protocol */
nxf2459148793b62018-06-06 14:40:49 +0530209#if (NXP_EXTNS == TRUE)
210 tNFA_NFC_PROTOCOL pa_protocol; /* Passive poll A SWP Reader */
211 tNFA_NFC_PROTOCOL pb_protocol; /* Passive poll B SWP Reader */
212 uint8_t ee_req_op; /* add or remove req ntf*/
213#endif
nxpandroidc7611652015-09-23 16:42:05 +0530214} tNFA_EE_DISCOVER_INFO;
215
216/* Data for NFA_EE_DISCOVER_REQ_EVT */
nxpandroid8f6d0532017-07-12 18:25:30 +0530217typedef struct {
218 uint8_t status; /* NFA_STATUS_OK if successful */
219 uint8_t num_ee; /* number of MFCEE information */
220 tNFA_EE_DISCOVER_INFO ee_disc_info[NFA_EE_MAX_EE_SUPPORTED -
221 1]; /* NFCEE DISCOVER Request info */
nxpandroidc7611652015-09-23 16:42:05 +0530222} tNFA_EE_DISCOVER_REQ;
223
224/* Data for NFA_EE_DATA_EVT */
nxpandroid8f6d0532017-07-12 18:25:30 +0530225typedef struct {
226 tNFA_HANDLE handle; /* Connection handle */
227 uint16_t len; /* Length of data */
228 uint8_t* p_buf; /* Data buffer */
nxpandroidc7611652015-09-23 16:42:05 +0530229} tNFA_EE_DATA;
230
231/* Union of all EE callback structures */
nxpandroid8f6d0532017-07-12 18:25:30 +0530232typedef union {
233 tNFA_STATUS
234 status; /* NFA_STATUS_OK is successful; otherwise NFA_STATUS_FAILED */
235 tNFA_EE_DATA data;
236 tNFA_HANDLE handle;
237 tNFA_EE_DISCOVER ee_discover;
238 tNFA_STATUS ee_register;
239 tNFA_STATUS deregister;
240 tNFA_STATUS add_aid;
241 tNFA_STATUS remove_aid;
Suraj Uday Kotharkar6f7757b2018-05-10 15:58:29 +0530242 tNFA_STATUS add_sc;
243 tNFA_STATUS remove_sc;
nxpandroid8f6d0532017-07-12 18:25:30 +0530244 tNFA_STATUS set_tech;
245 tNFA_STATUS set_proto;
246 uint16_t size;
247 tNFA_EE_CONNECT connect;
248 tNFA_EE_ACTION action;
249 tNFA_EE_MODE_SET mode_set;
nxpandroid65a02602017-01-13 19:13:19 +0530250#if (NXP_EXTNS == TRUE)
nxpandroid8f6d0532017-07-12 18:25:30 +0530251 tNFA_EE_SET_MODE_INFO ee_set_mode_info;
nxpandroid8f6d0532017-07-12 18:25:30 +0530252 tNFA_EE_PWR_LNK_CTRL pwr_lnk_ctrl;
nxpandroid3e4012e2016-08-01 19:09:55 +0530253#endif
nxpandroid8f6d0532017-07-12 18:25:30 +0530254 tNFA_EE_INFO new_ee;
255 tNFA_EE_DISCOVER_REQ discover_req;
nxpandroidc7611652015-09-23 16:42:05 +0530256} tNFA_EE_CBACK_DATA;
257
nxpandroidc7611652015-09-23 16:42:05 +0530258/* EE callback */
nxpandroid8f6d0532017-07-12 18:25:30 +0530259typedef void(tNFA_EE_CBACK)(tNFA_EE_EVT event, tNFA_EE_CBACK_DATA* p_data);
nxpandroidc7611652015-09-23 16:42:05 +0530260
261/*****************************************************************************
262** External Function Declarations
263*****************************************************************************/
nxpandroidc7611652015-09-23 16:42:05 +0530264
265/*******************************************************************************
266**
267** Function NFA_EeDiscover
268**
269** Description This function retrieves the NFCEE information from NFCC.
270** The NFCEE information is reported in NFA_EE_DISCOVER_EVT.
271**
272** This function may be called when a system supports removable
273** NFCEEs,
274**
275** Returns NFA_STATUS_OK if information is retrieved successfully
276** NFA_STATUS_FAILED If wrong state (retry later)
277** NFA_STATUS_INVALID_PARAM If bad parameter
278**
279*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530280extern tNFA_STATUS NFA_EeDiscover(tNFA_EE_CBACK* p_cback);
nxpandroidc7611652015-09-23 16:42:05 +0530281
282/*******************************************************************************
283**
284** Function NFA_EeGetInfo
285**
286** Description This function retrieves the NFCEE information from NFA.
287** The actual number of NFCEE is returned in p_num_nfcee
288** and NFCEE information is returned in p_info
289**
290** Returns NFA_STATUS_OK if information is retrieved successfully
291** NFA_STATUS_FAILED If wrong state (retry later)
292** NFA_STATUS_INVALID_PARAM If bad parameter
293**
294*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530295extern tNFA_STATUS NFA_EeGetInfo(uint8_t* p_num_nfcee, tNFA_EE_INFO* p_info);
nxpandroidc7611652015-09-23 16:42:05 +0530296
nxpandroidc7611652015-09-23 16:42:05 +0530297/*******************************************************************************
298**
299** Function NFA_EeRegister
300**
301** Description This function registers a callback function to receive the
302** events from NFA-EE module.
303**
304** Returns NFA_STATUS_OK if successfully initiated
305** NFA_STATUS_FAILED otherwise
306** NFA_STATUS_INVALID_PARAM If bad parameter
307**
308*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530309extern tNFA_STATUS NFA_EeRegister(tNFA_EE_CBACK* p_cback);
nxpandroidc7611652015-09-23 16:42:05 +0530310
311/*******************************************************************************
312**
313** Function NFA_EeDeregister
314**
315** Description This function de-registers the callback function
316**
317** Returns NFA_STATUS_OK if successfully initiated
318** NFA_STATUS_FAILED otherwise
319** NFA_STATUS_INVALID_PARAM If bad parameter
320**
321*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530322extern tNFA_STATUS NFA_EeDeregister(tNFA_EE_CBACK* p_cback);
nxf24591c1cbeab2018-02-21 17:32:26 +0530323
nxpandroidc7611652015-09-23 16:42:05 +0530324/*******************************************************************************
325**
326** Function NFA_EeModeSet
327**
nxpandroid8f6d0532017-07-12 18:25:30 +0530328** Description This function is called to activate
329** (mode = NFA_EE_MD_ACTIVATE) or deactivate
330** (mode = NFA_EE_MD_DEACTIVATE) the NFCEE identified by the
331** given ee_handle. The result of this operation is reported
332** with the NFA_EE_MODE_SET_EVT.
nxpandroidc7611652015-09-23 16:42:05 +0530333**
334** Returns NFA_STATUS_OK if successfully initiated
335** NFA_STATUS_FAILED otherwise
336** NFA_STATUS_INVALID_PARAM If bad parameter
337**
338*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530339extern tNFA_STATUS NFA_EeModeSet(tNFA_HANDLE ee_handle, tNFA_EE_MD mode);
nxpandroidc7611652015-09-23 16:42:05 +0530340
341/*******************************************************************************
342**
343** Function NFA_EeSetDefaultTechRouting
344**
345** Description This function is called to add, change or remove the
346** default routing based on RF technology in the listen mode
347** routing table for the given ee_handle. The status of this
348** operation is reported as the NFA_EE_SET_TECH_CFG_EVT.
349**
nxpandroid8f6d0532017-07-12 18:25:30 +0530350** Note: If RF discovery is started,
351** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
352** happen before calling this function
nxpandroidc7611652015-09-23 16:42:05 +0530353**
nxpandroid8f6d0532017-07-12 18:25:30 +0530354** Note: NFA_EeUpdateNow() should be called after last NFA-EE
355** function to change the listen mode routing is called.
nxpandroidc7611652015-09-23 16:42:05 +0530356**
357** Returns NFA_STATUS_OK if successfully initiated
358** NFA_STATUS_FAILED otherwise
359** NFA_STATUS_INVALID_PARAM If bad parameter
360**
361*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530362extern tNFA_STATUS NFA_EeSetDefaultTechRouting(
363 tNFA_HANDLE ee_handle, tNFA_TECHNOLOGY_MASK technologies_switch_on,
364 tNFA_TECHNOLOGY_MASK technologies_switch_off,
Suraj Uday Kotharkar1e7b99a2018-05-10 16:14:37 +0530365 tNFA_TECHNOLOGY_MASK technologies_battery_off,
nxpandroid8f6d0532017-07-12 18:25:30 +0530366 tNFA_TECHNOLOGY_MASK technologies_screen_lock,
367 tNFA_TECHNOLOGY_MASK technologies_screen_off,
Suraj Uday Kotharkar1e7b99a2018-05-10 16:14:37 +0530368 tNFA_TECHNOLOGY_MASK technologies_screen_off_lock);
nxpandroidc7611652015-09-23 16:42:05 +0530369
370/*******************************************************************************
371**
372** Function NFA_EeSetDefaultProtoRouting
373**
374** Description This function is called to add, change or remove the
375** default routing based on Protocol in the listen mode routing
376** table for the given ee_handle. The status of this
377** operation is reported as the NFA_EE_SET_PROTO_CFG_EVT.
378**
nxpandroid8f6d0532017-07-12 18:25:30 +0530379** Note: If RF discovery is started,
380** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
381** happen before calling this function
nxpandroidc7611652015-09-23 16:42:05 +0530382**
nxpandroid8f6d0532017-07-12 18:25:30 +0530383** Note: NFA_EeUpdateNow() should be called after last NFA-EE
384** function to change the listen mode routing is called.
nxpandroidc7611652015-09-23 16:42:05 +0530385**
386** Returns NFA_STATUS_OK if successfully initiated
387** NFA_STATUS_FAILED otherwise
388** NFA_STATUS_INVALID_PARAM If bad parameter
389**
390*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530391extern tNFA_STATUS NFA_EeSetDefaultProtoRouting(
392 tNFA_HANDLE ee_handle, tNFA_PROTOCOL_MASK protocols_switch_on,
393 tNFA_PROTOCOL_MASK protocols_switch_off,
Suraj Uday Kotharkar1e7b99a2018-05-10 16:14:37 +0530394 tNFA_PROTOCOL_MASK protocols_battery_off,
Suraj Uday Kotharkard70a4c02018-05-15 17:55:49 +0530395 tNFA_PROTOCOL_MASK protocols_screen_lock,
396 tNFA_PROTOCOL_MASK protocols_screen_off,
397 tNFA_PROTOCOL_MASK protocols_screen_off_lock);
nxpandroidc7611652015-09-23 16:42:05 +0530398
399/*******************************************************************************
400**
401** Function NFA_EeAddAidRouting
402**
403** Description This function is called to add an AID entry in the
404** listen mode routing table in NFCC. The status of this
405** operation is reported as the NFA_EE_ADD_AID_EVT.
406**
nxpandroid8f6d0532017-07-12 18:25:30 +0530407** Note: If RF discovery is started,
408** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
409** happen before calling this function
nxpandroidc7611652015-09-23 16:42:05 +0530410**
nxpandroid8f6d0532017-07-12 18:25:30 +0530411** Note: NFA_EeUpdateNow() should be called after last NFA-EE
412** function to change the listen mode routing is called.
nxpandroidc7611652015-09-23 16:42:05 +0530413**
414** Returns NFA_STATUS_OK if successfully initiated
415** NFA_STATUS_FAILED otherwise
416** NFA_STATUS_INVALID_PARAM If bad parameter
417**
418*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530419extern tNFA_STATUS NFA_EeAddAidRouting(tNFA_HANDLE ee_handle, uint8_t aid_len,
420 uint8_t* p_aid,
nxf24591c1cbeab2018-02-21 17:32:26 +0530421 tNFA_EE_PWR_STATE power_state,
422 uint8_t aidInfo);
nxpandroidc7611652015-09-23 16:42:05 +0530423
424/*******************************************************************************
425**
426** Function NFA_EeRemoveAidRouting
427**
nxpandroid8f6d0532017-07-12 18:25:30 +0530428** Description This function is called to remove the given AID entry from
429** the listen mode routing table. If the entry configures VS,
nxpandroidc7611652015-09-23 16:42:05 +0530430** it is also removed. The status of this operation is reported
431** as the NFA_EE_REMOVE_AID_EVT.
432**
nxpandroid8f6d0532017-07-12 18:25:30 +0530433** Note: If RF discovery is started,
434** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
435** happen before calling this function
nxpandroidc7611652015-09-23 16:42:05 +0530436**
nxpandroid8f6d0532017-07-12 18:25:30 +0530437** Note: NFA_EeUpdateNow() should be called after last NFA-EE
438** function to change the listen mode routing is called.
nxpandroidc7611652015-09-23 16:42:05 +0530439**
440** Returns NFA_STATUS_OK if successfully initiated
441** NFA_STATUS_FAILED otherwise
442** NFA_STATUS_INVALID_PARAM If bad parameter
443**
444*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530445extern tNFA_STATUS NFA_EeRemoveAidRouting(uint8_t aid_len, uint8_t* p_aid);
nxpandroidc7611652015-09-23 16:42:05 +0530446
447/*******************************************************************************
Suraj Uday Kotharkar6f7757b2018-05-10 15:58:29 +0530448 **
449 ** Function NFA_EeAddSystemCodeRouting
450 **
451 ** Description This function is called to add an system code entry in the
452 ** listen mode routing table in NFCC. The status of this
453 ** operation is reported as the NFA_EE_ADD_SYSCODE_EVT.
454 **
455 ** Note: If RF discovery is started,
456 ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
457 ** happen before calling this function
458 **
459 ** Note: NFA_EeUpdateNow() should be called after last NFA-EE
460 ** function to change the listen mode routing is called.
461 **
462 ** Returns NFA_STATUS_OK if successfully initiated
463 ** NFA_STATUS_FAILED otherwise
464 ** NFA_STATUS_INVALID_PARAM If bad parameter
465 **
466 *******************************************************************************/
467extern tNFA_STATUS NFA_EeAddSystemCodeRouting(uint16_t systemcode,
468 tNFA_HANDLE ee_handle,
469 tNFA_EE_PWR_STATE power_state);
470
471/*******************************************************************************
472**
473** Function NFA_EeRemoveSystemCodeRouting
474**
475** Description This function is called to remove the given System Code
476*based entry from
477** the listen mode routing table. The status of this operation
478*is reported
479** as the NFA_EE_REMOVE_SYSCODE_EVT.
480**
481** Note: If RF discovery is started,
482** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
483** happen before calling this function
484**
485** Note: NFA_EeUpdateNow() should be called after last NFA-EE
486** function to change the listen mode routing is called.
487**
488** Returns NFA_STATUS_OK if successfully initiated
489** NFA_STATUS_FAILED otherwise
490** NFA_STATUS_INVALID_PARAM If bad parameter
491**
492*******************************************************************************/
493extern tNFA_STATUS NFA_EeRemoveSystemCodeRouting(uint16_t systemcode);
Suraj Uday Kotharkar11ae20f2018-07-20 23:29:36 +0530494#if (NXP_EXTNS == TRUE)
495/*******************************************************************************
496**
497** Function NFA_EeAddApduPatternRouting
498**
499** Description This function is called to add an APDU pattern entry in the
500** listen mode routing table in NFCC. The status of this
501** operation is reported as the NFA_EE_ADD_APDU_EVT.
502**
503** Note: If RF discovery is started,
504** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
505** happen before calling this function
506**
507** Note: NFA_EeUpdateNow() should be called after last NFA-EE
508** function to change the listen mode routing is called.
509**
510** Returns NFA_STATUS_OK if successfully initiated
511** NFA_STATUS_FAILED otherwise
512** NFA_STATUS_INVALID_PARAM If bad parameter
513**
514*******************************************************************************/
515extern tNFA_STATUS NFA_EeAddApduPatternRouting(uint8_t apdu_data_len,uint8_t* apdu_data, uint8_t apdu_mask_len,
516 uint8_t* apdu_mask, tNFA_HANDLE ee_handle, uint8_t power_state);
Suraj Uday Kotharkar6f7757b2018-05-10 15:58:29 +0530517
518/*******************************************************************************
nxpandroidc7611652015-09-23 16:42:05 +0530519**
Suraj Uday Kotharkar11ae20f2018-07-20 23:29:36 +0530520** Function NFA_EeRemoveApduPatternRouting
521**
522** Description This function is called to remove the given APDU pattern entry from
523** the listen mode routing table. If the entry configures VS,
524** it is also removed. The status of this operation is reported
525** as the NFA_EE_REMOVE_APDU_EVT.
526**
527** Note: If RF discovery is started,
528** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
529** happen before calling this function
530**
531** Note: NFA_EeUpdateNow() should be called after last NFA-EE
532** function to change the listen mode routing is called.
533**
534** Returns NFA_STATUS_OK if successfully initiated
535** NFA_STATUS_FAILED otherwise
536** NFA_STATUS_INVALID_PARAM If bad parameter
537**
538*******************************************************************************/
539extern tNFA_STATUS NFA_EeRemoveApduPatternRouting(uint8_t apdu_len, uint8_t* p_apdu);
540#endif
541/*******************************************************************************
542**
nxpandroidc7611652015-09-23 16:42:05 +0530543** Function NFA_EeGetLmrtRemainingSize
544**
545** Description This function is called to get remaining size of the
546** Listen Mode Routing Table.
547** The remaining size is reported in NFA_EE_REMAINING_SIZE_EVT
548**
549** Returns NFA_STATUS_OK if successfully initiated
550** NFA_STATUS_FAILED otherwise
551**
552*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530553extern tNFA_STATUS NFA_EeGetLmrtRemainingSize(void);
nxpandroidc7611652015-09-23 16:42:05 +0530554
555/*******************************************************************************
556**
557** Function NFA_EeUpdateNow
558**
559** Description This function is called to send the current listen mode
nxpandroid8f6d0532017-07-12 18:25:30 +0530560** routing table and VS configuration to the NFCC (without
561** waiting for NFA_EE_ROUT_TIMEOUT_VAL).
nxpandroidc7611652015-09-23 16:42:05 +0530562**
563** The status of this operation is
564** reported with the NFA_EE_UPDATED_EVT.
565**
566** Returns NFA_STATUS_OK if successfully initiated
567** NFA_STATUS_SEMANTIC_ERROR is update is currently in progress
568** NFA_STATUS_FAILED otherwise
569**
570*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530571extern tNFA_STATUS NFA_EeUpdateNow(void);
nxpandroidc7611652015-09-23 16:42:05 +0530572
573/*******************************************************************************
574**
575** Function NFA_EeConnect
576**
577** Description Open connection to an NFCEE attached to the NFCC
578**
579** The status of this operation is
580** reported with the NFA_EE_CONNECT_EVT.
581**
582** Returns NFA_STATUS_OK if successfully initiated
583** NFA_STATUS_FAILED otherwise
584** NFA_STATUS_INVALID_PARAM If bad parameter
585**
586*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530587extern tNFA_STATUS NFA_EeConnect(tNFA_HANDLE ee_handle, uint8_t ee_interface,
588 tNFA_EE_CBACK* p_cback);
nxpandroidc7611652015-09-23 16:42:05 +0530589
590/*******************************************************************************
591**
592** Function NFA_EeSendData
593**
594** Description Send data to the given NFCEE.
nxpandroid8f6d0532017-07-12 18:25:30 +0530595** This function shall be called after NFA_EE_CONNECT_EVT is
596** reported and before NFA_EeDisconnect is called on the given
597** ee_handle.
nxpandroidc7611652015-09-23 16:42:05 +0530598**
599** Returns NFA_STATUS_OK if successfully initiated
600** NFA_STATUS_FAILED otherwise
601** NFA_STATUS_INVALID_PARAM If bad parameter
602**
603*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530604extern tNFA_STATUS NFA_EeSendData(tNFA_HANDLE ee_handle, uint16_t data_len,
605 uint8_t* p_data);
nxpandroidc7611652015-09-23 16:42:05 +0530606
607/*******************************************************************************
608**
609** Function NFA_EeDisconnect
610**
611** Description Disconnect (if a connection is currently open) from an
612** NFCEE interface. The result of this operation is reported
613** with the NFA_EE_DISCONNECT_EVT.
614**
615** Returns NFA_STATUS_OK if successfully initiated
616** NFA_STATUS_FAILED otherwise
617** NFA_STATUS_INVALID_PARAM If bad parameter
618**
619*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530620extern tNFA_STATUS NFA_EeDisconnect(tNFA_HANDLE ee_handle);
nxpandroidc7611652015-09-23 16:42:05 +0530621
nxpandroid8f6d0532017-07-12 18:25:30 +0530622#if (NXP_EXTNS == TRUE)
nxpandroidc7611652015-09-23 16:42:05 +0530623/*******************************************************************************
624**
nxf24591c1cbeab2018-02-21 17:32:26 +0530625** Function NFA_AllEeGetInfo
nxpandroidc7611652015-09-23 16:42:05 +0530626**
nxf24591c1cbeab2018-02-21 17:32:26 +0530627** Description This function retrieves the All NFCEE's independent of
628** their status information from NFA.
629** The actual number of NFCEE is returned in p_num_nfcee
630** and NFCEE information is returned in p_info
nxpandroidc7611652015-09-23 16:42:05 +0530631**
nxf24591c1cbeab2018-02-21 17:32:26 +0530632** Returns NFA_STATUS_OK if information is retrieved successfully
633** NFA_STATUS_FAILED If wrong state (retry later)
634** NFA_STATUS_INVALID_PARAM If bad parameter
nxpandroidc7611652015-09-23 16:42:05 +0530635**
nxf24591c1cbeab2018-02-21 17:32:26 +0530636*******************************************************************************/
637extern tNFA_STATUS NFA_AllEeGetInfo(uint8_t* p_num_nfcee, tNFA_EE_INFO* p_info);
638/*******************************************************************************
639**
640** Function NFA_SendPowerLinkCommand
641**
642** Description This function sends the power link control command
nxpandroidc7611652015-09-23 16:42:05 +0530643**
644** Returns NFA_STATUS_OK if successfully initiated
645** NFA_STATUS_FAILED otherwise
646** NFA_STATUS_INVALID_PARAM If bad parameter
647**
648*******************************************************************************/
nxf24591c1cbeab2018-02-21 17:32:26 +0530649extern tNFA_STATUS NFA_SendPowerLinkCommand(uint8_t nfcee_id, uint8_t cfg_value);
Ravishinde26233bb2018-08-06 22:16:08 +0530650/*******************************************************************************
651**
652** Function NFA_GetAidTableSize
653**
654** Description This function is called to get the AID routing table size.
655**
656** Returns Maximum AID routing table size.
657**
658*******************************************************************************/
659extern uint16_t NFA_GetAidTableSize();
660
661/*******************************************************************************
662**
663** Function NFA_GetRemainingAidTableSize
664**
665** Description This function is called to get the remaining AID routing
666** table size.
667**
668** Returns Remaining AID routing table size.
669**
670*******************************************************************************/
671extern uint16_t NFA_GetRemainingAidTableSize();
672#endif /* #if (NXP_EXTNS == TRUE) */
nxpandroidc7611652015-09-23 16:42:05 +0530673#endif /* NFA_EE_API_H */