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