The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
Evan Chu | e9629ba | 2014-01-31 11:18:47 -0500 | [diff] [blame] | 3 | * Copyright (C) 2010-2014 Broadcom Corporation |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 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 | /****************************************************************************** |
| 20 | * |
| 21 | * NFA interface to NFCEE |
| 22 | * |
| 23 | ******************************************************************************/ |
| 24 | #ifndef NFA_EE_API_H |
| 25 | #define NFA_EE_API_H |
| 26 | |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 27 | #include "nfa_api.h" |
| 28 | #include "nfc_api.h" |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 29 | #include "nfc_target.h" |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 30 | |
| 31 | /***************************************************************************** |
| 32 | ** Constants and data types |
| 33 | *****************************************************************************/ |
Ruchi Kandoi | 46e6e28 | 2017-01-30 14:26:10 -0800 | [diff] [blame] | 34 | /* 16 per ISO 7816 specification */ |
| 35 | #define NFA_MAX_AID_LEN NFC_MAX_AID_LEN |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 36 | |
| 37 | /* NFA EE callback events */ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 38 | enum { |
| 39 | NFA_EE_DISCOVER_EVT, /* The status for NFA_EeDiscover () */ |
| 40 | NFA_EE_REGISTER_EVT, /* The status for NFA_EeRegister () */ |
| 41 | NFA_EE_DEREGISTER_EVT, /* The status for NFA_EeDeregister () */ |
| 42 | NFA_EE_MODE_SET_EVT, /* The status for activating or deactivating an NFCEE */ |
| 43 | NFA_EE_ADD_AID_EVT, /* The status for adding an AID to a routing table entry |
Love Khanna | 1d06277 | 2018-04-10 21:10:02 +0530 | [diff] [blame^] | 44 | */ |
| 45 | NFA_EE_REMOVE_AID_EVT, /* The status for removing an AID from a routing table |
| 46 | */ |
| 47 | NFA_EE_ADD_SYSCODE_EVT, /* The status for adding an System Code to a routing |
| 48 | table entry */ |
| 49 | NFA_EE_REMOVE_SYSCODE_EVT, /* The status for removing an System Code from |
| 50 | routing table */ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 51 | NFA_EE_REMAINING_SIZE_EVT, /* The remaining size of the Listen Mode Routing |
| 52 | Table */ |
| 53 | NFA_EE_SET_TECH_CFG_EVT, /* The status for setting the routing based on RF |
| 54 | tech. */ |
| 55 | NFA_EE_SET_PROTO_CFG_EVT, /* The status for setting the routing based on |
| 56 | protocols */ |
| 57 | NFA_EE_UPDATED_EVT, /* The status for NFA_EeUpdateNow */ |
| 58 | NFA_EE_CONNECT_EVT, /* Result of NFA_EeConnect */ |
| 59 | NFA_EE_DATA_EVT, /* Received data from NFCEE. */ |
| 60 | NFA_EE_DISCONNECT_EVT, /* NFCEE connection closed. */ |
| 61 | NFA_EE_NEW_EE_EVT, /* A new NFCEE is discovered */ |
| 62 | NFA_EE_ACTION_EVT, /* An action happened in NFCEE */ |
| 63 | NFA_EE_DISCOVER_REQ_EVT, /* NFCEE Discover Request Notification */ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 64 | NFA_EE_NO_MEM_ERR_EVT, /* Error - out of GKI buffers */ |
| 65 | NFA_EE_NO_CB_ERR_EVT /* Error - Can not find control block or wrong state */ |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 66 | }; |
Ruchi Kandoi | 512ee63 | 2017-01-03 13:59:10 -0800 | [diff] [blame] | 67 | typedef uint8_t tNFA_EE_EVT; |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 68 | |
| 69 | /* tNFA_NFCEE_INTERFACE values */ |
Ruchi Kandoi | 46e6e28 | 2017-01-30 14:26:10 -0800 | [diff] [blame] | 70 | /* HCI Access Interface*/ |
| 71 | #define NFA_EE_INTERFACE_HCI_ACCESS NFC_NFCEE_INTERFACE_HCI_ACCESS |
Ruchi Kandoi | 512ee63 | 2017-01-03 13:59:10 -0800 | [diff] [blame] | 72 | typedef uint8_t tNFA_EE_INTERFACE; |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 73 | |
Ruchi Kandoi | 512ee63 | 2017-01-03 13:59:10 -0800 | [diff] [blame] | 74 | typedef uint8_t tNFA_EE_TAG; |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 75 | |
| 76 | /* for NFA_EeModeSet () */ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 77 | #define NFA_EE_MD_ACTIVATE NFC_MODE_ACTIVATE |
| 78 | #define NFA_EE_MD_DEACTIVATE NFC_MODE_DEACTIVATE |
Ruchi Kandoi | 512ee63 | 2017-01-03 13:59:10 -0800 | [diff] [blame] | 79 | typedef uint8_t tNFA_EE_MD; |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 80 | |
Ruchi Kandoi | 46e6e28 | 2017-01-30 14:26:10 -0800 | [diff] [blame] | 81 | /* The device is on */ |
| 82 | #define NFA_EE_PWR_STATE_ON 0x01 |
| 83 | /* The device is switched off */ |
| 84 | #define NFA_EE_PWR_STATE_SWITCH_OFF 0x02 |
| 85 | /* The device's battery is removed */ |
| 86 | #define NFA_EE_PWR_STATE_BATT_OFF 0x04 |
Ruchi Kandoi | 512ee63 | 2017-01-03 13:59:10 -0800 | [diff] [blame] | 87 | typedef uint8_t tNFA_EE_PWR_STATE; |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 88 | |
Ruchi Kandoi | 46e6e28 | 2017-01-30 14:26:10 -0800 | [diff] [blame] | 89 | /* NFCEE connected and inactive */ |
| 90 | #define NFA_EE_STATUS_INACTIVE NFC_NFCEE_STATUS_INACTIVE |
| 91 | /* NFCEE connected and active */ |
| 92 | #define NFA_EE_STATUS_ACTIVE NFC_NFCEE_STATUS_ACTIVE |
| 93 | /* NFCEE removed */ |
| 94 | #define NFA_EE_STATUS_REMOVED NFC_NFCEE_STATUS_REMOVED |
| 95 | /* waiting for response from NFCC */ |
| 96 | #define NFA_EE_STATUS_PENDING 0x10 |
Ruchi Kandoi | 512ee63 | 2017-01-03 13:59:10 -0800 | [diff] [blame] | 97 | typedef uint8_t tNFA_EE_STATUS; |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 98 | |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 99 | /* additional NFCEE Info */ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 100 | typedef struct { |
| 101 | tNFA_EE_TAG tag; |
| 102 | uint8_t len; |
| 103 | uint8_t info[NFC_MAX_EE_INFO]; |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 104 | } tNFA_EE_TLV; |
| 105 | |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 106 | typedef struct { |
| 107 | tNFA_HANDLE ee_handle; /* handle for NFCEE oe DH */ |
| 108 | tNFA_EE_STATUS ee_status; /* The NFCEE status */ |
| 109 | uint8_t num_interface; /* number of NFCEE interface*/ |
| 110 | tNFA_EE_INTERFACE |
| 111 | ee_interface[NFC_MAX_EE_INTERFACE]; /* NFCEE supported interface */ |
| 112 | uint8_t num_tlvs; /* number of TLVs */ |
| 113 | tNFA_EE_TLV ee_tlv[NFC_MAX_EE_TLVS]; /* the TLV */ |
Love Khanna | 81e4f81 | 2017-06-02 17:50:19 +0530 | [diff] [blame] | 114 | uint8_t ee_power_supply_status; /* The NFCEE Power supply */ |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 115 | } tNFA_EE_INFO; |
| 116 | |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 117 | typedef struct { |
| 118 | tNFA_STATUS status; /* NFA_STATUS_OK is successful */ |
| 119 | uint8_t num_ee; /* number of NFCEEs found */ |
| 120 | tNFA_EE_INFO ee_info[NFA_EE_MAX_EE_SUPPORTED]; /*NFCEE information */ |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 121 | } tNFA_EE_DISCOVER; |
| 122 | |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 123 | typedef struct { |
| 124 | tNFA_HANDLE ee_handle; /* Handle of NFCEE */ |
| 125 | tNFA_STATUS status; /* NFA_STATUS_OK is successful */ |
| 126 | tNFA_EE_INTERFACE |
| 127 | ee_interface; /* NFCEE interface associated with this connection */ |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 128 | } tNFA_EE_CONNECT; |
| 129 | |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 130 | typedef tNFC_EE_TRIGGER tNFA_EE_TRIGGER; |
| 131 | |
| 132 | /* Union of NFCEE action parameter depending on the associated trigger */ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 133 | typedef union { |
| 134 | tNFA_NFC_PROTOCOL protocol; /* NFA_EE_TRGR_RF_PROTOCOL: the protocol that |
| 135 | triggers this event */ |
| 136 | tNFC_RF_TECH technology; /* NFA_EE_TRGR_RF_TECHNOLOGY:the technology that |
| 137 | triggers this event */ |
| 138 | tNFC_AID aid; /* NFA_EE_TRGR_SELECT : the AID in the received SELECT AID |
| 139 | command */ |
| 140 | tNFC_APP_INIT app_init; /* NFA_EE_TRGR_APP_INIT: The information for the |
| 141 | application initiated trigger */ |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 142 | } tNFA_EE_ACTION_PARAM; |
| 143 | |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 144 | typedef struct { |
| 145 | tNFA_HANDLE ee_handle; /* Handle of NFCEE */ |
| 146 | tNFA_EE_TRIGGER trigger; /* the trigger of this event */ |
| 147 | tNFA_EE_ACTION_PARAM param; |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 148 | } tNFA_EE_ACTION; |
| 149 | |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 150 | typedef struct { |
| 151 | tNFA_HANDLE ee_handle; /* Handle of NFCEE */ |
| 152 | tNFA_STATUS status; /* NFA_STATUS_OK is successful */ |
| 153 | tNFA_EE_STATUS ee_status; /* The NFCEE status */ |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 154 | } tNFA_EE_MODE_SET; |
| 155 | |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 156 | typedef struct { |
| 157 | tNFA_HANDLE ee_handle; /* Handle of MFCEE */ |
| 158 | tNFA_NFC_PROTOCOL la_protocol; /* Listen A protocol */ |
| 159 | tNFA_NFC_PROTOCOL lb_protocol; /* Listen B protocol */ |
| 160 | tNFA_NFC_PROTOCOL lf_protocol; /* Listen F protocol */ |
| 161 | tNFA_NFC_PROTOCOL lbp_protocol; /* Listen B' protocol */ |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 162 | } tNFA_EE_DISCOVER_INFO; |
| 163 | |
| 164 | /* Data for NFA_EE_DISCOVER_REQ_EVT */ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 165 | typedef struct { |
| 166 | uint8_t status; /* NFA_STATUS_OK if successful */ |
| 167 | uint8_t num_ee; /* number of MFCEE information */ |
| 168 | tNFA_EE_DISCOVER_INFO ee_disc_info[NFA_EE_MAX_EE_SUPPORTED - |
| 169 | 1]; /* NFCEE DISCOVER Request info */ |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 170 | } tNFA_EE_DISCOVER_REQ; |
| 171 | |
Martijn Coenen | 5c65c3a | 2013-03-27 13:23:36 -0700 | [diff] [blame] | 172 | /* Data for NFA_EE_DATA_EVT */ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 173 | typedef struct { |
| 174 | tNFA_HANDLE handle; /* Connection handle */ |
| 175 | uint16_t len; /* Length of data */ |
| 176 | uint8_t* p_buf; /* Data buffer */ |
Martijn Coenen | 5c65c3a | 2013-03-27 13:23:36 -0700 | [diff] [blame] | 177 | } tNFA_EE_DATA; |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 178 | |
| 179 | /* Union of all EE callback structures */ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 180 | typedef union { |
| 181 | tNFA_STATUS |
| 182 | status; /* NFA_STATUS_OK is successful; otherwise NFA_STATUS_FAILED */ |
| 183 | tNFA_EE_DATA data; |
| 184 | tNFA_HANDLE handle; |
| 185 | tNFA_EE_DISCOVER ee_discover; |
| 186 | tNFA_STATUS ee_register; |
| 187 | tNFA_STATUS deregister; |
| 188 | tNFA_STATUS add_aid; |
| 189 | tNFA_STATUS remove_aid; |
Love Khanna | 1d06277 | 2018-04-10 21:10:02 +0530 | [diff] [blame^] | 190 | tNFA_STATUS add_sc; |
| 191 | tNFA_STATUS remove_sc; |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 192 | tNFA_STATUS set_tech; |
| 193 | tNFA_STATUS set_proto; |
| 194 | uint16_t size; |
| 195 | tNFA_EE_CONNECT connect; |
| 196 | tNFA_EE_ACTION action; |
| 197 | tNFA_EE_MODE_SET mode_set; |
| 198 | tNFA_EE_INFO new_ee; |
| 199 | tNFA_EE_DISCOVER_REQ discover_req; |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 200 | } tNFA_EE_CBACK_DATA; |
| 201 | |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 202 | /* EE callback */ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 203 | typedef void(tNFA_EE_CBACK)(tNFA_EE_EVT event, tNFA_EE_CBACK_DATA* p_data); |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 204 | |
| 205 | /***************************************************************************** |
| 206 | ** External Function Declarations |
| 207 | *****************************************************************************/ |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 208 | |
| 209 | /******************************************************************************* |
| 210 | ** |
| 211 | ** Function NFA_EeDiscover |
| 212 | ** |
| 213 | ** Description This function retrieves the NFCEE information from NFCC. |
| 214 | ** The NFCEE information is reported in NFA_EE_DISCOVER_EVT. |
| 215 | ** |
| 216 | ** This function may be called when a system supports removable |
| 217 | ** NFCEEs, |
| 218 | ** |
| 219 | ** Returns NFA_STATUS_OK if information is retrieved successfully |
| 220 | ** NFA_STATUS_FAILED If wrong state (retry later) |
| 221 | ** NFA_STATUS_INVALID_PARAM If bad parameter |
| 222 | ** |
| 223 | *******************************************************************************/ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 224 | extern tNFA_STATUS NFA_EeDiscover(tNFA_EE_CBACK* p_cback); |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 225 | |
| 226 | /******************************************************************************* |
| 227 | ** |
| 228 | ** Function NFA_EeGetInfo |
| 229 | ** |
| 230 | ** Description This function retrieves the NFCEE information from NFA. |
| 231 | ** The actual number of NFCEE is returned in p_num_nfcee |
| 232 | ** and NFCEE information is returned in p_info |
| 233 | ** |
| 234 | ** Returns NFA_STATUS_OK if information is retrieved successfully |
| 235 | ** NFA_STATUS_FAILED If wrong state (retry later) |
| 236 | ** NFA_STATUS_INVALID_PARAM If bad parameter |
| 237 | ** |
| 238 | *******************************************************************************/ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 239 | extern tNFA_STATUS NFA_EeGetInfo(uint8_t* p_num_nfcee, tNFA_EE_INFO* p_info); |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 240 | |
| 241 | /******************************************************************************* |
| 242 | ** |
| 243 | ** Function NFA_EeRegister |
| 244 | ** |
| 245 | ** Description This function registers a callback function to receive the |
| 246 | ** events from NFA-EE module. |
| 247 | ** |
| 248 | ** Returns NFA_STATUS_OK if successfully initiated |
| 249 | ** NFA_STATUS_FAILED otherwise |
| 250 | ** NFA_STATUS_INVALID_PARAM If bad parameter |
| 251 | ** |
| 252 | *******************************************************************************/ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 253 | extern tNFA_STATUS NFA_EeRegister(tNFA_EE_CBACK* p_cback); |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 254 | |
| 255 | /******************************************************************************* |
| 256 | ** |
| 257 | ** Function NFA_EeDeregister |
| 258 | ** |
| 259 | ** Description This function de-registers the callback function |
| 260 | ** |
| 261 | ** Returns NFA_STATUS_OK if successfully initiated |
| 262 | ** NFA_STATUS_FAILED otherwise |
| 263 | ** NFA_STATUS_INVALID_PARAM If bad parameter |
| 264 | ** |
| 265 | *******************************************************************************/ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 266 | extern tNFA_STATUS NFA_EeDeregister(tNFA_EE_CBACK* p_cback); |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 267 | |
| 268 | /******************************************************************************* |
| 269 | ** |
| 270 | ** Function NFA_EeModeSet |
| 271 | ** |
Ruchi Kandoi | 552f2b7 | 2017-01-28 16:22:55 -0800 | [diff] [blame] | 272 | ** Description This function is called to activate |
| 273 | ** (mode = NFA_EE_MD_ACTIVATE) or deactivate |
| 274 | ** (mode = NFA_EE_MD_DEACTIVATE) the NFCEE identified by the |
| 275 | ** given ee_handle. The result of this operation is reported |
| 276 | ** with the NFA_EE_MODE_SET_EVT. |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 277 | ** |
| 278 | ** Returns NFA_STATUS_OK if successfully initiated |
| 279 | ** NFA_STATUS_FAILED otherwise |
| 280 | ** NFA_STATUS_INVALID_PARAM If bad parameter |
| 281 | ** |
| 282 | *******************************************************************************/ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 283 | extern tNFA_STATUS NFA_EeModeSet(tNFA_HANDLE ee_handle, tNFA_EE_MD mode); |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 284 | |
| 285 | /******************************************************************************* |
| 286 | ** |
| 287 | ** Function NFA_EeSetDefaultTechRouting |
| 288 | ** |
| 289 | ** Description This function is called to add, change or remove the |
| 290 | ** default routing based on RF technology in the listen mode |
| 291 | ** routing table for the given ee_handle. The status of this |
| 292 | ** operation is reported as the NFA_EE_SET_TECH_CFG_EVT. |
| 293 | ** |
Ruchi Kandoi | 552f2b7 | 2017-01-28 16:22:55 -0800 | [diff] [blame] | 294 | ** Note: If RF discovery is started, |
| 295 | ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should |
| 296 | ** happen before calling this function |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 297 | ** |
Ruchi Kandoi | 552f2b7 | 2017-01-28 16:22:55 -0800 | [diff] [blame] | 298 | ** Note: NFA_EeUpdateNow() should be called after last NFA-EE |
| 299 | ** function to change the listen mode routing is called. |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 300 | ** |
| 301 | ** Returns NFA_STATUS_OK if successfully initiated |
| 302 | ** NFA_STATUS_FAILED otherwise |
| 303 | ** NFA_STATUS_INVALID_PARAM If bad parameter |
| 304 | ** |
| 305 | *******************************************************************************/ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 306 | extern tNFA_STATUS NFA_EeSetDefaultTechRouting( |
| 307 | tNFA_HANDLE ee_handle, tNFA_TECHNOLOGY_MASK technologies_switch_on, |
| 308 | tNFA_TECHNOLOGY_MASK technologies_switch_off, |
| 309 | tNFA_TECHNOLOGY_MASK technologies_battery_off); |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 310 | |
| 311 | /******************************************************************************* |
| 312 | ** |
| 313 | ** Function NFA_EeSetDefaultProtoRouting |
| 314 | ** |
| 315 | ** Description This function is called to add, change or remove the |
| 316 | ** default routing based on Protocol in the listen mode routing |
| 317 | ** table for the given ee_handle. The status of this |
| 318 | ** operation is reported as the NFA_EE_SET_PROTO_CFG_EVT. |
| 319 | ** |
Ruchi Kandoi | 552f2b7 | 2017-01-28 16:22:55 -0800 | [diff] [blame] | 320 | ** Note: If RF discovery is started, |
| 321 | ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should |
| 322 | ** happen before calling this function |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 323 | ** |
Ruchi Kandoi | 552f2b7 | 2017-01-28 16:22:55 -0800 | [diff] [blame] | 324 | ** Note: NFA_EeUpdateNow() should be called after last NFA-EE |
| 325 | ** function to change the listen mode routing is called. |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 326 | ** |
| 327 | ** Returns NFA_STATUS_OK if successfully initiated |
| 328 | ** NFA_STATUS_FAILED otherwise |
| 329 | ** NFA_STATUS_INVALID_PARAM If bad parameter |
| 330 | ** |
| 331 | *******************************************************************************/ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 332 | extern tNFA_STATUS NFA_EeSetDefaultProtoRouting( |
| 333 | tNFA_HANDLE ee_handle, tNFA_PROTOCOL_MASK protocols_switch_on, |
| 334 | tNFA_PROTOCOL_MASK protocols_switch_off, |
| 335 | tNFA_PROTOCOL_MASK protocols_battery_off); |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 336 | |
| 337 | /******************************************************************************* |
| 338 | ** |
| 339 | ** Function NFA_EeAddAidRouting |
| 340 | ** |
| 341 | ** Description This function is called to add an AID entry in the |
| 342 | ** listen mode routing table in NFCC. The status of this |
| 343 | ** operation is reported as the NFA_EE_ADD_AID_EVT. |
| 344 | ** |
Ruchi Kandoi | 552f2b7 | 2017-01-28 16:22:55 -0800 | [diff] [blame] | 345 | ** Note: If RF discovery is started, |
| 346 | ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should |
| 347 | ** happen before calling this function |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 348 | ** |
Ruchi Kandoi | 552f2b7 | 2017-01-28 16:22:55 -0800 | [diff] [blame] | 349 | ** Note: NFA_EeUpdateNow() should be called after last NFA-EE |
| 350 | ** function to change the listen mode routing is called. |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 351 | ** |
| 352 | ** Returns NFA_STATUS_OK if successfully initiated |
| 353 | ** NFA_STATUS_FAILED otherwise |
| 354 | ** NFA_STATUS_INVALID_PARAM If bad parameter |
| 355 | ** |
| 356 | *******************************************************************************/ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 357 | extern tNFA_STATUS NFA_EeAddAidRouting(tNFA_HANDLE ee_handle, uint8_t aid_len, |
| 358 | uint8_t* p_aid, |
Love Khanna | f3c018a | 2017-05-11 18:34:32 +0530 | [diff] [blame] | 359 | tNFA_EE_PWR_STATE power_state, |
| 360 | uint8_t aidInfo); |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 361 | |
| 362 | /******************************************************************************* |
| 363 | ** |
| 364 | ** Function NFA_EeRemoveAidRouting |
| 365 | ** |
Ruchi Kandoi | 552f2b7 | 2017-01-28 16:22:55 -0800 | [diff] [blame] | 366 | ** Description This function is called to remove the given AID entry from |
| 367 | ** the listen mode routing table. If the entry configures VS, |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 368 | ** it is also removed. The status of this operation is reported |
| 369 | ** as the NFA_EE_REMOVE_AID_EVT. |
| 370 | ** |
Ruchi Kandoi | 552f2b7 | 2017-01-28 16:22:55 -0800 | [diff] [blame] | 371 | ** Note: If RF discovery is started, |
| 372 | ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should |
| 373 | ** happen before calling this function |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 374 | ** |
Ruchi Kandoi | 552f2b7 | 2017-01-28 16:22:55 -0800 | [diff] [blame] | 375 | ** Note: NFA_EeUpdateNow() should be called after last NFA-EE |
| 376 | ** function to change the listen mode routing is called. |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 377 | ** |
| 378 | ** Returns NFA_STATUS_OK if successfully initiated |
| 379 | ** NFA_STATUS_FAILED otherwise |
| 380 | ** NFA_STATUS_INVALID_PARAM If bad parameter |
| 381 | ** |
| 382 | *******************************************************************************/ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 383 | extern tNFA_STATUS NFA_EeRemoveAidRouting(uint8_t aid_len, uint8_t* p_aid); |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 384 | |
| 385 | /******************************************************************************* |
Love Khanna | 1d06277 | 2018-04-10 21:10:02 +0530 | [diff] [blame^] | 386 | ** |
| 387 | ** Function NFA_EeAddSystemCodeRouting |
| 388 | ** |
| 389 | ** Description This function is called to add an system code entry in the |
| 390 | ** listen mode routing table in NFCC. The status of this |
| 391 | ** operation is reported as the NFA_EE_ADD_SYSCODE_EVT. |
| 392 | ** |
| 393 | ** Note: If RF discovery is started, |
| 394 | ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should |
| 395 | ** happen before calling this function |
| 396 | ** |
| 397 | ** Note: NFA_EeUpdateNow() should be called after last NFA-EE |
| 398 | ** function to change the listen mode routing is called. |
| 399 | ** |
| 400 | ** Returns NFA_STATUS_OK if successfully initiated |
| 401 | ** NFA_STATUS_FAILED otherwise |
| 402 | ** NFA_STATUS_INVALID_PARAM If bad parameter |
| 403 | ** |
| 404 | *******************************************************************************/ |
| 405 | extern tNFA_STATUS NFA_EeAddSystemCodeRouting(uint16_t systemcode, |
| 406 | tNFA_HANDLE ee_handle, |
| 407 | tNFA_EE_PWR_STATE power_state); |
| 408 | |
| 409 | /******************************************************************************* |
| 410 | ** |
| 411 | ** Function NFA_EeRemoveSystemCodeRouting |
| 412 | ** |
| 413 | ** Description This function is called to remove the given System Code |
| 414 | *based entry from |
| 415 | ** the listen mode routing table. The status of this operation |
| 416 | *is reported |
| 417 | ** as the NFA_EE_REMOVE_SYSCODE_EVT. |
| 418 | ** |
| 419 | ** Note: If RF discovery is started, |
| 420 | ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should |
| 421 | ** happen before calling this function |
| 422 | ** |
| 423 | ** Note: NFA_EeUpdateNow() should be called after last NFA-EE |
| 424 | ** function to change the listen mode routing is called. |
| 425 | ** |
| 426 | ** Returns NFA_STATUS_OK if successfully initiated |
| 427 | ** NFA_STATUS_FAILED otherwise |
| 428 | ** NFA_STATUS_INVALID_PARAM If bad parameter |
| 429 | ** |
| 430 | *******************************************************************************/ |
| 431 | extern tNFA_STATUS NFA_EeRemoveSystemCodeRouting(uint16_t systemcode); |
| 432 | |
| 433 | /******************************************************************************* |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 434 | ** |
Sherry Smith | ca0bff4 | 2014-01-22 15:15:54 -0800 | [diff] [blame] | 435 | ** Function NFA_EeGetLmrtRemainingSize |
| 436 | ** |
| 437 | ** Description This function is called to get remaining size of the |
| 438 | ** Listen Mode Routing Table. |
| 439 | ** The remaining size is reported in NFA_EE_REMAINING_SIZE_EVT |
| 440 | ** |
| 441 | ** Returns NFA_STATUS_OK if successfully initiated |
| 442 | ** NFA_STATUS_FAILED otherwise |
| 443 | ** |
| 444 | *******************************************************************************/ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 445 | extern tNFA_STATUS NFA_EeGetLmrtRemainingSize(void); |
Sherry Smith | ca0bff4 | 2014-01-22 15:15:54 -0800 | [diff] [blame] | 446 | |
| 447 | /******************************************************************************* |
| 448 | ** |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 449 | ** Function NFA_EeUpdateNow |
| 450 | ** |
| 451 | ** Description This function is called to send the current listen mode |
Ruchi Kandoi | 552f2b7 | 2017-01-28 16:22:55 -0800 | [diff] [blame] | 452 | ** routing table and VS configuration to the NFCC (without |
| 453 | ** waiting for NFA_EE_ROUT_TIMEOUT_VAL). |
Sherry Smith | 40e67c9 | 2014-01-16 10:10:29 -0800 | [diff] [blame] | 454 | ** |
| 455 | ** The status of this operation is |
| 456 | ** reported with the NFA_EE_UPDATED_EVT. |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 457 | ** |
| 458 | ** Returns NFA_STATUS_OK if successfully initiated |
Sherry Smith | 40e67c9 | 2014-01-16 10:10:29 -0800 | [diff] [blame] | 459 | ** NFA_STATUS_SEMANTIC_ERROR is update is currently in progress |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 460 | ** NFA_STATUS_FAILED otherwise |
| 461 | ** |
| 462 | *******************************************************************************/ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 463 | extern tNFA_STATUS NFA_EeUpdateNow(void); |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 464 | |
| 465 | /******************************************************************************* |
| 466 | ** |
| 467 | ** Function NFA_EeConnect |
| 468 | ** |
| 469 | ** Description Open connection to an NFCEE attached to the NFCC |
| 470 | ** |
| 471 | ** The status of this operation is |
| 472 | ** reported with the NFA_EE_CONNECT_EVT. |
| 473 | ** |
| 474 | ** Returns NFA_STATUS_OK if successfully initiated |
| 475 | ** NFA_STATUS_FAILED otherwise |
| 476 | ** NFA_STATUS_INVALID_PARAM If bad parameter |
| 477 | ** |
| 478 | *******************************************************************************/ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 479 | extern tNFA_STATUS NFA_EeConnect(tNFA_HANDLE ee_handle, uint8_t ee_interface, |
| 480 | tNFA_EE_CBACK* p_cback); |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 481 | |
| 482 | /******************************************************************************* |
| 483 | ** |
| 484 | ** Function NFA_EeSendData |
| 485 | ** |
| 486 | ** Description Send data to the given NFCEE. |
Ruchi Kandoi | 552f2b7 | 2017-01-28 16:22:55 -0800 | [diff] [blame] | 487 | ** This function shall be called after NFA_EE_CONNECT_EVT is |
| 488 | ** reported and before NFA_EeDisconnect is called on the given |
| 489 | ** ee_handle. |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 490 | ** |
| 491 | ** Returns NFA_STATUS_OK if successfully initiated |
| 492 | ** NFA_STATUS_FAILED otherwise |
| 493 | ** NFA_STATUS_INVALID_PARAM If bad parameter |
| 494 | ** |
| 495 | *******************************************************************************/ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 496 | extern tNFA_STATUS NFA_EeSendData(tNFA_HANDLE ee_handle, uint16_t data_len, |
| 497 | uint8_t* p_data); |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 498 | |
| 499 | /******************************************************************************* |
| 500 | ** |
| 501 | ** Function NFA_EeDisconnect |
| 502 | ** |
| 503 | ** Description Disconnect (if a connection is currently open) from an |
| 504 | ** NFCEE interface. The result of this operation is reported |
| 505 | ** with the NFA_EE_DISCONNECT_EVT. |
| 506 | ** |
| 507 | ** Returns NFA_STATUS_OK if successfully initiated |
| 508 | ** NFA_STATUS_FAILED otherwise |
| 509 | ** NFA_STATUS_INVALID_PARAM If bad parameter |
| 510 | ** |
| 511 | *******************************************************************************/ |
Ruchi Kandoi | 6fca02d | 2017-01-30 14:28:16 -0800 | [diff] [blame] | 512 | extern tNFA_STATUS NFA_EeDisconnect(tNFA_HANDLE ee_handle); |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 513 | |
The Android Open Source Project | e9df6ba | 2012-12-13 14:55:37 -0800 | [diff] [blame] | 514 | #endif /* NFA_EE_API_H */ |