Home | History | Annotate | Download | only in include
      1 /******************************************************************************
      2  *
      3  *  Copyright (C) 2009-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 /******************************************************************************
     20  *
     21  *  This file contains the Near Field Communication (NFC) API function
     22  *  external definitions.
     23  *
     24  ******************************************************************************/
     25 
     26 #ifndef NFC_API_H
     27 #define NFC_API_H
     28 
     29 #include "gki.h"
     30 #include "nci_defs.h"
     31 #include "nfc_hal_api.h"
     32 #include "nfc_target.h"
     33 
     34 #include "vendor_cfg.h"
     35 
     36 /* NFC application return status codes */
     37 /* Command succeeded    */
     38 #define NFC_STATUS_OK NCI_STATUS_OK
     39 /* Command is rejected. */
     40 #define NFC_STATUS_REJECTED NCI_STATUS_REJECTED
     41 /* Message is corrupted */
     42 #define NFC_STATUS_MSG_CORRUPTED NCI_STATUS_MESSAGE_CORRUPTED
     43 /* buffer full          */
     44 #define NFC_STATUS_BUFFER_FULL NCI_STATUS_BUFFER_FULL
     45 /* failed               */
     46 #define NFC_STATUS_FAILED NCI_STATUS_FAILED
     47 /* not initialized      */
     48 #define NFC_STATUS_NOT_INITIALIZED NCI_STATUS_NOT_INITIALIZED
     49 /* Syntax error         */
     50 #define NFC_STATUS_SYNTAX_ERROR NCI_STATUS_SYNTAX_ERROR
     51 /* Semantic error       */
     52 #define NFC_STATUS_SEMANTIC_ERROR NCI_STATUS_SEMANTIC_ERROR
     53 /* Unknown NCI Group ID */
     54 #define NFC_STATUS_UNKNOWN_GID NCI_STATUS_UNKNOWN_GID
     55 /* Unknown NCI Opcode   */
     56 #define NFC_STATUS_UNKNOWN_OID NCI_STATUS_UNKNOWN_OID
     57 /* Invalid Parameter    */
     58 #define NFC_STATUS_INVALID_PARAM NCI_STATUS_INVALID_PARAM
     59 /* Message size too big */
     60 #define NFC_STATUS_MSG_SIZE_TOO_BIG NCI_STATUS_MSG_SIZE_TOO_BIG
     61 /* Already started      */
     62 #define NFC_STATUS_ALREADY_STARTED NCI_STATUS_ALREADY_STARTED
     63 /* Activation Failed    */
     64 #define NFC_STATUS_ACTIVATION_FAILED NCI_STATUS_ACTIVATION_FAILED
     65 /* Tear Down Error      */
     66 #define NFC_STATUS_TEAR_DOWN NCI_STATUS_TEAR_DOWN
     67 /* RF transmission error*/
     68 #define NFC_STATUS_RF_TRANSMISSION_ERR NCI_STATUS_RF_TRANSMISSION_ERR
     69 /* RF protocol error    */
     70 #define NFC_STATUS_RF_PROTOCOL_ERR NCI_STATUS_RF_PROTOCOL_ERR
     71 /* RF Timeout           */
     72 #define NFC_STATUS_TIMEOUT NCI_STATUS_TIMEOUT
     73 /* EE Intf activate err */
     74 #define NFC_STATUS_EE_INTF_ACTIVE_FAIL NCI_STATUS_EE_INTF_ACTIVE_FAIL
     75 /* EE transmission error*/
     76 #define NFC_STATUS_EE_TRANSMISSION_ERR NCI_STATUS_EE_TRANSMISSION_ERR
     77 /* EE protocol error    */
     78 #define NFC_STATUS_EE_PROTOCOL_ERR NCI_STATUS_EE_PROTOCOL_ERR
     79 /* EE Timeout           */
     80 #define NFC_STATUS_EE_TIMEOUT NCI_STATUS_EE_TIMEOUT
     81 
     82 /* 0xE0 ~0xFF are proprietary status codes */
     83 /* Command started successfully                     */
     84 #define NFC_STATUS_CMD_STARTED 0xE3
     85 /* NFCC Timeout in responding to an NCI command     */
     86 #define NFC_STATUS_HW_TIMEOUT 0xE4
     87 /* More (same) event to follow                      */
     88 #define NFC_STATUS_CONTINUE 0xE5
     89 /* API is called to perform illegal function        */
     90 #define NFC_STATUS_REFUSED 0xE6
     91 /* Wrong format of R-APDU, CC file or NDEF file     */
     92 #define NFC_STATUS_BAD_RESP 0xE7
     93 /* 7816 Status Word is not command complete(0x9000) */
     94 #define NFC_STATUS_CMD_NOT_CMPLTD 0xE8
     95 /* Out of GKI buffers                               */
     96 #define NFC_STATUS_NO_BUFFERS 0xE9
     97 /* Protocol mismatch between API and activated one  */
     98 #define NFC_STATUS_WRONG_PROTOCOL 0xEA
     99 /* Another Tag command is already in progress       */
    100 #define NFC_STATUS_BUSY 0xEB
    101 
    102 /* Link Loss                  */
    103 #define NFC_STATUS_LINK_LOSS 0xFC
    104 /* data len exceeds MIU       */
    105 #define NFC_STATUS_BAD_LENGTH 0xFD
    106 /* invalid handle             */
    107 #define NFC_STATUS_BAD_HANDLE 0xFE
    108 /* congested                  */
    109 #define NFC_STATUS_CONGESTED 0xFF
    110 typedef uint8_t tNFC_STATUS;
    111 
    112 /**********************************************
    113  * NFC Config Parameter IDs defined by NCI
    114  **********************************************/
    115 #define NFC_PMID_TOTAL_DURATION NCI_PARAM_ID_TOTAL_DURATION
    116 #define NFC_PMID_CON_DEVICES_LIMIT NCI_PARAM_ID_CON_DEVICES_LIMIT
    117 #define NFC_PMID_PA_BAILOUT NCI_PARAM_ID_PA_BAILOUT
    118 #define NFC_PMID_CON_DISCOVERY_PARAM NCI_PARAM_ID_CON_DISCOVERY_PARAM
    119 #define NFC_PMID_PB_AFI NCI_PARAM_ID_PB_AFI
    120 #define NFC_PMID_PB_BAILOUT NCI_PARAM_ID_PB_BAILOUT
    121 #define NFC_PMID_PB_ATTRIB_PARAM1 NCI_PARAM_ID_PB_ATTRIB_PARAM1
    122 #define NFC_PMID_PF_BIT_RATE NCI_PARAM_ID_PF_BIT_RATE
    123 #define NFC_PMID_PF_RC NCI_PARAM_ID_PF_RC
    124 #define NFC_PMID_PB_H_INFO NCI_PARAM_ID_PB_H_INFO
    125 #define NFC_PMID_BITR_NFC_DEP NCI_PARAM_ID_BITR_NFC_DEP
    126 #define NFC_PMID_ATR_REQ_GEN_BYTES NCI_PARAM_ID_ATR_REQ_GEN_BYTES
    127 #define NFC_PMID_ATR_REQ_CONFIG NCI_PARAM_ID_ATR_REQ_CONFIG
    128 #define NFC_PMID_LA_HIST_BY NCI_PARAM_ID_LA_HIST_BY
    129 #define NFC_PMID_LA_NFCID1 NCI_PARAM_ID_LA_NFCID1
    130 #define NFC_PMID_PI_BIT_RATE NCI_PARAM_ID_PI_BIT_RATE
    131 #define NFC_PMID_LA_BIT_FRAME_SDD NCI_PARAM_ID_LA_BIT_FRAME_SDD
    132 #define NFC_PMID_LA_PLATFORM_CONFIG NCI_PARAM_ID_LA_PLATFORM_CONFIG
    133 #define NFC_PMID_LA_SEL_INFO NCI_PARAM_ID_LA_SEL_INFO
    134 #define NFC_PMID_LI_BIT_RATE NCI_PARAM_ID_LI_BIT_RATE
    135 #define NFC_PMID_LB_SENSB_INFO NCI_PARAM_ID_LB_SENSB_INFO
    136 #define NFC_PMID_LB_PROTOCOL NCI_PARAM_ID_LB_PROTOCOL
    137 #define NFC_PMID_LB_H_INFO NCI_PARAM_ID_LB_H_INFO_RSP
    138 #define NFC_PMID_LB_NFCID0 NCI_PARAM_ID_LB_NFCID0
    139 #define NFC_PMID_LB_APPDATA NCI_PARAM_ID_LB_APPDATA
    140 #define NFC_PMID_LB_SFGI NCI_PARAM_ID_LB_SFGI
    141 #define NFC_PMID_LB_ADC_FO NCI_PARAM_ID_LB_ADC_FO
    142 #define NFC_PMID_LF_T3T_ID1 NCI_PARAM_ID_LF_T3T_ID1
    143 #define NFC_PMID_LF_T3T_ID2 NCI_PARAM_ID_LF_T3T_ID2
    144 #define NFC_PMID_LF_T3T_ID3 NCI_PARAM_ID_LF_T3T_ID3
    145 #define NFC_PMID_LF_T3T_ID4 NCI_PARAM_ID_LF_T3T_ID4
    146 #define NFC_PMID_LF_T3T_ID5 NCI_PARAM_ID_LF_T3T_ID5
    147 #define NFC_PMID_LF_T3T_ID6 NCI_PARAM_ID_LF_T3T_ID6
    148 #define NFC_PMID_LF_T3T_ID7 NCI_PARAM_ID_LF_T3T_ID7
    149 #define NFC_PMID_LF_T3T_ID8 NCI_PARAM_ID_LF_T3T_ID8
    150 #define NFC_PMID_LF_T3T_ID9 NCI_PARAM_ID_LF_T3T_ID9
    151 #define NFC_PMID_LF_T3T_ID10 NCI_PARAM_ID_LF_T3T_ID10
    152 #define NFC_PMID_LF_T3T_ID11 NCI_PARAM_ID_LF_T3T_ID11
    153 #define NFC_PMID_LF_T3T_ID12 NCI_PARAM_ID_LF_T3T_ID12
    154 #define NFC_PMID_LF_T3T_ID13 NCI_PARAM_ID_LF_T3T_ID13
    155 #define NFC_PMID_LF_T3T_ID14 NCI_PARAM_ID_LF_T3T_ID14
    156 #define NFC_PMID_LF_T3T_ID15 NCI_PARAM_ID_LF_T3T_ID15
    157 #define NFC_PMID_LF_T3T_ID16 NCI_PARAM_ID_LF_T3T_ID16
    158 #define NFC_PMID_LF_PROTOCOL NCI_PARAM_ID_LF_PROTOCOL
    159 #define NFC_PMID_LF_T3T_PMM NCI_PARAM_ID_LF_T3T_PMM
    160 #define NFC_PMID_LF_T3T_MAX NCI_PARAM_ID_LF_T3T_MAX
    161 #define NFC_PMID_LF_T3T_FLAGS2 NCI_PARAM_ID_LF_T3T_FLAGS2
    162 #define NFC_PMID_FWI NCI_PARAM_ID_FWI
    163 #define NFC_PMID_LF_CON_BITR_F NCI_PARAM_ID_LF_CON_BITR_F
    164 #define NFC_PMID_WT NCI_PARAM_ID_WT
    165 #define NFC_PMID_ATR_RES_GEN_BYTES NCI_PARAM_ID_ATR_RES_GEN_BYTES
    166 #define NFC_PMID_ATR_RSP_CONFIG NCI_PARAM_ID_ATR_RSP_CONFIG
    167 #define NFC_PMID_RF_FIELD_INFO NCI_PARAM_ID_RF_FIELD_INFO
    168 #define NFC_PMID_NFC_DEP_OP NCI_PARAM_ID_NFC_DEP_OP
    169 #define NFC_PARAM_ID_RF_EE_ACTION NCI_PARAM_ID_RF_EE_ACTION
    170 #define NFC_PARAM_ID_ISO_DEP_OP NCI_PARAM_ID_ISO_DEP_OP
    171 
    172 /* Technology based routing  */
    173 #define NFC_ROUTE_TAG_TECH NCI_ROUTE_TAG_TECH
    174 /* Protocol based routing  */
    175 #define NFC_ROUTE_TAG_PROTO NCI_ROUTE_TAG_PROTO
    176 #define NFC_ROUTE_TAG_AID NCI_ROUTE_TAG_AID /* AID routing */
    177 /* tag, len, 2 byte value for technology/protocol based routing */
    178 #define NFC_ROUTE_TLV_ENTRY_SIZE 4
    179 
    180 /* For routing */
    181 #define NFC_DH_ID NCI_DH_ID /* for DH */
    182 /* To identify the loopback test */
    183 /* use a proprietary range */
    184 #define NFC_TEST_ID NCI_TEST_ID
    185 
    186 typedef uint8_t tNFC_PMID;
    187 #define NFC_TL_SIZE 2
    188 #define NFC_SAVED_CMD_SIZE 2
    189 
    190 typedef tNCI_DISCOVER_MAPS tNFC_DISCOVER_MAPS;
    191 typedef tNCI_DISCOVER_PARAMS tNFC_DISCOVER_PARAMS;
    192 
    193 /* all NFC Manager Callback functions have prototype like void (cback) (uint8_t
    194  * event, void *p_data)
    195  * tNFC_DATA_CBACK uses connection id as the first parameter; range 0x00-0x0F.
    196  * tNFC_DISCOVER_CBACK uses tNFC_DISCOVER_EVT; range  0x4000 ~
    197  * tNFC_RESPONSE_CBACK uses tNFC_RESPONSE_EVT; range  0x5000 ~
    198  */
    199 
    200 #define NFC_FIRST_DEVT 0x4000
    201 #define NFC_FIRST_REVT 0x5000
    202 #define NFC_FIRST_CEVT 0x6000
    203 #define NFC_FIRST_TEVT 0x8000
    204 
    205 /* the events reported on tNFC_RESPONSE_CBACK */
    206 enum {
    207   NFC_ENABLE_REVT = NFC_FIRST_REVT, /* 0  Enable event                  */
    208   NFC_DISABLE_REVT,                 /* 1  Disable event                 */
    209   NFC_SET_CONFIG_REVT,              /* 2  Set Config Response           */
    210   NFC_GET_CONFIG_REVT,              /* 3  Get Config Response           */
    211   NFC_NFCEE_DISCOVER_REVT,          /* 4  Discover NFCEE response       */
    212   NFC_NFCEE_INFO_REVT,              /* 5  Discover NFCEE Notification   */
    213   NFC_NFCEE_MODE_SET_REVT,          /* 6  NFCEE Mode Set response       */
    214   NFC_RF_FIELD_REVT,                /* 7  RF Field information          */
    215   NFC_EE_ACTION_REVT,               /* 8  EE Action notification        */
    216   NFC_EE_DISCOVER_REQ_REVT,         /* 9  EE Discover Req notification  */
    217   NFC_SET_ROUTING_REVT,             /* 10 Configure Routing response    */
    218   NFC_GET_ROUTING_REVT,             /* 11 Retrieve Routing response     */
    219   NFC_RF_COMM_PARAMS_UPDATE_REVT,   /* 12 RF Communication Param Update */
    220   NFC_GEN_ERROR_REVT,               /* 13 generic error notification    */
    221   NFC_NFCC_RESTART_REVT,            /* 14 NFCC has been re-initialized  */
    222   NFC_NFCC_TIMEOUT_REVT,            /* 15 NFCC is not responding        */
    223   NFC_NFCC_TRANSPORT_ERR_REVT,      /* 16 NCI Tranport error            */
    224   NFC_NFCC_POWER_OFF_REVT,          /* 17 NFCC turned off               */
    225   NFC_SET_POWER_SUB_STATE_REVT,     /* 18 Set power sub state response  */
    226   NFC_FIRST_VS_REVT                 /* First vendor-specific rsp event  */
    227 };
    228 typedef uint16_t tNFC_RESPONSE_EVT;
    229 
    230 enum {
    231   NFC_CONN_CREATE_CEVT = NFC_FIRST_CEVT, /* 0  Conn Create Response          */
    232   NFC_CONN_CLOSE_CEVT,                   /* 1  Conn Close Response           */
    233   NFC_DEACTIVATE_CEVT,                   /* 2  Deactivate response/notificatn*/
    234   NFC_DATA_CEVT,                         /* 3  Data                          */
    235   NFC_ERROR_CEVT,                        /* 4  generic or interface error    */
    236   NFC_DATA_START_CEVT /* 5  received the first fragment on RF link */
    237 };
    238 typedef uint16_t tNFC_CONN_EVT;
    239 
    240 #define NFC_NFCC_INFO_LEN 4
    241 #ifndef NFC_NFCC_MAX_NUM_VS_INTERFACE
    242 #define NFC_NFCC_MAX_NUM_VS_INTERFACE 5
    243 #endif
    244 typedef struct {
    245   tNFC_STATUS status;                   /* The event status.                */
    246   uint8_t nci_version;                  /* the NCI version of NFCC          */
    247   uint8_t max_conn;                     /* max number of connections by NFCC*/
    248   uint32_t nci_features;                /* the NCI features of NFCC         */
    249   uint16_t nci_interfaces;              /* the NCI interfaces of NFCC       */
    250   uint16_t max_ce_table;                /* the max routing table size       */
    251   uint16_t max_param_size;              /* Max Size for Large Parameters    */
    252   uint8_t manufacture_id;               /* the Manufacture ID for NFCC      */
    253   uint8_t nfcc_info[NFC_NFCC_INFO_LEN]; /* the Manufacture Info for NFCC      */
    254   uint8_t vs_interface
    255       [NFC_NFCC_MAX_NUM_VS_INTERFACE]; /* the NCI VS interfaces of NFCC    */
    256   uint8_t hci_packet_size;             /*HCI payload size*/
    257   uint8_t hci_conn_credits;            /*max number of HCI credits*/
    258   uint16_t max_nfc_v_size;             /* maximum frame size for NFC-V*/
    259 } tNFC_ENABLE_REVT;
    260 
    261 #define NFC_MAX_NUM_IDS 125
    262 /* the data type associated with NFC_SET_CONFIG_REVT */
    263 typedef struct {
    264   tNFC_STATUS status;                 /* The event status.                */
    265   uint8_t num_param_id;               /* Number of rejected NCI Param ID  */
    266   uint8_t param_ids[NFC_MAX_NUM_IDS]; /* NCI Param ID          */
    267 } tNFC_SET_CONFIG_REVT;
    268 
    269 /* the data type associated with NFC_GET_CONFIG_REVT */
    270 typedef struct {
    271   tNFC_STATUS status;    /* The event status.    */
    272   uint16_t tlv_size;     /* The length of TLV    */
    273   uint8_t* p_param_tlvs; /* TLV                  */
    274 } tNFC_GET_CONFIG_REVT;
    275 
    276 /* the data type associated with NFC_NFCEE_DISCOVER_REVT */
    277 typedef struct {
    278   tNFC_STATUS status; /* The event status.    */
    279   uint8_t num_nfcee;  /* The number of NFCEE  */
    280 } tNFC_NFCEE_DISCOVER_REVT;
    281 
    282 #define NFC_NFCEE_INTERFACE_APDU NCI_NFCEE_INTERFACE_APDU
    283 #define NFC_NFCEE_INTERFACE_HCI_ACCESS NCI_NFCEE_INTERFACE_HCI_ACCESS
    284 #define NFC_NFCEE_INTERFACE_T3T NCI_NFCEE_INTERFACE_T3T
    285 #define NFC_NFCEE_INTERFACE_TRANSPARENT NCI_NFCEE_INTERFACE_TRANSPARENT
    286 #define NFC_NFCEE_INTERFACE_PROPRIETARY NCI_NFCEE_INTERFACE_PROPRIETARY
    287 typedef uint8_t tNFC_NFCEE_INTERFACE;
    288 
    289 #define NFC_NFCEE_TAG_HW_ID NCI_NFCEE_TAG_HW_ID
    290 #define NFC_NFCEE_TAG_ATR_BYTES NCI_NFCEE_TAG_ATR_BYTES
    291 #define NFC_NFCEE_TAG_T3T_INFO NCI_NFCEE_TAG_T3T_INFO
    292 #define NFC_NFCEE_TAG_HCI_HOST_ID NCI_NFCEE_TAG_HCI_HOST_ID
    293 typedef uint8_t tNFC_NFCEE_TAG;
    294 /* additional NFCEE Info */
    295 typedef struct {
    296   tNFC_NFCEE_TAG tag;
    297   uint8_t len;
    298   uint8_t info[NFC_MAX_EE_INFO];
    299 } tNFC_NFCEE_TLV;
    300 
    301 /* NFCEE connected and inactive */
    302 #define NFC_NFCEE_STATUS_INACTIVE NCI_NFCEE_STS_CONN_INACTIVE
    303 /* NFCEE connected and active   */
    304 #define NFC_NFCEE_STATUS_ACTIVE NCI_NFCEE_STS_CONN_ACTIVE
    305 /* NFCEE removed                */
    306 #define NFC_NFCEE_STATUS_REMOVED NCI_NFCEE_STS_REMOVED
    307 /* the data type associated with NFC_NFCEE_INFO_REVT */
    308 typedef struct {
    309   tNFC_STATUS status;    /* The event status - place holder  */
    310   uint8_t nfcee_id;      /* NFCEE ID                         */
    311   uint8_t ee_status;     /* The NFCEE status.                */
    312   uint8_t num_interface; /* number of NFCEE interfaces       */
    313   uint8_t ee_interface[NFC_MAX_EE_INTERFACE]; /* NFCEE interface       */
    314   uint8_t num_tlvs;                       /* number of TLVs                   */
    315   tNFC_NFCEE_TLV ee_tlv[NFC_MAX_EE_TLVS]; /* The TLVs associated with NFCEE   */
    316 } tNFC_NFCEE_INFO_REVT;
    317 
    318 #define NFC_MODE_ACTIVATE NCI_NFCEE_MD_ACTIVATE
    319 #define NFC_MODE_DEACTIVATE NCI_NFCEE_MD_DEACTIVATE
    320 typedef uint8_t tNFC_NFCEE_MODE;
    321 /* the data type associated with NFC_NFCEE_MODE_SET_REVT */
    322 typedef struct {
    323   tNFC_STATUS status;   /* The event status.*/
    324   uint8_t nfcee_id;     /* NFCEE ID         */
    325   tNFC_NFCEE_MODE mode; /* NFCEE mode       */
    326 } tNFC_NFCEE_MODE_SET_REVT;
    327 
    328 #if (APPL_DTA_MODE == TRUE)
    329 /* This data type is for FW Version */
    330 typedef struct {
    331   uint8_t rom_code_version; /* ROM code Version  */
    332   uint8_t major_version;    /* Major Version */
    333   uint8_t minor_version;    /* Minor Version  */
    334 } tNFC_FW_VERSION;
    335 #endif
    336 #define NFC_MAX_AID_LEN NCI_MAX_AID_LEN /* 16 */
    337 
    338 /* the data type associated with NFC_CE_GET_ROUTING_REVT */
    339 typedef struct {
    340   tNFC_STATUS status; /* The event status                 */
    341   uint8_t nfcee_id;   /* NFCEE ID                         */
    342   uint8_t num_tlvs;   /* number of TLVs                   */
    343   uint8_t tlv_size;   /* the total len of all TLVs        */
    344   uint8_t param_tlvs[NFC_MAX_EE_TLV_SIZE]; /* the TLVs         */
    345 } tNFC_GET_ROUTING_REVT;
    346 
    347 /* the data type associated with NFC_CONN_CREATE_CEVT */
    348 typedef struct {
    349   tNFC_STATUS status; /* The event status                 */
    350   uint8_t dest_type;  /* the destination type             */
    351   uint8_t id;         /* NFCEE ID  or RF Discovery ID     */
    352   uint8_t buff_size;  /* The max buffer size              */
    353   uint8_t num_buffs;  /* The number of buffers            */
    354 } tNFC_CONN_CREATE_CEVT;
    355 
    356 /* the data type associated with NFC_CONN_CLOSE_CEVT */
    357 typedef struct {
    358   tNFC_STATUS status; /* The event status                 */
    359 } tNFC_CONN_CLOSE_CEVT;
    360 
    361 /* the data type associated with NFC_DATA_CEVT */
    362 typedef struct {
    363   tNFC_STATUS status; /* The event status                 */
    364   NFC_HDR* p_data;    /* The received Data                */
    365 } tNFC_DATA_CEVT;
    366 
    367 /* RF Field Status */
    368 /* No field generated by remote device  */
    369 #define NFC_RF_STS_NO_REMOTE NCI_RF_STS_NO_REMOTE
    370 /* field generated by remote device     */
    371 #define NFC_RF_STS_REMOTE NCI_RF_STS_REMOTE
    372 typedef uint8_t tNFC_RF_STS;
    373 
    374 /* RF Field Technologies */
    375 #define NFC_RF_TECHNOLOGY_A NCI_RF_TECHNOLOGY_A
    376 #define NFC_RF_TECHNOLOGY_B NCI_RF_TECHNOLOGY_B
    377 #define NFC_RF_TECHNOLOGY_F NCI_RF_TECHNOLOGY_F
    378 #define NFC_RF_TECHNOLOGY_V NCI_RF_TECHNOLOGY_V
    379 typedef uint8_t tNFC_RF_TECH;
    380 
    381 #ifdef __cplusplus
    382 extern "C" uint8_t NFC_GetNCIVersion();
    383 #else
    384 extern uint8_t NFC_GetNCIVersion();
    385 #endif
    386 
    387 /* Supported Protocols */
    388 #define NFC_PROTOCOL_UNKNOWN NCI_PROTOCOL_UNKNOWN /* Unknown */
    389 /* Type1Tag    - NFC-A            */
    390 #define NFC_PROTOCOL_T1T NCI_PROTOCOL_T1T
    391 /* Type2Tag    - NFC-A            */
    392 #define NFC_PROTOCOL_T2T NCI_PROTOCOL_T2T
    393 /* Type3Tag    - NFC-F            */
    394 #define NFC_PROTOCOL_T3T NCI_PROTOCOL_T3T
    395 /* Type5Tag    - NFC-V/ISO15693*/
    396 #define NFC_PROTOCOL_T5T NFC_PROTOCOL_T5T_(NFC_GetNCIVersion())
    397 #define NFC_PROTOCOL_T5T_(x) \
    398   ((x == NCI_VERSION_2_0) ? NCI_PROTOCOL_T5T : NCI_PROTOCOL_15693)
    399 /* Type 4A,4B  - NFC-A or NFC-B   */
    400 #define NFC_PROTOCOL_ISO_DEP NCI_PROTOCOL_ISO_DEP
    401 /* NFCDEP/LLCP - NFC-A or NFC-F       */
    402 #define NFC_PROTOCOL_NFC_DEP NCI_PROTOCOL_NFC_DEP
    403 #define NFC_PROTOCOL_MIFARE NCI_PROTOCOL_MIFARE
    404 #define NFC_PROTOCOL_ISO15693 NCI_PROTOCOL_15693
    405 #define NFC_PROTOCOL_B_PRIME NCI_PROTOCOL_B_PRIME
    406 #define NFC_PROTOCOL_KOVIO NCI_PROTOCOL_KOVIO
    407 typedef uint8_t tNFC_PROTOCOL;
    408 
    409 /* Discovery Types/Detected Technology and Mode */
    410 #define NFC_DISCOVERY_TYPE_POLL_A NCI_DISCOVERY_TYPE_POLL_A
    411 #define NFC_DISCOVERY_TYPE_POLL_B NCI_DISCOVERY_TYPE_POLL_B
    412 #define NFC_DISCOVERY_TYPE_POLL_F NCI_DISCOVERY_TYPE_POLL_F
    413 #define NFC_DISCOVERY_TYPE_POLL_A_ACTIVE NCI_DISCOVERY_TYPE_POLL_A_ACTIVE
    414 #define NFC_DISCOVERY_TYPE_POLL_F_ACTIVE NCI_DISCOVERY_TYPE_POLL_F_ACTIVE
    415 #define NFC_DISCOVERY_TYPE_POLL_ACTIVE NCI_DISCOVERY_TYPE_POLL_ACTIVE
    416 #define NFC_DISCOVERY_TYPE_POLL_V NCI_DISCOVERY_TYPE_POLL_V
    417 #define NFC_DISCOVERY_TYPE_POLL_B_PRIME NCI_DISCOVERY_TYPE_POLL_B_PRIME
    418 #define NFC_DISCOVERY_TYPE_POLL_KOVIO NCI_DISCOVERY_TYPE_POLL_KOVIO
    419 #define NFC_DISCOVERY_TYPE_LISTEN_A NCI_DISCOVERY_TYPE_LISTEN_A
    420 #define NFC_DISCOVERY_TYPE_LISTEN_B NCI_DISCOVERY_TYPE_LISTEN_B
    421 #define NFC_DISCOVERY_TYPE_LISTEN_F NCI_DISCOVERY_TYPE_LISTEN_F
    422 #define NFC_DISCOVERY_TYPE_LISTEN_A_ACTIVE NCI_DISCOVERY_TYPE_LISTEN_A_ACTIVE
    423 #define NFC_DISCOVERY_TYPE_LISTEN_F_ACTIVE NCI_DISCOVERY_TYPE_LISTEN_F_ACTIVE
    424 #define NFC_DISCOVERY_TYPE_LISTEN_ACTIVE NCI_DISCOVERY_TYPE_LISTEN_ACTIVE
    425 #define NFC_DISCOVERY_TYPE_LISTEN_ISO15693 NCI_DISCOVERY_TYPE_LISTEN_ISO15693
    426 #define NFC_DISCOVERY_TYPE_LISTEN_B_PRIME NCI_DISCOVERY_TYPE_LISTEN_B_PRIME
    427 typedef uint8_t tNFC_DISCOVERY_TYPE;
    428 typedef uint8_t tNFC_RF_TECH_N_MODE;
    429 
    430 /* Select Response codes */
    431 #define NFC_SEL_RES_NFC_FORUM_T2T 0x00
    432 #define NFC_SEL_RES_MF_CLASSIC 0x08
    433 
    434 /* Bit Rates */
    435 #define NFC_BIT_RATE_106 NCI_BIT_RATE_106   /* 106 kbit/s */
    436 #define NFC_BIT_RATE_212 NCI_BIT_RATE_212   /* 212 kbit/s */
    437 #define NFC_BIT_RATE_424 NCI_BIT_RATE_424   /* 424 kbit/s */
    438 #define NFC_BIT_RATE_848 NCI_BIT_RATE_848   /* 848 Kbit/s */
    439 #define NFC_BIT_RATE_1696 NCI_BIT_RATE_1696 /* 1696 Kbit/s*/
    440 #define NFC_BIT_RATE_3392 NCI_BIT_RATE_3392 /* 3392 Kbit/s*/
    441 #define NFC_BIT_RATE_6784 NCI_BIT_RATE_6784 /* 6784 Kbit/s*/
    442 typedef uint8_t tNFC_BIT_RATE;
    443 
    444 /**********************************************
    445  * Interface Types
    446  **********************************************/
    447 #define NFC_INTERFACE_EE_DIRECT_RF NCI_INTERFACE_EE_DIRECT_RF
    448 #define NFC_INTERFACE_FRAME NCI_INTERFACE_FRAME
    449 #define NFC_INTERFACE_ISO_DEP NCI_INTERFACE_ISO_DEP
    450 #define NFC_INTERFACE_NDEF NCI_INTERFACE_NDEF
    451 #define NFC_INTERFACE_NFC_DEP NCI_INTERFACE_NFC_DEP
    452 #define NFC_INTERFACE_LLCP_LOW NCI_INTERFACE_LLCP_LOW
    453 #define NFC_INTERFACE_LLCP_HIGH NCI_INTERFACE_LLCP_HIGH
    454 #define NFC_INTERFACE_VS_T2T_CE NCI_INTERFACE_VS_T2T_CE
    455 #define NFC_INTERFACE_MIFARE NCI_INTERFACE_VS_MIFARE
    456 typedef tNCI_INTF_TYPE tNFC_INTF_TYPE;
    457 
    458 /**********************************************
    459  *  Deactivation Type
    460  **********************************************/
    461 #define NFC_DEACTIVATE_TYPE_IDLE NCI_DEACTIVATE_TYPE_IDLE
    462 #define NFC_DEACTIVATE_TYPE_SLEEP NCI_DEACTIVATE_TYPE_SLEEP
    463 #define NFC_DEACTIVATE_TYPE_SLEEP_AF NCI_DEACTIVATE_TYPE_SLEEP_AF
    464 #define NFC_DEACTIVATE_TYPE_DISCOVERY NCI_DEACTIVATE_TYPE_DISCOVERY
    465 typedef uint8_t tNFC_DEACT_TYPE;
    466 
    467 /**********************************************
    468  *  Deactivation Reasons
    469  **********************************************/
    470 #define NFC_DEACTIVATE_REASON_DH_REQ NCI_DEACTIVATE_REASON_DH_REQ
    471 #define NFC_DEACTIVATE_REASON_ENDPOINT_REQ NCI_DEACTIVATE_REASON_ENDPOINT_REQ
    472 #define NFC_DEACTIVATE_REASON_RF_LINK_LOSS NCI_DEACTIVATE_REASON_RF_LINK_LOSS
    473 #define NFC_DEACTIVATE_REASON_NFCB_BAD_AFI NCI_DEACTIVATE_REASON_NFCB_BAD_AFI
    474 #define NFC_DEACTIVATE_REASON_DH_REQ_FAILED NCI_DEACTIVATE_REASON_DH_REQ_FAILED
    475 typedef uint8_t tNFC_DEACT_REASON;
    476 
    477 /* the data type associated with NFC_RF_FIELD_REVT */
    478 typedef struct {
    479   tNFC_STATUS status;   /* The event status - place holder. */
    480   tNFC_RF_STS rf_field; /* RF Field Status                  */
    481 } tNFC_RF_FIELD_REVT;
    482 
    483 #define NFC_MAX_APP_DATA_LEN 40
    484 typedef struct {
    485   uint8_t len_aid;              /* length of application id */
    486   uint8_t aid[NFC_MAX_AID_LEN]; /* application id           */
    487 } tNFC_AID;
    488 typedef struct {
    489   uint8_t len_aid;                    /* length of application id */
    490   uint8_t aid[NFC_MAX_AID_LEN];       /* application id           */
    491   uint8_t len_data;                   /* len of application data  */
    492   uint8_t data[NFC_MAX_APP_DATA_LEN]; /* application data    */
    493 } tNFC_APP_INIT;
    494 
    495 /* ISO 7816-4 SELECT command */
    496 #define NFC_EE_TRIG_SELECT NCI_EE_TRIG_7816_SELECT
    497 /* RF Protocol changed       */
    498 #define NFC_EE_TRIG_RF_PROTOCOL NCI_EE_TRIG_RF_PROTOCOL
    499 /* RF Technology changed     */
    500 #define NFC_EE_TRIG_RF_TECHNOLOGY NCI_EE_TRIG_RF_TECHNOLOGY
    501 /* Application initiation    */
    502 #define NFC_EE_TRIG_APP_INIT NCI_EE_TRIG_APP_INIT
    503 typedef uint8_t tNFC_EE_TRIGGER;
    504 typedef struct {
    505   tNFC_EE_TRIGGER trigger; /* the trigger of this event        */
    506   union {
    507     tNFC_PROTOCOL protocol;
    508     tNFC_RF_TECH technology;
    509     tNFC_AID aid;
    510     tNFC_APP_INIT app_init;
    511   } param; /* Discovery Type specific parameters */
    512 } tNFC_ACTION_DATA;
    513 
    514 /* the data type associated with NFC_EE_ACTION_REVT */
    515 typedef struct {
    516   tNFC_STATUS status;        /* The event status - place holder  */
    517   uint8_t nfcee_id;          /* NFCEE ID                         */
    518   tNFC_ACTION_DATA act_data; /* data associated /w the action    */
    519 } tNFC_EE_ACTION_REVT;
    520 
    521 #define NFC_EE_DISC_OP_ADD 0
    522 #define NFC_EE_DISC_OP_REMOVE 1
    523 typedef uint8_t tNFC_EE_DISC_OP;
    524 typedef struct {
    525   tNFC_EE_DISC_OP op;              /* add or remove this entry         */
    526   uint8_t nfcee_id;                /* NFCEE ID                         */
    527   tNFC_RF_TECH_N_MODE tech_n_mode; /* Discovery Technology and Mode    */
    528   tNFC_PROTOCOL protocol;          /* NFC protocol                     */
    529 } tNFC_EE_DISCOVER_INFO;
    530 
    531 #ifndef NFC_MAX_EE_DISC_ENTRIES
    532 #define NFC_MAX_EE_DISC_ENTRIES 6
    533 #endif
    534 /* T, L, V(NFCEE ID, TechnMode, Protocol) */
    535 #define NFC_EE_DISCOVER_ENTRY_LEN 5
    536 #define NFC_EE_DISCOVER_INFO_LEN 3 /* NFCEE ID, TechnMode, Protocol */
    537 /* the data type associated with NFC_EE_DISCOVER_REQ_REVT */
    538 typedef struct {
    539   tNFC_STATUS status; /* The event status - place holder  */
    540   uint8_t num_info;   /* number of entries in info[]      */
    541   tNFC_EE_DISCOVER_INFO
    542       info[NFC_MAX_EE_DISC_ENTRIES]; /* discovery request from NFCEE */
    543 } tNFC_EE_DISCOVER_REQ_REVT;
    544 
    545 typedef union {
    546   tNFC_STATUS status; /* The event status. */
    547   tNFC_ENABLE_REVT enable;
    548   tNFC_SET_CONFIG_REVT set_config;
    549   tNFC_GET_CONFIG_REVT get_config;
    550   tNFC_NFCEE_DISCOVER_REVT nfcee_discover;
    551   tNFC_NFCEE_INFO_REVT nfcee_info;
    552   tNFC_NFCEE_MODE_SET_REVT mode_set;
    553   tNFC_RF_FIELD_REVT rf_field;
    554   tNFC_STATUS cfg_routing;
    555   tNFC_GET_ROUTING_REVT get_routing;
    556   tNFC_EE_ACTION_REVT ee_action;
    557   tNFC_EE_DISCOVER_REQ_REVT ee_discover_req;
    558   void* p_vs_evt_data;
    559 } tNFC_RESPONSE;
    560 
    561 /*************************************
    562 **  RESPONSE Callback Functions
    563 **************************************/
    564 typedef void(tNFC_RESPONSE_CBACK)(tNFC_RESPONSE_EVT event,
    565                                   tNFC_RESPONSE* p_data);
    566 
    567 /* The events reported on tNFC_VS_CBACK */
    568 /* The event is (NCI_RSP_BIT|oid) for response and (NCI_NTF_BIT|oid) for
    569  * notification*/
    570 
    571 typedef uint8_t tNFC_VS_EVT;
    572 
    573 /*************************************
    574 **  Proprietary (Vendor Specific) Callback Functions
    575 **************************************/
    576 typedef void(tNFC_VS_CBACK)(tNFC_VS_EVT event, uint16_t data_len,
    577                             uint8_t* p_data);
    578 
    579 /* the events reported on tNFC_DISCOVER_CBACK */
    580 enum {
    581   NFC_START_DEVT = NFC_FIRST_DEVT, /* Status of NFC_DiscoveryStart     */
    582   NFC_MAP_DEVT,                    /* Status of NFC_DiscoveryMap       */
    583   NFC_RESULT_DEVT,                 /* The responses from remote device */
    584   NFC_SELECT_DEVT,                 /* Status of NFC_DiscoverySelect    */
    585   NFC_ACTIVATE_DEVT,               /* RF interface is activated        */
    586   NFC_DEACTIVATE_DEVT              /* Status of RF deactivation        */
    587 };
    588 typedef uint16_t tNFC_DISCOVER_EVT;
    589 
    590 /* the data type associated with NFC_START_DEVT */
    591 typedef tNFC_STATUS tNFC_START_DEVT;
    592 
    593 typedef tNCI_RF_PA_PARAMS tNFC_RF_PA_PARAMS;
    594 #define NFC_MAX_SENSB_RES_LEN NCI_MAX_SENSB_RES_LEN
    595 #define NFC_NFCID0_MAX_LEN 4
    596 typedef struct {
    597   uint8_t sensb_res_len; /* Length of SENSB_RES Response (Byte 2 - Byte 12 or
    598                             13) Available after Technology Detection */
    599   uint8_t sensb_res[NFC_MAX_SENSB_RES_LEN]; /* SENSB_RES Response (ATQ) */
    600   uint8_t nfcid0[NFC_NFCID0_MAX_LEN];
    601 } tNFC_RF_PB_PARAMS;
    602 
    603 #define NFC_MAX_SENSF_RES_LEN NCI_MAX_SENSF_RES_LEN
    604 #define NFC_NFCID2_LEN NCI_NFCID2_LEN
    605 typedef struct {
    606   uint8_t bit_rate;      /* NFC_BIT_RATE_212 or NFC_BIT_RATE_424 */
    607   uint8_t sensf_res_len; /* Length of SENSF_RES Response (Byte 2 - Byte 17 or
    608                             19) Available after Technology Detection */
    609   uint8_t sensf_res[NFC_MAX_SENSF_RES_LEN]; /* SENSB_RES Response */
    610   uint8_t nfcid2[NFC_NFCID2_LEN]; /* NFCID2 generated by the Local NFCC for
    611                                      NFC-DEP Protocol.Available for Frame
    612                                      Interface  */
    613   uint8_t mrti_check;
    614   uint8_t mrti_update;
    615 } tNFC_RF_PF_PARAMS;
    616 
    617 typedef tNCI_RF_LF_PARAMS tNFC_RF_LF_PARAMS;
    618 
    619 #define NFC_ISO15693_UID_LEN 8
    620 typedef struct {
    621   uint8_t flag;
    622   uint8_t dsfid;
    623   uint8_t uid[NFC_ISO15693_UID_LEN];
    624 } tNFC_RF_PISO15693_PARAMS;
    625 
    626 #ifndef NFC_KOVIO_MAX_LEN
    627 #define NFC_KOVIO_MAX_LEN 32
    628 #endif
    629 typedef struct {
    630   uint8_t uid_len;
    631   uint8_t uid[NFC_KOVIO_MAX_LEN];
    632 } tNFC_RF_PKOVIO_PARAMS;
    633 
    634 typedef tNCI_RF_ACM_P_PARAMS tNFC_RF_ACM_P_PARAMS;
    635 
    636 typedef union {
    637   tNFC_RF_PA_PARAMS pa;
    638   tNFC_RF_PB_PARAMS pb;
    639   tNFC_RF_PF_PARAMS pf;
    640   tNFC_RF_LF_PARAMS lf;
    641   tNFC_RF_PISO15693_PARAMS pi93;
    642   tNFC_RF_PKOVIO_PARAMS pk;
    643   tNFC_RF_ACM_P_PARAMS acm_p;
    644 } tNFC_RF_TECH_PARAMU;
    645 
    646 typedef struct {
    647   tNFC_DISCOVERY_TYPE mode;
    648   tNFC_RF_TECH_PARAMU param;
    649 } tNFC_RF_TECH_PARAMS;
    650 
    651 /* the data type associated with NFC_RESULT_DEVT */
    652 typedef struct {
    653   tNFC_STATUS status;                /* The event status - place holder.  */
    654   uint8_t rf_disc_id;                /* RF Discovery ID                   */
    655   uint8_t protocol;                  /* supported protocol                */
    656   tNFC_RF_TECH_PARAMS rf_tech_param; /* RF technology parameters          */
    657   uint8_t more;                      /* 0: last, 1: last (limit), 2: more */
    658 } tNFC_RESULT_DEVT;
    659 
    660 /* the data type associated with NFC_SELECT_DEVT */
    661 typedef tNFC_STATUS tNFC_SELECT_DEVT;
    662 
    663 /* the data type associated with NFC_STOP_DEVT */
    664 typedef tNFC_STATUS tNFC_STOP_DEVT;
    665 
    666 #define NFC_MAX_ATS_LEN NCI_MAX_ATS_LEN
    667 #define NFC_MAX_HIS_BYTES_LEN NCI_MAX_HIS_BYTES_LEN
    668 #define NFC_MAX_GEN_BYTES_LEN NCI_MAX_GEN_BYTES_LEN
    669 
    670 typedef struct {
    671   uint8_t ats_res_len;              /* Length of ATS RES                */
    672   uint8_t ats_res[NFC_MAX_ATS_LEN]; /* ATS RES                          */
    673   bool nad_used;                    /* NAD is used or not               */
    674   uint8_t fwi;                      /* Frame Waiting time Integer       */
    675   uint8_t sfgi;                     /* Start-up Frame Guard time Integer*/
    676   uint8_t his_byte_len;             /* len of historical bytes          */
    677   uint8_t his_byte[NFC_MAX_HIS_BYTES_LEN]; /* historical bytes             */
    678 } tNFC_INTF_PA_ISO_DEP;
    679 
    680 typedef struct { uint8_t rats; /* RATS */ } tNFC_INTF_LA_ISO_DEP;
    681 
    682 typedef struct {
    683   uint8_t atr_res_len;                      /* Length of ATR_RES            */
    684   uint8_t atr_res[NFC_MAX_ATS_LEN];         /* ATR_RES (Byte 3 - Byte 17+n) */
    685   uint8_t max_payload_size;                 /* 64, 128, 192 or 254          */
    686   uint8_t gen_bytes_len;                    /* len of general bytes         */
    687   uint8_t gen_bytes[NFC_MAX_GEN_BYTES_LEN]; /* general bytes           */
    688   uint8_t
    689       waiting_time; /* WT -> Response Waiting Time RWT = (256 x 16/fC) x 2WT */
    690 } tNFC_INTF_PA_NFC_DEP;
    691 
    692 /* Note: keep tNFC_INTF_PA_NFC_DEP data member in the same order as
    693  * tNFC_INTF_LA_NFC_DEP */
    694 typedef struct {
    695   uint8_t atr_req_len;                      /* Length of ATR_REQ            */
    696   uint8_t atr_req[NFC_MAX_ATS_LEN];         /* ATR_REQ (Byte 3 - Byte 18+n) */
    697   uint8_t max_payload_size;                 /* 64, 128, 192 or 254          */
    698   uint8_t gen_bytes_len;                    /* len of general bytes         */
    699   uint8_t gen_bytes[NFC_MAX_GEN_BYTES_LEN]; /* general bytes           */
    700 } tNFC_INTF_LA_NFC_DEP;
    701 typedef tNFC_INTF_LA_NFC_DEP tNFC_INTF_LF_NFC_DEP;
    702 typedef tNFC_INTF_PA_NFC_DEP tNFC_INTF_PF_NFC_DEP;
    703 
    704 #define NFC_MAX_ATTRIB_LEN NCI_MAX_ATTRIB_LEN
    705 
    706 typedef struct {
    707   uint8_t attrib_res_len;                 /* Length of ATTRIB RES      */
    708   uint8_t attrib_res[NFC_MAX_ATTRIB_LEN]; /* ATTRIB RES                */
    709   uint8_t hi_info_len;                    /* len of Higher layer Info  */
    710   uint8_t hi_info[NFC_MAX_GEN_BYTES_LEN]; /* Higher layer Info         */
    711   uint8_t mbli;                           /* Maximum buffer length.    */
    712 } tNFC_INTF_PB_ISO_DEP;
    713 
    714 typedef struct {
    715   uint8_t attrib_req_len;                 /* Length of ATTRIB REQ      */
    716   uint8_t attrib_req[NFC_MAX_ATTRIB_LEN]; /* ATTRIB REQ (Byte 2 - 10+k)*/
    717   uint8_t hi_info_len;                    /* len of Higher layer Info  */
    718   uint8_t hi_info[NFC_MAX_GEN_BYTES_LEN]; /* Higher layer Info         */
    719   uint8_t nfcid0[NFC_NFCID0_MAX_LEN];     /* NFCID0                    */
    720 } tNFC_INTF_LB_ISO_DEP;
    721 
    722 #ifndef NFC_MAX_RAW_PARAMS
    723 #define NFC_MAX_RAW_PARAMS 16
    724 #endif
    725 #define NFC_MAX_RAW_PARAMS 16
    726 typedef struct {
    727   uint8_t param_len;
    728   uint8_t param[NFC_MAX_RAW_PARAMS];
    729 } tNFC_INTF_FRAME;
    730 
    731 typedef struct {
    732   tNFC_INTF_TYPE type; /* Interface Type  1 Byte  See Table 67 */
    733   union {
    734     tNFC_INTF_LA_ISO_DEP la_iso;
    735     tNFC_INTF_PA_ISO_DEP pa_iso;
    736     tNFC_INTF_LB_ISO_DEP lb_iso;
    737     tNFC_INTF_PB_ISO_DEP pb_iso;
    738     tNFC_INTF_LA_NFC_DEP la_nfc;
    739     tNFC_INTF_PA_NFC_DEP pa_nfc;
    740     tNFC_INTF_LF_NFC_DEP lf_nfc;
    741     tNFC_INTF_PF_NFC_DEP pf_nfc;
    742     tNFC_INTF_FRAME frame;
    743   } intf_param; /* Activation Parameters   0 - n Bytes */
    744 } tNFC_INTF_PARAMS;
    745 
    746 /* the data type associated with NFC_ACTIVATE_DEVT */
    747 typedef struct {
    748   uint8_t rf_disc_id;                /* RF Discovery ID          */
    749   tNFC_PROTOCOL protocol;            /* supported protocol       */
    750   tNFC_RF_TECH_PARAMS rf_tech_param; /* RF technology parameters */
    751   tNFC_DISCOVERY_TYPE data_mode;     /* for future Data Exchange */
    752   tNFC_BIT_RATE tx_bitrate;          /* Data Exchange Tx Bitrate */
    753   tNFC_BIT_RATE rx_bitrate;          /* Data Exchange Rx Bitrate */
    754   tNFC_INTF_PARAMS intf_param;       /* interface type and params*/
    755 } tNFC_ACTIVATE_DEVT;
    756 
    757 /* the data type associated with NFC_DEACTIVATE_DEVT and NFC_DEACTIVATE_CEVT */
    758 typedef struct {
    759   tNFC_STATUS status;   /* The event status.        */
    760   tNFC_DEACT_TYPE type; /* De-activate type         */
    761   bool is_ntf;          /* TRUE, if deactivate notif*/
    762   tNFC_DEACT_REASON reason; /* De-activate reason    */
    763 } tNFC_DEACTIVATE_DEVT;
    764 
    765 typedef union {
    766   tNFC_STATUS status; /* The event status.        */
    767   tNFC_START_DEVT start;
    768   tNFC_RESULT_DEVT result;
    769   tNFC_SELECT_DEVT select;
    770   tNFC_STOP_DEVT stop;
    771   tNFC_ACTIVATE_DEVT activate;
    772   tNFC_DEACTIVATE_DEVT deactivate;
    773 } tNFC_DISCOVER;
    774 
    775 /* Min TR0 indicates to tag the min delay before responding after the end of
    776  * command */
    777 #define NFC_RF_PARAM_MIN_TR0_DEFAULT 0x00
    778 #define NFC_RF_PARAM_MIN_TR0_48X 0x01 /* 48 x 16/fc */
    779 #define NFC_RF_PARAM_MIN_TR0_16X 0x02 /* 16 x 16/fc */
    780 
    781 /* Min TR1 indicates to tag the min delay between subcarrier modulation and data
    782  * transmission */
    783 #define NFC_RF_PARAM_MIN_TR1_DEFAULT 0x00
    784 #define NFC_RF_PARAM_MIN_TR1_64X 0x01 /* 64 x 16/fc */
    785 #define NFC_RF_PARAM_MIN_TR1_16X 0x02 /* 16 x 16/fc */
    786 
    787 /* Min TR2 indicates to RW the min delay between EoS of tag and SoS of RW */
    788 #define NFC_RF_PARAM_MIN_TR2_1792 0x00 /* 1792/fc (10etu + 32/fc) */
    789 #define NFC_RF_PARAM_MIN_TR2_3328 0x01 /* 3328/fc (10etu + 128/fc) */
    790 #define NFC_RF_PARAM_MIN_TR2_5376 0x02 /* 5376/fc (10etu + 256/fc) */
    791 #define NFC_RF_PARAM_MIN_TR2_9472 0x03 /* 9472/fc (10etu + 512/fc) */
    792 
    793 #define NFC_RF_PARAM_EOS_REQUIRED 0x00     /* EoS required */
    794 #define NFC_RF_PARAM_EOS_NOT_REQUIRED 0x01 /* EoS not required */
    795 
    796 #define NFC_RF_PARAM_SOS_REQUIRED 0x00     /* SoS required */
    797 #define NFC_RF_PARAM_SOS_NOT_REQUIRED 0x01 /* SoS not required */
    798 
    799 typedef struct {
    800   bool include_rf_tech_mode; /* TRUE if including RF Tech and Mode update    */
    801   tNFC_RF_TECH_N_MODE rf_tech_n_mode; /* RF tech and mode */
    802   bool include_tx_bit_rate;  /* TRUE if including Tx bit rate update         */
    803   tNFC_BIT_RATE tx_bit_rate; /* Transmit Bit Rate                            */
    804   bool include_rx_bit_rate;  /* TRUE if including Rx bit rate update         */
    805   tNFC_BIT_RATE rx_bit_rate; /* Receive Bit Rate                             */
    806   bool include_nfc_b_config; /* TRUE if including NFC-B data exchange config */
    807   uint8_t min_tr0;           /* Minimun TR0                                  */
    808   uint8_t min_tr1;           /* Minimun TR1                                  */
    809   uint8_t suppression_eos;   /* Suppression of EoS                           */
    810   uint8_t suppression_sos;   /* Suppression of SoS                           */
    811   uint8_t min_tr2;           /* Minimun TR1                                  */
    812 } tNFC_RF_COMM_PARAMS;
    813 
    814 /*************************************
    815 **  DISCOVER Callback Functions
    816 **************************************/
    817 typedef void(tNFC_DISCOVER_CBACK)(tNFC_DISCOVER_EVT event,
    818                                   tNFC_DISCOVER* p_data);
    819 
    820 /* the events reported on tNFC_TEST_CBACK */
    821 enum {
    822   NFC_LOOPBACK_TEVT = NFC_FIRST_TEVT, /* 0  Loopback test             */
    823   NFC_RF_CONTROL_TEVT,                /* 1  RF control Test response  */
    824   NFC_RF_FIELD_DONE_TEVT              /* 1  RF control Test notificatn*/
    825 };
    826 typedef uint16_t tNFC_TEST_EVT;
    827 
    828 /* the data type associated with NFC_LOOPBACK_TEVT */
    829 typedef struct {
    830   tNFC_STATUS status; /* The event status.            */
    831   NFC_HDR* p_data;    /* The loop back data from NFCC */
    832 } tNFC_LOOPBACK_TEVT;
    833 
    834 /* the data type associated with NFC_RF_CONTROL_TEVT */
    835 typedef tNFC_STATUS tNFC_RF_CONTROL_TEVT;
    836 
    837 typedef union {
    838   tNFC_STATUS status; /* The event status.            */
    839   tNFC_LOOPBACK_TEVT loop_back;
    840   tNFC_RF_CONTROL_TEVT rf_control;
    841 } tNFC_TEST;
    842 
    843 /*************************************
    844 **  TEST Callback Functions
    845 **************************************/
    846 typedef void(tNFC_TEST_CBACK)(tNFC_TEST_EVT event, tNFC_TEST* p_data);
    847 
    848 typedef tNFC_DEACTIVATE_DEVT tNFC_DEACTIVATE_CEVT;
    849 typedef union {
    850   tNFC_STATUS status; /* The event status. */
    851   tNFC_CONN_CREATE_CEVT conn_create;
    852   tNFC_CONN_CLOSE_CEVT conn_close;
    853   tNFC_DEACTIVATE_CEVT deactivate;
    854   tNFC_DATA_CEVT data;
    855 } tNFC_CONN;
    856 
    857 /*************************************
    858 **  Data Callback Functions
    859 **************************************/
    860 typedef void(tNFC_CONN_CBACK)(uint8_t conn_id, tNFC_CONN_EVT event,
    861                               tNFC_CONN* p_data);
    862 #define NFC_MAX_CONN_ID 15
    863 #define NFC_ILLEGAL_CONN_ID 0xFF
    864 /* the static connection ID for RF traffic */
    865 #define NFC_RF_CONN_ID 0
    866 
    867 /*************************************
    868 **  Status callback function
    869 **************************************/
    870 typedef void(tNFC_STATUS_CBACK)(tNFC_STATUS status);
    871 
    872 /*****************************************************************************
    873 **  EXTERNAL FUNCTION DECLARATIONS
    874 *****************************************************************************/
    875 #ifdef __cplusplus
    876 extern "C" {
    877 #endif
    878 
    879 /*******************************************************************************
    880 **
    881 ** Function         NFC_Enable
    882 **
    883 ** Description      This function enables NFC. Prior to calling NFC_Enable:
    884 **                  - the NFCC must be powered up, and ready to receive
    885 **                    commands.
    886 **                  - GKI must be enabled
    887 **                  - NFC_TASK must be started
    888 **                  - NCIT_TASK must be started (if using dedicated NCI
    889 **                    transport)
    890 **
    891 **                  This function opens the NCI transport (if applicable),
    892 **                  resets the NFC controller, and initializes the NFC
    893 **                  subsystems.
    894 **
    895 **                  When the NFC startup procedure is completed, an
    896 **                  NFC_ENABLE_REVT is returned to the application using the
    897 **                  tNFC_RESPONSE_CBACK.
    898 **
    899 ** Returns          tNFC_STATUS
    900 **
    901 *******************************************************************************/
    902 extern tNFC_STATUS NFC_Enable(tNFC_RESPONSE_CBACK* p_cback);
    903 
    904 /*******************************************************************************
    905 **
    906 ** Function         NFC_Disable
    907 **
    908 ** Description      This function performs clean up routines for shutting down
    909 **                  NFC and closes the NCI transport (if using dedicated NCI
    910 **                  transport).
    911 **
    912 **                  When the NFC shutdown procedure is completed, an
    913 **                  NFC_DISABLED_REVT is returned to the application using the
    914 **                  tNFC_RESPONSE_CBACK.
    915 **
    916 ** Returns          nothing
    917 **
    918 *******************************************************************************/
    919 extern void NFC_Disable(void);
    920 
    921 /*******************************************************************************
    922 **
    923 ** Function         NFC_Init
    924 **
    925 ** Description      This function initializes control blocks for NFC
    926 **
    927 ** Returns          nothing
    928 **
    929 *******************************************************************************/
    930 extern void NFC_Init(tHAL_NFC_ENTRY* p_hal_entry_tbl);
    931 
    932 /*******************************************************************************
    933 **
    934 ** Function         NFC_GetLmrtSize
    935 **
    936 ** Description      Called by application wto query the Listen Mode Routing
    937 **                  Table size supported by NFCC
    938 **
    939 ** Returns          Listen Mode Routing Table size
    940 **
    941 *******************************************************************************/
    942 extern uint16_t NFC_GetLmrtSize(void);
    943 
    944 /*******************************************************************************
    945 **
    946 ** Function         NFC_SetConfig
    947 **
    948 ** Description      This function is called to send the configuration parameter
    949 **                  TLV to NFCC. The response from NFCC is reported by
    950 **                  tNFC_RESPONSE_CBACK as NFC_SET_CONFIG_REVT.
    951 **
    952 ** Parameters       tlv_size - the length of p_param_tlvs.
    953 **                  p_param_tlvs - the parameter ID/Len/Value list
    954 **
    955 ** Returns          tNFC_STATUS
    956 **
    957 *******************************************************************************/
    958 extern tNFC_STATUS NFC_SetConfig(uint8_t tlv_size, uint8_t* p_param_tlvs);
    959 
    960 /*******************************************************************************
    961 **
    962 ** Function         NFC_GetConfig
    963 **
    964 ** Description      This function is called to retrieve the parameter TLV from
    965 **                  NFCC. The response from NFCC is reported by
    966 **                  tNFC_RESPONSE_CBACK as NFC_GET_CONFIG_REVT.
    967 **
    968 ** Parameters       num_ids - the number of parameter IDs
    969 **                  p_param_ids - the parameter ID list.
    970 **
    971 ** Returns          tNFC_STATUS
    972 **
    973 *******************************************************************************/
    974 extern tNFC_STATUS NFC_GetConfig(uint8_t num_ids, uint8_t* p_param_ids);
    975 
    976 /*******************************************************************************
    977 **
    978 ** Function         NFC_NfceeDiscover
    979 **
    980 ** Description      This function is called to enable or disable NFCEE
    981 **                  Discovery. The response from NFCC is reported by
    982 **                  tNFC_RESPONSE_CBACK as NFC_NFCEE_DISCOVER_REVT.
    983 **                  The notification from NFCC is reported by
    984 **                  tNFC_RESPONSE_CBACK as NFC_NFCEE_INFO_REVT.
    985 **
    986 ** Parameters       discover - 1 to enable discover, 0 to disable.
    987 **
    988 ** Returns          tNFC_STATUS
    989 **
    990 *******************************************************************************/
    991 extern tNFC_STATUS NFC_NfceeDiscover(bool discover);
    992 
    993 /*******************************************************************************
    994 **
    995 ** Function         NFC_NfceeModeSet
    996 **
    997 ** Description      This function is called to activate or de-activate an NFCEE
    998 **                  connected to the NFCC.
    999 **                  The response from NFCC is reported by tNFC_RESPONSE_CBACK
   1000 **                  as NFC_NFCEE_MODE_SET_REVT.
   1001 **
   1002 ** Parameters       nfcee_id - the NFCEE to activate or de-activate.
   1003 **                  mode - 0 to activate NFCEE, 1 to de-activate.
   1004 **
   1005 ** Returns          tNFC_STATUS
   1006 **
   1007 *******************************************************************************/
   1008 extern tNFC_STATUS NFC_NfceeModeSet(uint8_t nfcee_id, tNFC_NFCEE_MODE mode);
   1009 /*******************************************************************************
   1010 **
   1011 ** Function         NFC_DiscoveryMap
   1012 **
   1013 ** Description      This function is called to set the discovery interface
   1014 **                  mapping. The response from NFCC is reported by
   1015 **                  tNFC_DISCOVER_CBACK as. NFC_MAP_DEVT.
   1016 **
   1017 ** Parameters       num - the number of items in p_params.
   1018 **                  p_maps - the discovery interface mappings
   1019 **                  p_cback - the discovery callback function
   1020 **
   1021 ** Returns          tNFC_STATUS
   1022 **
   1023 *******************************************************************************/
   1024 extern tNFC_STATUS NFC_DiscoveryMap(uint8_t num, tNFC_DISCOVER_MAPS* p_maps,
   1025                                     tNFC_DISCOVER_CBACK* p_cback);
   1026 
   1027 /*******************************************************************************
   1028 **
   1029 ** Function         NFC_DiscoveryStart
   1030 **
   1031 ** Description      This function is called to start Polling and/or Listening.
   1032 **                  The response from NFCC is reported by tNFC_DISCOVER_CBACK
   1033 **                  as NFC_START_DEVT. The notification from NFCC is reported by
   1034 **                  tNFC_DISCOVER_CBACK as NFC_RESULT_DEVT.
   1035 **
   1036 ** Parameters       num_params - the number of items in p_params.
   1037 **                  p_params - the discovery parameters
   1038 **                  p_cback - the discovery callback function
   1039 **
   1040 ** Returns          tNFC_STATUS
   1041 **
   1042 *******************************************************************************/
   1043 extern tNFC_STATUS NFC_DiscoveryStart(uint8_t num_params,
   1044                                       tNFC_DISCOVER_PARAMS* p_params,
   1045                                       tNFC_DISCOVER_CBACK* p_cback);
   1046 
   1047 /*******************************************************************************
   1048 **
   1049 ** Function         NFC_DiscoverySelect
   1050 **
   1051 ** Description      If tNFC_DISCOVER_CBACK reports status=NFC_MULTIPLE_PROT,
   1052 **                  the application needs to use this function to select the
   1053 **                  the logical endpoint to continue. The response from NFCC is
   1054 **                  reported by tNFC_DISCOVER_CBACK as NFC_SELECT_DEVT.
   1055 **
   1056 ** Parameters       rf_disc_id - The ID identifies the remote device.
   1057 **                  protocol - the logical endpoint on the remote devide
   1058 **                  rf_interface - the RF interface to communicate with NFCC
   1059 **
   1060 ** Returns          tNFC_STATUS
   1061 **
   1062 *******************************************************************************/
   1063 extern tNFC_STATUS NFC_DiscoverySelect(uint8_t rf_disc_id, uint8_t protocol,
   1064                                        uint8_t rf_interface);
   1065 
   1066 /*******************************************************************************
   1067 **
   1068 ** Function         NFC_ConnCreate
   1069 **
   1070 ** Description      This function is called to create a logical connection with
   1071 **                  NFCC for data exchange.
   1072 **                  The response from NFCC is reported in tNFC_CONN_CBACK
   1073 **                  as NFC_CONN_CREATE_CEVT.
   1074 **
   1075 ** Parameters       dest_type - the destination type
   1076 **                  id   - the NFCEE ID or RF Discovery ID .
   1077 **                  protocol - the protocol
   1078 **                  p_cback - the data callback function to receive data from
   1079 **                  NFCC
   1080 **
   1081 ** Returns          tNFC_STATUS
   1082 **
   1083 *******************************************************************************/
   1084 extern tNFC_STATUS NFC_ConnCreate(uint8_t dest_type, uint8_t id,
   1085                                   uint8_t protocol, tNFC_CONN_CBACK* p_cback);
   1086 
   1087 /*******************************************************************************
   1088 **
   1089 ** Function         NFC_ConnClose
   1090 **
   1091 ** Description      This function is called to close a logical connection with
   1092 **                  NFCC.
   1093 **                  The response from NFCC is reported in tNFC_CONN_CBACK
   1094 **                  as NFC_CONN_CLOSE_CEVT.
   1095 **
   1096 ** Parameters       conn_id - the connection id.
   1097 **
   1098 ** Returns          tNFC_STATUS
   1099 **
   1100 *******************************************************************************/
   1101 extern tNFC_STATUS NFC_ConnClose(uint8_t conn_id);
   1102 
   1103 /*******************************************************************************
   1104 **
   1105 ** Function         NFC_SetStaticRfCback
   1106 **
   1107 ** Description      This function is called to update the data callback function
   1108 **                  to receive the data for the given connection id.
   1109 **
   1110 ** Parameters       p_cback - the connection callback function
   1111 **
   1112 ** Returns          Nothing
   1113 **
   1114 *******************************************************************************/
   1115 extern void NFC_SetStaticRfCback(tNFC_CONN_CBACK* p_cback);
   1116 
   1117 /*******************************************************************************
   1118 **
   1119 ** Function         NFC_SetReassemblyFlag
   1120 **
   1121 ** Description      This function is called to set if nfc will reassemble
   1122 **                  nci packet as much as its buffer can hold or it should not
   1123 **                  reassemble but forward the fragmented nci packet to layer
   1124 **                  above. If nci data pkt is fragmented, nfc may send multiple
   1125 **                  NFC_DATA_CEVT with status NFC_STATUS_CONTINUE before sending
   1126 **                  NFC_DATA_CEVT with status NFC_STATUS_OK based on reassembly
   1127 **                  configuration and reassembly buffer size
   1128 **
   1129 ** Parameters       reassembly - flag to indicate if nfc may reassemble or not
   1130 **
   1131 ** Returns          Nothing
   1132 **
   1133 *******************************************************************************/
   1134 extern void NFC_SetReassemblyFlag(bool reassembly);
   1135 
   1136 /*******************************************************************************
   1137 **
   1138 ** Function         NFC_SendData
   1139 **
   1140 ** Description      This function is called to send the given data packet
   1141 **                  to the connection identified by the given connection id.
   1142 **
   1143 ** Parameters       conn_id - the connection id.
   1144 **                  p_data - the data packet
   1145 **
   1146 ** Returns          tNFC_STATUS
   1147 **
   1148 *******************************************************************************/
   1149 extern tNFC_STATUS NFC_SendData(uint8_t conn_id, NFC_HDR* p_data);
   1150 
   1151 /*******************************************************************************
   1152 **
   1153 ** Function         NFC_FlushData
   1154 **
   1155 ** Description      This function is called to discard the tx data queue of
   1156 **                  the given connection id.
   1157 **
   1158 ** Parameters       conn_id - the connection id.
   1159 **
   1160 ** Returns          tNFC_STATUS
   1161 **
   1162 *******************************************************************************/
   1163 extern tNFC_STATUS NFC_FlushData(uint8_t conn_id);
   1164 
   1165 /*******************************************************************************
   1166 **
   1167 ** Function         NFC_Deactivate
   1168 **
   1169 ** Description      This function is called to stop the discovery process or
   1170 **                  put the listen device in sleep mode or terminate the NFC
   1171 **                  link.
   1172 **
   1173 **                  The response from NFCC is reported by tNFC_DISCOVER_CBACK
   1174 **                  as NFC_DEACTIVATE_DEVT.
   1175 **
   1176 ** Parameters       deactivate_type - NFC_DEACTIVATE_TYPE_IDLE, to IDLE mode.
   1177 **                                    NFC_DEACTIVATE_TYPE_SLEEP to SLEEP mode.
   1178 **                                    NFC_DEACTIVATE_TYPE_SLEEP_AF to SLEEP_AF
   1179 **                                    mode.
   1180 **
   1181 ** Returns          tNFC_STATUS
   1182 **
   1183 *******************************************************************************/
   1184 extern tNFC_STATUS NFC_Deactivate(tNFC_DEACT_TYPE deactivate_type);
   1185 
   1186 /*******************************************************************************
   1187 **
   1188 ** Function         NFC_UpdateRFCommParams
   1189 **
   1190 ** Description      This function is called to update RF Communication
   1191 **                  parameters once the Frame RF Interface has been activated.
   1192 **
   1193 **                  The response from NFCC is reported by tNFC_RESPONSE_CBACK
   1194 **                  as NFC_RF_COMM_PARAMS_UPDATE_REVT.
   1195 **
   1196 ** Returns          tNFC_STATUS
   1197 **
   1198 *******************************************************************************/
   1199 extern tNFC_STATUS NFC_UpdateRFCommParams(tNFC_RF_COMM_PARAMS* p_params);
   1200 
   1201 /*******************************************************************************
   1202 **
   1203 ** Function         NFC_SetPowerOffSleep
   1204 **
   1205 ** Description      This function closes/opens transport and turns off/on NFCC.
   1206 **
   1207 ** Returns          tNFC_STATUS
   1208 **
   1209 *******************************************************************************/
   1210 extern tNFC_STATUS NFC_SetPowerOffSleep(bool enable);
   1211 
   1212 /*******************************************************************************
   1213 **
   1214 ** Function         NFC_SetPowerSubState
   1215 **
   1216 ** Description      This function is called to send the power sub state(screen
   1217 **                  state) to NFCC. The response from NFCC is reported by
   1218 **                  tNFC_RESPONSE_CBACK as NFC_SET_POWER_STATE_REVT.
   1219 **
   1220 ** Parameters       scree_state
   1221 **
   1222 ** Returns          tNFC_STATUS
   1223 **
   1224 *******************************************************************************/
   1225 extern tNFC_STATUS NFC_SetPowerSubState(uint8_t screen_state);
   1226 
   1227 /*******************************************************************************
   1228 **
   1229 ** Function         NFC_PowerCycleNFCC
   1230 **
   1231 ** Description      This function turns off and then on NFCC.
   1232 **
   1233 ** Returns          tNFC_STATUS
   1234 **
   1235 *******************************************************************************/
   1236 extern tNFC_STATUS NFC_PowerCycleNFCC(void);
   1237 
   1238 /*******************************************************************************
   1239 **
   1240 ** Function         NFC_SetRouting
   1241 **
   1242 ** Description      This function is called to configure the CE routing table.
   1243 **                  The response from NFCC is reported by tNFC_RESPONSE_CBACK
   1244 **                  as NFC_SET_ROUTING_REVT.
   1245 **
   1246 ** Parameters
   1247 **
   1248 ** Returns          tNFC_STATUS
   1249 **
   1250 *******************************************************************************/
   1251 extern tNFC_STATUS NFC_SetRouting(bool more, uint8_t num_tlv, uint8_t tlv_size,
   1252                                   uint8_t* p_param_tlvs);
   1253 
   1254 /*******************************************************************************
   1255 **
   1256 ** Function         NFC_GetRouting
   1257 **
   1258 ** Description      This function is called to retrieve the CE routing table
   1259 **                  from NFCC. The response from NFCC is reported by
   1260 **                  tNFC_RESPONSE_CBACK as NFC_GET_ROUTING_REVT.
   1261 **
   1262 ** Returns          tNFC_STATUS
   1263 **
   1264 *******************************************************************************/
   1265 extern tNFC_STATUS NFC_GetRouting(void);
   1266 
   1267 /*******************************************************************************
   1268 **
   1269 ** Function         NFC_RegVSCback
   1270 **
   1271 ** Description      This function is called to register or de-register a
   1272 **                  callback function to receive Proprietary NCI response and
   1273 **                  notification events.
   1274 **                  The maximum number of callback functions allowed is
   1275 **                  NFC_NUM_VS_CBACKS
   1276 **
   1277 ** Returns          tNFC_STATUS
   1278 **
   1279 *******************************************************************************/
   1280 extern tNFC_STATUS NFC_RegVSCback(bool is_register, tNFC_VS_CBACK* p_cback);
   1281 
   1282 /*******************************************************************************
   1283 **
   1284 ** Function         NFC_SendVsCommand
   1285 **
   1286 ** Description      This function is called to send the given vendor specific
   1287 **                  command to NFCC. The response from NFCC is reported to the
   1288 **                  given tNFC_VS_CBACK as (oid).
   1289 **
   1290 ** Parameters       oid - The opcode of the VS command.
   1291 **                  p_data - The parameters for the VS command
   1292 **
   1293 ** Returns          tNFC_STATUS
   1294 **
   1295 *******************************************************************************/
   1296 extern tNFC_STATUS NFC_SendVsCommand(uint8_t oid, NFC_HDR* p_data,
   1297                                      tNFC_VS_CBACK* p_cback);
   1298 
   1299 /*******************************************************************************
   1300 **
   1301 ** Function         NFC_SendRawVsCommand
   1302 **
   1303 ** Description      This function is called to send the given raw command to
   1304 **                  NFCC. The response from NFCC is reported to the given
   1305 **                  tNFC_VS_CBACK.
   1306 **
   1307 ** Parameters       p_data - The command buffer
   1308 **
   1309 ** Returns          tNFC_STATUS
   1310 **
   1311 *******************************************************************************/
   1312 extern tNFC_STATUS NFC_SendRawVsCommand(NFC_HDR* p_data,
   1313                                         tNFC_VS_CBACK* p_cback);
   1314 
   1315 /*******************************************************************************
   1316 **
   1317 ** Function         NFC_TestLoopback
   1318 **
   1319 ** Description      This function is called to send the given data packet
   1320 **                  to NFCC for loopback test.
   1321 **                  When loopback data is received from NFCC, tNFC_TEST_CBACK .
   1322 **                  reports a NFC_LOOPBACK_TEVT.
   1323 **
   1324 ** Parameters       p_data - the data packet
   1325 **
   1326 ** Returns          tNFC_STATUS
   1327 **
   1328 *******************************************************************************/
   1329 extern tNFC_STATUS NFC_TestLoopback(NFC_HDR* p_data);
   1330 
   1331 /*******************************************************************************
   1332 **
   1333 ** Function         NFC_SetTraceLevel
   1334 **
   1335 ** Description      This function sets the trace level for NFC.  If called with
   1336 **                  a value of 0xFF, it simply returns the current trace level.
   1337 **
   1338 ** Returns          The new or current trace level
   1339 **
   1340 *******************************************************************************/
   1341 extern uint8_t NFC_SetTraceLevel(uint8_t new_level);
   1342 
   1343 /*******************************************************************************
   1344 **
   1345 ** Function         NFC_ISODEPNakPresCheck
   1346 **
   1347 ** Description      This function is called to send the ISO DEP nak presence
   1348 **                  check cmd to check that the remote end point in RF field.
   1349 **
   1350 ** Returns          tNFC_STATUS
   1351 **
   1352 *******************************************************************************/
   1353 extern tNFC_STATUS NFC_ISODEPNakPresCheck();
   1354 
   1355 #if (APPL_DTA_MODE == TRUE)
   1356 /*******************************************************************************
   1357 **
   1358 ** Function         nfc_ncif_getFWVersion
   1359 **
   1360 ** Description      This function sets the trace level for NFC.  If called with
   1361 **                  a value of 0xFF, it simply returns the current trace level.
   1362 **
   1363 ** Returns          The new or current trace level
   1364 **
   1365 *******************************************************************************/
   1366 extern tNFC_FW_VERSION nfc_ncif_getFWVersion();
   1367 #endif
   1368 
   1369 #if (BT_TRACE_VERBOSE == TRUE)
   1370 /*******************************************************************************
   1371 **
   1372 ** Function         NFC_GetStatusName
   1373 **
   1374 ** Description      This function returns the status name.
   1375 **
   1376 ** NOTE             conditionally compiled to save memory.
   1377 **
   1378 ** Returns          pointer to the name
   1379 **
   1380 *******************************************************************************/
   1381 extern char* NFC_GetStatusName(tNFC_STATUS status);
   1382 #endif
   1383 
   1384 #ifdef __cplusplus
   1385 }
   1386 #endif
   1387 
   1388 #endif /* NFC_API_H */
   1389