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 /****************************************************************************** 20 * 21 * NFA interface to NFCEE 22 * 23 ******************************************************************************/ 24 #ifndef NFA_EE_API_H 25 #define NFA_EE_API_H 26 27 #include "nfa_api.h" 28 #include "nfc_api.h" 29 #include "nfc_target.h" 30 31 /***************************************************************************** 32 ** Constants and data types 33 *****************************************************************************/ 34 /* 16 per ISO 7816 specification */ 35 #define NFA_MAX_AID_LEN NFC_MAX_AID_LEN 36 extern const uint8_t NFA_REMOVE_ALL_AID[]; 37 #define NFA_REMOVE_ALL_AID_LEN (0x08) 38 39 /* NFA EE callback events */ 40 enum { 41 NFA_EE_DISCOVER_EVT, /* The status for NFA_EeDiscover () */ 42 NFA_EE_REGISTER_EVT, /* The status for NFA_EeRegister () */ 43 NFA_EE_DEREGISTER_EVT, /* The status for NFA_EeDeregister () */ 44 NFA_EE_MODE_SET_EVT, /* The status for activating or deactivating an NFCEE */ 45 NFA_EE_ADD_AID_EVT, /* The status for adding an AID to a routing table entry 46 */ 47 NFA_EE_REMOVE_AID_EVT, /* The status for removing an AID from a routing table 48 */ 49 NFA_EE_ADD_SYSCODE_EVT, /* The status for adding an System Code to a routing 50 table entry */ 51 NFA_EE_REMOVE_SYSCODE_EVT, /* The status for removing an System Code from 52 routing table */ 53 NFA_EE_REMAINING_SIZE_EVT, /* The remaining size of the Listen Mode Routing 54 Table */ 55 NFA_EE_SET_TECH_CFG_EVT, /* The status for setting the routing based on RF 56 tech. */ 57 NFA_EE_CLEAR_TECH_CFG_EVT, /* The status for clearing the routing based on RF 58 tech. */ 59 60 NFA_EE_SET_PROTO_CFG_EVT, /* The status for setting the routing based on 61 protocols */ 62 NFA_EE_CLEAR_PROTO_CFG_EVT, /* The status for clearing the routing based on 63 protocols */ 64 65 NFA_EE_UPDATED_EVT, /* The status for NFA_EeUpdateNow */ 66 NFA_EE_CONNECT_EVT, /* Result of NFA_EeConnect */ 67 NFA_EE_DATA_EVT, /* Received data from NFCEE. */ 68 NFA_EE_DISCONNECT_EVT, /* NFCEE connection closed. */ 69 NFA_EE_NEW_EE_EVT, /* A new NFCEE is discovered */ 70 NFA_EE_ACTION_EVT, /* An action happened in NFCEE */ 71 NFA_EE_DISCOVER_REQ_EVT, /* NFCEE Discover Request Notification */ 72 NFA_EE_ENABLED_EVT, /* NFCEE EEs after active EE */ 73 NFA_EE_PWR_AND_LINK_CTRL_EVT, /* NFCEE power and link ctrl */ 74 NFA_EE_NO_MEM_ERR_EVT, /* Error - out of GKI buffers */ 75 NFA_EE_NO_CB_ERR_EVT /* Error - Can not find control block or wrong state */ 76 }; 77 typedef uint8_t tNFA_EE_EVT; 78 79 /* tNFA_NFCEE_INTERFACE values */ 80 /* HCI Access Interface*/ 81 #define NFA_EE_INTERFACE_HCI_ACCESS NFC_NFCEE_INTERFACE_HCI_ACCESS 82 typedef uint8_t tNFA_EE_INTERFACE; 83 84 typedef uint8_t tNFA_EE_TAG; 85 86 /* for NFA_EeModeSet () */ 87 #define NFA_EE_MD_ACTIVATE NFC_MODE_ACTIVATE 88 #define NFA_EE_MD_DEACTIVATE NFC_MODE_DEACTIVATE 89 typedef uint8_t tNFA_EE_MD; 90 91 /* The device is on */ 92 #define NFA_EE_PWR_STATE_ON 0x01 93 /* The device is switched off */ 94 #define NFA_EE_PWR_STATE_SWITCH_OFF 0x02 95 /* The device's battery is removed */ 96 #define NFA_EE_PWR_STATE_BATT_OFF 0x04 97 typedef uint8_t tNFA_EE_PWR_STATE; 98 99 /* NFCEE connected and inactive */ 100 #define NFA_EE_STATUS_INACTIVE NFC_NFCEE_STATUS_INACTIVE 101 /* NFCEE connected and active */ 102 #define NFA_EE_STATUS_ACTIVE NFC_NFCEE_STATUS_ACTIVE 103 /* NFCEE removed */ 104 #define NFA_EE_STATUS_REMOVED NFC_NFCEE_STATUS_REMOVED 105 106 /* waiting for response from NFCC */ 107 #define NFA_EE_STATUS_PENDING 0x10 108 typedef uint8_t tNFA_EE_STATUS; 109 110 /* additional NFCEE Info */ 111 typedef struct { 112 tNFA_EE_TAG tag; 113 uint8_t len; 114 uint8_t info[NFC_MAX_EE_INFO]; 115 } tNFA_EE_TLV; 116 117 typedef struct { 118 tNFA_HANDLE ee_handle; /* handle for NFCEE oe DH */ 119 tNFA_EE_STATUS ee_status; /* The NFCEE status */ 120 uint8_t num_interface; /* number of NFCEE interface*/ 121 tNFA_EE_INTERFACE 122 ee_interface[NFC_MAX_EE_INTERFACE]; /* NFCEE supported interface */ 123 uint8_t num_tlvs; /* number of TLVs */ 124 tNFA_EE_TLV ee_tlv[NFC_MAX_EE_TLVS]; /* the TLV */ 125 uint8_t ee_power_supply_status; /* The NFCEE Power supply */ 126 tNFA_NFC_PROTOCOL la_protocol; /* Listen A protocol */ 127 tNFA_NFC_PROTOCOL lb_protocol; /* Listen B protocol */ 128 tNFA_NFC_PROTOCOL lf_protocol; /* Listen F protocol */ 129 } tNFA_EE_INFO; 130 131 typedef struct { 132 tNFA_STATUS status; /* NFA_STATUS_OK is successful */ 133 uint8_t num_ee; /* number of NFCEEs found */ 134 tNFA_EE_INFO ee_info[NFA_EE_MAX_EE_SUPPORTED]; /*NFCEE information */ 135 } tNFA_EE_DISCOVER; 136 137 typedef struct { 138 tNFA_HANDLE ee_handle; /* Handle of NFCEE */ 139 tNFA_STATUS status; /* NFA_STATUS_OK is successful */ 140 tNFA_EE_INTERFACE 141 ee_interface; /* NFCEE interface associated with this connection */ 142 } tNFA_EE_CONNECT; 143 144 typedef tNFC_EE_TRIGGER tNFA_EE_TRIGGER; 145 146 /* Union of NFCEE action parameter depending on the associated trigger */ 147 typedef union { 148 tNFA_NFC_PROTOCOL protocol; /* NFA_EE_TRGR_RF_PROTOCOL: the protocol that 149 triggers this event */ 150 tNFC_RF_TECH technology; /* NFA_EE_TRGR_RF_TECHNOLOGY:the technology that 151 triggers this event */ 152 tNFC_AID aid; /* NFA_EE_TRGR_SELECT : the AID in the received SELECT AID 153 command */ 154 tNFC_APP_INIT app_init; /* NFA_EE_TRGR_APP_INIT: The information for the 155 application initiated trigger */ 156 } tNFA_EE_ACTION_PARAM; 157 158 typedef struct { 159 tNFA_HANDLE ee_handle; /* Handle of NFCEE */ 160 tNFA_EE_TRIGGER trigger; /* the trigger of this event */ 161 tNFA_EE_ACTION_PARAM param; 162 } tNFA_EE_ACTION; 163 164 typedef struct { 165 tNFA_HANDLE ee_handle; /* Handle of NFCEE */ 166 tNFA_STATUS status; /* NFA_STATUS_OK is successful */ 167 tNFA_EE_STATUS ee_status; /* The NFCEE status */ 168 } tNFA_EE_MODE_SET; 169 170 typedef struct { 171 tNFA_HANDLE ee_handle; /* Handle of MFCEE */ 172 tNFA_NFC_PROTOCOL la_protocol; /* Listen A protocol */ 173 tNFA_NFC_PROTOCOL lb_protocol; /* Listen B protocol */ 174 tNFA_NFC_PROTOCOL lf_protocol; /* Listen F protocol */ 175 tNFA_NFC_PROTOCOL lbp_protocol; /* Listen B' protocol */ 176 } tNFA_EE_DISCOVER_INFO; 177 178 /* Data for NFA_EE_DISCOVER_REQ_EVT */ 179 typedef struct { 180 uint8_t status; /* NFA_STATUS_OK if successful */ 181 uint8_t num_ee; /* number of MFCEE information */ 182 tNFA_EE_DISCOVER_INFO ee_disc_info[NFA_EE_MAX_EE_SUPPORTED - 183 1]; /* NFCEE DISCOVER Request info */ 184 } tNFA_EE_DISCOVER_REQ; 185 186 /* Data for NFA_EE_DATA_EVT */ 187 typedef struct { 188 tNFA_HANDLE handle; /* Connection handle */ 189 uint16_t len; /* Length of data */ 190 uint8_t* p_buf; /* Data buffer */ 191 } tNFA_EE_DATA; 192 193 /* Union of all EE callback structures */ 194 typedef union { 195 tNFA_STATUS 196 status; /* NFA_STATUS_OK is successful; otherwise NFA_STATUS_FAILED */ 197 tNFA_EE_DATA data; 198 tNFA_HANDLE handle; 199 tNFA_EE_DISCOVER ee_discover; 200 tNFA_STATUS ee_register; 201 tNFA_STATUS deregister; 202 tNFA_STATUS add_aid; 203 tNFA_STATUS remove_aid; 204 tNFA_STATUS add_sc; 205 tNFA_STATUS remove_sc; 206 tNFA_STATUS set_tech; 207 tNFA_STATUS clear_tech; 208 tNFA_STATUS set_proto; 209 tNFA_STATUS clear_proto; 210 uint16_t size; 211 tNFA_EE_CONNECT connect; 212 tNFA_EE_ACTION action; 213 tNFA_EE_MODE_SET mode_set; 214 tNFA_EE_INFO new_ee; 215 tNFA_EE_DISCOVER_REQ discover_req; 216 } tNFA_EE_CBACK_DATA; 217 218 /* EE callback */ 219 typedef void(tNFA_EE_CBACK)(tNFA_EE_EVT event, tNFA_EE_CBACK_DATA* p_data); 220 221 /***************************************************************************** 222 ** External Function Declarations 223 *****************************************************************************/ 224 225 /******************************************************************************* 226 ** 227 ** Function NFA_EeDiscover 228 ** 229 ** Description This function retrieves the NFCEE information from NFCC. 230 ** The NFCEE information is reported in NFA_EE_DISCOVER_EVT. 231 ** 232 ** This function may be called when a system supports removable 233 ** NFCEEs, 234 ** 235 ** Returns NFA_STATUS_OK if information is retrieved successfully 236 ** NFA_STATUS_FAILED If wrong state (retry later) 237 ** NFA_STATUS_INVALID_PARAM If bad parameter 238 ** 239 *******************************************************************************/ 240 extern tNFA_STATUS NFA_EeDiscover(tNFA_EE_CBACK* p_cback); 241 242 /******************************************************************************* 243 ** 244 ** Function NFA_EeGetInfo 245 ** 246 ** Description This function retrieves the NFCEE information from NFA. 247 ** The actual number of NFCEE is returned in p_num_nfcee 248 ** and NFCEE information is returned in p_info 249 ** 250 ** Returns NFA_STATUS_OK if information is retrieved successfully 251 ** NFA_STATUS_FAILED If wrong state (retry later) 252 ** NFA_STATUS_INVALID_PARAM If bad parameter 253 ** 254 *******************************************************************************/ 255 extern tNFA_STATUS NFA_EeGetInfo(uint8_t* p_num_nfcee, tNFA_EE_INFO* p_info); 256 257 /******************************************************************************* 258 ** 259 ** Function NFA_EeGetMepInfo 260 ** 261 ** Description This function retrieves the MEP NFCEE information from NFA. 262 ** The actual number of NFCEE is returned in p_num_nfcee 263 ** and NFCEE information is returned in p_info 264 ** 265 ** Returns NFA_STATUS_OK if information is retrieved successfully 266 ** NFA_STATUS_FAILED If wrong state (retry later) 267 ** NFA_STATUS_INVALID_PARAM If bad parameter 268 ** 269 *******************************************************************************/ 270 extern tNFA_STATUS NFA_EeGetMepInfo(uint8_t* p_num_nfcee, tNFA_EE_INFO* p_info); 271 272 /******************************************************************************* 273 ** 274 ** Function NFA_EeRegister 275 ** 276 ** Description This function registers a callback function to receive the 277 ** events from NFA-EE module. 278 ** 279 ** Returns NFA_STATUS_OK if successfully initiated 280 ** NFA_STATUS_FAILED otherwise 281 ** NFA_STATUS_INVALID_PARAM If bad parameter 282 ** 283 *******************************************************************************/ 284 extern tNFA_STATUS NFA_EeRegister(tNFA_EE_CBACK* p_cback); 285 286 /******************************************************************************* 287 ** 288 ** Function NFA_EeDeregister 289 ** 290 ** Description This function de-registers the callback function 291 ** 292 ** Returns NFA_STATUS_OK if successfully initiated 293 ** NFA_STATUS_FAILED otherwise 294 ** NFA_STATUS_INVALID_PARAM If bad parameter 295 ** 296 *******************************************************************************/ 297 extern tNFA_STATUS NFA_EeDeregister(tNFA_EE_CBACK* p_cback); 298 299 /******************************************************************************* 300 ** 301 ** Function NFA_EeModeSet 302 ** 303 ** Description This function is called to activate 304 ** (mode = NFA_EE_MD_ACTIVATE) or deactivate 305 ** (mode = NFA_EE_MD_DEACTIVATE) the NFCEE identified by the 306 ** given ee_handle. The result of this operation is reported 307 ** with the NFA_EE_MODE_SET_EVT. 308 ** 309 ** Returns NFA_STATUS_OK if successfully initiated 310 ** NFA_STATUS_FAILED otherwise 311 ** NFA_STATUS_INVALID_PARAM If bad parameter 312 ** 313 *******************************************************************************/ 314 extern tNFA_STATUS NFA_EeModeSet(tNFA_HANDLE ee_handle, tNFA_EE_MD mode); 315 316 /******************************************************************************* 317 ** 318 ** Function NFA_EeSetDefaultTechRouting 319 ** 320 ** Description This function is called to add, change or remove the 321 ** default routing based on RF technology in the listen mode 322 ** routing table for the given ee_handle. The status of this 323 ** operation is reported as the NFA_EE_SET_TECH_CFG_EVT. 324 ** 325 ** Note: If RF discovery is started, 326 ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should 327 ** happen before calling this function 328 ** 329 ** Note: NFA_EeUpdateNow() should be called after last NFA-EE 330 ** function to change the listen mode routing is called. 331 ** 332 ** Returns NFA_STATUS_OK if successfully initiated 333 ** NFA_STATUS_FAILED otherwise 334 ** NFA_STATUS_INVALID_PARAM If bad parameter 335 ** 336 *******************************************************************************/ 337 extern tNFA_STATUS NFA_EeSetDefaultTechRouting( 338 tNFA_HANDLE ee_handle, tNFA_TECHNOLOGY_MASK technologies_switch_on, 339 tNFA_TECHNOLOGY_MASK technologies_switch_off, 340 tNFA_TECHNOLOGY_MASK technologies_battery_off, 341 tNFA_TECHNOLOGY_MASK technologies_screen_lock, 342 tNFA_TECHNOLOGY_MASK technologies_screen_off, 343 tNFA_TECHNOLOGY_MASK technologies_screen_off_lock); 344 345 /******************************************************************************* 346 ** 347 ** Function NFA_EeClearDefaultTechRouting 348 ** 349 ** Description This function is called to remove the 350 ** default routing based on RF technology in the listen mode 351 ** routing table for the given ee_handle. The status of this 352 ** operation is reported as the NFA_EE_CLEAR_TECH_CFG_EVT. 353 ** 354 ** Note: If RF discovery is started, 355 ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should 356 ** happen before calling this function 357 ** 358 ** Note: NFA_EeUpdateNow() should be called after last NFA-EE 359 ** function to change the listen mode routing is called. 360 ** 361 ** Returns NFA_STATUS_OK if successfully initiated 362 ** NFA_STATUS_FAILED otherwise 363 ** NFA_STATUS_INVALID_PARAM If bad parameter 364 ** 365 *******************************************************************************/ 366 extern tNFA_STATUS NFA_EeClearDefaultTechRouting( 367 tNFA_HANDLE ee_handle, tNFA_TECHNOLOGY_MASK clear_technology); 368 369 /******************************************************************************* 370 ** 371 ** Function NFA_EeSetDefaultProtoRouting 372 ** 373 ** Description This function is called to add, change or remove the 374 ** default routing based on Protocol in the listen mode routing 375 ** table for the given ee_handle. The status of this 376 ** operation is reported as the NFA_EE_SET_PROTO_CFG_EVT. 377 ** 378 ** Note: If RF discovery is started, 379 ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should 380 ** happen before calling this function 381 ** 382 ** Note: NFA_EeUpdateNow() should be called after last NFA-EE 383 ** function to change the listen mode routing is called. 384 ** 385 ** Returns NFA_STATUS_OK if successfully initiated 386 ** NFA_STATUS_FAILED otherwise 387 ** NFA_STATUS_INVALID_PARAM If bad parameter 388 ** 389 *******************************************************************************/ 390 extern tNFA_STATUS NFA_EeSetDefaultProtoRouting( 391 tNFA_HANDLE ee_handle, tNFA_PROTOCOL_MASK protocols_switch_on, 392 tNFA_PROTOCOL_MASK protocols_switch_off, 393 tNFA_PROTOCOL_MASK protocols_battery_off, 394 tNFA_PROTOCOL_MASK technologies_screen_lock, 395 tNFA_PROTOCOL_MASK technologies_screen_off, 396 tNFA_PROTOCOL_MASK technologies_screen_off_lock); 397 398 /******************************************************************************* 399 ** 400 ** Function NFA_EeClearDefaultProtoRouting 401 ** 402 ** Description This function is called remove the 403 ** default routing based on Protocol in the listen mode routing 404 ** table for the given ee_handle. The status of this 405 ** operation is reported as the NFA_EE_CLEAR_PROTO_CFG_EVT. 406 ** 407 ** Note: If RF discovery is started, 408 ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should 409 ** happen before calling this function 410 ** 411 ** Note: NFA_EeUpdateNow() should be called after last NFA-EE 412 ** function to change the listen mode routing is called. 413 ** 414 ** Returns NFA_STATUS_OK if successfully initiated 415 ** NFA_STATUS_FAILED otherwise 416 ** NFA_STATUS_INVALID_PARAM If bad parameter 417 ** 418 *******************************************************************************/ 419 extern tNFA_STATUS NFA_EeClearDefaultProtoRouting( 420 tNFA_HANDLE ee_handle, tNFA_PROTOCOL_MASK clear_protocol); 421 422 /******************************************************************************* 423 ** 424 ** Function NFA_EeAddAidRouting 425 ** 426 ** Description This function is called to add an AID entry in the 427 ** listen mode routing table in NFCC. The status of this 428 ** operation is reported as the NFA_EE_ADD_AID_EVT. 429 ** 430 ** Note: If RF discovery is started, 431 ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should 432 ** happen before calling this function 433 ** 434 ** Note: NFA_EeUpdateNow() should be called after last NFA-EE 435 ** function to change the listen mode routing is called. 436 ** 437 ** Returns NFA_STATUS_OK if successfully initiated 438 ** NFA_STATUS_FAILED otherwise 439 ** NFA_STATUS_INVALID_PARAM If bad parameter 440 ** 441 *******************************************************************************/ 442 extern tNFA_STATUS NFA_EeAddAidRouting(tNFA_HANDLE ee_handle, uint8_t aid_len, 443 uint8_t* p_aid, 444 tNFA_EE_PWR_STATE power_state, 445 uint8_t aidInfo); 446 447 /******************************************************************************* 448 ** 449 ** Function NFA_EeRemoveAidRouting 450 ** 451 ** Description This function is called to remove the given AID entry from 452 ** the listen mode routing table. If the entry configures VS, 453 ** it is also removed. The status of this operation is reported 454 ** as the NFA_EE_REMOVE_AID_EVT. 455 ** 456 ** Note: If RF discovery is started, 457 ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should 458 ** happen before calling this function 459 ** 460 ** Note: NFA_EeUpdateNow() should be called after last NFA-EE 461 ** function to change the listen mode routing is called. 462 ** 463 ** Returns NFA_STATUS_OK if successfully initiated 464 ** NFA_STATUS_FAILED otherwise 465 ** NFA_STATUS_INVALID_PARAM If bad parameter 466 ** 467 *******************************************************************************/ 468 extern tNFA_STATUS NFA_EeRemoveAidRouting(uint8_t aid_len, uint8_t* p_aid); 469 470 /******************************************************************************* 471 ** 472 ** Function NFA_EeAddSystemCodeRouting 473 ** 474 ** Description This function is called to add an system code entry in the 475 ** listen mode routing table in NFCC. The status of this 476 ** operation is reported as the NFA_EE_ADD_SYSCODE_EVT. 477 ** 478 ** Note: If RF discovery is started, 479 ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should 480 ** happen before calling this function 481 ** 482 ** Note: NFA_EeUpdateNow() should be called after last NFA-EE 483 ** function to change the listen mode routing is called. 484 ** 485 ** Returns NFA_STATUS_OK if successfully initiated 486 ** NFA_STATUS_FAILED otherwise 487 ** NFA_STATUS_INVALID_PARAM If bad parameter 488 ** 489 *******************************************************************************/ 490 extern tNFA_STATUS NFA_EeAddSystemCodeRouting(uint16_t systemcode, 491 tNFA_HANDLE ee_handle, 492 tNFA_EE_PWR_STATE power_state); 493 494 /******************************************************************************* 495 ** 496 ** Function NFA_EeRemoveSystemCodeRouting 497 ** 498 ** Description This function is called to remove the given System Code 499 *based entry from 500 ** the listen mode routing table. The status of this operation 501 *is reported 502 ** as the NFA_EE_REMOVE_SYSCODE_EVT. 503 ** 504 ** Note: If RF discovery is started, 505 ** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should 506 ** happen before calling this function 507 ** 508 ** Note: NFA_EeUpdateNow() should be called after last NFA-EE 509 ** function to change the listen mode routing is called. 510 ** 511 ** Returns NFA_STATUS_OK if successfully initiated 512 ** NFA_STATUS_FAILED otherwise 513 ** NFA_STATUS_INVALID_PARAM If bad parameter 514 ** 515 *******************************************************************************/ 516 extern tNFA_STATUS NFA_EeRemoveSystemCodeRouting(uint16_t systemcode); 517 518 /******************************************************************************* 519 ** 520 ** Function NFA_GetAidTableSize 521 ** 522 ** Description This function is called to get the AID routing table size. 523 ** 524 ** Returns Maximum AID routing table size. 525 ** 526 *******************************************************************************/ 527 extern uint16_t NFA_GetAidTableSize(); 528 529 /******************************************************************************* 530 ** 531 ** Function NFA_EeGetLmrtRemainingSize 532 ** 533 ** Description This function is called to get remaining size of the 534 ** Listen Mode Routing Table. 535 ** The remaining size is reported in NFA_EE_REMAINING_SIZE_EVT 536 ** 537 ** Returns NFA_STATUS_OK if successfully initiated 538 ** NFA_STATUS_FAILED otherwise 539 ** 540 *******************************************************************************/ 541 extern tNFA_STATUS NFA_EeGetLmrtRemainingSize(void); 542 543 /******************************************************************************* 544 ** 545 ** Function NFA_EeUpdateNow 546 ** 547 ** Description This function is called to send the current listen mode 548 ** routing table and VS configuration to the NFCC (without 549 ** waiting for NFA_EE_ROUT_TIMEOUT_VAL). 550 ** 551 ** The status of this operation is 552 ** reported with the NFA_EE_UPDATED_EVT. 553 ** 554 ** Returns NFA_STATUS_OK if successfully initiated 555 ** NFA_STATUS_SEMANTIC_ERROR is update is currently in progress 556 ** NFA_STATUS_FAILED otherwise 557 ** 558 *******************************************************************************/ 559 extern tNFA_STATUS NFA_EeUpdateNow(void); 560 561 /******************************************************************************* 562 ** 563 ** Function NFA_EeConnect 564 ** 565 ** Description Open connection to an NFCEE attached to the NFCC 566 ** 567 ** The status of this operation is 568 ** reported with the NFA_EE_CONNECT_EVT. 569 ** 570 ** Returns NFA_STATUS_OK if successfully initiated 571 ** NFA_STATUS_FAILED otherwise 572 ** NFA_STATUS_INVALID_PARAM If bad parameter 573 ** 574 *******************************************************************************/ 575 extern tNFA_STATUS NFA_EeConnect(tNFA_HANDLE ee_handle, uint8_t ee_interface, 576 tNFA_EE_CBACK* p_cback); 577 578 /******************************************************************************* 579 ** 580 ** Function NFA_EeSendData 581 ** 582 ** Description Send data to the given NFCEE. 583 ** This function shall be called after NFA_EE_CONNECT_EVT is 584 ** reported and before NFA_EeDisconnect is called on the given 585 ** ee_handle. 586 ** 587 ** Returns NFA_STATUS_OK if successfully initiated 588 ** NFA_STATUS_FAILED otherwise 589 ** NFA_STATUS_INVALID_PARAM If bad parameter 590 ** 591 *******************************************************************************/ 592 extern tNFA_STATUS NFA_EeSendData(tNFA_HANDLE ee_handle, uint16_t data_len, 593 uint8_t* p_data); 594 595 /******************************************************************************* 596 ** 597 ** Function NFA_EeDisconnect 598 ** 599 ** Description Disconnect (if a connection is currently open) from an 600 ** NFCEE interface. The result of this operation is reported 601 ** with the NFA_EE_DISCONNECT_EVT. 602 ** 603 ** Returns NFA_STATUS_OK if successfully initiated 604 ** NFA_STATUS_FAILED otherwise 605 ** NFA_STATUS_INVALID_PARAM If bad parameter 606 ** 607 *******************************************************************************/ 608 extern tNFA_STATUS NFA_EeDisconnect(tNFA_HANDLE ee_handle); 609 610 /******************************************************************************* 611 ** 612 ** Function NFA_EePowerAndLinkCtrl 613 ** 614 ** Description This Control Message is used by the DH to constrain the way 615 ** the NFCC manages the power supply and communication links 616 ** between the NFCC and its connected NFCEEs. 617 ** 618 ** Returns NFA_STATUS_OK if successfully initiated 619 ** NFA_STATUS_FAILED otherwise 620 ** NFA_STATUS_INVALID_PARAM If bad parameter 621 ** 622 *******************************************************************************/ 623 extern tNFA_STATUS NFA_EePowerAndLinkCtrl(tNFA_HANDLE ee_handle, 624 uint8_t config); 625 626 /******************************************************************************* 627 ** 628 ** Function NFA_EeClearRoutingTable 629 ** 630 ** Description 631 ** 632 ** Returns NFA_STATUS_OK if successful 633 ** 634 *******************************************************************************/ 635 extern tNFA_STATUS NFA_EeClearRoutingTable(bool clear_tech, bool clear_proto, 636 bool clear_sc); 637 638 #endif /* NFA_EE_API_H */ 639