1 /* 2 * Copyright (C) 2010 NXP Semiconductors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 /*! 18 *\file phLibNfc_1.1.h 19 *\brief Contains FRI1.1 API details. 20 *Project: NFC-FRI 1.1 21 * $Workfile:: phLibNfc_1.1.h $ 22 * $Modtime:: $ 23 * $Author: ing07385 $ 24 * $Revision: 1.80 $ 25 * $Aliases: NFC_FRI1.1_WK1014_SDK,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1019_SDK,NFC_FRI1.1_WK1024_SDK $ 26 *\defgroup grp_lib_nfc LIBNFC Component 27 */ 28 /* \page LibNfc_release_label FRI1.1 API Release Label 29 * $Aliases: NFC_FRI1.1_WK1014_SDK,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1019_SDK,NFC_FRI1.1_WK1024_SDK $ 30 *\note This is the TAG (label, alias) of the FRI1.1. 31 *If the string is empty, the current documentation 32 * has not been generated for official release. 33 */ 34 #ifndef PHLIBNFC_H 35 #define PHLIBNFC_H 36 #include <phNfcTypes.h> 37 #include <phLibNfcStatus.h> 38 #include <phFriNfc_NdefRecord.h> 39 #include <phNfcLlcpTypes.h> 40 #ifdef ANDROID 41 #include <string.h> 42 #endif 43 /*! 44 *\def PHLIBNFC_MAXNO_OF_SE 45 *Defines maximum no of secured elements supported by PN544. 46 */ 47 #define PHLIBNFC_MAXNO_OF_SE (0x02) 48 49 typedef uint32_t phLibNfc_Handle; 50 51 52 /** 53 *\ingroup grp_lib_nfc 54 * 55 *\brief Defines Testmode Init configuration values 56 */ 57 58 typedef enum 59 { 60 phLibNfc_TstMode_Off = 0x00, /**< Test mode is off */ 61 phLibNfc_TstMode_On /**< Testmode is on */ 62 63 } phLibNfc_Cfg_Testmode_t; 64 65 66 /** 67 *\ingroup grp_lib_nfc 68 * 69 *\brief Defines Secure Element configurable states 70 */ 71 72 typedef enum 73 { 74 phLibNfc_SE_Active = 0x00, /**< state of the SE is active */ 75 phLibNfc_SE_Inactive= 0x01 /**< state of the SE is In active*/ 76 77 } phLibNfc_SE_State_t; 78 79 /** 80 *\ingroup grp_lib_nfc 81 * 82 *\brief Defines Secure Element types. 83 */ 84 typedef enum 85 { 86 phLibNfc_SE_Type_Invalid=0x00,/**< Indicates SE type is Invalid */ 87 phLibNfc_SE_Type_SmartMX=0x01,/**< Indicates SE type is SmartMX */ 88 phLibNfc_SE_Type_UICC =0x02,/**<Indicates SE type is UICC */ 89 phLibNfc_SE_Type_Unknown=0x03/**< Indicates SE type is Unknown */ 90 }phLibNfc_SE_Type_t; 91 92 /** 93 *\ingroup grp_lib_nfc 94 * 95 *\brief Defines Ndef Card Offset. 96 */ 97 typedef enum 98 { 99 phLibNfc_Ndef_EBegin = 0x01, /**< Start from Beginning position */ 100 phLibNfc_Ndef_ECurrent /**< Start from Current position */ 101 102 } phLibNfc_Ndef_EOffset_t; 103 104 /** 105 * \ingroup grp_lib_nfc 106 * 107 *\brief This function allows to activate specific Secure element. 108 109 *\b VirtualMode: Virtual mode is used to communicated with secure elements from external reader. 110 * This mode is also called as card emulation mode.when secure element mode is set 111 * to this mode,external reader can communicate with this SE. 112 * 113 *\b WiredMode: Wired mode is used to communicate with the Secure Element internally. 114 * No RF field is generated. In this mode, PN544 acts as reader and discovers 115 * SmartMX as MIFARE tag.External reader cannot access any of the SE's in this mode. 116 * This mode is applicable to only SmartMX secure element. 117 * 118 */ 119 typedef enum 120 { 121 phLibNfc_SE_ActModeWired=0x00, /**< Enables Wired Mode communication.This mode shall 122 be applied to */ 123 phLibNfc_SE_ActModeDefault = 0x01, /**< Enables Virtual Mode communication. 124 This can be applied to UICC as well as SmartMX*/ 125 phLibNfc_SE_ActModeVirtual=0x02, /**< Enables Virtual Mode communication. 126 This can be applied to UICC as well as SmartMX*/ 127 phLibNfc_SE_ActModeOff =0x03 /**< Inactivate SE.This means,put SE in in-active state */ 128 129 }phLibNfc_eSE_ActivationMode; 130 131 /** 132 * \ingroup grp_lib_nfc 133 * 134 *\brief Defines SE low power mode types. 135 */ 136 typedef enum 137 { 138 phLibNfc_SE_LowPowerMode_Off= 0x01, /**< Indicates no SE to be selected in low power mode */ 139 phLibNfc_SE_LowPowerMode_On = 0x02 /**< Indicates requested SE to be selected in low power mode */ 140 141 } phLibNfc_SE_LowPowerMode_t; 142 143 /** 144 * \ingroup grp_lib_nfc 145 * 146 *\brief Defines Secure element event info . 147 */ 148 typedef union phLibNfc_uSeEvtInfo 149 { 150 phNfc_sUiccInfo_t UiccEvtInfo; /**< Indicates UICC event info for Evt_Transaction event */ 151 }phLibNfc_uSeEvtInfo_t; 152 153 /** 154 * \ingroup grp_lib_nfc 155 * 156 *\brief Types of SE transaction events sent to SE notification handler . 157 */ 158 typedef enum 159 { 160 phLibNfc_eSE_EvtStartTransaction=0x00, /**< Indicates transaction started on 161 secure element */ 162 phLibNfc_eSE_EvtEndTransaction=0x01, /**<Indicates transaction ended on secure 163 element*/ 164 phLibNfc_eSE_EvtTypeTransaction=0x02, /**<Indicates external reader trying to access secure element */ 165 166 phLibNfc_eSE_EvtConnectivity /**<This event notifies the terminal host that it shall 167 send a connectivity event from UICC as defined in 168 ETSI TS 102 622 V7.4.0 */ 169 } phLibNfc_eSE_EvtType_t; 170 171 /** 172 * \ingroup grp_lib_nfc 173 * 174 *\brief Defines possible registration details for notifications. 175 */ 176 typedef phNfc_sSupProtocol_t phLibNfc_Registry_Info_t; 177 178 /** 179 * \ingroup grp_lib_nfc 180 * 181 *\brief Generic Data buffer definition. 182 */ 183 typedef phNfc_sData_t phLibNfc_Data_t; 184 /** 185 * \ingroup grp_lib_nfc 186 * 187 * Application Identifier (phLibNfc_AID) 188 * 189 * The application identifier defines a specific application on a SE. 190 * 191 */ 192 typedef phNfc_sData_t phLibNfc_AID; 193 /** 194 * \ingroup grp_lib_nfc 195 * 196 *\brief Remote Device Info definition . 197 */ 198 typedef phNfc_sRemoteDevInformation_t phLibNfc_sRemoteDevInformation_t; 199 /** 200 * \ingroup grp_lib_nfc 201 */ 202 typedef phNfc_eDiscoveryConfigMode_t phLibNfc_eDiscoveryConfigMode_t; 203 204 /** 205 * \ingroup grp_lib_nfc 206 * 207 *\brief Transceive info definition. 208 */ 209 typedef phNfc_sTransceiveInfo_t phLibNfc_sTransceiveInfo_t; 210 /** 211 * \ingroup grp_lib_nfc 212 * 213 *\brief Automatic Device Discovery Definition. 214 */ 215 typedef phNfc_sADD_Cfg_t phLibNfc_sADD_Cfg_t; 216 /** 217 *\ingroup grp_lib_nfc 218 * 219 *\brief Release mode definition. 220 */ 221 typedef phNfc_eReleaseType_t phLibNfc_eReleaseType_t; 222 223 /** 224 *\ingroup grp_lib_nfc 225 * 226 *\brief device capabilities details. 227 */ 228 typedef phNfc_sDeviceCapabilities_t phLibNfc_sDeviceCapabilities_t; 229 230 /** 231 * \ingroup grp_lib_nfc 232 * 233 *\brief Defines supported tag types for NDEF mapping and formatting feature. 234 */ 235 typedef struct SupportedTagInfo 236 { 237 unsigned MifareUL:1; /**<TRUE indicates specified feature (mapping or formatting)for MIFARE UL tag supported else not supported.*/ 238 unsigned MifareStd:1; /**<TRUE indicates specified feature (mapping or formatting)for Mifare Std tag supported else not supported.*/ 239 unsigned MifareULC:1; /**<TRUE indicates specified feature (mapping or formatting)for MIFARE UL2 tag supported else not supported.*/ 240 unsigned ISO14443_4A:1; /**<TRUE indicates specified feature (mapping or formatting)for ISO14443_4A tag supported else not supported.*/ 241 unsigned ISO14443_4B:1; /**<TRUE indicates specified feature (mapping or formatting)for ISO14443_4B tag supported else not supported.*/ 242 unsigned ISO15693:1; /**<TRUE indicates specified feature (mapping or formatting)for ISO15693 tag supported else not supported.*/ 243 unsigned FeliCa:1; /**<TRUE indicates specified feature (mapping or formatting)for FeliCa tag supported else not supported.*/ 244 unsigned Jewel:1; /**<TRUE indicates specified feature (mapping or formatting)for JEWEL tag supported else not supported.*/ 245 unsigned Desfire:1; /**<TRUE indicates specified feature (mapping or formatting)for desfire tag supported else not supported.*/ 246 247 }phLibNfc_sSupportedTagInfo_t; 248 249 250 /** 251 * \ingroup grp_lib_nfc 252 * 253 *\brief Defines supported tag types for NDEF mapping feature. 254 */ 255 typedef phLibNfc_sSupportedTagInfo_t phLibNfc_sNDEFMappingInfo_t; 256 257 /** 258 * \ingroup grp_lib_nfc 259 * 260 *\brief Defines supported tag types for NDEF formatting feature. 261 */ 262 263 typedef phLibNfc_sSupportedTagInfo_t phLibNfc_sTagFormattingInfo_t; 264 265 /** 266 * \ingroup grp_lib_nfc 267 * 268 *\brief Stack capabilities details contains device capabilities and supported tags for NDEF mapping and formatting feature. 269 */ 270 271 typedef struct StackCapabilities 272 { 273 phLibNfc_sDeviceCapabilities_t psDevCapabilities; 274 phLibNfc_sNDEFMappingInfo_t psMappingCapabilities; 275 phLibNfc_sTagFormattingInfo_t psFormatCapabilities; 276 }phLibNfc_StackCapabilities_t; 277 278 279 /** 280 * \ingroup grp_lib_nfc 281 * 282 *\brief Defines Secure Element list type. 283 */ 284 typedef struct phLibNfc_SecureElementInfo 285 { 286 phLibNfc_Handle hSecureElement; /**< handle to Secure Element */ 287 phLibNfc_SE_Type_t eSE_Type; /**< type of Secure Element(SE)*/ 288 phLibNfc_SE_State_t eSE_CurrentState;/**< state of the secure element indicates activated or not*/ 289 } phLibNfc_SE_List_t; 290 291 /** 292 * \ingroup grp_lib_nfc 293 * 294 *\brief Defines target specific info obtained during device discovery. 295 */ 296 typedef struct phLibNfc_RemoteDev 297 { 298 phLibNfc_Handle hTargetDev; /**< discovered Target handle */ 299 phLibNfc_sRemoteDevInformation_t* psRemoteDevInfo; /**< discovered Target details */ 300 301 }phLibNfc_RemoteDevList_t; 302 303 typedef phNfc_sNfcIPCfg_t phLibNfc_sNfcIPCfg_t; 304 305 /** 306 *\ingroup grp_lib_nfc 307 *\brief NDEF registration structure definition. 308 */ 309 typedef struct phLibNfc_Ndef_SrchType 310 { 311 uint8_t Tnf; /**< Type Name Format of this NDEF record */ 312 uint8_t *Type; /**< Type field of this NDEF record */ 313 uint8_t TypeLength; /**< Length of the Type field of this NDEF record */ 314 } phLibNfc_Ndef_SrchType_t; 315 316 /** 317 *\ingroup grp_lib_nfc 318 * \brief NDEF information structure definition. \n 319 */ 320 typedef struct phLibNfc_Ndef_Info 321 { 322 uint32_t NdefMessageLengthActual; /**< Actual length of the NDEF message */ 323 uint32_t NdefMessageLengthMaximum; /**< Maximum length of the NDEF message */ 324 uint8_t *pNdefMessage; /**< Pointer to raw NDEF Data buffer */ 325 uint32_t NdefRecordCount; /**< Number of NDEF records pointed by pNdefRecord */ 326 phFriNfc_NdefRecord_t *pNdefRecord; /**< Pointer to the NDEF Records contained within the NDEF message */ 327 328 } phLibNfc_Ndef_Info_t; 329 330 331 /** 332 * \ingroup grp_lib_nfc 333 * 334 *\brief Ndef Information Structure. 335 */ 336 typedef struct phLibNfc_ChkNdef_Info 337 { 338 uint32_t ActualNdefMsgLength; /**< Indicates Actual length of NDEF Message in Tag */ 339 uint32_t MaxNdefMsgLength; /**< Indicates Maximum Ndef Message length that Tag can hold*/ 340 } phLibNfc_ChkNdef_Info_t; 341 342 /** 343 *\ingroup grp_lib_nfc 344 * 345 *\brief LLCP link status. Refer to \ref phFriNfc_LlcpMac_eLinkStatus_t 346 * 347 */ 348 typedef phFriNfc_LlcpMac_eLinkStatus_t phLibNfc_Llcp_eLinkStatus_t; 349 350 typedef phFriNfc_Llcp_sLinkParameters_t phLibNfc_Llcp_sLinkParameters_t; 351 352 typedef phFriNfc_LlcpTransport_eSocketType_t phLibNfc_Llcp_eSocketType_t; 353 354 typedef phFriNfc_LlcpTransport_sSocketOptions_t phLibNfc_Llcp_sSocketOptions_t; 355 356 /** 357 * \ingroup grp_lib_nfc 358 * 359 *\brief Response callback for connect request. 360 * 361 * Callback type used to indicate a Connect request Successful or Failure indication to 362 * LibNfc client. 363 * 364 * \param[in] pContext Context passed in the connect request before. 365 * \param[in] hRemoteDev Handle to remote device on which connect was requested. 366 * \param[in] psRemoteDevInfo contains updated remote device details.For few tags 367 * like ISO-14443A details like historical bytes gets updated 368 * only after connecting to target.Once connect is successful 369 * \b psRemoteDevInfo gets updated. 370 * 371 * \param[in] status Status of the response callback. 372 * 373 * \param NFCSTATUS_SUCCESS Connect operation successful. 374 * \param NFCSTATUS_TARGET_LOST Connect operation failed because target is lost. 375 * \param NFCSTATUS_SHUTDOWN Shutdown in progress. 376 * 377 */ 378 379 typedef void (*pphLibNfc_ConnectCallback_t) (void* pContext, 380 phLibNfc_Handle hRemoteDev, 381 phLibNfc_sRemoteDevInformation_t* psRemoteDevInfo, 382 NFCSTATUS Status 383 ); 384 385 /** 386 * \ingroup grp_lib_nfc 387 * 388 *\brief Response callback for disconnect request. 389 * 390 * Callback type used to provide a disconnect Success or Failure indication to 391 * LibNfc client. 392 * 393 * \param[in] pContext Context passed in the disconnect request before. 394 * \param[in] hRemoteDev Handle to remote device on which disconnect is requested. 395 * \param[in] status Status of the response callback. 396 * 397 * \param NFCSTATUS_SUCCESS Disconnect operation successful. 398 * \param NFCSTATUS_SHUTDOWN Shutdown in progress. 399 * 400 */ 401 typedef void (*pphLibNfc_DisconnectCallback_t)(void* pContext, 402 phLibNfc_Handle hRemoteDev, 403 NFCSTATUS Status 404 ); 405 /** 406 * \ingroup grp_lib_nfc 407 * 408 *\brief Response callback for IOCTL request. 409 * 410 * Callback type to inform success or failure of the Ioctl request 411 * made by LibNfc client. It may optionally contain response data 412 * depending on the Ioctl command type issued. 413 414 * 415 * \param[in] pContext Context passed in the connect request before. 416 * \param[in] status Status of the response callback. 417 * 418 * \param NFCSTATUS_SUCCESS Ioctl operation successful. 419 * \param NFCSTATUS_TARGET_LOST Ioctl operation failed because target is lost. 420 * \param NFCSTATUS_SHUTDOWN Ioctl operation failed because Shutdown in progress. 421 * 422 *\param[in,out] pOutParam contains Ioctl command specific response buffer and size 423 * of the buffer.This buffer address will be same as 424 * pOutParam sent in \ref phLibNfc_Mgt_IoCtl. 425 * 426 */ 427 428 429 typedef void (*pphLibNfc_IoctlCallback_t) (void* pContext, 430 phNfc_sData_t* pOutParam, 431 NFCSTATUS Status 432 ); 433 434 435 436 /** 437 * \ingroup grp_lib_nfc 438 * 439 *\brief Response callback for Transceive request. 440 * 441 * This callback type is used to provide received data and it's size to the 442 * LibNfc client in \ref phNfc_sData_t format ,when LibNfc client has performed 443 * a Transceive operation on a tag or when the device acts as an Initiator during a 444 * P2P transactions. 445 * 446 * \param[in] pContext LibNfc client context passed in the corresponding request before. 447 * \param[in] hRemoteDev Handle to remote device on transceive is performed. 448 * \param[in] pResBuffer Response buffer of type \ref phNfc_sData_t. 449 * \param[in] status Status of the response callback. 450 * 451 * \param NFCSTATUS_SUCCESS Transceive operation successful. 452 * \param NFCSTATUS_TARGET_LOST Transceive operation failed because target is lost. 453 * \param NFCSTATUS_SHUTDOWN Transceive operation failed because Shutdown in progress. 454 * \param NFCSTATUS_ABORTED Aborted due to disconnect request in between. 455 * 456 */ 457 typedef void (*pphLibNfc_TransceiveCallback_t)( void* pContext, 458 phLibNfc_Handle hRemoteDev, 459 phNfc_sData_t* pResBuffer, 460 NFCSTATUS Status 461 ); 462 463 /** 464 * \ingroup grp_lib_nfc 465 * 466 * \brief Generic Response Callback definition. 467 * 468 * Generic callback definition used as callback type in few APIs below. 469 * 470 * \note : Status and error codes for this type of callback are documented in respective APIs 471 * wherever it is used. 472 * 473 * \param[in] pContext LibNfc client context passed in the corresponding request 474 * before. 475 * \param[in] status Status of the response callback. 476 */ 477 typedef void(*pphLibNfc_RspCb_t) (void* pContext,NFCSTATUS Status); 478 /** 479 * \ingroup grp_lib_nfc 480 * 481 * \brief Check NDEF Callback definition. 482 * 483 * This call back is used by check ndef api. 484 * 485 * \note : Status and error codes for this type of callback are documented in API 486 * 487 * \param[in] pContext LibNfc client context passed in the corresponding request 488 * before. 489 * \param[in] Ndef_Info Ndef message length and the container size. 490 * \param[in] status Status of the response callback. 491 */ 492 typedef void(*pphLibNfc_ChkNdefRspCb_t)(void* pContext, 493 phLibNfc_ChkNdef_Info_t Ndef_Info, 494 NFCSTATUS Status); 495 496 497 /** 498 * \ingroup grp_lib_nfc 499 * \brief Notification handler callback definition. 500 * 501 *This callback type is used to provide information on discovered targets to LibNfcClient. 502 *Discovered targets will be notified in \ref phLibNfc_RemoteDevList_t format. 503 *In case multiple targets discovered ,remote device list contains these targets one after another. 504 * 505 *\note List will be exported as memory block,based on \b uNofRemoteDev 506 * parameter application has to access remote devices accordingly. 507 * 508 *\b Ex: Multiple targets discovered can be referred as phLibNfc_RemoteDevList_t[0] 509 *and phLibNfc_RemoteDevList_t[1]. 510 * 511 *Subsequent operations on discovered target shall be performed using target specific handle 512 *\b hTargetDev. 513 * 514 * \param[in] pContext Client context passed in the corresponding 515 * request before.The context is handled by client 516 * only. 517 * 518 * \param[in] psRemoteDevList Remote Device list contains discovered target details. 519 * Refer to \ref phLibNfc_RemoteDevList_t . 520 * List size depends on no of remote devices discovered. 521 * 522 * \param[in] uNofRemoteDev Indicates no of remote devices discovered . 523 * In case more than one target discovered,\b psRemoteDevList contains 524 * multiple target details. 525 * 526 * \param[in] Status Status of the response callback. 527 * 528 * \param NFCSTATUS_SUCCESS Discovered single target successfully. 529 * \param NFCSTATUS_MULTIPLE_TARGETS multiple targets found. 530 * \param NFCSTATUS_MULTI_PROTOCOLS Target found supports multiple protocols. 531 * \param NFCSTATUS_SHUTDOWN Registration failed because shutdown in progress. 532 * \param NFCSTATUS_DESELECTED initiator issued disconnect or intiator 533 * physically removed from the RF field. 534 * 535 *\note: multiple tag detection is possible only within same technology but not across 536 * different technologies. 537 */ 538 typedef void (*phLibNfc_NtfRegister_RspCb_t)( 539 void* pContext, 540 phLibNfc_RemoteDevList_t* psRemoteDevList, 541 uint8_t uNofRemoteDev, 542 NFCSTATUS Status 543 ); 544 545 /** 546 * \ingroup grp_lib_nfc 547 * \brief Response Callback for secure element mode settings. 548 * 549 * This callback type is used to provide information on requested secure element is 550 * activated or not to LibNfcClient. 551 * 552 * \param[in] pContext LibNfc client context passed in the activation request. 553 * 554 * \param[in] hSecureElement Handle to secure element. 555 * 556 * \param[in] Status Indicates API status. 557 * \param NFCSTATUS_SUCCESS Secure element activated successfully. 558 * \param NFCSTATUS_SHUTDOWN Activation failed because shutdown in progress. 559 * \param NFCSTATUS_FAILED Activation failed. 560 * 561 */ 562 typedef void(*pphLibNfc_SE_SetModeRspCb_t)( 563 void* pContext, 564 phLibNfc_Handle hSecureElement, 565 NFCSTATUS Status 566 ); 567 /** 568 * \ingroup grp_lib_nfc 569 * \brief Notification callback for \ref phLibNfc_SE_NtfRegister(). 570 * 571 * A function of this type is called when external reader tries to access SE. 572 * 573 *\param[in] pContext LibNfc client context passed in the SE notification register request. 574 * The context is Handled by client only. 575 * \param[in] EventType Event type of secure element transaction 576 * \param[in] hSecureElement handle to Secures Element. 577 * 578 *\param[in] pAppID Application identifier to be accessed on SE . 579 * Sent when available from SE otherwise empty. 580 * 581 *\param[in] Status Indicates API status. 582 * \param NFCSTATUS_SUCCESS Notification handler registered sucessfully. 583 * \param NFCSTATUS_SHUTDOWN Shutdown in progress. 584 * \param NFCSTATUS_FAILED set mode operation failed. 585 * 586 * 587 */ 588 typedef void (*pphLibNfc_SE_NotificationCb_t) (void* pContext, 589 phLibNfc_eSE_EvtType_t EventType, 590 phLibNfc_Handle hSecureElement, 591 phLibNfc_uSeEvtInfo_t* pSeEvtInfo, 592 NFCSTATUS Status 593 ); 594 595 596 /** 597 *\ingroup grp_lib_nfc 598 *\brief Receive callback definition. 599 * 600 * This callback type is used to provide received data and it's size to the 601 * LibNfc client in \ref phNfc_sData_t format ,when LibNfc client has performed 602 * when the device acts as a Target during P2P communication 603 * 604 * \param[in] pContext LibNfc client context passed in the corresponding 605 * request before. 606 * \param[in] pRecvBufferInfo Response buffer of type \ref phNfc_sData_t. 607 * \param[in] status Status of the response callback. 608 * 609 * \param NFCSTATUS_SUCCESS Receive operation successful. 610 * \param NFCSTATUS_SHUTDOWN Receive operation failed because 611 * Shutdown in progress. 612 * \param NFCSTATUS_ABORTED Aborted due to initiator issued disconnect request. 613 * This status code reported,to indicate P2P session 614 * closed and send and receive requests not allowed any more 615 * unless new session is started. 616 */ 617 typedef void (*pphLibNfc_Receive_RspCb_t)(void* pContext, 618 phNfc_sData_t* pRecvBufferInfo, 619 NFCSTATUS status 620 ); 621 /** 622 *\ingroup grp_lib_nfc 623 * 624 * \brief NDEF Response callback definition 625 * 626 * A function of this type is notified when registered NDEF type detected. 627 * 628 * \b Note :Once this type callback is notified,discovery wheel is stopped. 629 *In order to restart discovery process again it is important to disconnect 630 *from current tag.LibNfc client shall disconnect explicitly using 631 *\ref phLibNfc_RemoteDev_Disconnect() interface. 632 * 633 *\param[in] pContext Pointer to context previously provided by the user 634 *\param[in] psNdefInfo All Ndef specific details of the remote device discovered. 635 *\param[in] hRemoteDevice handle to remote device on which NDEF detection is done. 636 * 637 *\param[in] Status Indicates callback status. 638 * 639 * \param NFCSTATUS_SUCCESS Indicates registered tnf type detected. . 640 * \param NFCSTATUS_SHUTDOWN Indicates shutdown in progress. 641 * \param NFCSTATUS_FAILED status failed. 642 * \param NFCSTATUS_ABORTED Aborted due to disconnect operation in between. 643 644 645 */ 646 typedef void (*pphLibNfc_Ndef_Search_RspCb_t) ( void* pContext, 647 phLibNfc_Ndef_Info_t* psNdefInfo, 648 phLibNfc_Handle hRemoteDevice, 649 NFCSTATUS Status 650 ); 651 652 653 /** 654 *\ingroup grp_lib_nfc 655 * 656 * \brief LLCP check response callback definition 657 */ 658 typedef void (*pphLibNfc_ChkLlcpRspCb_t) ( void* pContext, 659 NFCSTATUS status 660 ); 661 662 663 /** 664 *\ingroup grp_lib_nfc 665 * 666 * \brief LLCP check response callback definition 667 */ 668 typedef void (*pphLibNfc_LlcpLinkStatusCb_t) ( void* pContext, 669 phLibNfc_Llcp_eLinkStatus_t eLinkStatus 670 ); 671 672 673 /** 674 *\ingroup grp_lib_nfc 675 * 676 * \brief LLCP socket error notification callback definition 677 */ 678 typedef void (*pphLibNfc_LlcpSocketErrCb_t) ( void* pContext, 679 uint8_t nErrCode 680 ); 681 682 /** 683 *\ingroup grp_lib_nfc 684 * 685 * \brief Incoming connection on a listening LLCP socket callback definition 686 */ 687 typedef void (*pphLibNfc_LlcpSocketListenCb_t) ( void* pContext, 688 phLibNfc_Handle hIncomingSocket 689 ); 690 691 /** 692 *\ingroup grp_lib_nfc 693 * 694 * \brief LLCP socket connect callback definition 695 */ 696 typedef void (*pphLibNfc_LlcpSocketConnectCb_t) ( void* pContext, 697 uint8_t nErrCode, 698 NFCSTATUS status 699 ); 700 701 /** 702 *\ingroup grp_lib_nfc 703 * 704 * \brief LLCP socket disconnect callback definition 705 */ 706 typedef void (*pphLibNfc_LlcpSocketDisconnectCb_t) ( void* pContext, 707 NFCSTATUS status 708 ); 709 710 /** 711 *\ingroup grp_lib_nfc 712 * 713 * \brief LLCP socket Accept callback definition 714 */ 715 typedef void (*pphLibNfc_LlcpSocketAcceptCb_t) ( void* pContext, 716 NFCSTATUS status 717 ); 718 719 /** 720 *\ingroup grp_lib_nfc 721 * 722 * \brief LLCP socket Reject callback definition 723 */ 724 typedef void (*pphLibNfc_LlcpSocketRejectCb_t) ( void* pContext, 725 NFCSTATUS status 726 ); 727 728 /** 729 *\ingroup grp_lib_nfc 730 * 731 * \brief LLCP socket reception callback definition 732 */ 733 typedef void (*pphLibNfc_LlcpSocketRecvCb_t) ( void* pContext, 734 NFCSTATUS status 735 ); 736 737 /** 738 *\ingroup grp_lib_nfc 739 * 740 * \brief LLCP socket reception with SSAP callback definition 741 */ 742 typedef void (*pphLibNfc_LlcpSocketRecvFromCb_t) ( void* pContext, 743 uint8_t ssap, 744 NFCSTATUS status 745 ); 746 747 /** 748 *\ingroup grp_lib_nfc 749 * 750 * \brief LLCP socket emission callback definition 751 */ 752 typedef void (*pphLibNfc_LlcpSocketSendCb_t) ( void* pContext, 753 NFCSTATUS status 754 ); 755 756 757 /* FUNCTION PROTOTYPES */ 758 /** 759 * \ingroup grp_lib_nfc 760 * 761 * \brief Driver configuration function 762 * This synchronous function configures the given driver Interface and 763 * sends the HANDLE to the caller. 764 * 765 * \param[in] psConfig Driver configuration details as provided 766 * by the upper layer. 767 * \param[in,out] ppDriverHandle pointer to which valid Handle to driver 768 * interface is assigned. 769 * 770 * \retval NFCSTATUS_SUCCESS Configuration happened successfully. 771 * \retval NFCSTATUS_INVALID_PARAMETER At least one parameter of the function 772 * is invalid. 773 * \retval NFCSTATUS_FAILED Configuration failed(example.unable to 774 * open HW Interface). 775 * \retval NFCSTATUS_INVALID_DEVICE The device has not been opened or 776 * has been disconnected meanwhile 777 * \retval NFCSTATUS_BOARD_COMMUNICATION_ERROR A board communication error occurred 778 (e.g. configuration went wrong). 779 *\msc 780 *LibNfcClient,LibNfc; 781 *--- [label="Before initializing Nfc LIB,Configure Driver layer"]; 782 *LibNfcClient=>LibNfc[label="phLibNfc_Mgt_ConfigureDriver()",URL="\ref phLibNfc_Mgt_ConfigureDriver"]; 783 *LibNfcClient<<LibNfc[label="NFCSTATUS_SUCCESS"]; 784 *\endmsc 785 */ 786 NFCSTATUS phLibNfc_Mgt_ConfigureDriver (pphLibNfc_sConfig_t psConfig, 787 void ** ppDriverHandle 788 ); 789 /** 790 * \ingroup grp_lib_nfc 791 * 792 * \brief Release configuration for the given driver Interface. 793 * 794 * \copydoc page_reg Release all that has been 795 * initialised in \b phLibNfc_Mgt_ConfigureDriver function (Synchronous function). 796 * 797 * \param[in] pDriverHandle Link information of the hardware 798 * 799 * \retval NFCSTATUS_SUCCESS Driver Configuration Released successfully. 800 * \retval NFCSTATUS_FAILED Configuration release failed(example: Unable to close Com port). 801 * 802 *\msc 803 *LibNfcClient,LibNfc; 804 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_ConfigureDriver()",URL="\ref phLibNfc_Mgt_ConfigureDriver"]; 805 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 806 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 807 *LibNfcClient<<LibNfc [label="NFCSTATUS_PENDING"]; 808 *LibNfcClient<-LibNfc [label="pInitCb"]; 809 *--- [label="Perform feature operations "]; 810 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_DeInitialize()",URL="\ref phLibNfc_Mgt_DeInitialize"]; 811 *LibNfcClient<<LibNfc [label="NFCSTATUS_PENDING"]; 812 *LibNfcClient<-LibNfc [label="pDeInitCb"]; 813 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_UnConfigureDriver()",URL="\ref phLibNfc_Mgt_UnConfigureDriver"]; 814 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 815 *\endmsc 816 */ 817 NFCSTATUS phLibNfc_Mgt_UnConfigureDriver (void * pDriverHandle 818 ); 819 820 NFCSTATUS phLibNfc_HW_Reset (long level); 821 822 NFCSTATUS phLibNfc_Download_Mode (long level); 823 824 /** 825 * \ingroup grp_lib_nfc 826 * 827 * \brief Initializes the NFC library . 828 * 829 * 830 *\brief This function initializes NFC library and its underlying layers. 831 * As part of this interface underlying modules gets initialized. 832 * A session with NFC hardware will be established. 833 * Once initialization is successful ,NFC library ready for use. 834 *\note It is must to initialize prior usage of the stack . 835 * 836 * \param[in] pDriverHandle Driver Handle currently application is using. 837 * \param[in] pInitCb The init callback is called by the LibNfc when init is 838 * completed or there is an error in initialization. 839 * 840 * \param[in] pContext Client context which will be included in 841 * callback when the request is completed. 842 * 843 * \retval NFCSTATUS_ALREADY_INITIALISED Stack is already initialized. 844 * \retval NFCSTATUS_PENDING Init sequence has been successfully 845 * started and result will be conveyed via 846 * callback notification. 847 * \retval NFCSTATUS_INVALID_PARAMETER The parameter could not be properly 848 * interpreted. 849 *\retval NFCSTATUS_INSUFFICIENT_RESOURCES Insufficient resource.(Ex: insufficient memory) 850 * 851 *\msc 852 *LibNfcClient,LibNfc; 853 *--- [label="Before initializing Nfc LIB,Configure Driver layer"]; 854 *LibNfcClient=>LibNfc[label="phLibNfc_Mgt_ConfigureDriver()",URL="\ref phLibNfc_Mgt_ConfigureDriver"]; 855 *LibNfcClient<<LibNfc[label="NFCSTATUS_SUCCESS"]; 856 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 857 *LibNfcClient<<LibNfc [label="NFCSTATUS_PENDING"]; 858 *LibNfcClient<-LibNfc [label="pInitCb"]; 859 *\endmsc 860 */ 861 NFCSTATUS phLibNfc_Mgt_Initialize (void * pDriverHandle, 862 pphLibNfc_RspCb_t pInitCb, 863 void* pContext 864 ); 865 /** 866 * \ingroup grp_lib_nfc 867 * 868 * \brief De-Initializes NFC library. 869 * 870 * 871 * This function de-initializes and closes the current session with PN544 NFC hardware. 872 * All configurations and setups done until now are invalidated to restart 873 * communication. Resources currently used by stack gets released during De-initialization. 874 *\ref phLibNfc_Mgt_Initialize needs to be called once stack is 875 * De-initialized before using the stack again. 876 * 877 * \param[in] pHwHandle Hardware context currently application is using. 878 * 879 * \param[in] pDeInitCb De-initialization callback is called by the LibNfc when init 880 * completed or there is an error in initialization. 881 * \param[in] pContext Client context which will be included in 882 * callback when the request is completed. 883 * 884 * \retval NFCSTATUS_SUCCESS Device stack is already De-Initialized. 885 * \retval NFCSTATUS_PENDING De-Initialization sequence has been successfully 886 * started and result is conveyed via callback 887 * notification. 888 * 889 * \retval NFCSTATUS_INVALID_PARAMETER The parameter could not be properly 890 * interpreted. 891 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 892 * \retval NFCSTATUS_BUSY Previous request in progress can not accept new request. 893 * \retval NFCSTATUS_FAILED Request failed. 894 895 * 896 * 897 *\msc 898 *LibNfcClient,LibNfc; 899 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 900 *LibNfcClient<<LibNfc [label="NFCSTATUS_PENDING"]; 901 *LibNfcClient<-LibNfc [label="pInitCb"]; 902 *--- [label="Perform feature operations "]; 903 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_DeInitialize()",URL="\ref phLibNfc_Mgt_DeInitialize"]; 904 *LibNfcClient<<LibNfc [label="NFCSTATUS_PENDING"]; 905 *LibNfcClient<-LibNfc [label="pDeInitCb"]; 906 *\endmsc 907 */ 908 NFCSTATUS phLibNfc_Mgt_DeInitialize(void * pDriverHandle, 909 pphLibNfc_RspCb_t pDeInitCb, 910 void* pContext 911 ); 912 913 /** 914 * \ingroup grp_lib_nfc 915 * \brief Get list of available Secure Elements. 916 * 917 * This function retrieves list of secure elements locally connected. 918 * during LibNfc initialization these SEs enumerated from lower stack and maintained 919 * in LibNfc library.Once libNfc client queries using this interface, 920 * same details exposed to LibNfc client. 921 * LibNfc client shall pass empty list of size \ref PHLIBNFC_MAXNO_OF_SE . 922 * Once SE list is available, libNfc client can perform operation on specific SE 923 * using SE handle. 924 * The handle given in the \ref phLibNfc_SE_List_t structure stays valid until 925 * shutdown is called. 926 * 927 *\note In case no SE's found, API still returns \ref NFCSTATUS_SUCCESS with \b uSE_count 928 set to zero.Value zero indicates none of the SE's connected to PN544 hardware. 929 930 * \param[in,out] pSE_List contains list of SEs with SE details in \ref phLibNfc_SE_List_t format. 931 * \param[in,out] uSE_count contains no of SEs in the list. 932 * 933 *\note LibNfc client has to interpret no of secure elements in \b pSE_List based on this 934 *count. 935 * 936 *\retval NFCSTATUS_SUCCESS Indicates operation is sucessfull. 937 *\retval NFCSTATUS_SHUTDOWN Operation failed because shutdown in progress. 938 *\retval NFCSTATUS_NOT_INITIALISED Operation failed because stack is not yet initialized. 939 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 940 * could not be properly interpreted. 941 * 942 *\msc 943 *LibNfcClient,LibNfc; 944 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 945 *LibNfcClient<<LibNfc [label="NFCSTATUS_PENDING"]; 946 *LibNfcClient<-LibNfc [label="pInitCb"]; 947 *--- [label="Now SE list can be retrieved"]; 948 *\endmsc 949 */ 950 951 NFCSTATUS phLibNfc_SE_GetSecureElementList(phLibNfc_SE_List_t* pSE_List, 952 uint8_t* uSE_count 953 ); 954 955 956 /** 957 * \ingroup grp_lib_nfc 958 * 959 *\brief Sets secure element mode. 960 * 961 * This function configures SE to specific mode based on activation mode type. 962 * Effect of different modes on SE is as below. 963 * 964 *\b a)If mode is \ref phLibNfc_SE_ActModeVirtual then external reader can communicate 965 * with this SE. 966 *\note This mode is applicable to both UICC and SmartMX. 967 * 968 \b b)If mode is \ref phLibNfc_SE_ActModeWired then internal reader can communicate with 969 * this SE.In this mode PN544 can act as reader and communicate with SE as normal Tag. 970 *In this mode mode external reader ca not communicate with any of the SEs since RF filed is off. 971 * 972 *\note 1.Wired Mode is applicable to only SmartMX not to UICC. 973 * 2.When SmartMX SE configured in Wired Mode ,LibNfc client shall restart discovery process. 974 * SmartMX gets detected as MIFARE tag. 975 * 3.To exit wired mode ,LibNfc client has to disconnect with release type as "NFC_SMARTMX_RELEASE". 976 * 977 * 978 *\b c)If mode is \ref phLibNfc_SE_ActModeOff 979 *This means SE is off mode .It can not be accessed any more in wired or virtual mode. 980 *internal reader any more.communicate with internal reader and only 981 *PN544 can communicate in reader mode and external reader can not 982 *communicate with it.This mode is applicable both SE types ( UICC and SmartMX) 983 * 984 * \param[in] hSE_Handle Secure Element Handle . 985 * \param[in] eActivation_mode Indicates SE mode to be configured. 986 * 987 * 988 * 989 * \param[in] pphLibNfc_SE_setModeRspCb_t pointer to response callback. 990 * 991 * \param[in] pContext Client context which will be included in 992 * callback when the request is completed. 993 * 994 * 995 * \retval NFCSTATUS_PENDING Activation transaction started. 996 * \retval NFSCSTATUS_SHUTDOWN Shutdown in progress. 997 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 998 * \retval NFCSTATUS_INVALID_HANDLE Invalid Handle. 999 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 1000 * could not be properly interpreted. 1001 * \retval NFCSTATUS_REJECTED Invalid request.(Ex: If wired mode settings called using 1002 * UICC SE handle ,this error code seen). 1003 * \retval NFCSTATUS_FAILED Request failed. 1004 * 1005 *\msc 1006 *LibNfcClient,LibNfc; 1007 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 1008 *LibNfcClient<<LibNfc [label="NFCSTATUS_PENDING"]; 1009 *LibNfcClient<-LibNfc [label="pInitCb"]; 1010 *--- [label="Now query for available SE's"]; 1011 *LibNfcClient=>LibNfc [label="phLibNfc_SE_GetSecureElementList()",URL="\ref phLibNfc_SE_GetSecureElementList"]; 1012 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1013 *--- [label="Now configure specific SE"]; 1014 *LibNfcClient=>LibNfc [label="phLibNfc_SE_SetMode(hSE_Handle,)",URL="\ref phLibNfc_SE_SetMode"]; 1015 *LibNfcClient<<LibNfc [label="NFCSTATUS_PENDING"]; 1016 *LibNfcClient<-LibNfc [label="pSE_SetMode_Rsp_cb"]; 1017 *\endmsc 1018 */ 1019 NFCSTATUS phLibNfc_SE_SetMode ( phLibNfc_Handle hSE_Handle, 1020 phLibNfc_eSE_ActivationMode eActivation_mode, 1021 pphLibNfc_SE_SetModeRspCb_t pSE_SetMode_Rsp_cb, 1022 void * pContext 1023 ); 1024 1025 /** 1026 * \ingroup grp_lib_nfc 1027 * \brief Registers notification handler to handle secure element specific events. 1028 * 1029 * This function registers handler to report SE specific transaction events. 1030 * Possible different types of events are as defined in \ref phLibNfc_eSE_EvtType_t. 1031 1032 * \param[in] pSE_NotificationCb pointer to notification callback. 1033 * \param[in] pContext Client context which will be included in 1034 * callback when the request is completed. 1035 * 1036 *\retval NFCSTATUS_SUCCESS Registration Sucessful. 1037 *\retval NFSCSTATUS_SHUTDOWN Shutdown in progress. 1038 *\retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 1039 *\retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 1040 * could not be properly interpreted. 1041 *\retval NFCSTATUS_FAILED Request failed. 1042 * 1043 * 1044 *\msc 1045 *LibNfcClient,LibNfc; 1046 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 1047 *LibNfcClient<<LibNfc [label="NFCSTATUS_PENDING"]; 1048 *LibNfcClient<-LibNfc [label="pInitCb"]; 1049 *--- [label="Perform feature operations "]; 1050 * 1051 *LibNfcClient=>LibNfc [label="phLibNfc_SE_NtfRegister()",URL="\ref phLibNfc_SE_NtfRegister"]; 1052 LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1053 *--- [label="Registration sucessfull"]; 1054 * 1055 *--- [label="In case external reader performs transactions,callback is notified as shown below"]; 1056 *LibNfcClient<-LibNfc [label="pSE_NotificationCb"]; 1057 *\endmsc 1058 */ 1059 1060 NFCSTATUS phLibNfc_SE_NtfRegister (pphLibNfc_SE_NotificationCb_t pSE_NotificationCb, 1061 void * pContext 1062 ); 1063 /** 1064 * \ingroup grp_lib_nfc 1065 *\brief This function unregister the registered listener for SE event. 1066 * This function unregisters the listener which has been registered with \ref 1067 * phLibNfc_SE_NtfRegister. 1068 * 1069 *\retval NFCSTATUS_SUCCESS Unregistration successful. 1070 *\retval NFSCSTATUS_SHUTDOWN Shutdown in progress. 1071 *\retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 1072 *\retval NFCSTATUS_FAILED Request failed. 1073 *\msc 1074 *LibNfcClient,LibNfc; 1075 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 1076 *LibNfcClient<<LibNfc [label="NFCSTATUS_PENDING"]; 1077 *LibNfcClient<-LibNfc [label="pInitCb"]; 1078 *--- [label="Perform feature operations "]; 1079 *LibNfcClient=>LibNfc [label="phLibNfc_SE_NtfRegister()",URL="\ref phLibNfc_SE_NtfRegister"]; 1080 LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1081 *--- [label="Registration sucessfull"]; 1082 * 1083 *--- [label="In case external reader performs transactions,callback is notified as shown below"]; 1084 * 1085 *LibNfcClient<-LibNfc [label="pSE_NotificationCb"]; 1086 *--- [label="Unregister SE notification handler in case required "]; 1087 *LibNfcClient=>LibNfc [label="phLibNfc_SE_NtfUnregister()",URL="\ref phLibNfc_SE_NtfUnregister"]; 1088 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1089 1090 *\endmsc 1091 */ 1092 NFCSTATUS phLibNfc_SE_NtfUnregister(void); 1093 1094 /** 1095 *\ingroup grp_lib_nfc 1096 * \brief IOCTL interface. 1097 * 1098 * The I/O Control function allows the caller to configure specific 1099 * functionality provided by the lower layer.Each feature is accessible via a 1100 * specific IOCTL Code. 1101 * 1102 * \param[in] pDriverHandle Interface handle.This parameter is valid only for firmware download feature. 1103 * for other IOCTL features this parameter is not relevent. 1104 * 1105 * \param[in] IoctlCode Control code for the operation. 1106 * This value identifies the specific 1107 * operation to be performed.For more details on supported 1108 * IOCTL codes refer to \ref grp_lib_ioctl. 1109 *\param[in,out] pInParam Pointer to any input data structure 1110 * containing data which is interpreted 1111 * based on IoCtl code and the length of 1112 * the data. 1113 * 1114 *\param[in,out] pOutParam Pointer to output buffer details to hold 1115 * Ioctl specific response buffer and size of 1116 * the buffer.This buffer will be updated and 1117 * sent back as part of of callback details. 1118 * 1119 *\param[in] pIoCtl_Rsp_cb Response callback registered by the caller. 1120 * 1121 * \param[in] pContext Client context which will be included in 1122 * callback when the request is completed. 1123 * 1124 * 1125 *\retval NFCSTATUS_PENDING Update in pending state. RspCB will be 1126 * called later. 1127 *\retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 1128 * could not be properly interpreted. 1129 * 1130 \retval NFCSTATUS_BUFFER_TOO_SMALL The buffer supplied by the caller is to 1131 *\retval NFSCSTATUS_SHUTDOWN Shutdown in progress. 1132 *\retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 1133 *\retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 1134 * could not be properly interpreted. 1135 * 1136 *\msc 1137 *LibNfcClient,LibNfc; 1138 *--- [label="Firmware download Scenario"]; 1139 1140 *--- [label="Intialise Driver"]; 1141 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_IoCtl(pDriverHandle,)",URL="\ref phLibNfc_Mgt_IoCtl"]; 1142 *LibNfcClient<<LibNfc [label="NFCSTATUS_PENDING"]; 1143 *LibNfcClient<-LibNfc [label="pIoCtl_Rsp_cb()",URL="\ref pphLibNfc_IoctlCallback_t"]; 1144 **--- [label="requested IoCtl processed sucessfully "]; 1145 * 1146 *\endmsc 1147 */ 1148 NFCSTATUS phLibNfc_Mgt_IoCtl (void* pDriverHandle, 1149 uint16_t IoctlCode, 1150 phNfc_sData_t* pInParam, 1151 phNfc_sData_t* pOutParam, 1152 pphLibNfc_IoctlCallback_t pIoCtl_Rsp_cb, 1153 void* pContext 1154 ); 1155 1156 /** 1157 * \ingroup grp_lib_nfc 1158 * \brief This interface registers notification handler for target discovery. 1159 * 1160 * This function allows libNfc client to register for notifications based technology 1161 * type it is interested to discover. In case application is interested in multiples technology 1162 * discovery,it can enable respective bits in \b pRegistryInfo . when Registered type target 1163 * is discovered in RF field ,LibNfc notifies registered notification callback. 1164 * 1165 * \note In case this API is called multiple times ,most recent request registry details will be used 1166 *for registration. 1167 * 1168 *\param[in] pRegistryInfo structure contains bitwise registry information. 1169 * Specific technology type discovery can be registered if 1170 * corresponding bit is enabled.In case bit is disabled 1171 * it indicates specific technology type unregistered. 1172 * 1173 *\param[in] pNotificationHandler Notification callback.This callback will 1174 * be notified once registered target is discovered. 1175 * \param[in] pContext Client context which will be included in 1176 * callback when the request is completed. 1177 * 1178 * \retval NFCSTATUS_SUCCESS Indicates registration successful. 1179 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters could 1180 * not be properly interpreted. 1181 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 1182 * \retval NFSCSTATUS_SHUTDOWN Shutdown in progress. 1183 * 1184 * 1185 *\msc 1186 *LibNfcClient,LibNfc; 1187 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 1188 *LibNfcClient<-LibNfc [label="pInitCb()",URL="\ref pphLibNfc_RspCb_t()"]; 1189 *--- [label="Register for technology type.Ex: MIFARE UL"]; 1190 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_NtfRegister()",URL="\ref phLibNfc_RemoteDev_NtfRegister"]; 1191 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1192 * 1193 *\endmsc 1194 */ 1195 1196 NFCSTATUS phLibNfc_RemoteDev_NtfRegister( 1197 phLibNfc_Registry_Info_t* pRegistryInfo, 1198 phLibNfc_NtfRegister_RspCb_t pNotificationHandler, 1199 void* pContext 1200 ); 1201 1202 1203 /** 1204 * \ingroup grp_lib_nfc 1205 * \brief Configure Discovery Modes. 1206 * 1207 *This function is used to configure ,start and stop the discovery wheel. 1208 *Configuration includes 1209 *<br><br>a)Enabling/disabling of Reader phases for A,B and F technologies. 1210 *<br>b)Configuring NFC-IP1 Initiator Speed and duration of the Emulation phase . 1211 * 1212 *Discovery wheel configuration based on discovery mode selected is as below. 1213 *<br><br>1.If discovery Mode is set as \ref NFC_DISCOVERY_CONFIG then previous configurations 1214 * over written by new configurations passed in \ref phLibNfc_sADD_Cfg_t and Discovery wheel 1215 *restarts with new configurations. 1216 *<br><br>2.If discovery Mode is set as \ref NFC_DISCOVERY_START or \ref NFC_DISCOVERY_STOP then 1217 * discovery parameters passed in \ref phLibNfc_sADD_Cfg_t will not be considered and previous 1218 *configurations still holds good. 1219 *<br><br>3.If discovery Mode is set as \ref NFC_DISCOVERY_RESUME discovery mode starts the discovery 1220 *wheel from where it is stopped previously. 1221 * 1222 *\b Note: Config types \b NFC_DISCOVERY_START, \b NFC_DISCOVERY_STOP and \b NFC_DISCOVERY_RESUME 1223 * are not supported currently. It is for future use. 1224 * 1225 * \param[in] DiscoveryMode Discovery Mode allows to choose between: 1226 * discovery configuration and start, stop 1227 * discovery and start discovery (with last 1228 * set configuration).For mode details refer to 1229 \ref phNfc_eDiscoveryConfigMode_t. 1230 * \param[in] sADDSetup Includes Enable/Disable discovery for 1231 * each protocol A,B and F. 1232 * Details refer to \ref phNfc_sADD_Cfg_t. 1233 * \param[in] pConfigDiscovery_RspCb is called once the discovery wheel 1234 * configuration is complete. 1235 * \param[in] pContext Client context which will be included in 1236 * callback when the request is completed. 1237 * 1238 * 1239 *\retval NFCSTATUS_PENDING Discovery request is in progress and result 1240 * will be notified via callback later. 1241 *\retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 1242 * could not be properly interpreted. 1243 *\retval NFCSTATUS_NOT_INITIALISED Indicates stack is not initialized. 1244 *\retval NFCSTATUS_INSUFFICIENT_RESOURCES Insufficient resource.(Ex: insufficient memory) 1245 *\retval NFCSTATUS_BUSY already discovery in progress 1246 * or it is already discovered Target and 1247 * connected. 1248 *\retval NFSCSTATUS_SHUTDOWN Shutdown in progress. 1249 *\retval NFCSTATUS_FAILED Request failed. 1250 1251 * 1252 * \note : During Reader/Initiator mode it is mandatory 1253 * to call \ref phLibNfc_RemoteDev_Connect before any transaction can be performed 1254 * with the discovered target. Even if the LibNfc client is not 1255 * interested in using any of the discovered targets \ref phLibNfc_RemoteDev_Connect 1256 * and \ref phLibNfc_RemoteDev_Disconnect should be called to restart the Discovery 1257 * wheel. 1258 * \sa \ref phLibNfc_RemoteDev_Connect, phLibNfc_RemoteDev_Disconnect. 1259 1260 *\msc 1261 *LibNfcClient,LibNfc; 1262 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 1263 *LibNfcClient<-LibNfc [label="pInitCb()",URL="\ref pphLibNfc_RspCb_t()"]; 1264 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_NtfRegister()",URL="\ref 1265 phLibNfc_RemoteDev_NtfRegister"]; 1266 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1267 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_ConfigureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 1268 *LibNfcClient<-LibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1269 *--- [label="Now discovery wheel configured as requested"]; 1270 * 1271 *\endmsc 1272 * 1273 *\note Response callback parameters details for this interface are as listed below. 1274 * 1275 * \param[in] pContext LibNfc client context passed in the corresponding request before. 1276 * \param[in] status Status of the response callback. 1277 * 1278 * \param NFCSTATUS_SUCCESS Discovery Configuration successful. 1279 * \param NFCSTATUS_SHUTDOWN Shutdown in progress. 1280 * \param NFCSTATUS_FAILED Request failed. 1281 */ 1282 1283 NFCSTATUS phLibNfc_Mgt_ConfigureDiscovery (phLibNfc_eDiscoveryConfigMode_t DiscoveryMode, 1284 phLibNfc_sADD_Cfg_t sADDSetup, 1285 pphLibNfc_RspCb_t pConfigDiscovery_RspCb, 1286 void* pContext 1287 ); 1288 1289 1290 /** 1291 * \ingroup grp_lib_nfc 1292 * \brief This function is used to to connect to a single Remote Device. 1293 * 1294 * This function is called to connect to discovered target. 1295 * Once notification handler notified sucessfully discovered targets will be available in 1296 * \ref phLibNfc_RemoteDevList_t .Remote device list contains valid handles for discovered 1297 * targets .Using this interface LibNfc client can connect to one out of 'n' discovered targets. 1298 * A new session is started after connect operation is successful.The session ends with a 1299 * successful disconnect operation.Connect operation on an already connected tag Reactivates 1300 * the Tag.This Feature is not Valid for Jewel/Topaz Tags ,and hence a second connect if issued 1301 * without disconnecting a Jewel/Topaz tag always Fails. 1302 * 1303 * \note :In case multiple targets discovered LibNfc client can connect to only one target. 1304 * 1305 * \param[in] hRemoteDevice Handle of the target device obtained during discovery process. 1306 * 1307 * \param[in] pNotifyConnect_RspCb Client response callback to be to be 1308 * notified to indicate status of the request. 1309 * 1310 * \param[in] pContext Client context which will be included in 1311 * callback when the request is completed. 1312 * 1313 *\retval NFCSTATUS_PENDING Request initiated, result will be informed via 1314 * callback. 1315 *\retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 1316 * could not be properly interpreted. 1317 *\retval NFCSTATUS_TARGET_LOST Indicates target is lost. 1318 *\retval NFSCSTATUS_SHUTDOWN shutdown in progress. 1319 *\retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 1320 *\retval NFCSTATUS_INVALID_HANDLE Target handle is invalid. 1321 * 1322 *\retval NFCSTATUS_FAILED Request failed. 1323 * 1324 * 1325 *\msc 1326 *LibNfcClient,LibNfc; 1327 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 1328 *LibNfcClient<-LibNfc [label="pInitCb()",URL="\ref pphLibNfc_RspCb_t()"]; 1329 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_NtfRegister()",URL="\ref phLibNfc_RemoteDev_NtfRegister"]; 1330 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1331 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_configureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 1332 *LibNfcClient<-LibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1333 *--- [label="Now Present Tag to be discovered"]; 1334 *LibNfcClient<-LibNfc [label="pNotificationHandler",URL="\ref phLibNfc_NtfRegister_RspCb_t"]; 1335 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_Connect()",URL="\ref phLibNfc_RemoteDev_Connect"]; 1336 *LibNfcClient<-LibNfc [label="pNotifyConnect_RspCb",URL="\ref pphLibNfc_ConnectCallback_t"]; 1337 * 1338 *\endmsc 1339 */ 1340 1341 NFCSTATUS phLibNfc_RemoteDev_Connect(phLibNfc_Handle hRemoteDevice, 1342 pphLibNfc_ConnectCallback_t pNotifyConnect_RspCb, 1343 void* pContext 1344 ); 1345 1346 /** 1347 * \ingroup grp_lib_nfc 1348 * \brief This interface allows to perform Read/write operation on remote device. 1349 * 1350 * This function allows to send data to and receive data 1351 * from the target selected by libNfc client.It is also used by the 1352 * NFCIP1 Initiator while performing a transaction with the NFCIP1 target. 1353 * The LibNfc client has to provide the handle of the target and the 1354 * command in order to communicate with the selected remote device. 1355 * 1356 * 1357 *\param[in] hRemoteDevice handle of the remote device.This handle to be 1358 * same as as handle obtained for specific remote device 1359 * during device discovery. 1360 * \param[in] psTransceiveInfo Information required by transceive is concealed in 1361 * this structure.It contains send,receive buffers 1362 * and command specific details. 1363 * 1364 * 1365 * \param[in] pTransceive_RspCb Callback function for returning the received response 1366 * or error. 1367 * \param[in] pContext Client context which will be included in 1368 * callback when the request is completed. 1369 * 1370 * \retval NFCSTATUS_PENDING Request initiated, result will be informed through 1371 * the callback. 1372 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters could 1373 * not be properly interpreted or invalid. 1374 * \retval NFCSTATUS_COMMAND_NOT_SUPPORTED The command is not supported. 1375 * \retval NFSCSTATUS_SHUTDOWN shutdown in progress. 1376 * \retval NFCSTATUS_TARGET_LOST Indicates target is lost. 1377 * \retval NFCSTATUS_TARGET_NOT_CONNECTED The Remote Device is not connected. 1378 * \retval NFCSTATUS_INVALID_HANDLE Target handle is invalid 1379 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 1380 * \retval NFCSTATUS_REJECTED Indicates invalid request. 1381 * \retval NFCSTATUS_FAILED Request failed. 1382 * 1383 *\msc 1384 *LibNfcClient,LibNfc; 1385 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 1386 *LibNfcClient<-LibNfc [label="pInitCb()",URL="\ref pphLibNfc_RspCb_t()"]; 1387 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_NtfRegister()",URL="\ref phLibNfc_RemoteDev_NtfRegister"]; 1388 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1389 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_configureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 1390 *LibNfcClient<-LibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1391 *--- [label="Now Present Tag to be discovered"]; 1392 *LibNfcClient<-LibNfc [label="pNotificationHandler",URL="\ref phLibNfc_NtfRegister_RspCb_t"]; 1393 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_Connect()",URL="\ref phLibNfc_RemoteDev_Connect"]; 1394 *LibNfcClient<-LibNfc [label="pNotifyConnect_RspCb",URL="\ref pphLibNfc_ConnectCallback_t"]; 1395 *--- [label="Now perform transceive operation"]; 1396 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_Transceive()",URL="\ref phLibNfc_RemoteDev_Transceive "]; 1397 *LibNfcClient<-LibNfc [label="pTransceive_RspCb",URL="\ref pphLibNfc_TransceiveCallback_t"]; 1398 * 1399 *\endmsc 1400 */ 1401 1402 NFCSTATUS phLibNfc_RemoteDev_Transceive(phLibNfc_Handle hRemoteDevice, 1403 phLibNfc_sTransceiveInfo_t* psTransceiveInfo, 1404 pphLibNfc_TransceiveCallback_t pTransceive_RspCb, 1405 void* pContext 1406 ); 1407 1408 /** 1409 *\ingroup grp_lib_nfc 1410 *\brief Allows to disconnect from already connected target. 1411 * 1412 * The function allows to disconnect from from already connected target. This 1413 * function closes the session opened during connect operation.The status of discovery 1414 * wheel after disconnection is determined by the \ref phLibNfc_eReleaseType_t parameter. 1415 * it is also used to switch from wired to virtual mode in case the discovered 1416 * device is SmartMX in wired mode. 1417 * 1418 *\param[in] hRemoteDevice handle of the target device.This handle to be 1419 * same as as handle obtained for specific remote device 1420 * during device discovery. 1421 * \param[in] ReleaseType Release mode to be used while 1422 * disconnecting from target.Refer \ref phLibNfc_eReleaseType_t 1423 * for possible release types. 1424 *\param[in] pDscntCallback Client response callback to be to be notified 1425 to indicate status of the request. 1426 * \param[in] pContext Client context which will be included in 1427 * callback when the request is completed. 1428 1429 *\retval NFCSTATUS_PENDING Request initiated, result will be informed through 1430 the callback. 1431 *\retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters could not be 1432 * properly interpreted. 1433 *\retval NFCSTATUS_TARGET_NOT_CONNECTED The Remote Device is not connected. 1434 *\retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 1435 * \retval NFCSTATUS_INVALID_HANDLE Target handle is invalid. 1436 *\retval NFSCSTATUS_SHUTDOWN Shutdown in progress. 1437 *\retval NFCSTATUS_REJECTED Indicates previous disconnect in progress. 1438 * \retval NFCSTATUS_BUSY Indicates can not disconnect due to outstanding transaction in progress. 1439 * \retval NFCSTATUS_FAILED Request failed. 1440 1441 * 1442 * 1443 * 1444 *\msc 1445 *LibNfcClient,LibNfc; 1446 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 1447 *LibNfcClient<-LibNfc [label="pInitCb()",URL="\ref pphLibNfc_RspCb_t()"]; 1448 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_NtfRegister()",URL="\ref phLibNfc_RemoteDev_NtfRegister"]; 1449 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1450 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_configureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 1451 *LibNfcClient<-LibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1452 *--- [label="Now Present Tag to be discovered"]; 1453 *LibNfcClient<-LibNfc [label="pNotificationHandler",URL="\ref phLibNfc_NtfRegister_RspCb_t"]; 1454 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_Connect()",URL="\ref phLibNfc_RemoteDev_Connect"]; 1455 *LibNfcClient<-LibNfc [label="pNotifyConnect_RspCb",URL="\ref pphLibNfc_ConnectCallback_t"]; 1456 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_Transceive()",URL="\ref phLibNfc_RemoteDev_Transceive"]; 1457 *LibNfcClient<-LibNfc [label="pTransceive_RspCb",URL="\ref pphLibNfc_TransceiveCallback_t"]; 1458 *--- [label="Once transceive is completed Now disconnect"]; 1459 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_Disconnect()",URL="\ref phLibNfc_RemoteDev_Disconnect"]; 1460 *LibNfcClient<-LibNfc [label="pDscntCallback",URL="\ref pphLibNfc_RspCb_t"]; 1461 * 1462 *\endmsc 1463 */ 1464 NFCSTATUS phLibNfc_RemoteDev_Disconnect( phLibNfc_Handle hRemoteDevice, 1465 phLibNfc_eReleaseType_t ReleaseType, 1466 pphLibNfc_DisconnectCallback_t pDscntCallback, 1467 void* pContext 1468 ); 1469 1470 1471 1472 /** 1473 * \ingroup grp_lib_nfc 1474 *\brief This interface unregisters notification handler for target discovery. 1475 * 1476 * This function unregisters the listener which has been registered with 1477 * phLibNfc_RemoteDev_NtfUnregister() before. After this call the callback 1478 * function won't be called anymore. If nothing is registered the 1479 * function still succeeds 1480 * \retval NFCSTATUS_SUCCESS callback unregistered. 1481 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 1482 *\retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 1483 * 1484 *\msc 1485 *LibNfcClient,LibNfc; 1486 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 1487 *LibNfcClient<-LibNfc [label="pInitCb()",URL="\ref pphLibNfc_RspCb_t()"]; 1488 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_NtfRegister()",URL="\ref phLibNfc_RemoteDev_NtfRegister"]; 1489 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1490 *--- [label="Perform operations"]; 1491 *--- [label="In case required unregister now"]; 1492 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_NtfUnregister()",URL="\ref phLibNfc_RemoteDev_NtfUnregister"]; 1493 * 1494 *\endmsc 1495 */ 1496 1497 NFCSTATUS phLibNfc_RemoteDev_NtfUnregister(void); 1498 1499 /** 1500 * \ingroup grp_lib_nfc 1501 * \brief Check for target presence. 1502 * This function checks ,given target is present in RF filed or not. 1503 * Client can make use of this API to check periodically discovered 1504 * tag is present in RF field or not. 1505 * 1506 * 1507 *\param[in] hRemoteDevice handle of the target device.This handle to be 1508 * same as as handle obtained for specific remote device 1509 * during device discovery. 1510 * \param[in] pPresenceChk_RspCb callback function called on completion of the 1511 * presence check or in case an error has occurred. 1512 * \param[in] pContext Client context which will be included in 1513 * callback when the request is completed. 1514 * 1515 * \retval NFCSTATUS_PENDING presence check started. Status will be notified 1516 * via callback. 1517 * 1518 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not initialized. 1519 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters could 1520 * not be properly interpreted. 1521 * \retval NFCSTATUS_TARGET_NOT_CONNECTED The Remote Device is not connected. 1522 * \retval NFCSTATUS_INVALID_HANDLE Target handle is invalid 1523 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 1524 * \retval NFCSTATUS_FAILED Request failed. 1525 * 1526 * 1527 *\msc 1528 *LibNfcClient,LibNfc; 1529 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 1530 *LibNfcClient<-LibNfc [label="pInitCb()",URL="\ref pphLibNfc_RspCb_t()"]; 1531 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_NtfRegister()",URL="\ref phLibNfc_RemoteDev_NtfRegister"]; 1532 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1533 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_configureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 1534 *LibNfcClient<-LibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1535 *--- [label="Now Present Tag to be discovered"]; 1536 *LibNfcClient<-LibNfc [label="pNotificationHandler",URL="\ref phLibNfc_NtfRegister_RspCb_t"]; 1537 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_Connect()",URL="\ref phLibNfc_RemoteDev_Connect"]; 1538 *LibNfcClient<-LibNfc [label="pNotifyConnect_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1539 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_CheckPresence()",URL="\ref phLibNfc_RemoteDev_CheckPresence"]; 1540 *LibNfcClient<-LibNfc [label="pPresenceChk_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1541 * 1542 *\endmsc 1543 * 1544 *\note Response callback parameters details for this interface are as listed below. 1545 * 1546 * \param[in] pContext LibNfc client context passed in the corresponding request before. 1547 * \param[in] status Status of the response callback. 1548 * 1549 * \param NFCSTATUS_SUCCESS Successful,indicates tag is present in RF field. 1550 * \param NFCSTATUS_TARGET_LOST Indicates target is lost. 1551 * \param NFCSTATUS_SHUTDOWN Shutdown in progress. 1552 * \param NFCSTATUS_FAILED Request failed. 1553 * 1554 */ 1555 NFCSTATUS phLibNfc_RemoteDev_CheckPresence( phLibNfc_Handle hRemoteDevice, 1556 pphLibNfc_RspCb_t pPresenceChk_RspCb, 1557 void* pContext 1558 ); 1559 1560 /** 1561 * \ingroup grp_lib_nfc 1562 *\brief Allows to check connected tag is NDEF compliant or not. 1563 * This function allows to validate connected tag is NDEF compliant or not. 1564 * 1565 *\param[in] hRemoteDevice handle of the remote device.This handle to be 1566 * same as as handle obtained for specific remote device 1567 * during device discovery. 1568 *\param[in] pCheckNdef_RspCb Response callback defined by the caller. 1569 *\param[in] pContext Client context which will be included in 1570 * callback when the request is completed. 1571 * 1572 * \retval NFCSTATUS_PENDING The action has been successfully triggered. 1573 * \retval NFCSTATUS_INVALID_PARAMETER At least one parameter of the function 1574 * is invalid. 1575 * \retval NFCSTATUS_TARGET_LOST Indicates target is lost 1576 * \retval NFCSTATUS_TARGET_NOT_CONNECTED The Remote Device is not connected. 1577 * \retval NFCSTATUS_INVALID_HANDLE Target handle is invalid 1578 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 1579 * \retval NFCSTATUS_FAILED Request failed. 1580 * 1581 * 1582 *\msc 1583 *LibNfcClient,LibNfc; 1584 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 1585 *LibNfcClient<-LibNfc [label="pInitCb()",URL="\ref pphLibNfc_RspCb_t()"]; 1586 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_NtfRegister()",URL="\ref phLibNfc_RemoteDev_NtfRegister"]; 1587 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1588 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_configureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 1589 *LibNfcClient<-LibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1590 *--- [label="Now Present NDEF complaint Tag Type"]; 1591 *LibNfcClient<-LibNfc [label="pNotificationHandler",URL="\ref phLibNfc_NtfRegister_RspCb_t"]; 1592 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_Connect()",URL="\ref phLibNfc_RemoteDev_Connect"]; 1593 *LibNfcClient<-LibNfc [label="pNotifyConnect_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1594 *LibNfcClient=>LibNfc [label="phLibNfc_Ndef_CheckNdef()",URL="\ref phLibNfc_Ndef_CheckNdef "]; 1595 *LibNfcClient<-LibNfc [label="pCheckNdef_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1596 * 1597 *\endmsc 1598 * 1599 *\note Response callback parameters details for this interface are as listed below. 1600 * 1601 * \param[in] pContext LibNfc client context passed in the corresponding request before. 1602 * \param[in] status Status of the response callback. 1603 * 1604 * \param NFCSTATUS_SUCCESS Successful and tag is NDEF compliant . 1605 * \param NFCSTATUS_TARGET_LOST NDEF check operation is failed because of target is ** lost. 1606 * \param NFCSTATUS_SHUTDOWN Shutdown in progress. 1607 * \param NFCSTATUS_ABORTED Aborted due to disconnect operation in between. 1608 * \param NFCSTATUS_FAILED Request failed. 1609 */ 1610 1611 NFCSTATUS phLibNfc_Ndef_CheckNdef(phLibNfc_Handle hRemoteDevice, 1612 pphLibNfc_ChkNdefRspCb_t pCheckNdef_RspCb, 1613 void* pContext); 1614 1615 /** 1616 * \ingroup grp_lib_nfc 1617 * \brief Read NDEF message from a Tag. 1618 * This function reads an NDEF message from already connected tag. 1619 * the NDEF message is read starting after the position of the last read operation 1620 * of the same tag during current session. 1621 * If it's FALSE the NDEF message is read from starting of the NDEF message. 1622 * If the call returns with NFCSTATUS_PENDING , a response callback pNdefRead_RspCb is 1623 * called ,when the read operation is complete. 1624 * 1625 *\note Before issuing NDEF read operation LibNfc client should perform NDEF check operation 1626 * using \ref phLibNfc_Ndef_CheckNdef interface. 1627 * If the call back error code is NFCSTATUS_FAILED then the LIBNFC client has to do the 1628 * phLibNfc_RemoteDev_CheckPresence to find , its communication error or target lost. 1629 * 1630 *\param[in] hRemoteDevice handle of the remote device.This handle to be 1631 * same as as handle obtained for specific remote device 1632 * during device discovery. 1633 * \param[in] psRd Pointer to the read buffer info. 1634 * \param[in] Offset Reading Offset : phLibNfc_Ndef_EBegin means from the 1635 * beginning, phLibNfc_Ndef_ECurrent means from the 1636 * current offset. 1637 * \param[in] pNdefRead_RspCb Response callback defined by the caller. 1638 * \param[in] pContext Client context which will be included in 1639 * callback when the request is completed. 1640 * 1641 * \retval NFCSTATUS_SUCCESS NDEF read operation successful. 1642 * \retval NFCSTATUS_PENDING Request accepted and started 1643 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress 1644 * \retval NFCSTATUS_INVALID_HANDLE Target handle is invalid 1645 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 1646 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters could not 1647 * be properly interpreted. 1648 * \retval NFCSTATUS_TARGET_NOT_CONNECTED The Remote Device is not connected. 1649 * \retval NFCSTATUS_FAILED Read operation failed since tag does not contain NDEF data. 1650 * \retval NFCSTATUS_NON_NDEF_COMPLIANT Tag is not Ndef Compliant. 1651 * \param NFCSTATUS_REJECTED Rejected due to NDEF read issued on non 1652 * ,or Ndef check has not been performed 1653 * before the readNDEF tag. 1654 * 1655 *\msc 1656 *LibNfcClient,LibNfc; 1657 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 1658 *LibNfcClient<-LibNfc [label="pInitCb()",URL="\ref pphLibNfc_RspCb_t()"]; 1659 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_NtfRegister()",URL="\ref phLibNfc_RemoteDev_NtfRegister"]; 1660 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1661 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_configureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 1662 *LibNfcClient<-LibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1663 *--- [label="Now Present NDEF complaint Tag Type"]; 1664 *LibNfcClient<-LibNfc [label="pNotificationHandler",URL="\ref phLibNfc_NtfRegister_RspCb_t"]; 1665 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_Connect()",URL="\ref phLibNfc_RemoteDev_Connect"]; 1666 *LibNfcClient<-LibNfc [label="pNotifyConnect_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1667 *LibNfcClient=>LibNfc [label="phLibNfc_Ndef_CheckNdef()",URL="\ref phLibNfc_Ndef_CheckNdef "]; 1668 *LibNfcClient<-LibNfc [label="pCheckNdef_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1669 *LibNfcClient=>LibNfc [label="phLibNfc_Ndef_Read()",URL="\ref phLibNfc_Ndef_Read "]; 1670 *LibNfcClient<-LibNfc [label="pNdefRead_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1671 * 1672 *\endmsc 1673 * 1674 *\note Response callback parameters details for this interface are as listed below. 1675 * 1676 * \param[in] pContext LibNfc client context passed in the corresponding request before. 1677 * \param[in] status Status of the response callback. 1678 * 1679 * \param NFCSTATUS_SUCCESS NDEF read operation successful. 1680 * \param NFCSTATUS_SHUTDOWN Shutdown in progress. 1681 * \param NFCSTATUS_ABORTED Aborted due to disconnect operation in between. 1682 * \param NFCSTATUS_FAILED Request failed. 1683 */ 1684 NFCSTATUS phLibNfc_Ndef_Read(phLibNfc_Handle hRemoteDevice, 1685 phNfc_sData_t* psRd, 1686 phLibNfc_Ndef_EOffset_t Offset, 1687 pphLibNfc_RspCb_t pNdefRead_RspCb, 1688 void* pContext 1689 ); 1690 /** 1691 ** \ingroup grp_lib_nfc 1692 * 1693 * \brief Write NDEF data to NFC tag. 1694 * 1695 * This function allows the client to write a NDEF data to already connected NFC tag. 1696 * Function writes a complete NDEF message to a tag. If a NDEF message already 1697 * exists in the tag, it will be overwritten. When the transaction is complete, 1698 * a notification callback is notified. 1699 * 1700 *\note Before issuing NDEF write operation LibNfc client should perform NDEF check operation 1701 * using \ref phLibNfc_Ndef_CheckNdef interface. 1702 * 1703 *\param[in] hRemoteDevice handle of the remote device.This handle to be 1704 * same as as handle obtained for specific remote device 1705 * during device discovery. 1706 *\param[in] psWr Ndef Buffer to write. If NdefMessageLen is set to 0 1707 * and pNdefMessage = NULL, the NFC library will erase 1708 * tag internally. 1709 *\param[in] pNdefWrite_RspCb Response callback defined by the caller. 1710 *\param[in] pContext Client context which will be included in 1711 * callback when the request is completed. 1712 * 1713 *\note If \ref phNfc_sData_t.NdefMessageLen is 0 bytes, this function will erase all 1714 *current NDEF data present in the tag. Any non-zero length buffer size 1715 *will attempt to write NEDF data onto the tag. 1716 * If the call back error code is NFCSTATUS_FAILED then the LIBNFC client has to do the 1717 * phLibNfc_RemoteDev_CheckPresence to find , its communication error or target lost. 1718 * 1719 * 1720 * \retval NFCSTATUS_PENDING Request accepted and started. 1721 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 1722 * \retval NFCSTATUS_INVALID_HANDLE Target handle is invalid. 1723 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 1724 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters could not 1725 * be properly interpreted. 1726 * \retval NFCSTATUS_NON_NDEF_COMPLIANT Tag is not Ndef Compliant. 1727 * \retval NFCSTATUS_TARGET_NOT_CONNECTED The Remote Device is not connected. 1728 * \retval NFCSTATUS_REJECTED Rejected due to NDEF write issued without 1729 * performing a CheckNdef(). 1730 * \retval NFCSTATUS_FAILED operation failed. 1731 * 1732 *\msc 1733 *LibNfcClient,LibNfc; 1734 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 1735 *LibNfcClient<-LibNfc [label="pInitCb()",URL="\ref pphLibNfc_RspCb_t()"]; 1736 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_NtfRegister()",URL="\ref phLibNfc_RemoteDev_NtfRegister"]; 1737 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1738 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_configureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 1739 *LibNfcClient<-LibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1740 *--- [label="Now Present NDEF Tag "]; 1741 *LibNfcClient<-LibNfc [label="pNotificationHandler",URL="\ref phLibNfc_NtfRegister_RspCb_t"]; 1742 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_Connect()",URL="\ref phLibNfc_RemoteDev_Connect"]; 1743 *LibNfcClient<-LibNfc [label="pNotifyConnect_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1744 *LibNfcClient=>LibNfc [label="phLibNfc_Ndef_CheckNdef()",URL="\ref phLibNfc_Ndef_CheckNdef "]; 1745 *LibNfcClient<-LibNfc [label="pCheckNdef_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1746 *LibNfcClient=>LibNfc [label="phLibNfc_Ndef_Write()",URL="\ref phLibNfc_Ndef_Write "]; 1747 *LibNfcClient<-LibNfc [label="pNdefWrite_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1748 * 1749 *\endmsc 1750 * 1751 *\note Response callback parameters details for this interface are as listed below. 1752 * 1753 * \param[in] pContext LibNfc client context passed in the corresponding request before. 1754 * \param[in] status Status of the response callback. 1755 * 1756 * \param NFCSTATUS_SUCCESS NDEF write operation is successful. 1757 * \param NFCSTATUS_SHUTDOWN Shutdown in progress. 1758 * \param NFCSTATUS_ABORTED, Aborted due to disconnect operation in between. 1759 * \param NFCSTATUS_NOT_ENOUGH_MEMORY Requested no of bytes to be writen exceeds size of the memory available on the tag. 1760 * \param NFCSTATUS_FAILED Request failed. 1761 */ 1762 1763 NFCSTATUS phLibNfc_Ndef_Write (phLibNfc_Handle hRemoteDevice, 1764 phNfc_sData_t* psWr, 1765 pphLibNfc_RspCb_t pNdefWrite_RspCb, 1766 void* pContext 1767 ); 1768 1769 1770 1771 /** 1772 * \ingroup grp_lib_nfc 1773 * 1774 * \brief Format target. 1775 * 1776 * This function allows the LibNfc client to perform NDEF formating operation on discovered target. 1777 This function formats given target 1778 * 1779 *\note 1780 * <br>1. Prior to formating it is recommended to perform NDEF check using \ref phLibNfc_Ndef_CheckNdef interface. 1781 * <br>2. formatting feature supported only for MIFARE Std,MIFARE UL and Desfire tag types. 1782 * If the call back error code is NFCSTATUS_FAILED then the LIBNFC client has to do the 1783 * phLibNfc_RemoteDev_CheckPresence to find , its communication error or target lost. 1784 * 1785 *\param[in] hRemoteDevice handle of the remote device.This handle to be 1786 * same as as handle obtained for specific remote device 1787 * during device discovery. 1788 *\param[in] pScrtKey info containing the secret key data 1789 * and Secret key buffer length. 1790 * 1791 *\param[in] pNdefformat_RspCb Response callback defined by the caller. 1792 *\param[in] pContext Client context which will be included in 1793 * callback when the request is completed. 1794 * 1795 * 1796 * \retval NFCSTATUS_PENDING Request accepted and started. 1797 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 1798 * \retval NFCSTATUS_INVALID_HANDLE Target handle is invalid. 1799 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 1800 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters could not 1801 * be properly interpreted. 1802 * \retval NFCSTATUS_TARGET_NOT_CONNECTED The Remote Device is not connected. 1803 * \retval NFCSTATUS_FAILED operation failed. 1804 * \retval NFCSTATUS_REJECTED Tag is already formatted one. 1805 * 1806 *\msc 1807 *LibNfcClient,LibNfc; 1808 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 1809 *LibNfcClient<-LibNfc [label="pInitCb()",URL="\ref pphLibNfc_RspCb_t()"]; 1810 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_NtfRegister()",URL="\ref phLibNfc_RemoteDev_NtfRegister"]; 1811 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1812 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_configureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 1813 *LibNfcClient<-LibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1814 *--- [label="Now Present non NDEF Tag "]; 1815 *LibNfcClient<-LibNfc [label="pNotificationHandler",URL="\ref phLibNfc_NtfRegister_RspCb_t"]; 1816 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_Connect()",URL="\ref phLibNfc_RemoteDev_Connect"]; 1817 *LibNfcClient<-LibNfc [label="pNotifyConnect_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1818 *LibNfcClient=>LibNfc [label="phLibNfc_Ndef_CheckNdef()",URL="\ref phLibNfc_Ndef_CheckNdef "]; 1819 *LibNfcClient<-LibNfc [label="pCheckNdef_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1820 *--- [label="Tag found to be non NDEF compliant ,now format it"]; 1821 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_FormatNdef()",URL="\ref phLibNfc_RemoteDev_FormatNdef "]; 1822 *LibNfcClient<-LibNfc [label="pNdefformat_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1823 * 1824 *\endmsc 1825 * 1826 *\note Response callback parameters details for this interface are as listed below. 1827 * 1828 * \param[in] pContext LibNfc client context passed in the corresponding request before. 1829 * \param[in] status Status of the response callback. 1830 * 1831 * \param NFCSTATUS_SUCCESS NDEF formatting operation is successful. 1832 * \param NFCSTATUS_SHUTDOWN Shutdown in progress. 1833 * \param NFCSTATUS_ABORTED, Aborted due to disconnect operation in between. 1834 * \param NFCSTATUS_FAILED Request failed. 1835 */ 1836 1837 NFCSTATUS phLibNfc_RemoteDev_FormatNdef(phLibNfc_Handle hRemoteDevice, 1838 phNfc_sData_t* pScrtKey, 1839 pphLibNfc_RspCb_t pNdefformat_RspCb, 1840 void* pContext 1841 ); 1842 1843 /** 1844 * \ingroup grp_lib_nfc 1845 * \brief <b>Search for NDEF Record type</b>. 1846 * 1847 * This function allows LibNfc client to search NDEF content based on TNF value and type \n 1848 * 1849 *This API allows to find NDEF records based on RTD (Record Type Descriptor) info. 1850 *LibNfc internally parses NDEF content based registration type registered. 1851 *In case there is match LibNfc notifies LibNfc client with NDEF information details. 1852 *LibNfc client can search a new NDEF registration type once the previous call is handled. 1853 * 1854 *\param[in] hRemoteDevice Handle of the remote device.This handle to be 1855 * same as as handle obtained for specific remote device 1856 * during device discovery. 1857 *\param[in] psSrchTypeList List of NDEF records to be looked in based on TNF value and type. 1858 * For NDEF search type refer to \ref phLibNfc_Ndef_SrchType. 1859 * If this set to NULL then it means that libNfc client interested in 1860 * all possible NDEF records. 1861 * 1862 *\param[in] uNoSrchRecords Indicates no of NDEF records in requested list as mentioned 1863 * in psSrchTypeList. 1864 *\param[in] pNdefNtfRspCb Response callback defined by the caller. 1865 *\param[in] pContext Client context which will be included in 1866 * callback when callback is notified. 1867 * 1868 * 1869 * \retval NFCSTATUS_SUCCESS Indicates NDEF notification registration successful. 1870 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 1871 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 1872 * \retval NFCSTATUS_INVALID_HANDLE Target handle is invalid. 1873 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters could not 1874 * be properly interpreted. 1875 * \retval NFCSTATUS_TARGET_NOT_CONNECTED The Remote Device is not connected. 1876 * \retval NFCSTATUS_FAILED operation failed. 1877 * \retval NFCSTATUS_BUSY Previous request in progress can not accept new request. 1878 * 1879 * \retval NFCSTATUS_ABORTED Aborted due to disconnect request in between. 1880 *\msc 1881 *LibNfcClient,LibNfc; 1882 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 1883 *LibNfcClient<-LibNfc [label="pInitCb()",URL="\ref pphLibNfc_RspCb_t()"]; 1884 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_NtfRegister()",URL="\ref phLibNfc_RemoteDev_NtfRegister"]; 1885 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 1886 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_configureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 1887 *LibNfcClient<-LibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1888 *--- [label="Now Present NDEF Tag "]; 1889 *LibNfcClient<-LibNfc [label="pNotificationHandler",URL="\ref phLibNfc_NtfRegister_RspCb_t"]; 1890 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_Connect()",URL="\ref phLibNfc_RemoteDev_Connect"]; 1891 *LibNfcClient<-LibNfc [label="pNotifyConnect_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1892 *LibNfcClient=>LibNfc [label="phLibNfc_Ndef_CheckNdef()",URL="\ref phLibNfc_Ndef_CheckNdef "]; 1893 *LibNfcClient<-LibNfc [label="pCheckNdef_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1894 *LibNfcClient=>LibNfc [label="phLibNfc_Ndef_SearchNdefContent()",URL="\ref phLibNfc_Ndef_SearchNdefContent"]; 1895 *LibNfcClient<-LibNfc [label="pNdefNtfRspCb",URL="\ref pphLibNfc_Ndef_Search_RspCb_t()"]; 1896 *\endmsc 1897 * 1898 *\note Response callback parameters details for this interface are as listed below. 1899 * 1900 * \param[in] pContext LibNfc client context passed in the corresponding request before. 1901 * \param[in] status Status of the response callback. 1902 * 1903 */ 1904 NFCSTATUS phLibNfc_Ndef_SearchNdefContent( 1905 phLibNfc_Handle hRemoteDevice, 1906 phLibNfc_Ndef_SrchType_t* psSrchTypeList, 1907 uint8_t uNoSrchRecords, 1908 pphLibNfc_Ndef_Search_RspCb_t pNdefNtfRspCb, 1909 void * pContext 1910 ); 1911 1912 1913 1914 1915 /** 1916 * \ingroup grp_lib_nfc 1917 * \brief <b> Interface used to receive data from initiator at target side during P2P communication</b>. 1918 * 1919 *This function Allows the NFC-IP1 target to retrieve data/commands coming from the 1920 *Initiator.Once this function is called by LibNfc client on target side it waits for 1921 *receiving data from initiator.It is used by libNfc client which acts as target during P2P 1922 *communication. 1923 * 1924 *\note : Once this API is called,its mandatory to wait for receive 1925 *\ref pphLibNfc_Receive_RspCb_t callback notification,before calling any other 1926 *API.Only function allowed is \ref phLibNfc_Mgt_DeInitialize. 1927 * 1928 * \param[in] hRemoteDevice Peer handle obtained during device discovery process. 1929 * 1930 * \param[in] pReceiveRspCb Callback function called after receiving 1931 * the data or in case an error has 1932 * has occurred. 1933 * 1934 * \param[in] pContext Upper layer context to be returned 1935 * in the callback. 1936 * 1937 * \retval NFCSTATUS_PENDING Receive operation is in progress. 1938 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 1939 * could not be properly interpreted. 1940 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 1941 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 1942 * \retval NFCSTATUS_INVALID_DEVICE The device has been disconnected meanwhile. 1943 * \retval NFCSTATUS_DESELECTED Receive operation is not possible due to 1944 * initiator issued disconnect or intiator 1945 * physically removed from the RF field. 1946 * 1947 *\retval NFCSTATUS_REJECTED Indicates invalid request. 1948 *\retval NFCSTATUS_FAILED Request failed. 1949 * 1950 *\msc 1951 *P2PInitiatorClient,InitiatorLibNfc,P2PTargetLibNfc,P2PTargetClient; 1952 *--- [label="stack is intialised and P2P notification handler registered alredy"]; 1953 *P2PTargetClient=>P2PTargetLibNfc [label="phLibNfc_Mgt_SetP2P_ConfigParams()",URL="\ref phLibNfc_Mgt_SetP2P_ConfigParams"]; 1954 *P2PTargetClient<<P2PTargetLibNfc [label="NFCSTATUS_PENDING"]; 1955 *P2PTargetClient<-P2PTargetLibNfc [label="pConfigRspCb()",URL="\ref pphLibNfc_RspCb_t"]; 1956 *P2PInitiatorClient=>InitiatorLibNfc [label="phLibNfc_Mgt_SetP2P_ConfigParams()",URL="\ref phLibNfc_Mgt_SetP2P_ConfigParams"]; 1957 *P2PInitiatorClient<<InitiatorLibNfc [label="NFCSTATUS_PENDING"]; 1958 *P2PInitiatorClient<-InitiatorLibNfc [label="pConfigRspCb()",URL="\ref pphLibNfc_RspCb_t"]; 1959 *P2PTargetClient=>P2PTargetLibNfc [label="phLibNfc_Mgt_ConfigureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 1960 *P2PTargetClient<<P2PTargetLibNfc [label="NFCSTATUS_PENDING"]; 1961 *P2PTargetClient<-P2PTargetLibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1962 *P2PInitiatorClient=>InitiatorLibNfc [label="phLibNfc_Mgt_ConfigureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 1963 *P2PInitiatorClient<<InitiatorLibNfc [label="NFCSTATUS_PENDING"]; 1964 *P2PInitiatorClient<-InitiatorLibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 1965 *--- [label="Place Initiator and target closely"]; 1966 *P2PInitiatorClient<-InitiatorLibNfc [label="pNotificationHandler",URL="\ref phLibNfc_NtfRegister_RspCb_t"]; 1967 *P2PInitiatorClient=>InitiatorLibNfc [label="phLibNfc_RemoteDev_Connect()",URL="\ref phLibNfc_RemoteDev_Connect"]; 1968 *P2PInitiatorClient<<InitiatorLibNfc [label="NFCSTATUS_PENDING"]; 1969 *P2PInitiatorClient<-InitiatorLibNfc [label="pNotifyConnect_RspCb",URL="\ref pphLibNfc_ConnectCallback_t"]; 1970 *P2PTargetClient<-P2PTargetLibNfc [label="pNotificationHandler",URL="\ref phLibNfc_NtfRegister_RspCb_t"]; 1971 *--- [label="On connect target must be immediately ready to receive data from initiator"]; 1972 *P2PTargetClient=>P2PTargetLibNfc [label="phLibNfc_RemoteDev_Receive()",URL="\ref phLibNfc_RemoteDev_Receive"]; 1973 *--- [label="Now target waits to receive data from intiator"]; 1974 *--- [label="Send data from initiator now"]; 1975 *P2PInitiatorClient=>InitiatorLibNfc [label="phLibNfc_RemoteDev_Transceive()",URL="\ref phLibNfc_RemoteDev_Transceive "]; 1976 *P2PInitiatorClient<-InitiatorLibNfc [label="pTransceive_RspCb",URL="\ref pphLibNfc_TransceiveCallback_t"]; 1977 *--- [label="Now data arrived at target side"]; 1978 *P2PTargetClient<-P2PTargetLibNfc [label="pReceiveRspCb",URL="\ref pphLibNfc_Receive_RspCb_t"]; 1979 \endmsc 1980 *\note Response callback parameters details for this interface are as listed below. 1981 * 1982 * \param[in] pContext LibNfc client context passed in the corresponding request before. 1983 * \param[in] status Status of the response callback. 1984 * 1985 * \param NFCSTATUS_SUCCESS Receive operation successful. 1986 * \param NFCSTATUS_SHUTDOWN Receive operation failed because Shutdown in progress. 1987 * \param NFCSTATUS_ABORTED Aborted due to initiator issued disconnect request. 1988 * or intiator removed physically from the RF field. 1989 * This status code reported,to indicate P2P session 1990 * closed and send and receive requests not allowed 1991 * any more unless new session is started. 1992 * \param NFCSTATUS_DESELECTED Receive operation is not possible due to 1993 * initiator issued disconnect or intiator 1994 * physically removed from the RF field. 1995 */ 1996 extern 1997 NFCSTATUS 1998 phLibNfc_RemoteDev_Receive( phLibNfc_Handle hRemoteDevice, 1999 pphLibNfc_Receive_RspCb_t pReceiveRspCb, 2000 void* pContext 2001 ); 2002 2003 2004 2005 2006 2007 /** 2008 * \ingroup grp_lib_nfc 2009 * \brief <b>Interface used to send data from target to initiator during P2P communication</b>. 2010 * 2011 *This function Allows the NFC-IP1 target to send data to Initiator,in response to packet received 2012 *from initiator during P2P communication.It is must prior to send request target has received 2013 *data from initiator using \ref phLibNfc_RemoteDev_Receive interface. 2014 * 2015 * 2016 * \param[in] hRemoteDevice Peer handle obtained during device discovery process. 2017 * 2018 * \param[in] pTransferData Data and the length of the data to be 2019 * transferred. 2020 * \param[in] pSendRspCb Callback function called on completion 2021 * of the NfcIP sequence or in case an 2022 * error has occurred. 2023 * 2024 * \param[in] pContext Upper layer context to be returned in 2025 * the callback. 2026 * 2027 ** \retval NFCSTATUS_PENDING Send operation is in progress. 2028 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2029 * could not be properly interpreted. 2030 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2031 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2032 * \retval NFCSTATUS_INVALID_DEVICE The device has been disconnected meanwhile. 2033 * \retval NFCSTATUS_BUSY Previous request in progress can not accept new request. 2034 * \retval NFCSTATUS_DESELECTED Receive operation is not possible due to 2035 * initiator issued disconnect or intiator 2036 * physically removed from the RF field. 2037 *\retval NFCSTATUS_REJECTED Indicates invalid request. 2038 *\retval NFCSTATUS_FAILED Request failed. 2039 * 2040 *\msc 2041 *P2PInitiatorClient,InitiatorLibNfc,P2PTargetLibNfc,P2PTargetClient; 2042 *--- [label="stack is intialised and P2P notification handler registered alredy"]; 2043 *P2PTargetClient=>P2PTargetLibNfc [label="phLibNfc_Mgt_SetP2P_ConfigParams()",URL="\ref phLibNfc_Mgt_SetP2P_ConfigParams"]; 2044 *P2PTargetClient<<P2PTargetLibNfc [label="NFCSTATUS_PENDING"]; 2045 *P2PTargetClient<-P2PTargetLibNfc [label="pConfigRspCb()",URL="\ref pphLibNfc_RspCb_t"]; 2046 *P2PInitiatorClient=>InitiatorLibNfc [label="phLibNfc_Mgt_SetP2P_ConfigParams()",URL="\ref phLibNfc_Mgt_SetP2P_ConfigParams"]; 2047 *P2PInitiatorClient<<InitiatorLibNfc [label="NFCSTATUS_PENDING"]; 2048 *P2PInitiatorClient<-InitiatorLibNfc [label="pConfigRspCb()",URL="\ref pphLibNfc_RspCb_t"]; 2049 *P2PTargetClient=>P2PTargetLibNfc [label="phLibNfc_Mgt_ConfigureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 2050 *P2PTargetClient<<P2PTargetLibNfc [label="NFCSTATUS_PENDING"]; 2051 *P2PTargetClient<-P2PTargetLibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 2052 *P2PInitiatorClient=>InitiatorLibNfc [label="phLibNfc_Mgt_ConfigureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 2053 *P2PInitiatorClient<<InitiatorLibNfc [label="NFCSTATUS_PENDING"]; 2054 *P2PInitiatorClient<-InitiatorLibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 2055 *--- [label="Place Initiator and target closely"]; 2056 *P2PInitiatorClient<-InitiatorLibNfc [label="pNotificationHandler",URL="\ref phLibNfc_NtfRegister_RspCb_t"]; 2057 *P2PInitiatorClient=>InitiatorLibNfc [label="phLibNfc_RemoteDev_Connect()",URL="\ref phLibNfc_RemoteDev_Connect"]; 2058 *P2PInitiatorClient<<InitiatorLibNfc [label="NFCSTATUS_PENDING"]; 2059 *P2PInitiatorClient<-InitiatorLibNfc [label="pNotifyConnect_RspCb",URL="\ref pphLibNfc_ConnectCallback_t"]; 2060 *P2PTargetClient<-P2PTargetLibNfc [label="pNotificationHandler",URL="\ref phLibNfc_NtfRegister_RspCb_t"]; 2061 *--- [label="On connect target must be immediately ready to receive data from initiator"]; 2062 *P2PTargetClient=>P2PTargetLibNfc [label="phLibNfc_RemoteDev_Receive()",URL="\ref phLibNfc_RemoteDev_Receive"]; 2063 *--- [label="Now target waits to receive data from intiator"]; 2064 *--- [label="Send data from initiator now"]; 2065 *P2PInitiatorClient=>InitiatorLibNfc [label="phLibNfc_RemoteDev_Transceive()",URL="\ref phLibNfc_RemoteDev_Transceive "]; 2066 *--- [label="Now data arrived at target side"]; 2067 *P2PTargetClient<-P2PTargetLibNfc [label="pReceiveRspCb",URL="\ref pphLibNfc_Receive_RspCb_t"]; 2068 *--- [label="Now send data from target"]; 2069 *P2PTargetClient=>P2PTargetLibNfc [label="phLibNfc_RemoteDev_Send()",URL="\ref phLibNfc_RemoteDev_Send"]; 2070 *P2PInitiatorClient<-InitiatorLibNfc [label="pTransceive_RspCb",URL="\ref pphLibNfc_TransceiveCallback_t"]; 2071 *P2PTargetClient<-P2PTargetLibNfc [label="pSendRspCb",URL="\ref pphLibNfc_RspCb_t"]; 2072 *\endmsc 2073 * 2074 *\note Response callback parameters details for this interface are as listed below. 2075 * 2076 * \param[in] pContext LibNfc client context passed in the corresponding request before. 2077 * \param[in] status Status of the response callback. 2078 * 2079 * \param NFCSTATUS_SUCCESS Send operation successful. 2080 * \param NFCSTATUS_SHUTDOWN Send operation failed because Shutdown in progress. 2081 * \param NFCSTATUS_ABORTED Aborted due to initiator issued disconnect request. 2082 * or intiator removed physically from the RF field. 2083 * This status code reported,to indicate P2P session 2084 * closed and send and receive requests not allowed 2085 * any more unless new session is started. 2086 * \param NFCSTATUS_DESELECTED Receive operation is not possible due to 2087 * initiator issued disconnect or intiator 2088 * physically removed from the RF field. 2089 * 2090 * 2091 */ 2092 extern 2093 NFCSTATUS 2094 phLibNfc_RemoteDev_Send(phLibNfc_Handle hRemoteDevice, 2095 phNfc_sData_t* pTransferData, 2096 pphLibNfc_RspCb_t pSendRspCb, 2097 void* pContext 2098 ); 2099 2100 /** 2101 * \ingroup grp_lib_nfc 2102 * \brief <b>Interface to configure P2P and intiator mode configurations</b>. 2103 * The setting will be typically take effect for the next cycle of the relevant 2104 * phase of discovery. For optional configuration internal defaults will be 2105 * used in case the configuration is not set. 2106 * 2107 *\note Currently general bytes configuration supported. 2108 * 2109 * \param[in] pConfigInfo Union containing P2P configuration details as 2110 * in \ref phLibNfc_sNfcIPCfg_t. 2111 * 2112 * \param[in] pConfigRspCb This callback has to be called once LibNfc 2113 * completes the Configuration. 2114 * 2115 * \param[in] pContext Upper layer context to be returned in 2116 * the callback. 2117 * 2118 * 2119 * \retval NFCSTATUS_PENDING Config operation is in progress. 2120 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2121 * could not be properly interpreted. 2122 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2123 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2124 * \retval NFCSTATUS_BUSY Previous request in progress can not accept new request. 2125 * 2126 *\msc 2127 *P2PInitiatorClient,InitiatorLibNfc,P2PTargetLibNfc,P2PTargetClient; 2128 *--- [label="stack is intialised and P2P notification handler registered alredy"]; 2129 *P2PTargetClient=>P2PTargetLibNfc [label="phLibNfc_Mgt_SetP2P_ConfigParams()",URL="\ref phLibNfc_Mgt_SetP2P_ConfigParams"]; 2130 *P2PTargetClient<<P2PTargetLibNfc [label="NFCSTATUS_PENDING"]; 2131 *P2PTargetClient<-P2PTargetLibNfc [label="pConfigRspCb()",URL="\ref pphLibNfc_RspCb_t"]; 2132 *P2PInitiatorClient=>InitiatorLibNfc [label="phLibNfc_Mgt_SetP2P_ConfigParams()",URL="\ref phLibNfc_Mgt_SetP2P_ConfigParams"]; 2133 *P2PInitiatorClient<<InitiatorLibNfc [label="NFCSTATUS_PENDING"]; 2134 *P2PTargetClient=>P2PTargetLibNfc [label="phLibNfc_Mgt_ConfigureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 2135 *P2PTargetClient<<P2PTargetLibNfc [label="NFCSTATUS_PENDING"]; 2136 *P2PTargetClient<-P2PTargetLibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 2137 *P2PInitiatorClient=>InitiatorLibNfc [label="phLibNfc_Mgt_ConfigureDiscovery()",URL="\ref phLibNfc_Mgt_ConfigureDiscovery"]; 2138 *P2PInitiatorClient<<InitiatorLibNfc [label="NFCSTATUS_PENDING"]; 2139 *P2PInitiatorClient<-InitiatorLibNfc [label="pConfigDiscovery_RspCb",URL="\ref pphLibNfc_RspCb_t"]; 2140 *--- [label="Place Initiator and target closely"]; 2141 *P2PInitiatorClient<-InitiatorLibNfc [label="pNotificationHandler",URL="\ref phLibNfc_NtfRegister_RspCb_t"]; 2142 *P2PInitiatorClient=>InitiatorLibNfc [label="phLibNfc_RemoteDev_Connect()",URL="\ref phLibNfc_RemoteDev_Connect"]; 2143 *P2PInitiatorClient<<InitiatorLibNfc [label="NFCSTATUS_PENDING"]; 2144 *P2PInitiatorClient<-InitiatorLibNfc [label="pNotifyConnect_RspCb",URL="\ref pphLibNfc_ConnectCallback_t"]; 2145 *P2PTargetClient<-P2PTargetLibNfc [label="pNotificationHandler",URL="\ref phLibNfc_NtfRegister_RspCb_t"]; 2146 *--- [label="Now configured params ( Ex : general bytes can been seen in remote device info"]; 2147 *\endmsc 2148 * 2149 *\note Response callback parameters details for this interface are as listed below. 2150 * 2151 * \param[in] pContext LibNfc client context passed in the corresponding request before. 2152 * \param[in] status Status of the response callback. 2153 * 2154 * \param NFCSTATUS_SUCCESS configuration operation is successful. 2155 * \param NFCSTATUS_SHUTDOWN Shutdown in progress. 2156 * \param NFCSTATUS_FAILED Request failed. 2157 * 2158 */ 2159 extern NFCSTATUS phLibNfc_Mgt_SetP2P_ConfigParams( phLibNfc_sNfcIPCfg_t* pConfigInfo, 2160 pphLibNfc_RspCb_t pConfigRspCb, 2161 void* pContext 2162 ); 2163 2164 /** 2165 * \ingroup grp_lib_nfc 2166 * \brief <b>Interface to stack capabilities</b>. 2167 * 2168 * LibNfc client can query to retrieve stack capabilities.Stack capabilities contains 2169 * <br><br>a).Device capabilities which contains details like protocols supported, 2170 * Hardware,Firmware and model-id version details .For details refer to \ref phNfc_sDeviceCapabilities_t. 2171 * <br><br>b).NDEF mapping related info. This info helps in identifying supported tags for NDEF mapping feature. 2172 * <br><br>c).NDEF formatting related info. This info helps in identifying supported tags for NDEF formatting feature. 2173 * 2174 * \param[in] phLibNfc_StackCapabilities Contains device capabilities and NDEF mapping and formatting feature 2175 support for different tag types. 2176 * 2177 * \param[in] pContext Upper layer context to be returned in 2178 * the callback. 2179 * 2180 * 2181 * \retval NFCSTATUS_SUCCESS Indicates Get stack Capabilities operation successful. 2182 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2183 * could not be properly interpreted. 2184 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2185 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2186 * \retval NFCSTATUS_FAILED operation failed. 2187 * \retval NFCSTATUS_BUSY Previous request in progress can not accept new request. 2188 * 2189 * 2190 *\msc 2191 *LibNfcClient,LibNfc; 2192 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_Initialize()",URL="\ref phLibNfc_Mgt_Initialize"]; 2193 *LibNfcClient<-LibNfc [label="pInitCb()",URL="\ref pphLibNfc_RspCb_t()"]; 2194 *LibNfcClient=>LibNfc [label="phLibNfc_RemoteDev_NtfRegister()",URL="\ref phLibNfc_RemoteDev_NtfRegister"]; 2195 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 2196 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_GetstackCapabilities()",URL="\ref phLibNfc_Mgt_GetstackCapabilities"]; 2197 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 2198 *--- [label="Now stack capabilities available "]; 2199 * 2200 *\endmsc*/ 2201 2202 2203 extern NFCSTATUS phLibNfc_Mgt_GetstackCapabilities(phLibNfc_StackCapabilities_t* phLibNfc_StackCapabilities, 2204 void* pContext 2205 ); 2206 2207 2208 /** 2209 * \ingroup grp_lib_nfcHW_ 2210 * \brief <b>Interface to configure local LLCP peer</b>. 2211 * 2212 * This function configures the parameters of the local LLCP peer. This function must be called 2213 * before any other LLCP-related function from this API. 2214 * 2215 * \param[in] pConfigInfo Contains local LLCP link parameters to be applied 2216 * \param[in] pConfigRspCb This callback has to be called once LibNfc 2217 * completes the Configuration. 2218 * \param[in] pContext Upper layer context to be returned in 2219 * the callback. 2220 * 2221 * 2222 * \retval NFCSTATUS_SUCCESS Operation successful. 2223 * \retval NFCSTATUS_PENDING Configuration operation is in progress, 2224 pConfigRspCb will be called upon completion. 2225 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2226 * could not be properly interpreted. 2227 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2228 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2229 * \retval NFCSTATUS_FAILED Operation failed. 2230 * \retval NFCSTATUS_BUSY Previous request in progress can not accept new request. 2231 */ 2232 extern NFCSTATUS phLibNfc_Mgt_SetLlcp_ConfigParams( phLibNfc_Llcp_sLinkParameters_t* pConfigInfo, 2233 pphLibNfc_RspCb_t pConfigRspCb, 2234 void* pContext 2235 ); 2236 2237 2238 /** 2239 * \ingroup grp_lib_nfc 2240 * \brief <b>Checks if a remote peer is LLCP compliant</b>. 2241 * 2242 * This functions allows to check if a previously detected tag is compliant with the 2243 * LLCP protocol. This step is needed before calling any other LLCP-related function on 2244 * this remote peer, except local LLCP peer configurationn, which is more general. Once 2245 * this checking is done, the caller will be able to receive link status notifications 2246 * until the peer is disconnected. 2247 * 2248 * \param[in] hRemoteDevice Peer handle obtained during device discovery process. 2249 * \param[in] pCheckLlcp_RspCb The callback to be called once LibNfc 2250 * completes the LLCP compliancy check. 2251 * \param[in] pLink_Cb The callback to be called each time the 2252 * LLCP link status changes. 2253 * \param[in] pContext Upper layer context to be returned in 2254 * the callbacks. 2255 * 2256 * 2257 * \retval NFCSTATUS_SUCCESS Operation successful. 2258 * \retval NFCSTATUS_PENDING Check operation is in progress, pCheckLlcp_RspCb will 2259 * be called upon completion. 2260 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2261 * could not be properly interpreted. 2262 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2263 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2264 * \retval NFCSTATUS_FAILED Operation failed. 2265 * \retval NFCSTATUS_BUSY Previous request in progress can not accept new request. 2266 */ 2267 extern NFCSTATUS phLibNfc_Llcp_CheckLlcp( phLibNfc_Handle hRemoteDevice, 2268 pphLibNfc_ChkLlcpRspCb_t pCheckLlcp_RspCb, 2269 pphLibNfc_LlcpLinkStatusCb_t pLink_Cb, 2270 void* pContext 2271 ); 2272 2273 2274 /** 2275 * \ingroup grp_lib_nfc 2276 * \brief <b>Activates a LLCP link with a remote device </b>. 2277 * 2278 * This function launches the link activation process on a remote LLCP-compliant peer. The link status 2279 * notification will be sent by the corresponding callback given in the phLibNfc_Llcp_CheckLlcp function. 2280 * If the activation fails, the deactivated status will be notified, even if the link is already in a 2281 * deactivated state. 2282 * 2283 * \param[in] hRemoteDevice Peer handle obtained during device discovery process. 2284 * 2285 * \retval NFCSTATUS_SUCCESS Operation successful. 2286 * \retval NFCSTATUS_PENDING Activation operation is in progress, 2287 pLink_Cb will be called upon completion. 2288 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2289 * could not be properly interpreted. 2290 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2291 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2292 * \retval NFCSTATUS_FAILED Operation failed. 2293 * \retval NFCSTATUS_BUSY Previous request in progress can not accept new request. 2294 */ 2295 extern NFCSTATUS phLibNfc_Llcp_Activate( phLibNfc_Handle hRemoteDevice ); 2296 2297 2298 /** 2299 * \ingroup grp_lib_nfc 2300 * \brief <b>Deactivate a previously activated LLCP link with a remote device</b>. 2301 * 2302 * This function launches the link deactivation process on a remote LLCP-compliant peer. The link status 2303 * notification will be sent by the corresponding callback given in the phLibNfc_Llcp_CheckLlcp function. 2304 * 2305 * \param[in] hRemoteDevice Peer handle obtained during device discovery process. 2306 * 2307 * \retval NFCSTATUS_SUCCESS Operation successful. 2308 * \retval NFCSTATUS_PENDING Deactivation operation is in progress, 2309 pLink_Cb will be called upon completion. 2310 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2311 * could not be properly interpreted. 2312 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2313 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2314 * \retval NFCSTATUS_FAILED Operation failed. 2315 * \retval NFCSTATUS_BUSY Previous request in progress can not accept new request. 2316 */ 2317 extern NFCSTATUS phLibNfc_Llcp_Deactivate( phLibNfc_Handle hRemoteDevice ); 2318 2319 2320 /** 2321 * \ingroup grp_lib_nfc 2322 * \brief <b>Get information on the local LLCP peer</b>. 2323 * 2324 * This function returns the LLCP link parameters of the local peer that were used 2325 * during the link activation. 2326 * 2327 * \param[in] hRemoteDevice Peer handle obtained during device discovery process. 2328 * \param[out] pConfigInfo Pointer on the variable to be filled with the configuration 2329 parameters used during activation. 2330 * 2331 * \retval NFCSTATUS_SUCCESS Operation successful. 2332 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2333 * could not be properly interpreted. 2334 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2335 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2336 * \retval NFCSTATUS_FAILED Operation failed. 2337 * \retval NFCSTATUS_BUSY Previous request in progress can not accept new request. 2338 */ 2339 extern NFCSTATUS phLibNfc_Llcp_GetLocalInfo( phLibNfc_Handle hRemoteDevice, 2340 phLibNfc_Llcp_sLinkParameters_t* pConfigInfo 2341 ); 2342 2343 2344 /** 2345 * \ingroup grp_lib_nfc 2346 * \brief <b>Get information on the remote LLCP peer</b>. 2347 * 2348 * This function returns the LLCP link parameters of the remote peer that were received 2349 * during the link activation. 2350 * 2351 * \param[in] hRemoteDevice Peer handle obtained during device discovery process. 2352 * \param[out] pConfigInfo Pointer on the variable to be filled with the configuration 2353 parameters used during activation. 2354 * 2355 * \retval NFCSTATUS_SUCCESS Operation successful. 2356 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2357 * could not be properly interpreted. 2358 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2359 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2360 * \retval NFCSTATUS_FAILED Operation failed. 2361 * \retval NFCSTATUS_BUSY Previous request in progress can not accept new request. 2362 */ 2363 extern NFCSTATUS phLibNfc_Llcp_GetRemoteInfo( phLibNfc_Handle hRemoteDevice, 2364 phLibNfc_Llcp_sLinkParameters_t* pConfigInfo 2365 ); 2366 2367 2368 /** 2369 * \ingroup grp_lib_nfc 2370 * \brief <b>Create a socket on a LLCP-connected device</b>. 2371 * 2372 * This function creates a socket for a given LLCP link. Sockets can be of two types : 2373 * connection-oriented and connectionless. If the socket is connection-oriented, the caller 2374 * must provide a working buffer to the socket in order to handle incoming data. This buffer 2375 * must be large enough to fit the receive window (RW * MIU), the remaining space being 2376 * used as a linear buffer to store incoming data as a stream. Data will be readable later 2377 * using the phLibNfc_Llcp_Recv function. 2378 * The options and working buffer are not required if the socket is used as a listening socket, 2379 * since it cannot be directly used for communication. 2380 * 2381 * \param[in] hRemoteDevice Peer handle obtained during device discovery process. 2382 * \param[in] eType The socket type. 2383 * \param[in] psOptions The options to be used with the socket. 2384 * \param[in] psWorkingBuffer A working buffer to be used by the library. 2385 * \param[out] phSocket A pointer on the variable to be filled with the handle 2386 * on the created socket. 2387 * \param[in] pErr_Cb The callback to be called each time the socket 2388 * is in error. 2389 * \param[in] pContext Upper layer context to be returned in the callback. 2390 * 2391 * \retval NFCSTATUS_SUCCESS Operation successful. 2392 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2393 * could not be properly interpreted. 2394 * \retval NFCSTATUS_BUFFER_TOO_SMALL The working buffer is too small for the MIU and RW 2395 * declared in the options. 2396 * \retval NFCSTATUS_INSUFFICIENT_RESOURCES No more socket handle available. 2397 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2398 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2399 * \retval NFCSTATUS_FAILED Operation failed. 2400 */ 2401 extern NFCSTATUS phLibNfc_Llcp_Socket( phLibNfc_Handle hRemoteDevice, 2402 phLibNfc_Llcp_eSocketType_t eType, 2403 phLibNfc_Llcp_sSocketOptions_t* psOptions, 2404 phNfc_sData_t* psWorkingBuffer, 2405 phLibNfc_Handle* phSocket, 2406 pphLibNfc_LlcpSocketErrCb_t pErr_Cb, 2407 void* pContext 2408 ); 2409 2410 2411 /** 2412 * \ingroup grp_lib_nfc 2413 * \brief <b>Close a socket on a LLCP-connected device</b>. 2414 * 2415 * This function closes a LLCP socket previously created using phLibNfc_Llcp_Socket. 2416 * If the socket was connected, it is first disconnected, and then closed. 2417 * 2418 * \param[in] hSocket Socket handle obtained during socket creation. 2419 * 2420 * \retval NFCSTATUS_SUCCESS Operation successful. 2421 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2422 * could not be properly interpreted. 2423 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2424 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2425 * \retval NFCSTATUS_FAILED Operation failed. 2426 */ 2427 extern NFCSTATUS phLibNfc_Llcp_Close( phLibNfc_Handle hSocket ); 2428 2429 2430 /** 2431 * \ingroup grp_lib_nfc 2432 * \brief <b>Get the local options of a socket</b>. 2433 * 2434 * This function returns the local options (maximum packet size and receive window size) used 2435 * for a given connection-oriented socket. This function shall not be used with connectionless 2436 * sockets. 2437 * 2438 * \param[in] hSocket Socket handle obtained during socket creation. 2439 * \param[in] psLocalOptions A pointer to be filled with the local options of the socket. 2440 * 2441 * \retval NFCSTATUS_SUCCESS Operation successful. 2442 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2443 * could not be properly interpreted. 2444 * \retval NFCSTATUS_INVALID_STATE The socket is not in a valid state, or not of 2445 * a valid type to perform the requsted operation. 2446 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2447 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2448 * \retval NFCSTATUS_FAILED Operation failed. 2449 */ 2450 extern NFCSTATUS phLibNfc_Llcp_SocketGetLocalOptions( phLibNfc_Handle hSocket, 2451 phLibNfc_Llcp_sSocketOptions_t* psLocalOptions 2452 ); 2453 2454 2455 /** 2456 * \ingroup grp_lib_nfc 2457 * \brief <b>Get the local options of a socket</b>. 2458 * 2459 * This function returns the remote options (maximum packet size and receive window size) used 2460 * for a given connection-oriented socket. This function shall not be used with connectionless 2461 * sockets. 2462 * 2463 * \param[in] hSocket Socket handle obtained during socket creation. 2464 * \param[in] psRemoteOptions A pointer to be filled with the remote options of the socket. 2465 * 2466 * \retval NFCSTATUS_SUCCESS Operation successful. 2467 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2468 * could not be properly interpreted. 2469 * \retval NFCSTATUS_INVALID_STATE The socket is not in a valid state, or not of 2470 * a valid type to perform the requsted operation. 2471 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2472 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2473 * \retval NFCSTATUS_FAILED Operation failed. 2474 */ 2475 extern NFCSTATUS phLibNfc_Llcp_SocketGetRemoteOptions( phLibNfc_Handle hSocket, 2476 phLibNfc_Llcp_sSocketOptions_t* psRemoteOptions 2477 ); 2478 2479 2480 /** 2481 * \ingroup grp_lib_nfc 2482 * \brief <b>Bind a socket to a local SAP</b>. 2483 * 2484 * This function binds the socket to a local Service Access Point. 2485 * 2486 * \param[in] hSocket Peer handle obtained during device discovery process. 2487 * \param[out] pConfigInfo Pointer on the variable to be filled with the configuration 2488 * parameters used during activation. 2489 * 2490 * \retval NFCSTATUS_SUCCESS Operation successful. 2491 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2492 * could not be properly interpreted. 2493 * \retval NFCSTATUS_INVALID_STATE The socket is not in a valid state, or not of 2494 * a valid type to perform the requsted operation. 2495 * \retval NFCSTATUS_ALREADY_REGISTERED The selected SAP is already bound to another 2496 socket. 2497 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2498 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2499 * \retval NFCSTATUS_FAILED Operation failed. 2500 */ 2501 extern NFCSTATUS phLibNfc_Llcp_Bind( phLibNfc_Handle hSocket, 2502 uint8_t nSap 2503 ); 2504 2505 2506 /** 2507 * \ingroup grp_lib_nfc 2508 * \brief <b>Listen for incoming connection requests on a socket</b>. 2509 * 2510 * This function switches a socket into a listening state and registers a callback on 2511 * incoming connection requests. In this state, the socket is not able to communicate 2512 * directly. The listening state is only available for connection-oriented sockets 2513 * which are still not connected. The socket keeps listening until it is closed, and 2514 * thus can trigger several times the pListen_Cb callback. The caller can adverise the 2515 * service through SDP by providing a service name. 2516 * 2517 * 2518 * \param[in] hSocket Socket handle obtained during socket creation. 2519 * \param[in] psServiceName A buffer containing the name of the service for SDP. No SDP 2520 * advertising if set to NULL. 2521 * \param[in] pListen_Cb The callback to be called each time the 2522 * socket receive a connection request. 2523 * \param[in] pContext Upper layer context to be returned in 2524 * the callback. 2525 * 2526 * \retval NFCSTATUS_SUCCESS Operation successful. 2527 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2528 * could not be properly interpreted. 2529 * \retval NFCSTATUS_INVALID_STATE The socket is not in a valid state to switch 2530 * to listening state. 2531 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2532 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2533 * \retval NFCSTATUS_FAILED Operation failed. 2534 */ 2535 extern NFCSTATUS phLibNfc_Llcp_Listen( phLibNfc_Handle hSocket, 2536 phNfc_sData_t *psServiceName, 2537 pphLibNfc_LlcpSocketListenCb_t pListen_Cb, 2538 void* pContext 2539 ); 2540 2541 2542 /** 2543 * \ingroup grp_lib_nfc 2544 * \brief <b>Accept an incoming connection request for a socket</b>. 2545 * 2546 * This functions allows the client to accept an incoming connection request. 2547 * It must be used with the socket provided within the listen callback. The socket 2548 * is implicitly switched to the connected state when the function is called. 2549 * 2550 * \param[in] hSocket Socket handle obtained in the listening callback. 2551 * \param[in] psOptions The options to be used with the socket. 2552 * \param[in] psWorkingBuffer A working buffer to be used by the library. 2553 * \param[in] pErr_Cb The callback to be called each time the accepted socket 2554 * is in error. 2555 * \param[in] pAccept_RspCb The callback to be called when the Accept operation 2556 * is completed. 2557 * \param[in] pContext Upper layer context to be returned in the callback. 2558 * 2559 * \retval NFCSTATUS_SUCCESS Operation successful. 2560 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2561 * could not be properly interpreted. 2562 * \retval NFCSTATUS_BUFFER_TOO_SMALL The working buffer is too small for the MIU and RW 2563 * declared in the options. 2564 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2565 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2566 * \retval NFCSTATUS_FAILED Operation failed. 2567 */ 2568 extern NFCSTATUS phLibNfc_Llcp_Accept( phLibNfc_Handle hSocket, 2569 phLibNfc_Llcp_sSocketOptions_t* psOptions, 2570 phNfc_sData_t* psWorkingBuffer, 2571 pphLibNfc_LlcpSocketErrCb_t pErr_Cb, 2572 pphLibNfc_LlcpSocketAcceptCb_t pAccept_RspCb, 2573 void* pContext 2574 ); 2575 2576 2577 /** 2578 * \ingroup grp_lib_nfc 2579 * \brief <b>Reject an incoming connection request for a socket</b>. 2580 * 2581 * This functions allows the client to reject an incoming connection request. 2582 * It must be used with the socket provided within the listen callback. The socket 2583 * is implicitly closed when the function is called. 2584 * 2585 * \param[in] hSocket Socket handle obtained in the listening callback. 2586 * \param[in] pReject_RspCb The callback to be called when the Reject operation 2587 * is completed. 2588 * \retval NFCSTATUS_SUCCESS Operation successful. 2589 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2590 * could not be properly interpreted. 2591 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2592 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2593 * \retval NFCSTATUS_FAILED Operation failed. 2594 */ 2595 extern NFCSTATUS phLibNfc_Llcp_Reject( phLibNfc_Handle hSocket, 2596 pphLibNfc_LlcpSocketAcceptCb_t pReject_RspCb, 2597 void* pContext); 2598 2599 2600 /** 2601 * \ingroup grp_lib_nfc 2602 * \brief <b>Try to establish connection with a socket on a remote SAP</b>. 2603 * 2604 * This function tries to connect to a given SAP on the remote peer. If the 2605 * socket is not bound to a local SAP, it is implicitly bound to a free SAP. 2606 * 2607 * \param[in] hSocket Socket handle obtained during socket creation. 2608 * \param[in] nSap The destination SAP to connect to. 2609 * \param[in] pConnect_RspCb The callback to be called when the connection 2610 * operation is completed. 2611 * \param[in] pContext Upper layer context to be returned in 2612 * the callback. 2613 * 2614 * \retval NFCSTATUS_SUCCESS Operation successful. 2615 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2616 * could not be properly interpreted. 2617 * \retval NFCSTATUS_PENDING Connection operation is in progress, 2618 * pConnect_RspCb will be called upon completion. 2619 * \retval NFCSTATUS_INVALID_STATE The socket is not in a valid state, or not of 2620 * a valid type to perform the requsted operation. 2621 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2622 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2623 * \retval NFCSTATUS_FAILED Operation failed. 2624 */ 2625 extern NFCSTATUS phLibNfc_Llcp_Connect( phLibNfc_Handle hSocket, 2626 uint8_t nSap, 2627 pphLibNfc_LlcpSocketConnectCb_t pConnect_RspCb, 2628 void* pContext 2629 ); 2630 2631 2632 /** 2633 * \ingroup grp_lib_nfc 2634 * \brief <b>Try to establish connection with a socket on a remote service, given its URI</b>. 2635 * 2636 * This function tries to connect to a SAP designated by an URI. If the 2637 * socket is not bound to a local SAP, it is implicitly bound to a free SAP. 2638 * 2639 * \param[in] hSocket Socket handle obtained during socket creation. 2640 * \param[in] psUri The URI corresponding to the destination SAP to connect to. 2641 * \param[in] pConnect_RspCb The callback to be called when the connection 2642 * operation is completed. 2643 * \param[in] pContext Upper layer context to be returned in 2644 * the callback. 2645 * 2646 * \retval NFCSTATUS_SUCCESS Operation successful. 2647 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2648 * could not be properly interpreted. 2649 * \retval NFCSTATUS_PENDING Connection operation is in progress, 2650 * pConnect_RspCb will be called upon completion. 2651 * \retval NFCSTATUS_INVALID_STATE The socket is not in a valid state, or not of 2652 * a valid type to perform the requsted operation. 2653 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2654 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2655 * \retval NFCSTATUS_FAILED Operation failed. 2656 */ 2657 extern NFCSTATUS phLibNfc_Llcp_ConnectByUri( phLibNfc_Handle hSocket, 2658 phNfc_sData_t* psUri, 2659 pphLibNfc_LlcpSocketConnectCb_t pConnect_RspCb, 2660 void* pContext 2661 ); 2662 2663 2664 /** 2665 * \ingroup grp_lib_nfc 2666 * \brief <b>Disconnect a currently connected socket</b>. 2667 * 2668 * This function initiates the disconnection of a previously connected socket. 2669 * 2670 * \param[in] hSocket Socket handle obtained during socket creation. 2671 * \param[in] pDisconnect_RspCb The callback to be called when the 2672 * operation is completed. 2673 * \param[in] pContext Upper layer context to be returned in 2674 * the callback. 2675 * 2676 * \retval NFCSTATUS_SUCCESS Operation successful. 2677 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2678 * could not be properly interpreted. 2679 * \retval NFCSTATUS_PENDING Disconnection operation is in progress, 2680 * pDisconnect_RspCb will be called upon completion. 2681 * \retval NFCSTATUS_INVALID_STATE The socket is not in a valid state, or not of 2682 * a valid type to perform the requsted operation. 2683 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2684 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2685 * \retval NFCSTATUS_FAILED Operation failed. 2686 */ 2687 extern NFCSTATUS phLibNfc_Llcp_Disconnect( phLibNfc_Handle hSocket, 2688 pphLibNfc_LlcpSocketDisconnectCb_t pDisconnect_RspCb, 2689 void* pContext 2690 ); 2691 2692 2693 /** 2694 * \ingroup grp_lib_nfc 2695 * \brief <b>Read data on a socket</b>. 2696 * 2697 * This function is used to read data from a socket. It reads at most the 2698 * size of the reception buffer, but can also return less bytes if less bytes 2699 * are available. If no data is available, the function will be pending until 2700 * more data comes, and the response will be sent by the callback. This function 2701 * can only be called on a connection-oriented socket. 2702 * 2703 * 2704 * \param[in] hSocket Socket handle obtained during socket creation. 2705 * \param[in] psBuffer The buffer receiving the data. 2706 * \param[in] pRecv_RspCb The callback to be called when the 2707 * operation is completed. 2708 * \param[in] pContext Upper layer context to be returned in 2709 * the callback. 2710 * 2711 * \retval NFCSTATUS_SUCCESS Operation successful. 2712 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2713 * could not be properly interpreted. 2714 * \retval NFCSTATUS_PENDING Reception operation is in progress, 2715 * pRecv_RspCb will be called upon completion. 2716 * \retval NFCSTATUS_INVALID_STATE The socket is not in a valid state, or not of 2717 * a valid type to perform the requsted operation. 2718 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2719 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2720 * \retval NFCSTATUS_FAILED Operation failed. 2721 */ 2722 extern NFCSTATUS phLibNfc_Llcp_Recv( phLibNfc_Handle hSocket, 2723 phNfc_sData_t* psBuffer, 2724 pphLibNfc_LlcpSocketRecvCb_t pRecv_RspCb, 2725 void* pContext 2726 ); 2727 2728 2729 /** 2730 * \ingroup grp_lib_nfc 2731 * \brief <b>Read data on a socket and get the source SAP</b>. 2732 * 2733 * This function is the same as phLibNfc_Llcp_Recv, except that the callback includes 2734 * the source SAP. This functions can only be called on a connectionless socket. 2735 * 2736 * 2737 * \param[in] hSocket Socket handle obtained during socket creation. 2738 * \param[in] psBuffer The buffer receiving the data. 2739 * \param[in] pRecv_RspCb The callback to be called when the 2740 * operation is completed. 2741 * \param[in] pContext Upper layer context to be returned in 2742 * the callback. 2743 * 2744 * \retval NFCSTATUS_SUCCESS Operation successful. 2745 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2746 * could not be properly interpreted. 2747 * \retval NFCSTATUS_PENDING Reception operation is in progress, 2748 * pRecv_RspCb will be called upon completion. 2749 * \retval NFCSTATUS_INVALID_STATE The socket is not in a valid state, or not of 2750 * a valid type to perform the requsted operation. 2751 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2752 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2753 * \retval NFCSTATUS_FAILED Operation failed. 2754 */ 2755 extern NFCSTATUS phLibNfc_Llcp_RecvFrom( phLibNfc_Handle hSocket, 2756 phNfc_sData_t* psBuffer, 2757 pphLibNfc_LlcpSocketRecvFromCb_t pRecv_Cb, 2758 void* pContext 2759 ); 2760 2761 2762 /** 2763 * \ingroup grp_lib_nfc 2764 * \brief <b>Send data on a socket</b>. 2765 * 2766 * This function is used to write data on a socket. This function 2767 * can only be called on a connection-oriented socket which is already 2768 * in a connected state. 2769 * 2770 * 2771 * \param[in] hSocket Socket handle obtained during socket creation. 2772 * \param[in] psBuffer The buffer containing the data to send. 2773 * \param[in] pSend_RspCb The callback to be called when the 2774 * operation is completed. 2775 * \param[in] pContext Upper layer context to be returned in 2776 * the callback. 2777 * 2778 * \retval NFCSTATUS_SUCCESS Operation successful. 2779 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2780 * could not be properly interpreted. 2781 * \retval NFCSTATUS_PENDING Reception operation is in progress, 2782 * pSend_RspCb will be called upon completion. 2783 * \retval NFCSTATUS_INVALID_STATE The socket is not in a valid state, or not of 2784 * a valid type to perform the requsted operation. 2785 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2786 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2787 * \retval NFCSTATUS_FAILED Operation failed. 2788 */ 2789 extern NFCSTATUS phLibNfc_Llcp_Send( phLibNfc_Handle hSocket, 2790 phNfc_sData_t* psBuffer, 2791 pphLibNfc_LlcpSocketSendCb_t pSend_RspCb, 2792 void* pContext 2793 ); 2794 2795 2796 /** 2797 * \ingroup grp_lib_nfc 2798 * \brief <b>Send data on a socket to a given destination SAP</b>. 2799 * 2800 * This function is used to write data on a socket to a given destination SAP. 2801 * This function can only be called on a connectionless socket. 2802 * 2803 * 2804 * \param[in] hSocket Socket handle obtained during socket creation. 2805 * \param[in] nSap The destination SAP. 2806 * \param[in] psBuffer The buffer containing the data to send. 2807 * \param[in] pSend_RspCb The callback to be called when the 2808 * operation is completed. 2809 * \param[in] pContext Upper layer context to be returned in 2810 * the callback. 2811 * 2812 * \retval NFCSTATUS_SUCCESS Operation successful. 2813 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2814 * could not be properly interpreted. 2815 * \retval NFCSTATUS_PENDING Reception operation is in progress, 2816 * pSend_RspCb will be called upon completion. 2817 * \retval NFCSTATUS_INVALID_STATE The socket is not in a valid state, or not of 2818 * a valid type to perform the requsted operation. 2819 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2820 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2821 * \retval NFCSTATUS_FAILED Operation failed. 2822 */ 2823 extern NFCSTATUS phLibNfc_Llcp_SendTo( phLibNfc_Handle hSocket, 2824 uint8_t nSap, 2825 phNfc_sData_t* psBuffer, 2826 pphLibNfc_LlcpSocketSendCb_t pSend_RspCb, 2827 void* pContext 2828 ); 2829 2830 2831 /** 2832 * \ingroup grp_lib_nfc 2833 * 2834 * \brief Initializes \ DeInitialize the NFC library for testmode. 2835 * 2836 * 2837 *\brief This function initializes / DeInitialize NFC library and its underlying layers 2838 * in test mode. As part of this interface underlying layers gets configured. 2839 * Once phLibNfc_TstMode_On is successful ,NFC library ready in testmode using IOCTL. 2840 * After using test IOCTLs ,Test mode should be DeInit using phLibNfc_TstMode_Off. 2841 *\note This API should be used only for test IOCTL codes. 2842 * 2843 * \param[in] pDriverHandle Driver Handle currently application is using. 2844 * \param[in] pTestModeCb The init callback is called by the LibNfc when 2845 * Configure test mode completed or there is an error 2846 * in initialization. 2847 * 2848 * \param[in] pContext Client context which will be included in 2849 * callback when the request is completed. 2850 * 2851 * \retval NFCSTATUS_ALREADY_INITIALISED Stack is already initialized. 2852 * \retval NFCSTATUS_PENDING Init sequence has been successfully 2853 * started and result will be conveyed via 2854 * callback notification. 2855 * \retval NFCSTATUS_INVALID_PARAMETER The parameter could not be properly 2856 * interpreted. 2857 *\retval NFCSTATUS_INSUFFICIENT_RESOURCES Insufficient resource.(Ex: insufficient memory) 2858 * 2859 *\msc 2860 *LibNfcClient,LibNfc; 2861 *--- [label="Before initializing Nfc LIB,Setup Driver layer"]; 2862 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_ConfigureDriver()",URL="\ref phLibNfc_Mgt_ConfigureDriver"]; 2863 *LibNfcClient<<LibNfc [label="NFCSTATUS_SUCCESS"]; 2864 *LibNfcClient=>LibNfc [label="phLibNfc_Mgt_ConfigureTestMode()",URL="\ref phLibNfc_Mgt_ConfigureTestMode"]; 2865 *LibNfcClient<<LibNfc [label="NFCSTATUS_PENDING"]; 2866 *LibNfcClient<-LibNfc [label="pTestModeCb"]; 2867 *\endmsc 2868 */ 2869 NFCSTATUS phLibNfc_Mgt_ConfigureTestMode(void *pDriverHandle, 2870 pphLibNfc_RspCb_t pTestModeCb, 2871 phLibNfc_Cfg_Testmode_t eTstmode, 2872 void *pContext 2873 ); 2874 2875 /** 2876 * \ingroup grp_lib_nfc 2877 * \brief <b>Interface to LibNfc Reset</b>. 2878 * 2879 * LibNfc client can reset the stack. 2880 * 2881 * \param[in] pContext Upper layer context to be returned in 2882 * the callback. 2883 * 2884 * 2885 * \retval NFCSTATUS_SUCCESS Indicates Get stack Capabilities operation successful. 2886 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters 2887 * could not be properly interpreted. 2888 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized. 2889 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress. 2890 */ 2891 2892 NFCSTATUS phLibNfc_Mgt_Reset(void *pContext); 2893 2894 #endif /* PHLIBNFC_H */ 2895 2896