nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1 | /****************************************************************************** |
| 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 | * |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 20 | * The original Work has been changed by NXP. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 21 | * |
| 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 | * |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 34 | * Copyright 2018 NXP |
| 35 | * |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 36 | ******************************************************************************/ |
| 37 | |
| 38 | /****************************************************************************** |
| 39 | * |
| 40 | * This is the public interface file for NFA, Broadcom's NFC application |
| 41 | * layer for mobile phones. |
| 42 | * |
| 43 | ******************************************************************************/ |
| 44 | #ifndef NFA_API_H |
| 45 | #define NFA_API_H |
| 46 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 47 | #include "gki.h" |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 48 | #include "nci_defs.h" |
| 49 | #include "nfc_api.h" |
| 50 | #include "nfc_hal_api.h" |
| 51 | #include "nfc_target.h" |
| 52 | #include "rw_api.h" |
| 53 | #include "tags_defs.h" |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 54 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 55 | /***************************************************************************** |
| 56 | ** Constants and data types |
| 57 | *****************************************************************************/ |
| 58 | |
nxpandroid | 70cccc7 | 2016-11-18 19:58:22 +0530 | [diff] [blame] | 59 | /* Max length of Appliction ID in 7816-4 */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 60 | #define NFA_MAX_AID_LEN NFC_MAX_AID_LEN |
| 61 | #define NFA_MIN_AID_LEN 5 /* per NCI specification */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 62 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 63 | /* Command succeeded */ |
| 64 | #define NFA_STATUS_OK NCI_STATUS_OK |
| 65 | /* Command is rejected. */ |
| 66 | #define NFA_STATUS_REJECTED NCI_STATUS_REJECTED |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 67 | /* buffer full */ |
| 68 | #define NFA_STATUS_BUFFER_FULL NCI_STATUS_BUFFER_FULL |
| 69 | /* failed */ |
| 70 | #define NFA_STATUS_FAILED NCI_STATUS_FAILED |
Suraj Uday Kotharkar | 6f7757b | 2018-05-10 15:58:29 +0530 | [diff] [blame] | 71 | /* Optional feature of NCI Spec not supported */ |
| 72 | #define NFA_STATUS_NOT_SUPPORTED NCI_STATUS_NOT_SUPPORTED |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 73 | /* Semantic error */ |
| 74 | #define NFA_STATUS_SEMANTIC_ERROR NCI_STATUS_SEMANTIC_ERROR |
| 75 | /* Unknown NCI Group ID */ |
| 76 | #define NFA_STATUS_UNKNOWN_GID NCI_STATUS_UNKNOWN_GID |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 77 | /* Invalid Parameter */ |
| 78 | #define NFA_STATUS_INVALID_PARAM NCI_STATUS_INVALID_PARAM |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 79 | /* Already started */ |
| 80 | #define NFA_STATUS_ALREADY_STARTED NCI_STATUS_ALREADY_STARTED |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 81 | /* RF Timeout */ |
| 82 | #define NFA_STATUS_TIMEOUT NCI_STATUS_TIMEOUT |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 83 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 84 | /* Out of GKI buffers */ |
| 85 | #define NFA_STATUS_NO_BUFFERS NFC_STATUS_NO_BUFFERS |
| 86 | /* Protocol mismatch between API and activated one */ |
| 87 | #define NFA_STATUS_WRONG_PROTOCOL NFC_STATUS_WRONG_PROTOCOL |
| 88 | /* Another Tag command is already in progress */ |
| 89 | #define NFA_STATUS_BUSY NFC_STATUS_BUSY |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 90 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 91 | /* data len exceeds MIU */ |
| 92 | #define NFA_STATUS_BAD_LENGTH NFC_STATUS_BAD_LENGTH |
| 93 | /* invalid handle */ |
| 94 | #define NFA_STATUS_BAD_HANDLE NFC_STATUS_BAD_HANDLE |
| 95 | /* congested */ |
| 96 | #define NFA_STATUS_CONGESTED NFC_STATUS_CONGESTED |
nxpandroid | 70cccc7 | 2016-11-18 19:58:22 +0530 | [diff] [blame] | 97 | #if (NXP_EXTNS == TRUE) |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 98 | #define NFA_STATUS_ALREADY_INITIALIZED NFC_STATUS_ALREADY_INITIALIZED |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 99 | /* API is called to perform illegal function */ |
| 100 | #define NFA_STATUS_REFUSED NFC_STATUS_REFUSED |
Suraj Uday Kotharkar | c4ef3e7 | 2018-06-08 14:33:26 +0530 | [diff] [blame] | 101 | #define NFA_STATUS_HCI_WTX_TIMEOUT 0xE0 |
nxpandroid | 70cccc7 | 2016-11-18 19:58:22 +0530 | [diff] [blame] | 102 | #endif |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 103 | typedef uint8_t tNFA_STATUS; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 104 | |
| 105 | /* Handle for NFA registrations and connections */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 106 | typedef uint16_t tNFA_HANDLE; |
| 107 | #define NFA_HANDLE_INVALID (0xFFFF) |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 108 | /* NFA Handle definitions */ |
| 109 | |
| 110 | /* The upper byte of NFA_HANDLE signifies the handle group */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 111 | /* NDEF Type Handler handles */ |
| 112 | #define NFA_HANDLE_GROUP_NDEF_HANDLER 0x0200 |
| 113 | /* DH Card Emulation handles */ |
| 114 | #define NFA_HANDLE_GROUP_CE 0x0300 |
| 115 | /* Handles to identify NFCEE */ |
| 116 | #define NFA_HANDLE_GROUP_EE 0x0400 |
| 117 | /* P2P handles */ |
| 118 | #define NFA_HANDLE_GROUP_P2P 0x0500 |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 119 | /* HCI handles */ |
| 120 | #define NFA_HANDLE_GROUP_HCI 0x0800 |
| 121 | /* Local NDEF message handle */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 122 | #define NFA_HANDLE_GROUP_MASK 0xFF00 |
| 123 | #define NFA_HANDLE_MASK 0x00FF |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 124 | |
| 125 | /* NCI Parameter IDs */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 126 | typedef uint8_t tNFA_PMID; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 127 | |
| 128 | /* Definitions for tNFA_TECHNOLOGY_MASK */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 129 | #define NFA_TECHNOLOGY_MASK_A 0x01 /* NFC Technology A */ |
| 130 | #define NFA_TECHNOLOGY_MASK_B 0x02 /* NFC Technology B */ |
| 131 | #define NFA_TECHNOLOGY_MASK_F 0x04 /* NFC Technology F */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 132 | /* TECHNOLOGY_MASK_V in NCI2.0 and TECHNOLOGY_MASK_15693 proprietary in NCI1.0*/ |
| 133 | #define NFA_TECHNOLOGY_MASK_V 0x08 |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 134 | #define NFA_TECHNOLOGY_MASK_B_PRIME 0x10 /* Proprietary Technology */ |
| 135 | #define NFA_TECHNOLOGY_MASK_KOVIO 0x20 /* Proprietary Technology */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 136 | /* NFC technology NFC-DEP protocol active mode */ |
| 137 | #define NFA_TECHNOLOGY_MASK_ACTIVE 0x40 |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 138 | /* NFC Technology A active mode */ |
| 139 | #define NFA_TECHNOLOGY_MASK_A_ACTIVE 0x40 |
| 140 | /* NFC Technology F active mode */ |
| 141 | #define NFA_TECHNOLOGY_MASK_F_ACTIVE 0x80 |
| 142 | /* All supported technologies */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 143 | typedef uint8_t tNFA_TECHNOLOGY_MASK; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 144 | |
| 145 | /* Definitions for NFC protocol for RW, CE and P2P APIs */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 146 | /* Type1Tag - NFC-A */ |
| 147 | #define NFA_PROTOCOL_T1T NFC_PROTOCOL_T1T |
| 148 | /* MIFARE/Type2Tag - NFC-A */ |
| 149 | #define NFA_PROTOCOL_T2T NFC_PROTOCOL_T2T |
| 150 | /* Felica/Type3Tag - NFC-F */ |
| 151 | #define NFA_PROTOCOL_T3T NFC_PROTOCOL_T3T |
| 152 | /* Type 4A,4B - NFC-A or NFC-B */ |
| 153 | #define NFA_PROTOCOL_ISO_DEP NFC_PROTOCOL_ISO_DEP |
| 154 | /* NFCDEP/LLCP - NFC-A or NFC-F */ |
| 155 | #define NFA_PROTOCOL_NFC_DEP NFC_PROTOCOL_NFC_DEP |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 156 | /* NFC_PROTOCOL_T5T in NCI2.0 and NFC_PROTOCOL_ISO15693 proprietary in NCI1.0*/ |
| 157 | #define NFA_PROTOCOL_T5T NFC_PROTOCOL_T5T |
nxpandroid | cdd3044 | 2016-05-27 17:26:18 +0530 | [diff] [blame] | 158 | #if (NXP_EXTNS == TRUE) |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 159 | #define NFA_PROTOCOL_MIFARE NFC_PROTOCOL_MIFARE |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 160 | #define NFA_PROTOCOL_T3BT NFC_PROTOCOL_T3BT |
| 161 | #define NFA_NORMAL_BOOT_MODE NFC_NORMAL_BOOT_MODE |
| 162 | #define NFA_FAST_BOOT_MODE NFC_FAST_BOOT_MODE |
| 163 | #define NFA_OSU_BOOT_MODE NFC_OSU_BOOT_MODE |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 164 | |
| 165 | #define NFA_MAX_NUM_PROTOCOLS 8 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 166 | #endif |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 167 | #define NFA_PROTOCOL_INVALID 0xFF |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 168 | typedef uint8_t tNFA_NFC_PROTOCOL; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 169 | |
| 170 | /* Definitions for tNFA_PROTOCOL_MASK */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 171 | #define NFA_PROTOCOL_MASK_T1T 0x01 /* Type 1 tag */ |
| 172 | #define NFA_PROTOCOL_MASK_T2T 0x02 /* MIFARE / Type 2 tag */ |
| 173 | #define NFA_PROTOCOL_MASK_T3T 0x04 /* FeliCa / Type 3 tag */ |
| 174 | #define NFA_PROTOCOL_MASK_ISO_DEP 0x08 /* ISODEP/4A,4B */ |
| 175 | #define NFA_PROTOCOL_MASK_NFC_DEP 0x10 /* NFCDEP/LLCP */ |
| 176 | #if (NXP_EXTNS == TRUE) |
| 177 | #define NFC_PROTOCOL_MASK_ISO7816 0x20 /*ISO 7816 - Aid Default Route */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 178 | #endif |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 179 | typedef uint8_t tNFA_PROTOCOL_MASK; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 180 | |
| 181 | /* NFA_DM callback events */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 182 | /* Result of NFA_Enable */ |
| 183 | #define NFA_DM_ENABLE_EVT 0 |
| 184 | /* Result of NFA_Disable */ |
| 185 | #define NFA_DM_DISABLE_EVT 1 |
| 186 | /* Result of NFA_SetConfig */ |
| 187 | #define NFA_DM_SET_CONFIG_EVT 2 |
| 188 | /* Result of NFA_GetConfig */ |
| 189 | #define NFA_DM_GET_CONFIG_EVT 3 |
| 190 | /* Result of NFA_PowerOffSleepMode */ |
| 191 | #define NFA_DM_PWR_MODE_CHANGE_EVT 4 |
| 192 | #define NFA_DM_RF_FIELD_EVT 5 /* Status of RF Field */ |
| 193 | /* NFCC is not responding */ |
| 194 | #define NFA_DM_NFCC_TIMEOUT_EVT 6 |
| 195 | /* NCI Tranport error */ |
| 196 | #define NFA_DM_NFCC_TRANSPORT_ERR_EVT 7 |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 197 | /* Result of NFA_SetPowerSubStateForScreenState */ |
| 198 | #define NFA_DM_SET_POWER_SUB_STATE_EVT 11 |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 199 | #if (NXP_EXTNS == TRUE) |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 200 | #define NFA_DM_EE_HCI_DISABLE 24 |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 201 | /*Status when EE HCI susbsystems enabled*/ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 202 | #define NFA_DM_EE_HCI_ENABLE 25 |
Ravishinde | 26233bb | 2018-08-06 22:16:08 +0530 | [diff] [blame] | 203 | /*Status when Transit Config is set*/ |
| 204 | #define NFA_DM_SET_TRANSIT_CONFIG_EVT 14 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 205 | #endif |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 206 | /* T1T HR length */ |
| 207 | #define NFA_T1T_HR_LEN T1T_HR_LEN |
| 208 | /* Max UID length of T1/T2 */ |
| 209 | #define NFA_MAX_UID_LEN TAG_MAX_UID_LEN |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 210 | /* UID len for T1T cmds */ |
| 211 | #define NFA_T1T_CMD_UID_LEN T1T_CMD_UID_LEN |
| 212 | /* T2T UID length */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 213 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 214 | /* Tag formated for NDEF */ |
| 215 | #define NFA_RW_NDEF_FL_FORMATED RW_NDEF_FL_FORMATED |
| 216 | /* NDEF supported by the tag */ |
| 217 | #define NFA_RW_NDEF_FL_SUPPORTED RW_NDEF_FL_SUPPORTED |
| 218 | /* Unable to find if tag is ndef capable/formated/read only */ |
| 219 | #define NFA_RW_NDEF_FL_UNKNOWN RW_NDEF_FL_UNKNOWN |
| 220 | /* Tag supports format operation */ |
| 221 | #define NFA_RW_NDEF_FL_FORMATABLE RW_NDEF_FL_FORMATABLE |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 222 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 223 | typedef uint8_t tNFA_RW_NDEF_FLAG; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 224 | |
| 225 | /* Data for NFA_DM_SET_CONFIG_EVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 226 | typedef struct { |
| 227 | tNFA_STATUS status; /* NFA_STATUS_OK if successful */ |
| 228 | uint8_t num_param_id; /* Number of rejected Param ID */ |
| 229 | tNFA_PMID param_ids[NFC_MAX_NUM_IDS]; /* Rejected Param ID */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 230 | } tNFA_SET_CONFIG; |
| 231 | |
| 232 | /* Data for NFA_DM_GET_CONFIG_EVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 233 | typedef struct { |
| 234 | tNFA_STATUS status; /* NFA_STATUS_OK if successful */ |
| 235 | uint16_t tlv_size; /* The length of TLV */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 236 | uint8_t* param_tlvs; /* TLV (Parameter ID-Len-Value byte stream) */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 237 | } tNFA_GET_CONFIG; |
| 238 | |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 239 | /* Structure to store screen state */ |
| 240 | typedef enum screen_state { |
| 241 | NFA_SCREEN_STATE_UNKNOWN = 0x00, |
| 242 | NFA_SCREEN_STATE_OFF_UNLOCKED = 0x01, |
| 243 | NFA_SCREEN_STATE_OFF_LOCKED = 0x02, |
| 244 | NFA_SCREEN_STATE_ON_LOCKED = 0x04, |
| 245 | NFA_SCREEN_STATE_ON_UNLOCKED = 0x08 |
| 246 | } eScreenState_t; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 247 | |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 248 | typedef enum power_substate { |
| 249 | SCREEN_STATE_ON_UNLOCKED = 0x00, |
| 250 | SCREEN_STATE_OFF_UNLOCKED, |
| 251 | SCREEN_STATE_ON_LOCKED, |
| 252 | SCREEN_STATE_OFF_LOCKED, |
nxf24591 | 1fec714 | 2018-06-06 14:29:48 +0530 | [diff] [blame] | 253 | #if (NXP_EXTNS == TRUE) |
| 254 | SCREEN_STATE_INVALID = 0xFF |
| 255 | #endif |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 256 | } epower_substate_t; |
| 257 | |
| 258 | #define NFA_SCREEN_STATE_MASK 0x0F |
Ravishinde | 26233bb | 2018-08-06 22:16:08 +0530 | [diff] [blame] | 259 | #if (NXP_EXTNS == TRUE) |
| 260 | typedef struct { tNFA_STATUS status; } tNFA_SET_TRANSIT_CONFIG; |
| 261 | #endif |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 262 | /* CONN_DISCOVER_PARAM */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 263 | #define NFA_DM_PWR_MODE_FULL 0x04 |
| 264 | #define NFA_DM_PWR_MODE_OFF_SLEEP 0x00 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 265 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 266 | typedef uint8_t tNFA_DM_PWR_MODE; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 267 | |
| 268 | /* Data for NFA_DM_PWR_MODE_CHANGE_EVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 269 | typedef struct { |
| 270 | tNFA_STATUS status; /* NFA_STATUS_OK if successful */ |
| 271 | /* NFA_DM_PWR_MODE_FULL or NFA_DM_PWR_MODE_OFF_SLEEP */ |
| 272 | tNFA_DM_PWR_MODE power_mode; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 273 | } tNFA_DM_PWR_MODE_CHANGE; |
| 274 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 275 | /* Data for NFA_DM_RF_FIELD_EVT */ |
| 276 | #define NFA_DM_RF_FIELD_OFF 0x00 |
| 277 | #define NFA_DM_RF_FIELD_ON 0x01 |
| 278 | |
| 279 | typedef struct { |
| 280 | tNFA_STATUS status; /* NFA_STATUS_OK if successful */ |
| 281 | /* NFA_DM_RF_FIELD_ON if operating field generated by remote */ |
| 282 | uint8_t rf_field_status; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 283 | } tNFA_DM_RF_FIELD; |
| 284 | |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 285 | typedef struct { |
| 286 | tNFA_STATUS status; /* NFA_STATUS_OK if successful */ |
| 287 | uint8_t power_state; /* current screen/power state */ |
| 288 | } tNFA_DM_POWER_STATE; |
| 289 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 290 | /* Union of all DM callback structures */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 291 | typedef union { |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 292 | tNFA_STATUS status; /* NFA_DM_ENABLE_EVT */ |
| 293 | tNFA_SET_CONFIG set_config; /* NFA_DM_SET_CONFIG_EVT */ |
| 294 | tNFA_GET_CONFIG get_config; /* NFA_DM_GET_CONFIG_EVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 295 | tNFA_DM_PWR_MODE_CHANGE power_mode; /* NFA_DM_PWR_MODE_CHANGE_EVT */ |
| 296 | tNFA_DM_RF_FIELD rf_field; /* NFA_DM_RF_FIELD_EVT */ |
| 297 | void* p_vs_evt_data; /* Vendor-specific evt data */ |
| 298 | tNFA_DM_POWER_STATE power_sub_state; /* power sub state */ |
Ravishinde | 26233bb | 2018-08-06 22:16:08 +0530 | [diff] [blame] | 299 | #if (NXP_EXTNS == TRUE) |
| 300 | tNFA_SET_TRANSIT_CONFIG set_transit_config; /* NFA_DM_SET_TRANSIT_CONFIG */ |
| 301 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 302 | } tNFA_DM_CBACK_DATA; |
| 303 | |
| 304 | /* NFA_DM callback */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 305 | typedef void(tNFA_DM_CBACK)(uint8_t event, tNFA_DM_CBACK_DATA* p_data); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 306 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 307 | /* NFA Enable DTA Type Mode */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 308 | typedef enum { |
| 309 | NFA_DTA_DEFAULT_MODE = 0x00000001, |
| 310 | NFA_DTA_LLCP_MODE = 0x00000002, |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 311 | NFA_DTA_HCEF_MODE = 0x00000004, |
| 312 | NFA_DTA_CR8 = 0x00000080, |
Soma | 8f4735d | 2018-06-19 14:24:00 +0530 | [diff] [blame] | 313 | NFA_DTA_CR9 = 0x00000090, |
| 314 | NFA_DTA_CR10 = 0x000000A0, |
| 315 | NFA_DTA_CR11 = 0x000000B0, |
| 316 | NFA_DTA_CR12 = 0x000000C0, |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 317 | } tNFA_eDtaModes; |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 318 | |
| 319 | #if (NXP_EXTNS == TRUE) |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 320 | typedef struct { |
| 321 | uint32_t validation; /* indicates on which platform validation is done like |
| 322 | pn547, pn548, pn65T, pn66T */ |
| 323 | uint8_t android_version; /* Nxp's android version */ |
| 324 | uint8_t major_version; /* Major Version of MW*/ |
| 325 | uint8_t minor_version; /* Minor Version of Mw */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 326 | uint8_t rc_version; /*RC version*/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 327 | } tNFA_MW_VERSION; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 328 | #endif |
| 329 | |
| 330 | /* NFA Connection Callback Events */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 331 | #define NFA_POLL_ENABLED_EVT 0 /* Polling enabled event */ |
| 332 | #define NFA_POLL_DISABLED_EVT 1 /* Polling disabled event */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 333 | /* NFC link/protocol discovery notificaiton */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 334 | #define NFA_DISC_RESULT_EVT 2 |
| 335 | /* NFC link/protocol discovery select response */ |
| 336 | #define NFA_SELECT_RESULT_EVT 3 |
| 337 | #define NFA_DEACTIVATE_FAIL_EVT 4 /* NFA_Deactivate failure */ |
| 338 | /* NFC link/protocol activated */ |
| 339 | #define NFA_ACTIVATED_EVT 5 |
| 340 | /* NFC link/protocol deactivated */ |
| 341 | #define NFA_DEACTIVATED_EVT 6 |
| 342 | #define NFA_TLV_DETECT_EVT 7 /* TLV Detection complete */ |
| 343 | /* NDEF Detection complete */ |
| 344 | #define NFA_NDEF_DETECT_EVT 8 |
| 345 | #define NFA_DATA_EVT 9 /* Data message received */ |
| 346 | #define NFA_SELECT_CPLT_EVT 10 /* Select completed */ |
| 347 | #define NFA_READ_CPLT_EVT 11 /* Read completed */ |
| 348 | #define NFA_WRITE_CPLT_EVT 12 /* Write completed */ |
| 349 | #define NFA_LLCP_ACTIVATED_EVT 13 /* LLCP link is activated */ |
| 350 | /* LLCP link is deactivated */ |
| 351 | #define NFA_LLCP_DEACTIVATED_EVT 14 |
| 352 | /* Response to NFA_RwPresenceCheck */ |
| 353 | #define NFA_PRESENCE_CHECK_EVT 15 |
| 354 | /* Tag Formating completed */ |
| 355 | #define NFA_FORMAT_CPLT_EVT 16 |
| 356 | /* ISO 15693 command completed */ |
| 357 | #define NFA_I93_CMD_CPLT_EVT 17 |
| 358 | #define NFA_SET_TAG_RO_EVT 18 /* Tag set as Read only */ |
| 359 | /* Result for NFA_RequestExclusiveRfControl */ |
| 360 | #define NFA_EXCLUSIVE_RF_CONTROL_STARTED_EVT 19 |
| 361 | /* Result for NFA_ReleaseExclusiveRfControl */ |
| 362 | #define NFA_EXCLUSIVE_RF_CONTROL_STOPPED_EVT 20 |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 363 | /* DH Card emulation: AID or System code reg'd */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 364 | #define NFA_CE_REGISTERED_EVT 21 |
| 365 | /* DH Card emulation: AID or System code dereg'd */ |
| 366 | #define NFA_CE_DEREGISTERED_EVT 22 |
| 367 | /* DH Card emulation: data received event */ |
| 368 | #define NFA_CE_DATA_EVT 23 |
| 369 | /* DH Card emulation: activation event */ |
| 370 | #define NFA_CE_ACTIVATED_EVT 24 |
| 371 | /* DH Card emulation: deactivation event */ |
| 372 | #define NFA_CE_DEACTIVATED_EVT 25 |
| 373 | /* DH Card emulation: local NDEF configured */ |
| 374 | #define NFA_CE_LOCAL_TAG_CONFIGURED_EVT 26 |
| 375 | /* DH Card emulation: NDEF write started */ |
| 376 | #define NFA_CE_NDEF_WRITE_START_EVT 27 |
| 377 | /* DH Card emulation: NDEF write completed */ |
| 378 | #define NFA_CE_NDEF_WRITE_CPLT_EVT 28 |
| 379 | #define NFA_CE_UICC_LISTEN_CONFIGURED_EVT 29 /* UICC Listen configured */ |
| 380 | /* RF Discovery started event */ |
| 381 | #define NFA_RF_DISCOVERY_STARTED_EVT 30 |
| 382 | /* RF Discovery stopped event */ |
| 383 | #define NFA_RF_DISCOVERY_STOPPED_EVT 31 |
| 384 | /* status of updating RF communication paramters */ |
| 385 | #define NFA_UPDATE_RF_PARAM_RESULT_EVT 32 |
| 386 | /* RF Interface error event */ |
| 387 | #define NFA_RW_INTF_ERROR_EVT 34 |
| 388 | /* status of setting P2P listen technologies */ |
| 389 | #define NFA_SET_P2P_LISTEN_TECH_EVT 33 |
| 390 | /* First packet received over LLCP link */ |
| 391 | #define NFA_LLCP_FIRST_PACKET_RECEIVED_EVT 35 |
| 392 | /* Listening enabled event */ |
| 393 | #define NFA_LISTEN_ENABLED_EVT 36 |
| 394 | /* Listening disabled event */ |
| 395 | #define NFA_LISTEN_DISABLED_EVT 37 |
| 396 | /* P2P services paused event */ |
| 397 | #define NFA_P2P_PAUSED_EVT 38 |
| 398 | /* P2P services resumed event */ |
| 399 | #define NFA_P2P_RESUMED_EVT 39 |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 400 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 401 | /* NFC deactivation type */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 402 | #define NFA_DEACTIVATE_TYPE_IDLE NFC_DEACTIVATE_TYPE_IDLE |
| 403 | #define NFA_DEACTIVATE_TYPE_SLEEP NFC_DEACTIVATE_TYPE_SLEEP |
| 404 | #define NFA_DEACTIVATE_TYPE_DISCOVERY NFC_DEACTIVATE_TYPE_DISCOVERY |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 405 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 406 | typedef uint8_t tNFA_DEACTIVATE_TYPE; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 407 | |
| 408 | /* Data for NFA_DISC_RESULT_EVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 409 | typedef struct { |
| 410 | tNFA_STATUS status; /* NFA_STATUS_OK if successful */ |
| 411 | tNFC_RESULT_DEVT discovery_ntf; /* RF discovery notification details */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 412 | } tNFA_DISC_RESULT; |
| 413 | |
| 414 | /* Data for NFA_ACTIVATED_EVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 415 | typedef struct { |
| 416 | uint8_t hr[NFA_T1T_HR_LEN]; /* HR of Type 1 tag */ |
| 417 | uint8_t uid[NFA_T1T_CMD_UID_LEN]; /* UID used in T1T Commands */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 418 | } tNFA_T1T_PARAMS; |
| 419 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 420 | typedef struct { |
| 421 | uint8_t uid[NFA_MAX_UID_LEN]; /* UID of T2T tag */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 422 | } tNFA_T2T_PARAMS; |
| 423 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 424 | typedef struct { |
| 425 | uint8_t num_system_codes; /* Number of system codes supporte by tag */ |
| 426 | uint16_t* p_system_codes; /* Pointer to list of system codes */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 427 | } tNFA_T3T_PARAMS; |
| 428 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 429 | typedef struct { |
| 430 | uint8_t uid[I93_UID_BYTE_LEN]; /* UID[0]:MSB, ... UID[7]:LSB */ |
| 431 | uint8_t info_flags; /* information flags */ |
| 432 | uint8_t dsfid; /* DSFID if I93_INFO_FLAG_DSFID */ |
| 433 | uint8_t afi; /* AFI if I93_INFO_FLAG_AFI */ |
| 434 | uint16_t num_block; /* number of blocks if I93_INFO_FLAG_MEM_SIZE */ |
| 435 | uint8_t block_size; /* block size in byte if I93_INFO_FLAG_MEM_SIZE */ |
| 436 | uint8_t IC_reference; /* IC Reference if I93_INFO_FLAG_IC_REF */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 437 | } tNFA_I93_PARAMS; |
| 438 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 439 | typedef union { |
| 440 | tNFA_T1T_PARAMS t1t; /* HR and UID of T1T */ |
| 441 | tNFA_T2T_PARAMS t2t; /* UID of T2T */ |
| 442 | tNFA_T3T_PARAMS t3t; /* System codes */ |
| 443 | tNFA_I93_PARAMS i93; /* System Information of ISO 15693 */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 444 | } tNFA_TAG_PARAMS; |
| 445 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 446 | typedef struct { |
| 447 | tNFC_ACTIVATE_DEVT activate_ntf; /* RF discovery activation details */ |
| 448 | tNFA_TAG_PARAMS params; /* additional informaiton of tag */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 449 | } tNFA_ACTIVATED; |
| 450 | |
| 451 | /* Data for NFA_DEACTIVATED_EVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 452 | typedef struct { |
| 453 | /* NFA_DEACTIVATE_TYPE_IDLE or NFA_DEACTIVATE_TYPE_SLEEP */ |
| 454 | tNFA_DEACTIVATE_TYPE type; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 455 | } tNFA_DEACTIVATED; |
| 456 | |
| 457 | /* Structure for NFA_NDEF_DETECT_EVT event data */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 458 | typedef struct { |
| 459 | tNFA_STATUS status; /* Status of the ndef detecton */ |
| 460 | tNFA_NFC_PROTOCOL protocol; /* protocol used to detect NDEF */ |
| 461 | uint32_t max_size; /* max number of bytes available for NDEF data */ |
| 462 | uint32_t cur_size; /* current size of stored NDEF data (in bytes) */ |
| 463 | /* Flags to indicate NDEF capability, is formated, soft/hard lockable, |
| 464 | * formatable, otp and read only */ |
| 465 | tNFA_RW_NDEF_FLAG flags; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 466 | } tNFA_NDEF_DETECT; |
| 467 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 468 | /* Structure for NFA_TLV_DETECT_EVT event data */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 469 | typedef struct { |
| 470 | tNFA_STATUS status; /* Status of the tlv detecton */ |
| 471 | tNFA_NFC_PROTOCOL protocol; /* protocol used to detect TLV */ |
| 472 | uint8_t num_tlvs; /* number of tlvs present in the tag */ |
| 473 | uint8_t num_bytes; /* number of lock/reserved bytes */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 474 | } tNFA_TLV_DETECT; |
| 475 | |
| 476 | /* Structure for NFA_DATA_EVT data */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 477 | typedef struct { |
| 478 | tNFA_STATUS status; /* Status of Data received */ |
| 479 | uint8_t* p_data; /* Data buffer */ |
| 480 | uint16_t len; /* Length of data */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 481 | } tNFA_RX_DATA; |
| 482 | |
| 483 | /* Structure for NFA_CE_NDEF_WRITE_CPLT_EVT data */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 484 | typedef struct { |
| 485 | tNFA_STATUS status; /* Status of the ndef write op */ |
| 486 | uint32_t len; /* Update length of NDEF data */ |
| 487 | uint8_t* p_data; /* data buffer */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 488 | } tNFA_CE_NDEF_WRITE_CPLT; |
| 489 | |
| 490 | /* Data for NFA_LLCP_ACTIVATED_EVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 491 | typedef struct { |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 492 | bool is_initiator; /* TRUE if initiator */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 493 | uint16_t remote_wks; /* Well-Known service mask of peer */ |
| 494 | uint8_t remote_lsc; /* Link Service Class of peer */ |
| 495 | uint16_t remote_link_miu; /* Link MIU of peer */ |
| 496 | uint16_t local_link_miu; /* Link MIU of local */ |
| 497 | uint8_t remote_version; /* LLCP version of remote */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 498 | } tNFA_LLCP_ACTIVATED; |
| 499 | |
| 500 | /* Data for NFA_LLCP_DEACTIVATED_EVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 501 | typedef struct { |
| 502 | uint8_t reason; /* reason of deactivation */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 503 | } tNFA_LLCP_DEACTIVATED; |
| 504 | |
| 505 | /* Data for NFA_I93_CMD_CPLT_EVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 506 | typedef struct { |
| 507 | uint8_t dsfid; /* DSFID */ |
| 508 | uint8_t uid[I93_UID_BYTE_LEN]; /* UID[0]:MSB, ... UID[7]:LSB */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 509 | } tNFA_I93_INVENTORY; |
| 510 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 511 | typedef struct /* RW_I93_SYS_INFO_EVT */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 512 | { |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 513 | uint8_t info_flags; /* information flags */ |
| 514 | uint8_t uid[I93_UID_BYTE_LEN]; /* UID */ |
| 515 | uint8_t dsfid; /* DSFID if I93_INFO_FLAG_DSFID */ |
| 516 | uint8_t afi; /* AFI if I93_INFO_FLAG_AFI */ |
| 517 | uint16_t num_block; /* number of blocks if I93_INFO_FLAG_MEM_SIZE */ |
| 518 | uint8_t block_size; /* block size in byte if I93_INFO_FLAG_MEM_SIZE */ |
| 519 | uint8_t IC_reference; /* IC Reference if I93_INFO_FLAG_IC_REF */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 520 | } tNFA_I93_SYS_INFO; |
| 521 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 522 | typedef struct { |
| 523 | tNFA_STATUS status; /* Status of sending command */ |
| 524 | uint8_t sent_command; /* sent command to tag */ |
| 525 | union { |
| 526 | uint8_t error_code; /* error code defined in ISO 15693 */ |
| 527 | tNFA_I93_INVENTORY inventory; /* inventory response */ |
| 528 | tNFA_I93_SYS_INFO sys_info; /* system information */ |
| 529 | } params; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 530 | } tNFA_I93_CMD_CPLT; |
| 531 | |
| 532 | /* Data for NFA_CE_REGISTERED_EVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 533 | typedef struct { |
| 534 | tNFA_STATUS status; /* NFA_STATUS_OK if successful */ |
| 535 | tNFA_HANDLE handle; /* handle for NFA_CeRegisterFelicaSystemCodeOnDH () */ |
| 536 | /* NFA_CeRegisterT4tAidOnDH () */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 537 | } tNFA_CE_REGISTERED; |
| 538 | |
| 539 | /* Data for NFA_CE_DEREGISTERED_EVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 540 | typedef struct { |
| 541 | tNFA_HANDLE handle; /* handle from NFA_CE_REGISTERED_EVT */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 542 | } tNFA_CE_DEREGISTERED; |
| 543 | |
| 544 | /* Data for NFA_CE_ACTIVATED_EVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 545 | typedef struct { |
| 546 | tNFA_STATUS status; /* NFA_STATUS_OK if successful */ |
| 547 | tNFA_HANDLE handle; /* handle from NFA_CE_REGISTERED_EVT */ |
| 548 | tNFC_ACTIVATE_DEVT activate_ntf; /* RF discovery activation details */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 549 | } tNFA_CE_ACTIVATED; |
| 550 | |
| 551 | /* Data for NFA_CE_DEACTIVATED_EVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 552 | typedef struct { |
| 553 | tNFA_HANDLE handle; /* handle from NFA_CE_REGISTERED_EVT */ |
| 554 | /* NFA_DEACTIVATE_TYPE_IDLE or NFA_DEACTIVATE_TYPE_SLEEP */ |
| 555 | tNFA_DEACTIVATE_TYPE type; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 556 | } tNFA_CE_DEACTIVATED; |
| 557 | |
| 558 | /* Structure for NFA_CE_DATA_EVT data */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 559 | typedef struct { |
| 560 | tNFA_STATUS status; /* NFA_STATUS_OK if complete packet */ |
| 561 | tNFA_HANDLE handle; /* handle from NFA_CE_REGISTERED_EVT */ |
| 562 | uint8_t* p_data; /* Data buffer */ |
| 563 | uint16_t len; /* Length of data */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 564 | } tNFA_CE_DATA; |
| 565 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 566 | /* Union of all connection callback structures */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 567 | typedef union { |
| 568 | tNFA_STATUS status; /* NFA_POLL_ENABLED_EVT */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 569 | tNFA_DISC_RESULT disc_result; /* NFA_DISC_RESULT_EVT */ |
| 570 | tNFA_ACTIVATED activated; /* NFA_ACTIVATED_EVT */ |
| 571 | tNFA_DEACTIVATED deactivated; /* NFA_DEACTIVATED_EVT */ |
| 572 | tNFA_NDEF_DETECT ndef_detect; /* NFA_NDEF_DETECT_EVT */ |
| 573 | tNFA_TLV_DETECT tlv_detect; /* NFA_TLV_DETECT_EVT */ |
| 574 | tNFA_RX_DATA data; /* NFA_DATA_EVT */ |
| 575 | tNFA_CE_NDEF_WRITE_CPLT ndef_write_cplt; /* NFA_CE_NDEF_WRITE_CPLT_EVT */ |
| 576 | tNFA_LLCP_ACTIVATED llcp_activated; /* NFA_LLCP_ACTIVATED_EVT */ |
| 577 | tNFA_LLCP_DEACTIVATED llcp_deactivated; /* NFA_LLCP_DEACTIVATED_EVT */ |
| 578 | tNFA_I93_CMD_CPLT i93_cmd_cplt; /* NFA_I93_CMD_CPLT_EVT */ |
| 579 | tNFA_CE_REGISTERED ce_registered; /* NFA_CE_REGISTERED_EVT */ |
| 580 | tNFA_CE_DEREGISTERED ce_deregistered; /* NFA_CE_DEREGISTERED_EVT */ |
| 581 | tNFA_CE_ACTIVATED ce_activated; /* NFA_CE_ACTIVATED_EVT */ |
| 582 | tNFA_CE_DEACTIVATED ce_deactivated; /* NFA_CE_DEACTIVATED_EVT */ |
| 583 | tNFA_CE_DATA ce_data; /* NFA_CE_DATA_EVT */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 584 | |
| 585 | } tNFA_CONN_EVT_DATA; |
| 586 | |
| 587 | /* NFA Connection Callback */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 588 | typedef void(tNFA_CONN_CBACK)(uint8_t event, tNFA_CONN_EVT_DATA* p_data); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 589 | |
| 590 | #ifndef NFA_DM_NUM_INTERFACE_MAP |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 591 | #define NFA_DM_NUM_INTERFACE_MAP 3 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 592 | #endif |
| 593 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 594 | /* compile-time configuration structure for the RF Discovery Frequency for each |
| 595 | * technology */ |
| 596 | typedef struct { |
| 597 | uint8_t pa; /* Frequency for NFC Technology A */ |
| 598 | uint8_t pb; /* Frequency for NFC Technology B */ |
| 599 | uint8_t pf; /* Frequency for NFC Technology F */ |
| 600 | uint8_t pi93; /* Frequency for Proprietary Technology/15693 */ |
| 601 | uint8_t pbp; /* Frequency for Proprietary Technology/B-Prime */ |
| 602 | uint8_t pk; /* Frequency for Proprietary Technology/Kovio */ |
| 603 | uint8_t paa; /* Frequency for NFC Technology A active mode */ |
| 604 | uint8_t pfa; /* Frequency for NFC Technology F active mode */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 605 | uint8_t pacm; /* Frequency for NFC Technology active mode */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 606 | } tNFA_DM_DISC_FREQ_CFG; |
| 607 | |
| 608 | /* definitions for tNFA_DM_CFG.presence_check_option */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 609 | /* if NDEF is not supported by the tag, use sleep/wake(last interface) */ |
| 610 | #define NFA_DM_PCO_ISO_SLEEP_WAKE 0x01 |
| 611 | /* NFA_SendRawFrame() has been used, use empty I block for presence check |
| 612 | * if this bit is not set, use read-binary on channel 3 for presence check */ |
| 613 | #define NFA_DM_PCO_EMPTY_I_BLOCK 0x02 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 614 | |
| 615 | /* compile-time configuration structure */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 616 | typedef struct { |
| 617 | /* Automatic NDEF detection (when not in exclusive RF mode) */ |
| 618 | bool auto_detect_ndef; |
| 619 | /* Automatic NDEF read (when not in exclusive RF mode) */ |
| 620 | bool auto_read_ndef; |
| 621 | /* Automatic presence check */ |
| 622 | bool auto_presence_check; |
| 623 | /* Use sleep/wake(last interface) for ISODEP presence check */ |
| 624 | uint8_t presence_check_option; |
| 625 | /* Maximum time to wait for presence check response */ |
| 626 | uint16_t presence_check_timeout; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 627 | } tNFA_DM_CFG; |
| 628 | |
| 629 | /* compile-time configuration structure for HCI */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 630 | typedef struct { |
| 631 | /* Maximum idle(no HCP Pkt) time to wait for EE DISC REQ Ntf(s) */ |
| 632 | uint16_t hci_netwk_enable_timeout; |
| 633 | /* Maximum time to wait for EE DISC REQ NTF(s) after HOT PLUG EVT(s) */ |
| 634 | uint16_t hcp_response_timeout; |
| 635 | /* Number of host in the whitelist of Terminal host */ |
nxf24591 | 193ee78 | 2018-06-06 14:26:10 +0530 | [diff] [blame] | 636 | #if(NXP_EXTNS == TRUE) |
| 637 | /* Maximum time to wait for HCI response */ |
| 638 | uint8_t max_wtx_count; |
| 639 | #endif |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 640 | uint8_t num_whitelist_host; |
| 641 | /* Whitelist of Terminal Host */ |
| 642 | uint8_t* p_whitelist; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 643 | } tNFA_HCI_CFG; |
| 644 | |
| 645 | /* |
| 646 | ** Exclusive RF mode listen configuration |
| 647 | */ |
| 648 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 649 | #define NFA_LB_MAX_NFCID0_LEN 4 |
| 650 | #define NFA_LF_MAX_SC_NFCID2 1 |
| 651 | #define NFA_LA_MAX_HIST_BYTES 15 |
| 652 | #define NFA_LB_MAX_H_INFO_LEN 15 |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 653 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 654 | typedef struct { |
| 655 | /* |
| 656 | ** Discovery Configuration Parameters for Listen A |
| 657 | */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 658 | bool la_enable; /* TRUE if listening A */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 659 | uint8_t la_bit_frame_sdd; /* Bit Frame SDD in Byte 1 of SENS_RES */ |
| 660 | uint8_t la_platform_config; /* Platform Config in Byte 2 of SENS_RES */ |
| 661 | uint8_t la_sel_info; /* Byte of SEL_RES */ |
| 662 | uint8_t la_nfcid1_len; /* NFCID1 (0, 4, 7 or 10 bytes) */ |
| 663 | uint8_t la_nfcid1[NCI_NFCID1_MAX_LEN]; /* if empty, NFCC will decide */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 664 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 665 | /* |
| 666 | ** Discovery Configuration Parameters for Listen B |
| 667 | */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 668 | bool lb_enable; /* TRUE if listening B */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 669 | uint8_t lb_sensb_info; /* Byte 2 of Protocol Info within SENSB_RES */ |
| 670 | uint8_t lb_nfcid0_len; /* NFCID0 (0, 1 or 4 bytes) */ |
| 671 | uint8_t |
| 672 | lb_nfcid0[NFA_LB_MAX_NFCID0_LEN]; /* if empty, NFCC will decide */ |
| 673 | uint8_t lb_app_data[NCI_PARAM_LEN_LB_APPDATA]; /* Bytes 6 - 9 in SENSB_RES */ |
| 674 | uint8_t lb_sfgi; /* Start-Up Frame Guard Time */ |
| 675 | uint8_t lb_adc_fo; /* Byte 12 in SENSB_RES */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 676 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 677 | /* |
| 678 | ** Discovery Configuration Parameters for Listen F |
| 679 | */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 680 | bool lf_enable; /* TRUE if listening F */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 681 | uint8_t lf_con_bitr_f; /* bit rate to listen */ |
| 682 | uint8_t lf_protocol_type; /* Supported Protocols */ |
| 683 | /* bit field indicating which lf_t3t_identifier are enabled */ |
| 684 | uint16_t lf_t3t_flags; |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 685 | uint8_t lf_t3t_identifier[NFA_LF_MAX_SC_NFCID2] |
| 686 | [NCI_SYSTEMCODE_LEN + NCI_NFCID2_LEN]; |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 687 | /* System Code and NFCID2 */ |
| 688 | uint8_t lf_t3t_pmm[NCI_T3T_PMM_LEN]; /* Bytes 10 - 17 in SENSF_RES */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 689 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 690 | /* |
| 691 | ** Discovery Configuration Parameters for Listen ISO-DEP |
| 692 | */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 693 | bool li_enable; /* TRUE if listening ISO-DEP */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 694 | uint8_t li_fwi; /* Frame Waiting Time Integer */ |
| 695 | uint8_t la_hist_bytes_len; /* historical bytes for Listen-A */ |
| 696 | uint8_t la_hist_bytes[NFA_LA_MAX_HIST_BYTES]; |
| 697 | uint8_t lb_h_info_resp_len; /* higher layer response for Listen-B */ |
| 698 | uint8_t lb_h_info_resp[NFA_LB_MAX_H_INFO_LEN]; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 699 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 700 | /* |
| 701 | ** Discovery Configuration Parameters for Listen NFC-DEP |
| 702 | */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 703 | bool ln_enable; /* TRUE if listening NFC-DEP */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 704 | uint8_t ln_wt; /* Waiting Time Integer */ |
| 705 | uint8_t ln_atr_res_gen_bytes_len; /* General bytes in ATR_RES */ |
| 706 | uint8_t ln_atr_res_gen_bytes[NCI_MAX_GEN_BYTES_LEN]; |
| 707 | uint8_t ln_atr_res_config; /* Optional parameters (PPt) in ATR_RES */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 708 | } tNFA_LISTEN_CFG; |
| 709 | |
| 710 | /* Data for NFA_UpdateRFCommParams () */ |
| 711 | typedef tNFC_RF_COMM_PARAMS tNFA_RF_COMM_PARAMS; |
| 712 | |
| 713 | /* RF Interface type */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 714 | #define NFA_INTERFACE_FRAME NFC_INTERFACE_FRAME |
| 715 | #define NFA_INTERFACE_ISO_DEP NFC_INTERFACE_ISO_DEP |
| 716 | #define NFA_INTERFACE_NFC_DEP NFC_INTERFACE_NFC_DEP |
| 717 | #define NFA_INTERFACE_MIFARE NFC_INTERFACE_MIFARE |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 718 | typedef tNFC_INTF_TYPE tNFA_INTF_TYPE; |
| 719 | |
| 720 | /******************************************************************************* |
| 721 | ** NDEF Definitions |
| 722 | *******************************************************************************/ |
| 723 | |
| 724 | /* Definitions for tNFA_TNF (NDEF type name format ID) */ |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 725 | /* Empty or no type specified */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 726 | #define NFA_TNF_EMPTY NDEF_TNF_EMPTY |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 727 | /* NFC Forum well-known type [NFC RTD] */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 728 | #define NFA_TNF_WKT NDEF_TNF_WKT |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 729 | /* Media-type as defined in RFC 2046 [RFC 2046] */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 730 | #define NFA_TNF_RFC2046_MEDIA NDEF_TNF_MEDIA |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 731 | /* Absolute URI as defined in RFC 3986 [RFC 3986] */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 732 | #define NFA_TNF_RFC3986_URI NDEF_TNF_URI |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 733 | /* NFC Forum external type [NFC RTD] */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 734 | #define NFA_TNF_EXTERNAL NDEF_TNF_EXT |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 735 | /* Unknown */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 736 | #define NFA_TNF_UNKNOWN NDEF_TNF_UNKNOWN |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 737 | /* Unchanged */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 738 | #define NFA_TNF_UNCHANGED NDEF_TNF_UNCHANGED |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 739 | /* Reserved */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 740 | #define NFA_TNF_RESERVED NDEF_TNF_RESERVED |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 741 | /* Used to register default NDEF type handler */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 742 | #define NFA_TNF_DEFAULT 0xFF |
| 743 | typedef uint8_t tNFA_TNF; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 744 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 745 | /* Definitions for tNFA_NDEF_URI_ID (Frequently used prefixes. For additional |
| 746 | * values, see [NFC RTD URI] */ |
| 747 | #define NFA_NDEF_URI_ID_ABSOLUTE 0x00 /* Unabridged URI. */ |
| 748 | #define NFA_NDEF_URI_ID_HTTP 0x03 /* http:// */ |
| 749 | #define NFA_NDEF_URI_ID_HTTPS 0x04 /* https:// */ |
| 750 | #define NFA_NDEF_URI_ID_TEL 0x05 /* tel: */ |
| 751 | #define NFA_NDEF_URI_ID_MAILTO 0x06 /* mailto: */ |
| 752 | #define NFA_NDEF_URI_ID_FTP 0x0D /* ftp:// */ |
| 753 | #define NFA_NDEF_URI_ID_FILE 0x1D /* file:// */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 754 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 755 | typedef uint8_t tNFA_NDEF_URI_ID; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 756 | |
| 757 | /* Events for tNFA_NDEF_CBACK */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 758 | /* NDEF record type registered. (In response to NFA_RegisterNDefTypeHandler) */ |
| 759 | #define NFA_NDEF_REGISTER_EVT 0 |
| 760 | /* Received an NDEF message with the registered type. See [tNFA_NDEF_DATA] */ |
| 761 | #define NFA_NDEF_DATA_EVT 1 |
| 762 | typedef uint8_t tNFA_NDEF_EVT; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 763 | |
| 764 | /* Structure for NFA_NDEF_REGISTER_EVT event data */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 765 | typedef struct { |
| 766 | tNFA_STATUS status; /* Status of the registration */ |
| 767 | tNFA_HANDLE ndef_type_handle; /* Handle for this NDEF type registration. */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 768 | } tNFA_NDEF_REGISTER; |
| 769 | |
| 770 | /* Structure for NFA_NDEF_DATA_EVT event data */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 771 | typedef struct { |
| 772 | tNFA_HANDLE ndef_type_handle; /* Handle for NDEF type registration. */ |
| 773 | uint8_t* p_data; /* Data buffer */ |
| 774 | uint32_t len; /* Length of data */ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 775 | } tNFA_NDEF_DATA; |
| 776 | |
| 777 | /* Union of all NDEF callback structures */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 778 | typedef union { |
| 779 | /* Structure for NFA_NDEF_REGISTER_EVT event data */ |
| 780 | tNFA_NDEF_REGISTER ndef_reg; |
| 781 | /* Structure for NFA_NDEF_DATA_EVT event data */ |
| 782 | tNFA_NDEF_DATA ndef_data; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 783 | } tNFA_NDEF_EVT_DATA; |
| 784 | |
| 785 | /* NFA_NDEF callback */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 786 | typedef void(tNFA_NDEF_CBACK)(tNFA_NDEF_EVT event, tNFA_NDEF_EVT_DATA* p_data); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 787 | |
| 788 | /* NFA VSC Callback */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 789 | typedef void(tNFA_VSC_CBACK)(uint8_t event, uint16_t param_len, |
| 790 | uint8_t* p_param); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 791 | |
| 792 | /***************************************************************************** |
| 793 | ** External Function Declarations |
| 794 | *****************************************************************************/ |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 795 | |
| 796 | /******************************************************************************* |
| 797 | ** |
| 798 | ** Function NFA_Init |
| 799 | ** |
| 800 | ** Description This function initializes control blocks for NFA |
| 801 | ** |
| 802 | ** p_hal_entry_tbl points to a table of HAL entry points |
| 803 | ** |
| 804 | ** NOTE: the buffer that p_hal_entry_tbl points must be |
| 805 | ** persistent until NFA is disabled. |
| 806 | ** |
| 807 | ** |
| 808 | ** Returns none |
| 809 | ** |
| 810 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 811 | extern void NFA_Init(tHAL_NFC_ENTRY* p_hal_entry_tbl); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 812 | |
| 813 | /******************************************************************************* |
| 814 | ** |
| 815 | ** Function NFA_Enable |
| 816 | ** |
| 817 | ** Description This function enables NFC. Prior to calling NFA_Enable, |
| 818 | ** the NFCC must be powered up, and ready to receive commands. |
| 819 | ** This function enables the tasks needed by NFC, opens the NCI |
| 820 | ** transport, resets the NFC controller, downloads patches to |
| 821 | ** the NFCC (if necessary), and initializes the NFC subsystems. |
| 822 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 823 | ** This function should only be called once - typically when |
| 824 | ** NFC is enabled during boot-up, or when NFC is enabled from a |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 825 | ** settings UI. Subsequent calls to NFA_Enable while NFA is |
| 826 | ** enabling or enabled will be ignored. When the NFC startup |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 827 | ** procedure is completed, an NFA_DM_ENABLE_EVT is returned to |
| 828 | ** the application using the tNFA_DM_CBACK. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 829 | ** |
| 830 | ** The tNFA_CONN_CBACK parameter is used to register a callback |
| 831 | ** for polling, p2p and card emulation events. |
| 832 | ** |
| 833 | ** |
| 834 | ** Returns NFA_STATUS_OK if successfully initiated |
| 835 | ** NFA_STATUS_FAILED otherwise |
| 836 | ** |
| 837 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 838 | extern tNFA_STATUS NFA_Enable(tNFA_DM_CBACK* p_dm_cback, |
| 839 | tNFA_CONN_CBACK* p_conn_cback); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 840 | |
| 841 | /******************************************************************************* |
| 842 | ** |
| 843 | ** Function NFA_Disable |
| 844 | ** |
| 845 | ** Description This function is called to shutdown NFC. The tasks for NFC |
| 846 | ** are terminated, and clean up routines are performed. This |
| 847 | ** function is typically called during platform shut-down, or |
| 848 | ** when NFC is disabled from a settings UI. When the NFC |
| 849 | ** shutdown procedure is completed, an NFA_DM_DISABLE_EVT is |
| 850 | ** returned to the application using the tNFA_DM_CBACK. |
| 851 | ** |
| 852 | ** The platform should wait until the NFC_DISABLE_REVT is |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 853 | ** received before powering down the NFC chip and NCI |
| 854 | ** transport. This is required to so that NFA can gracefully |
| 855 | ** shut down any open connections. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 856 | ** |
| 857 | ** Returns NFA_STATUS_OK if successfully initiated |
| 858 | ** NFA_STATUS_FAILED otherwise |
| 859 | ** |
| 860 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 861 | extern tNFA_STATUS NFA_Disable(bool graceful); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 862 | |
| 863 | /******************************************************************************* |
| 864 | ** |
| 865 | ** Function NFA_SetConfig |
| 866 | ** |
| 867 | ** Description Set the configuration parameters to NFCC. The result is |
| 868 | ** reported with an NFA_DM_SET_CONFIG_EVT in the tNFA_DM_CBACK |
| 869 | ** callback. |
| 870 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 871 | ** Note: If RF discovery is started, |
| 872 | ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should |
| 873 | ** happen before calling this function. Most Configuration |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 874 | ** parameters are related to RF discovery. |
| 875 | ** |
| 876 | ** Returns NFA_STATUS_OK if successfully initiated |
| 877 | ** NFA_STATUS_BUSY if previous setting is on-going |
| 878 | ** NFA_STATUS_FAILED otherwise |
| 879 | ** |
| 880 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 881 | extern tNFA_STATUS NFA_SetConfig(tNFA_PMID param_id, uint8_t length, |
| 882 | uint8_t* p_data); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 883 | |
| 884 | /******************************************************************************* |
| 885 | ** |
| 886 | ** Function NFA_GetConfig |
| 887 | ** |
| 888 | ** Description Get the configuration parameters from NFCC. The result is |
| 889 | ** reported with an NFA_DM_GET_CONFIG_EVT in the tNFA_DM_CBACK |
| 890 | ** callback. |
| 891 | ** |
| 892 | ** Returns NFA_STATUS_OK if successfully initiated |
| 893 | ** NFA_STATUS_FAILED otherwise |
| 894 | ** |
| 895 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 896 | extern tNFA_STATUS NFA_GetConfig(uint8_t num_ids, tNFA_PMID* p_param_ids); |
Ravishinde | 26233bb | 2018-08-06 22:16:08 +0530 | [diff] [blame] | 897 | #if (NXP_EXTNS == TRUE) |
| 898 | /******************************************************************************* |
| 899 | ** |
| 900 | ** Function NFA_SetTransitConfig |
| 901 | ** |
| 902 | ** Description Get the Transit configuration value from NFC Service. The |
| 903 | ** result is reported with an NFA_DM_SET_TRANSIT_CONFIG_EVT in |
| 904 | ** the tNFA_DM_CBACK callback. |
| 905 | ** |
| 906 | ** Returns NFA_STATUS_OK if successfully initiated |
| 907 | ** NFA_STATUS_BUSY if previous setting is on-going |
| 908 | ** NFA_STATUS_FAILED otherwise |
| 909 | ** |
| 910 | *******************************************************************************/ |
| 911 | extern tNFA_STATUS NFA_SetTransitConfig(std::string config); |
| 912 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 913 | /******************************************************************************* |
| 914 | ** |
| 915 | ** Function NFA_RequestExclusiveRfControl |
| 916 | ** |
| 917 | ** Description Request exclusive control of NFC. |
| 918 | ** - Previous behavior (polling/tag reading, DH card emulation) |
| 919 | ** will be suspended . |
| 920 | ** - Polling and listening will be done based on the specified |
| 921 | ** params |
| 922 | ** |
| 923 | ** The NFA_EXCLUSIVE_RF_CONTROL_STARTED_EVT event of |
| 924 | ** tNFA_CONN_CBACK indicates the status of the operation. |
| 925 | ** |
| 926 | ** NFA_ACTIVATED_EVT and NFA_DEACTIVATED_EVT indicates link |
| 927 | ** activation/deactivation. |
| 928 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 929 | ** NFA_SendRawFrame is used to send data to the peer. |
| 930 | ** NFA_DATA_EVT indicates data from the peer. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 931 | ** |
| 932 | ** If a tag is activated, then the NFA_RW APIs may be used to |
| 933 | ** send commands to the tag. Incoming NDEF messages are sent to |
| 934 | ** the NDEF callback. |
| 935 | ** |
| 936 | ** Once exclusive RF control has started, NFA will not activate |
| 937 | ** LLCP internally. The application has exclusive control of |
| 938 | ** the link. |
| 939 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 940 | ** Note: If RF discovery is started, |
| 941 | ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should |
| 942 | ** happen before calling this function |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 943 | ** |
| 944 | ** Returns NFA_STATUS_OK if successfully initiated |
| 945 | ** NFA_STATUS_FAILED otherwise |
| 946 | ** |
| 947 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 948 | extern tNFA_STATUS NFA_RequestExclusiveRfControl(tNFA_TECHNOLOGY_MASK poll_mask, |
| 949 | tNFA_LISTEN_CFG* p_listen_cfg, |
| 950 | tNFA_CONN_CBACK* p_conn_cback, |
| 951 | tNFA_NDEF_CBACK* p_ndef_cback); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 952 | |
| 953 | /******************************************************************************* |
| 954 | ** |
| 955 | ** Function NFA_ReleaseExclusiveRfControl |
| 956 | ** |
| 957 | ** Description Release exclusive control of NFC. Once released, behavior |
| 958 | ** prior to obtaining exclusive RF control will resume. |
| 959 | ** |
| 960 | Note?? |
| 961 | ** Returns NFA_STATUS_OK if successfully initiated |
| 962 | ** NFA_STATUS_FAILED otherwise |
| 963 | ** |
| 964 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 965 | extern tNFA_STATUS NFA_ReleaseExclusiveRfControl(void); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 966 | |
| 967 | /******************************************************************************* |
| 968 | ** |
| 969 | ** Function NFA_EnablePolling |
| 970 | ** |
| 971 | ** Description Enable polling for technologies specified by poll_mask. |
| 972 | ** |
| 973 | ** The following events (notified using the connection |
| 974 | ** callback registered with NFA_Enable) are generated during |
| 975 | ** polling: |
| 976 | ** |
| 977 | ** - NFA_POLL_ENABLED_EVT indicates whether or not polling |
| 978 | ** successfully enabled. |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 979 | ** - NFA_DISC_RESULT_EVT indicates there are more than one |
| 980 | ** devices, so application must select one of tags by calling |
| 981 | ** NFA_Select(). |
| 982 | ** - NFA_SELECT_RESULT_EVT indicates whether previous selection |
| 983 | ** was successful or not. If it was failed then application |
| 984 | ** must select again or deactivate by calling |
| 985 | ** NFA_Deactivate(). |
| 986 | ** - NFA_ACTIVATED_EVT is generated when an NFC link is |
| 987 | ** activated. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 988 | ** - NFA_NDEF_DETECT_EVT is generated if tag is activated |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 989 | ** - NFA_LLCP_ACTIVATED_EVT/NFA_LLCP_DEACTIVATED_EVT is |
| 990 | ** generated if NFC-DEP is activated |
| 991 | ** - NFA_DEACTIVATED_EVT will be returned after deactivating |
| 992 | ** NFC link. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 993 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 994 | ** Note: If RF discovery is started, |
| 995 | ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should |
| 996 | ** happen before calling this function |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 997 | ** |
| 998 | ** Returns NFA_STATUS_OK if successfully initiated |
| 999 | ** NFA_STATUS_FAILED otherwise |
| 1000 | ** |
| 1001 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1002 | extern tNFA_STATUS NFA_EnablePolling(tNFA_TECHNOLOGY_MASK poll_mask); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1003 | |
| 1004 | /******************************************************************************* |
| 1005 | ** |
| 1006 | ** Function NFA_DisablePolling |
| 1007 | ** |
| 1008 | ** Description Disable polling |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1009 | ** NFA_POLL_DISABLED_EVT will be returned after stopping |
| 1010 | ** polling. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1011 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1012 | ** Note: If RF discovery is started, |
| 1013 | ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should |
| 1014 | ** happen before calling this function |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1015 | ** |
| 1016 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1017 | ** NFA_STATUS_FAILED otherwise |
| 1018 | ** |
| 1019 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1020 | extern tNFA_STATUS NFA_DisablePolling(void); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1021 | |
| 1022 | /******************************************************************************* |
| 1023 | ** |
| 1024 | ** Function NFA_EnableListening |
| 1025 | ** |
| 1026 | ** Description Enable listening. |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1027 | ** NFA_LISTEN_ENABLED_EVT will be returned after listening is |
| 1028 | ** allowed. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1029 | ** |
| 1030 | ** The actual listening technologies are specified by other NFA |
| 1031 | ** API functions. Such functions include (but not limited to) |
| 1032 | ** NFA_CeConfigureUiccListenTech. |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1033 | ** If NFA_DisableListening () is called to ignore the listening |
| 1034 | ** technologies, NFA_EnableListening () is called to restore |
| 1035 | ** the listening technologies set by these functions. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1036 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1037 | ** Note: If RF discovery is started, |
| 1038 | ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should |
| 1039 | ** happen before calling this function |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1040 | ** |
| 1041 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1042 | ** NFA_STATUS_FAILED otherwise |
| 1043 | ** |
| 1044 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1045 | extern tNFA_STATUS NFA_EnableListening(void); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1046 | |
| 1047 | /******************************************************************************* |
| 1048 | ** |
| 1049 | ** Function NFA_DisableListening |
| 1050 | ** |
| 1051 | ** Description Disable listening |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1052 | ** NFA_LISTEN_DISABLED_EVT will be returned after stopping |
| 1053 | ** listening. This function is called to exclude listen at RF |
| 1054 | ** discovery. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1055 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1056 | ** Note: If RF discovery is started, |
| 1057 | ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should |
| 1058 | ** happen before calling this function |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1059 | ** |
| 1060 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1061 | ** NFA_STATUS_FAILED otherwise |
| 1062 | ** |
| 1063 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1064 | extern tNFA_STATUS NFA_DisableListening(void); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1065 | |
Ayush | df7ad67 | 2018-07-30 12:02:58 +0530 | [diff] [blame] | 1066 | #if (NXP_EXTNS == TRUE) |
| 1067 | /******************************************************************************* |
| 1068 | ** |
| 1069 | ** Function NFA_ChangeDiscoveryTech |
| 1070 | ** |
| 1071 | ** Description Change listening mask. |
| 1072 | ** NFA_LISTEN_CHANGED_EVT will be returned. |
| 1073 | ** |
| 1074 | ** The actual listening technologies are specified by other NFA |
| 1075 | ** API functions. Such functions include (but not limited to) |
| 1076 | ** NFA_CeConfigureUiccListenTech. |
| 1077 | ** If NFA_DisableListening () is called to ignore the listening technologies, |
| 1078 | ** NFA_EnableListening () is called to restore the listening technologies |
| 1079 | ** set by these functions. NFA_ChangeDiscoveryTech() is called to set the listening mask. |
| 1080 | ** |
| 1081 | ** Note: If RF discovery is started, NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT |
| 1082 | ** may happen before calling this function |
| 1083 | ** |
| 1084 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1085 | ** NFA_STATUS_FAILED otherwise |
| 1086 | ** |
| 1087 | *******************************************************************************/ |
| 1088 | extern tNFA_STATUS NFA_ChangeDiscoveryTech (tNFA_TECHNOLOGY_MASK pollTech, tNFA_TECHNOLOGY_MASK listenTech); |
| 1089 | #endif |
nxpandroid | 3e4012e | 2016-08-01 19:09:55 +0530 | [diff] [blame] | 1090 | /******************************************************************************* |
| 1091 | ** |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1092 | ** Function NFA_PauseP2p |
| 1093 | ** |
| 1094 | ** Description Pause P2P services. |
| 1095 | ** NFA_P2P_PAUSED_EVT will be returned after P2P services are |
| 1096 | ** disabled. |
| 1097 | ** |
| 1098 | ** The P2P services enabled by NFA_P2p* API functions are not |
| 1099 | ** available. NFA_ResumeP2p() is called to resume the P2P |
| 1100 | ** services. |
| 1101 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1102 | ** Note: If RF discovery is started, |
| 1103 | ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should |
| 1104 | ** happen before calling this function |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1105 | ** |
| 1106 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1107 | ** NFA_STATUS_FAILED otherwise |
| 1108 | ** |
| 1109 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1110 | extern tNFA_STATUS NFA_PauseP2p(void); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1111 | |
| 1112 | /******************************************************************************* |
| 1113 | ** |
| 1114 | ** Function NFA_ResumeP2p |
| 1115 | ** |
| 1116 | ** Description Resume P2P services. |
| 1117 | ** NFA_P2P_RESUMED_EVT will be returned after P2P services are. |
| 1118 | ** enables again. |
| 1119 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1120 | ** Note: If RF discovery is started, |
| 1121 | ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should |
| 1122 | ** happen before calling this function |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1123 | ** |
| 1124 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1125 | ** NFA_STATUS_FAILED otherwise |
| 1126 | ** |
| 1127 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1128 | extern tNFA_STATUS NFA_ResumeP2p(void); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1129 | |
| 1130 | /******************************************************************************* |
| 1131 | ** |
| 1132 | ** Function NFA_SetP2pListenTech |
| 1133 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1134 | ** Description This function is called to set listen technology for |
| 1135 | ** NFC-DEP. This funtion may be called before or after starting |
| 1136 | ** any server on NFA P2P/CHO/SNEP. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1137 | ** If there is no technology for NFC-DEP, P2P listening will be |
| 1138 | ** stopped. |
| 1139 | ** |
| 1140 | ** NFA_SET_P2P_LISTEN_TECH_EVT without data will be returned. |
| 1141 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1142 | ** Note: If RF discovery is started, |
| 1143 | ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should |
| 1144 | ** happen before calling this function |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1145 | ** |
| 1146 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1147 | ** NFA_STATUS_FAILED otherwise |
| 1148 | ** |
| 1149 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1150 | extern tNFA_STATUS NFA_SetP2pListenTech(tNFA_TECHNOLOGY_MASK tech_mask); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1151 | |
| 1152 | /******************************************************************************* |
| 1153 | ** |
| 1154 | ** Function NFA_StartRfDiscovery |
| 1155 | ** |
| 1156 | ** Description Start RF discovery |
| 1157 | ** RF discovery parameters shall be set by other APIs. |
| 1158 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1159 | ** An NFA_RF_DISCOVERY_STARTED_EVT indicates whether starting |
| 1160 | ** was successful or not. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1161 | ** |
| 1162 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1163 | ** NFA_STATUS_FAILED otherwise |
| 1164 | ** |
| 1165 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1166 | extern tNFA_STATUS NFA_StartRfDiscovery(void); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1167 | |
| 1168 | /******************************************************************************* |
| 1169 | ** |
| 1170 | ** Function NFA_StopRfDiscovery |
| 1171 | ** |
| 1172 | ** Description Stop RF discovery |
| 1173 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1174 | ** An NFA_RF_DISCOVERY_STOPPED_EVT indicates whether stopping |
| 1175 | ** was successful or not. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1176 | ** |
| 1177 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1178 | ** NFA_STATUS_FAILED otherwise |
| 1179 | ** |
| 1180 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1181 | extern tNFA_STATUS NFA_StopRfDiscovery(void); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1182 | |
| 1183 | /******************************************************************************* |
| 1184 | ** |
| 1185 | ** Function NFA_SetRfDiscoveryDuration |
| 1186 | ** |
| 1187 | ** Description Set the duration of the single discovery period in [ms]. |
| 1188 | ** Allowable range: 0 ms to 0xFFFF ms. |
| 1189 | ** |
| 1190 | ** Note: If discovery is already started, the application should |
| 1191 | ** call NFA_StopRfDiscovery prior to calling |
| 1192 | ** NFA_SetRfDiscoveryDuration, and then call |
| 1193 | ** NFA_StartRfDiscovery afterwards to restart discovery using |
| 1194 | ** the new duration. |
| 1195 | ** |
| 1196 | ** Returns: |
| 1197 | ** NFA_STATUS_OK, if command accepted |
| 1198 | ** NFA_STATUS_FAILED: otherwise |
| 1199 | ** |
| 1200 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1201 | extern tNFA_STATUS NFA_SetRfDiscoveryDuration(uint16_t discovery_period_ms); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1202 | |
| 1203 | /******************************************************************************* |
| 1204 | ** |
| 1205 | ** Function NFA_Select |
| 1206 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1207 | ** Description Select one from detected devices by NFA_DISC_RESULT_EVT |
| 1208 | ** after the last discovery result is received. |
| 1209 | ** An NFA_SELECT_RESULT_EVT indicates whether selection was |
| 1210 | ** successful or not. If failed then application must select |
| 1211 | ** again or deactivate by NFA_Deactivate (). |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1212 | ** |
| 1213 | ** Returns NFA_STATUS_OK if successfully initiated |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1214 | ** NFA_STATUS_INVALID_PARAM if RF interface is not matched |
| 1215 | ** protocol |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1216 | ** NFA_STATUS_FAILED otherwise |
| 1217 | ** |
| 1218 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1219 | extern tNFA_STATUS NFA_Select(uint8_t rf_disc_id, tNFA_NFC_PROTOCOL protocol, |
| 1220 | tNFA_INTF_TYPE rf_interface); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1221 | |
| 1222 | /******************************************************************************* |
| 1223 | ** |
| 1224 | ** Function NFA_UpdateRFCommParams |
| 1225 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1226 | ** Description This function is called to update RF Communication |
| 1227 | ** parameters once the Frame RF Interface has been activated. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1228 | ** |
| 1229 | ** An NFA_UPDATE_RF_PARAM_RESULT_EVT indicates whether updating |
| 1230 | ** was successful or not. |
| 1231 | ** |
| 1232 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1233 | ** NFA_STATUS_FAILED otherwise |
| 1234 | ** |
| 1235 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1236 | extern tNFA_STATUS NFA_UpdateRFCommParams(tNFA_RF_COMM_PARAMS* p_params); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1237 | |
| 1238 | /******************************************************************************* |
| 1239 | ** |
| 1240 | ** Function NFA_Deactivate |
| 1241 | ** |
| 1242 | ** Description |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1243 | ** If sleep_mode=TRUE: |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1244 | ** Deselect the activated device by deactivating into sleep |
| 1245 | ** mode. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1246 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1247 | ** An NFA_DEACTIVATE_FAIL_EVT indicates that selection was |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1248 | ** not successful. Application can select another |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1249 | ** discovered device or deactivate by NFA_Deactivate () |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1250 | ** after receiving NFA_DEACTIVATED_EVT. |
| 1251 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1252 | ** Deactivating to sleep mode is not allowed when NFCC is |
| 1253 | ** in wait-for-host-select mode, or in listen-sleep states; |
| 1254 | ** NFA will deactivate to idle or discovery state for these |
| 1255 | ** cases respectively. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1256 | ** |
| 1257 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1258 | ** If sleep_mode=FALSE: |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1259 | ** Deactivate the connection (e.g. as a result of presence |
| 1260 | ** check failure) NFA_DEACTIVATED_EVT will indicate that |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1261 | ** link is deactivated. Polling/listening will resume |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1262 | ** (unless the nfcc is in wait_for-all-discoveries state) |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1263 | ** |
| 1264 | ** |
| 1265 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1266 | ** NFA_STATUS_FAILED otherwise |
| 1267 | ** |
| 1268 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1269 | extern tNFA_STATUS NFA_Deactivate(bool sleep_mode); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1270 | |
| 1271 | /******************************************************************************* |
| 1272 | ** |
| 1273 | ** Function NFA_SendRawFrame |
| 1274 | ** |
| 1275 | ** Description Send a raw frame over the activated interface with the NFCC. |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1276 | ** This function can only be called after NFC link is |
| 1277 | ** activated. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1278 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1279 | ** If the activated interface is a tag and auto-presence check |
| 1280 | ** is enabled then presence_check_start_delay can be used to |
| 1281 | ** indicate the delay in msec after which the next auto |
| 1282 | ** presence check command can be sent. |
| 1283 | ** NFA_DM_DEFAULT_PRESENCE_CHECK_START_DELAY can be used as the |
| 1284 | ** default value for the delay. |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1285 | ** |
| 1286 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1287 | ** NFA_STATUS_FAILED otherwise |
| 1288 | ** |
| 1289 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1290 | extern tNFA_STATUS NFA_SendRawFrame(uint8_t* p_raw_data, uint16_t data_len, |
| 1291 | uint16_t presence_check_start_delay); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1292 | |
| 1293 | /******************************************************************************* |
| 1294 | ** NDEF APIs |
| 1295 | *******************************************************************************/ |
| 1296 | |
| 1297 | /******************************************************************************* |
| 1298 | ** |
| 1299 | ** Function NFA_RegisterNDefTypeHandler |
| 1300 | ** |
| 1301 | ** Description This function allows the applications to register for |
| 1302 | ** specific types of NDEF records. When NDEF records are |
| 1303 | ** received, NFA will parse the record-type field, and pass |
| 1304 | ** the record to the registered tNFA_NDEF_CBACK. |
| 1305 | ** |
| 1306 | ** For records types which were not registered, the record will |
| 1307 | ** be sent to the default handler. A default type-handler may |
| 1308 | ** be registered by calling this NFA_RegisterNDefTypeHandler |
| 1309 | ** with tnf=NFA_TNF_DEFAULT. In this case, all un-registered |
| 1310 | ** record types will be sent to the callback. Only one default |
| 1311 | ** handler may be registered at a time. |
| 1312 | ** |
| 1313 | ** An NFA_NDEF_REGISTER_EVT will be sent to the tNFA_NDEF_CBACK |
| 1314 | ** to indicate that registration was successful, and provide a |
| 1315 | ** handle for this record type. |
| 1316 | ** |
| 1317 | ** |
| 1318 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1319 | ** NFA_STATUS_FAILED otherwise |
| 1320 | ** |
| 1321 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1322 | extern tNFA_STATUS NFA_RegisterNDefTypeHandler(bool handle_whole_message, |
| 1323 | tNFA_TNF tnf, |
| 1324 | uint8_t* p_type_name, |
| 1325 | uint8_t type_name_len, |
| 1326 | tNFA_NDEF_CBACK* p_ndef_cback); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1327 | |
| 1328 | /******************************************************************************* |
| 1329 | ** |
| 1330 | ** Function NFA_RegisterNDefUriHandler |
| 1331 | ** |
| 1332 | ** Description This API is a special-case of NFA_RegisterNDefTypeHandler |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1333 | ** with TNF=NFA_TNF_WKT, and type_name='U' (URI record); and |
| 1334 | ** allows registering for specific URI types (e.g. 'tel:' or |
| 1335 | ** 'mailto:'). |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1336 | ** |
| 1337 | ** An NFA_NDEF_REGISTER_EVT will be sent to the tNFA_NDEF_CBACK |
| 1338 | ** to indicate that registration was successful, and provide a |
| 1339 | ** handle for this registration. |
| 1340 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1341 | ** If uri_id=NFA_NDEF_URI_ID_ABSOLUTE, then p_abs_uri contains |
| 1342 | ** the unabridged URI. For all other uri_id values, the |
| 1343 | ** p_abs_uri parameter is ignored (i.e the URI prefix is |
| 1344 | ** implied by uri_id). |
| 1345 | ** |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1346 | ** See [NFC RTD URI] for more information. |
| 1347 | ** |
| 1348 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1349 | ** NFA_STATUS_FAILED otherwise |
| 1350 | ** |
| 1351 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1352 | extern tNFA_STATUS NFA_RegisterNDefUriHandler(bool handle_whole_message, |
| 1353 | tNFA_NDEF_URI_ID uri_id, |
| 1354 | uint8_t* p_abs_uri, |
| 1355 | uint8_t uri_id_len, |
| 1356 | tNFA_NDEF_CBACK* p_ndef_cback); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1357 | |
| 1358 | /******************************************************************************* |
| 1359 | ** |
| 1360 | ** Function NFA_DeregisterNDefTypeHandler |
| 1361 | ** |
| 1362 | ** Description Deregister NDEF record type handler. |
| 1363 | ** |
| 1364 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1365 | ** NFA_STATUS_FAILED otherwise |
| 1366 | ** |
| 1367 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1368 | extern tNFA_STATUS NFA_DeregisterNDefTypeHandler(tNFA_HANDLE ndef_type_handle); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1369 | |
| 1370 | /******************************************************************************* |
| 1371 | ** |
| 1372 | ** Function NFA_PowerOffSleepMode |
| 1373 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1374 | ** Description This function is called to enter or leave NFCC Power Off |
| 1375 | ** Sleep mode |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1376 | ** NFA_DM_PWR_MODE_CHANGE_EVT will be sent to indicate status. |
| 1377 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1378 | ** start_stop : TRUE if entering Power Off Sleep mode |
| 1379 | ** FALSE if leaving Power Off Sleep mode |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1380 | ** |
| 1381 | Note?? |
| 1382 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1383 | ** NFA_STATUS_FAILED otherwise |
| 1384 | ** |
| 1385 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1386 | extern tNFA_STATUS NFA_PowerOffSleepMode(bool start_stop); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1387 | |
| 1388 | /******************************************************************************* |
| 1389 | ** |
| 1390 | ** Function NFA_RegVSCback |
| 1391 | ** |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1392 | ** Description This function is called to register or de-register a |
| 1393 | ** callback function to receive Proprietary NCI response and |
| 1394 | ** notification events. |
| 1395 | ** The maximum number of callback functions allowed is |
| 1396 | ** NFC_NUM_VS_CBACKS |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1397 | ** |
| 1398 | ** Returns tNFC_STATUS |
| 1399 | ** |
| 1400 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1401 | extern tNFC_STATUS NFA_RegVSCback(bool is_register, tNFA_VSC_CBACK* p_cback); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1402 | |
| 1403 | /******************************************************************************* |
| 1404 | ** |
| 1405 | ** Function NFA_SendVsCommand |
| 1406 | ** |
| 1407 | ** Description This function is called to send an NCI Vendor Specific |
| 1408 | ** command to NFCC. |
| 1409 | ** |
| 1410 | ** oid - The opcode of the VS command. |
| 1411 | ** cmd_params_len - The command parameter len |
| 1412 | ** p_cmd_params - The command parameter |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1413 | ** p_cback - The callback function to receive the |
| 1414 | ** command status |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1415 | ** |
| 1416 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1417 | ** NFA_STATUS_FAILED otherwise |
| 1418 | ** |
| 1419 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1420 | extern tNFA_STATUS NFA_SendVsCommand(uint8_t oid, uint8_t cmd_params_len, |
| 1421 | uint8_t* p_cmd_params, |
| 1422 | tNFA_VSC_CBACK* p_cback); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1423 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1424 | /******************************************************************************* |
| 1425 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1426 | ** Function NFA_SendRawVsCommand |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1427 | ** |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1428 | ** Description This function is called to send raw vendor specific |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1429 | ** command to NFCC. |
| 1430 | ** |
| 1431 | ** cmd_params_len - The command parameter len |
| 1432 | ** p_cmd_params - The command parameter |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1433 | ** p_cback - The callback function to receive the |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1434 | ** command |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1435 | ** |
| 1436 | ** Returns NFA_STATUS_OK if successfully initiated |
| 1437 | ** NFA_STATUS_FAILED otherwise |
| 1438 | ** |
| 1439 | *******************************************************************************/ |
| 1440 | |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1441 | extern tNFA_STATUS NFA_SendRawVsCommand(uint8_t cmd_params_len, |
| 1442 | uint8_t* p_cmd_params, |
| 1443 | tNFA_VSC_CBACK* p_cback); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1444 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1445 | /******************************************************************************* |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1446 | ** Function: NFA_EnableDTA_TypeMode |
| 1447 | ** |
| 1448 | ** Description: Initialize and get global DTA type mode from .conf |
| 1449 | ** |
| 1450 | ** Returns: none: |
| 1451 | ** |
| 1452 | *******************************************************************************/ |
| 1453 | extern void NFA_EnableDtamode(tNFA_eDtaModes eDtaMode); |
| 1454 | |
| 1455 | /******************************************************************************* |
| 1456 | ** Function NFA_GetNCIVersion |
| 1457 | ** |
| 1458 | ** Description Called by higher layer to get the current nci |
| 1459 | ** version of nfc. |
| 1460 | ** |
| 1461 | ** Returns NCI version NCI2.0 / NCI1.0 |
| 1462 | ** |
| 1463 | *******************************************************************************/ |
| 1464 | extern uint8_t NFA_GetNCIVersion(); |
| 1465 | |
| 1466 | /******************************************************************************* |
| 1467 | ** Function: NFA_SetPowerSubStateForScreenState |
| 1468 | ** |
| 1469 | ** Description: This function send the current screen state |
| 1470 | ** |
| 1471 | ** Returns: NFA_STATUS_OK if successfully initiated |
| 1472 | ** NFA_STATUS_FAILED otherwise |
| 1473 | *******************************************************************************/ |
| 1474 | extern tNFA_STATUS NFA_SetPowerSubStateForScreenState(uint8_t ScreenState); |
| 1475 | |
| 1476 | #if (NXP_EXTNS == TRUE) |
| 1477 | /******************************************************************************* |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1478 | ** |
| 1479 | ** Function NFA_Send_Core_Reset |
| 1480 | ** |
| 1481 | ** Description Performs NCI Core Reset dynamically based on NCI version |
| 1482 | ** |
| 1483 | ** |
| 1484 | ** Returns SUCCESS/FAIL |
| 1485 | ** |
| 1486 | *******************************************************************************/ |
| 1487 | extern tNFA_STATUS NFA_Send_Core_Reset(); |
| 1488 | |
| 1489 | /******************************************************************************* |
| 1490 | ** |
| 1491 | ** Function NFA_Send_Core_Init |
| 1492 | ** |
| 1493 | ** Description Performs NCI Core Init dynamically based on NCI version |
| 1494 | ** |
| 1495 | ** |
| 1496 | ** Returns void |
| 1497 | ** |
| 1498 | *******************************************************************************/ |
| 1499 | extern void NFA_Send_Core_Init(uint8_t** p); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1500 | |
nxpandroid | 6154b73 | 2016-01-14 20:39:23 +0530 | [diff] [blame] | 1501 | /******************************************************************************* |
| 1502 | ** |
| 1503 | ** Function NFA_SetBootMode |
| 1504 | ** |
| 1505 | ** Description This function enables the boot mode for NFC. |
| 1506 | ** boot_mode 0 NORMAL_BOOT 1 FAST_BOOT |
| 1507 | ** By default , the mode is set to NORMAL_BOOT. |
| 1508 | |
| 1509 | ** |
| 1510 | ** Returns none |
| 1511 | ** |
| 1512 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1513 | extern void NFA_SetBootMode(uint8_t boot_mode); |
nxpandroid | 6154b73 | 2016-01-14 20:39:23 +0530 | [diff] [blame] | 1514 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1515 | |
| 1516 | /******************************************************************************* |
| 1517 | ** |
| 1518 | ** Function: NFA_GetMwVersion |
| 1519 | ** |
| 1520 | ** Description: This function gets the Middleware Version |
| 1521 | ** |
| 1522 | ** Returns: First 8 bit Major Version |
| 1523 | ** Last 8 bit Minor Version |
| 1524 | ** |
| 1525 | *******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1526 | extern tNFA_MW_VERSION NFA_GetMwVersion(); |
nxpandroid | 70cccc7 | 2016-11-18 19:58:22 +0530 | [diff] [blame] | 1527 | |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 1528 | extern void NFA_EE_HCI_Control(bool mode); |
| 1529 | extern tNFA_STATUS NFA_ResetNfcc(); |
nxpandroid | 70cccc7 | 2016-11-18 19:58:22 +0530 | [diff] [blame] | 1530 | /******************************************************************************* |
| 1531 | ** |
| 1532 | ** Function NFA_checkNfcStateBusy() |
| 1533 | ** |
| 1534 | ** Description This function returns whether NFC process is busy or not. |
| 1535 | ** |
| 1536 | ** Returns if Nfc state busy return true otherwise false. |
| 1537 | ** |
| 1538 | +*******************************************************************************/ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 1539 | extern bool NFA_checkNfcStateBusy(); |
Ravishinde | 26233bb | 2018-08-06 22:16:08 +0530 | [diff] [blame] | 1540 | /******************************************************************************* |
| 1541 | ** |
| 1542 | ** Function nfc_ncif_getMaxRoutingTableSize |
| 1543 | ** |
| 1544 | ** Description This function is called to get the Max supported routing |
| 1545 | *Table size. |
| 1546 | ** |
| 1547 | ** Returns Max supported routing Table size |
| 1548 | ** |
| 1549 | *******************************************************************************/ |
| 1550 | extern uint16_t nfc_ncif_getMaxRoutingTableSize(); |
| 1551 | |
| 1552 | /******************************************************************************* |
| 1553 | ** |
| 1554 | ** Function: NFA_SetPreferredUiccId |
| 1555 | ** |
| 1556 | ** Description: Set Preferred Uicc ID |
| 1557 | ** 0x02 - UICC1 |
| 1558 | ** 0x81 - UICC2 |
| 1559 | ** |
| 1560 | ** Returns: none: |
| 1561 | ** |
| 1562 | *******************************************************************************/ |
| 1563 | extern void NFA_SetPreferredUiccId(uint8_t uicc_id); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1564 | #endif |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1565 | #endif /* NFA_API_H */ |