Update the latest source
[framework/api/nfc.git] / include / nfc.h
1 /*
2  * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
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 #ifndef __NFC_H__
19 #define __NFC_H__
20
21 #include <tizen.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /**
28  * @file nfc.h
29  * @brief This file contains the NFC API.
30  */
31
32 #define NFC_ERROR_CLASS TIZEN_ERROR_NETWORK_CLASS | 0x200
33
34
35 /**
36  * @brief Error codes reported by the NFC API.
37  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
38  */
39 typedef enum {
40         NFC_ERROR_NONE = TIZEN_ERROR_NONE,      /**< Successful */
41         NFC_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,    /**< Out of memory */
42         NFC_ERROR_OPERATION_FAILED = NFC_ERROR_CLASS | 0x01,    /**< Operation failed*/
43         NFC_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,    /**< Invalid parameter */
44         NFC_ERROR_INVALID_NDEF_MESSAGE = NFC_ERROR_CLASS | 0x02,        /**< Invalid NDEF message */
45         NFC_ERROR_INVALID_RECORD_TYPE  = NFC_ERROR_CLASS | 0x03,        /**< Invalid record type*/
46         NFC_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT,    /**< Timeout error, no answer */
47         NFC_ERROR_DEVICE_BUSY = TIZEN_ERROR_RESOURCE_BUSY,      /**< Previous opertion is not finished still busy */
48         NFC_ERROR_NO_DEVICE = NFC_ERROR_CLASS | 0x04, /**< no device */
49         NFC_ERROR_NOT_ACTIVATED = NFC_ERROR_CLASS | 0x05, /**< NFC is not activated */
50         NFC_ERROR_NOT_SUPPORTED = NFC_ERROR_CLASS | 0x06, /**< Not supported */
51         NFC_ERROR_ALREADY_ACTIVATED = NFC_ERROR_CLASS | 0x07, /**< Already activated */
52         NFC_ERROR_ALREADY_DEACTIVATED = NFC_ERROR_CLASS | 0x08, /**< Already deactivated */
53         NFC_ERROR_READ_ONLY_NDEF = NFC_ERROR_CLASS | 0x09, /**< Read only tag */
54         NFC_ERROR_NO_SPACE_ON_NDEF = NFC_ERROR_CLASS | 0x0a, /**< No enough space on tag */
55         NFC_ERROR_NO_NDEF_MESSAGE = NFC_ERROR_CLASS | 0x0b, /**< No NDEF Message on Tag */
56         NFC_ERROR_NOT_NDEF_FORMAT = NFC_ERROR_CLASS | 0x0c /**< Not NDEF format Tag */
57 } nfc_error_e;
58
59 /**
60  * @brief Enumerations for record TNF (Type Name Format)
61  * @details It is indicate format of type field
62  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
63  */
64 typedef enum {
65         NFC_RECORD_TNF_EMPTY = 0x00,    /**< Empty */
66         NFC_RECORD_TNF_WELL_KNOWN = 0x01,       /**< RTD(Record Type Definition) type format [NFC RTD] */
67         NFC_RECORD_TNF_MIME_MEDIA= 0x02,        /**< MIME Media types in RFC 2046 [RFC 2046] */
68         NFC_RECORD_TNF_URI = 0x03,      /**< Absolute URI as defined in RFC 3986 [RFC 3986] */
69         NFC_RECORD_TNF_EXTERNAL_RTD = 0x04,     /**< NFC Forum external type [NFC RTD] */
70         NFC_RECORD_TNF_UNKNOWN = 0x05,  /**< Unknown\n The payload type is unknown */
71         NFC_RECORD_TNF_UNCHAGNED = 0x06,        /**< It means the payload is an intermediate or final chunk of a chunked NDEF Record */
72 } nfc_record_tnf_e;
73
74
75 /**
76  * @brief Enumerations for NFC encode types
77  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
78  */
79 typedef enum {
80         NFC_ENCODE_UTF_8 = 0x00,        /**< UTF-8 */
81         NFC_ENCODE_UTF_16,      /**< UTF-16 */
82 } nfc_encode_type_e;
83
84 /**
85  * @brief Enumerations for NFC tag types
86  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
87  */
88 typedef enum {
89         NFC_UNKNOWN_TARGET = 0x00U,     /**< Unknown target */
90         NFC_GENERIC_PICC,       /**< GENERIC PICC*/
91         NFC_ISO14443_A_PICC,    /**< ISO14443_A PICC */
92         NFC_ISO14443_4A_PICC,   /**< ISO14443_4A PICC */
93         NFC_ISO14443_3A_PICC,   /**< ISO14443_3A PICC */
94         NFC_MIFARE_MINI_PICC,   /**< MIFARE_MINI_PICC */
95         NFC_MIFARE_1K_PICC,     /**< MIFARE_1K_PICC */
96         NFC_MIFARE_4K_PICC,     /**< MIFARE_4K_PICC */
97         NFC_MIFARE_ULTRA_PICC,  /**< MIFARE_ULTRA_PICC */
98         NFC_MIFARE_DESFIRE_PICC,        /**< MIFARE_DESFIRE_PICC */
99         NFC_ISO14443_B_PICC,    /**< ISO14443_B PICC */
100         NFC_ISO14443_4B_PICC,   /**< ISO14443_4B PICC */
101         NFC_ISO14443_BPRIME_PICC,       /**< ISO14443_BPRIME PICC */
102         NFC_FELICA_PICC,        /**< FELICA PICC */
103         NFC_JEWEL_PICC, /**< JEWEL PICC */
104         NFC_ISO15693_PICC,      /**< ISO15693 PICC */
105         NFC_NFCIP1_TARGET,      /**< NFCIP1_TARGET */
106         NFC_NFCIP1_INITIATOR,   /**< NFCIP1_INITIATOR */
107 } nfc_tag_type_e;
108
109
110
111 /**
112  * @brief Enumerations for NFC Tag filter
113  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
114  */
115 typedef enum {
116         NFC_TAG_FILTER_ALL_DISABLE = 0x0000,    /**< All disable */
117         NFC_TAG_FILTER_ISO14443A_ENABLE = 0x0001,       /**< ISO14443A enable */
118         NFC_TAG_FILTER_ISO14443B_ENABLE = 0x0002,       /**< ISO14443B enable */
119         NFC_TAG_FILTER_ISO15693_ENABLE = 0x0004,        /**< ISO15693 enable */
120         NFC_TAG_FILTER_FELICA_ENABLE = 0x0008,  /**< FELICA enable */
121         NFC_TAG_FILTER_JEWEL_ENABLE = 0x0010,   /**< JEWEL enable */
122         NFC_TAG_FILTER_IP_ENABLE = 0x0020,      /**< IP enable */
123         NFC_TAG_FILTER_ALL_ENABLE= ~0,  /**< All enable */
124 } nfc_tag_filter_e;
125
126 /**
127  * @brief Enumerations of polling request code for FeliCa tag
128  * @ingroup CAPI_NETWORK_NFC_TAG_FELICA
129  */
130 typedef enum {
131         NFC_TAG_FELICA_POLL_NO_REQUEST = 0x00,  /**< NO REQUEST */
132         NFC_TAG_FELICA_POLL_SYSTEM_CODE_REQUEST= 0x01,  /**< SYSTEM CODE REQUEST */
133         NFC_TAG_FELICA_POLL_COMM_SPEED_REQUEST= 0x02,   /**< COMM SPEED REQUEST */
134 } nfc_tag_felica_poll_request_code_e;
135
136
137 /**
138  * @brief Enumerations for NFC discovered type
139  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
140  */
141 typedef enum {
142         NFC_DISCOVERED_TYPE_ATTACHED,   /**< Attached, discovered, activated event*/
143         NFC_DISCOVERED_TYPE_DETACHED,   /**< detached, disappeared, deactivated event*/
144 } nfc_discovered_type_e;
145
146 /**
147  * @brief Enumerations for NFC Secure Element (SIM/UICC(Universal Integrated Circuit Card)) event
148  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
149  */
150 typedef enum{
151         NFC_SE_EVENT_START_TRANSACTION, /**< This event notifies the terminal host that it shall launch an application associated to an NFC application in a UICC(Universal Integrated Circuit Card) host. */
152         NFC_SE_EVENT_END_TRANSACTION,   /**< This event notifies the terminal host that current transaction in process was ended. */
153         NFC_SE_EVENT_CONNECTIVITY, /**< It's ready signal to communicate UICC(Universal Integrated Circuit Card) with terminal host. \nUICC(Universal Integrated Circuit Card) create pipe and open the pipe chanel.\nThen it sends the signal to terminal host or host controller. */
154         NFC_SE_EVENT_FIELD_ON, /**< When the CLF(Contactless Front-end) detects a RF field, the card RF gate sends the event #NFC_SE_EVENT_FIELD_ON to the card application gate.\nWhen there are multiple open card RF gates the CLF shall send the #NFC_SE_EVENT_FIELD_ON on all open pipes to these gates.Next the CLF starts the initialization and anti-collision process as defined in ISO/IEC 14443-3 [6]*/
155         NFC_SE_EVENT_FIELD_OFF, /**< When the CLF(Contactless Front-end) detects that the RF field is off, the card RF gate shall send #NFC_SE_EVENT_FIELD_OFF to the card application gate.\nWhen there are multiple open card RF gates the CLF shall send the #NFC_SE_EVENT_FIELD_OFF to one gate only.*/
156         NFC_SE_EVENT_TRANSACTION /**< This event  notifies , external reader trys to access secure element */
157 } nfc_se_event_e;
158
159
160 /**
161  * @brief Enumerations for NFC AC(Alternative Carrior)
162  * @ingroup CAPI_NETWORK_NFC_P2P_MODULE
163  */
164 typedef enum {
165         NFC_AC_TYPE_BT = 0x00, /**< Bluetooth AC*/
166         NFC_AC_TYPE_WIFI, /**<Wifi AC*/
167         NFC_AC_TYPE_WIFI_DIRECT,/**<Wifi-direct AC*/
168         NFC_AC_TYPE_UNKNOWN, /* No selected preferd AC */
169 } nfc_ac_type_e ;
170
171
172
173
174 /**
175  * @brief The handle to the NDEF record
176  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
177  */
178 typedef struct ndef_record_s *nfc_ndef_record_h;
179
180 /**
181  * @brief The handle to the NDEF message
182  * @ingroup CAPI_NETWORK_NFC_NDEF_MESSAGE_MODULE
183  */
184 typedef struct ndef_message_s *nfc_ndef_message_h;
185
186 /**
187  * @brief The handle to the NFC tag
188  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
189  */
190 typedef struct net_nfc_target_info_s *nfc_tag_h;
191
192
193 /**
194  * @brief The handle to NFC p2p target
195  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
196  */
197 typedef void* nfc_p2p_target_h;
198
199 /**
200  * @brief The default factory key.
201  * @details The key is 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
202  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
203  */
204 extern const unsigned char NFC_TAG_MIFARE_KEY_DEFAULT[6];
205
206 /**
207  * @brief The well-known key for tags formatted according to the MIFARE Application Directory (MAD) specification.
208  * @details The key is 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5
209  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
210  */
211 extern const unsigned char NFC_TAG_MIFARE_KEY_APPLICATION_DIRECTORY[6];
212
213 /**
214  * @brief The well-known key for tags formatted according to the NDEF on Mifare Classic specification.
215  * @details The key is 0xD3, 0xF7, 0xD3, 0xF7, 0xD3, 0xF7
216  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
217  */
218 extern const unsigned char NFC_TAG_MIFARE_KEY_NFC_FORUM[6];
219
220
221 /**
222  * @brief RTD(Record type definition) Type - Smart Poster type.
223  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
224  */
225 extern const unsigned char NFC_RECORD_SMART_POSTER_TYPE[2];
226
227 /**
228  * @brief  RTD(Record type definition) Type - Text type.
229  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
230  */
231 extern const unsigned char NFC_RECORD_TEXT_TYPE[1];
232 /**
233  * @brief  RTD(Record type definition) Type - URI type.
234  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
235  */
236 extern const unsigned char NFC_RECORD_URI_TYPE[1];
237 /**
238  * @brief  RTD(Record type definition) Type - Alternative Carrier type.
239  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
240  */
241 extern const unsigned char NFC_RECORD_ALTERNATIVE_CARRIER_TYPE[2];
242 /**
243  * @brief  RTD(Record type definition) Type - Handover Carrier type.
244  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
245  */
246 extern const unsigned char NFC_RECORD_HANDOVER_CARRIER_TYPE[2];
247 /**
248  * @brief  RTD(Record type definition) Type - Handover Request type.
249  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
250  */
251 extern const unsigned char NFC_RECORD_HANDOVER_REQUEST_TYPE[2];
252 /**
253  * @brief  RTD(Record type definition) Type - Handover Select type.
254  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
255  */
256 extern const unsigned char NFC_RECORD_HANDOVER_SELECT_TYPE[2];
257
258 /**
259  * @brief Called after nfc_manager_set_activation() has completed.
260  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
261  *
262  * @param [in] error The result
263  * @param [in] user_data The user data passed from the callback registration function
264  *
265  * @see nfc_manager_set_activation()
266  */
267 typedef void (* nfc_activation_completed_cb)(nfc_error_e error, void *user_data);
268
269 /**
270  * @brief Called when nfc activation state is changed.
271  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
272  *
273  * @param [in] activated The activation state
274  * @param [in] user_data The user data passed from the callback registeration function
275  *
276  * @see nfc_manager_set_activation_changed_cb()
277  */
278 typedef void (*nfc_activation_changed_cb)(bool activated , void *user_data);
279
280 /**
281  * @brief Called after nfc_manager_initialize() has completed.
282  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
283  *
284  * @param [in] error The result
285  * @param [in] user_data The user data passed from the callback registration function
286  *
287  * @see nfc_manager_initialize()
288  */
289 typedef void (* nfc_initialize_completed_cb)(nfc_error_e error, void *user_data);
290
291
292 /**
293  * @brief Called when an NFC tag appears or disappears
294  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
295  *
296  * @remarks  The tag handle does not have detail target info when an NFC tag disappeared.\n
297  *      So then do not use nfc_tag_get_keys().
298  *
299  * @param [in] type The discovered type attached or detached
300  * @param [in] tag The handle to NFC tag
301  * @param [in] user_data The user data passed from the callback registration function
302  *
303  * @see nfc_manager_set_tag_discovered_cb()
304  * @see nfc_manager_unset_tag_discovered_cb()
305  * @see nfc_manager_set_tag_filter()
306  */
307 typedef void (* nfc_tag_discovered_cb)(nfc_discovered_type_e type, nfc_tag_h tag, void *user_data);
308
309 /**
310  * @brief Called when an NDEF Message is discovered
311  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
312  *
313  * @remarks @a message will be automatically destroyed when the callback function returns. (Do not release @a message.)
314  *
315  * @param [in] message The handle to NDEF message
316  * @param [in] user_data The user data passed from the callback registration function
317  *
318  * @see nfc_manager_set_ndef_discovered_cb()
319  * @see nfc_manager_unset_ndef_discovered_cb()
320  */
321 typedef void (* nfc_ndef_discovered_cb)(nfc_ndef_message_h message, void *user_data);
322
323
324 /**
325  * @brief Called once for each tag information.
326  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
327  *
328  * @remarks @a key and value will be automatically destroyed when the callback function returns. (Do not release @a key and value.)
329  *
330  * @param[in] key The key of information
331  * @param[in] value The value of information
332  * @param[in] value_size The data size in bytes
333  * @param[in] user_data The user data passed from the foreach function
334  *
335  * @return @c true to continue with the next iteration of the loop, \n @c false to break outsp of the loop.
336  * @pre nfc_tag_foreach_informations() invokes this callback.
337  *
338  * @see nfc_tag_foreach_informations()
339  */
340
341 typedef bool (*nfc_tag_information_cb)(const char *key, const unsigned char *value, int value_size, void *user_data);
342
343
344 /**
345  * @brief Called after nfc_tag_transceive() has completed.
346  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
347  *
348  * @remarks @a buffer will be automatically destroyed when the callback function returns. (Do not release @a buffer.)
349  *
350  * @param [in] result The result of function call
351  * @param [in] buffer   The result data
352  * @param [in] buffer_size The size of buffer in bytes
353  * @param [in] user_data The user data passed from nfc_tag_transceive()
354  *
355  * @see nfc_tag_transceive()
356  */
357 typedef void (* nfc_tag_transceive_completed_cb)(nfc_error_e result, unsigned char *buffer, int buffer_size, void *user_data);
358
359 /**
360  * @brief Called after the nfc_tag_write_ndef() has completed.
361  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
362  *
363  * @param [in] result The result of function call
364  * @param [in] user_data The user data passed from nfc_manager_initialize()
365  *
366  * @see nfc_tag_write_ndef()
367  */
368 typedef void (* nfc_tag_write_completed_cb)(nfc_error_e result, void *user_data);
369
370 /**
371  * @brief Called after the nfc_tag_read_ndef() has completed.
372  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
373  *
374  * @remarks @a message will be automatically destroyed when the callback function returns. (Do not release @a message.)
375  *
376  * @param [in] result The result of function call
377  * @param [in] message The NDEF message
378  * @param [in] user_data The user data passed from nfc_tag_read_ndef()
379  *
380  * @see nfc_tag_read_ndef()
381  */
382 typedef void (* nfc_tag_read_completed_cb)(nfc_error_e result, nfc_ndef_message_h message, void *user_data);
383
384 /**
385  * @brief   Called after the nfc_tag_format_ndef() has completed.
386  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
387  *
388  * @param [in] result The result of function call
389  * @param [in] user_data The user data passed from nfc_tag_format_ndef()
390  *
391  * @see nfc_tag_format_ndef()
392  */
393 typedef void (* nfc_tag_format_completed_cb)(nfc_error_e result, void *user_data);
394
395
396 /**
397  * @brief Called after nfc_mifare_authenticate_with_keyA() has completed
398  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
399  * @param [in] result The result of nfc_mifare_authenticate_with_keyA()
400  * @param [in] user_data The user data passed from nfc_mifare_authenticate_with_keyA()
401  * @see nfc_mifare_authenticate_with_keyA()
402  */
403 typedef void (* nfc_mifare_authenticate_with_keyA_completed_cb)(nfc_error_e result, void *user_data);
404
405 /**
406  * @brief Called after nfc_mifare_authenticate_with_keyB() has completed
407  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
408  * @param [in] result The result of function call
409  * @param [in] user_data The user data passed from nfc_mifare_authenticate_with_keyB()
410  * @see nfc_mifare_authenticate_with_keyB()
411  */
412 typedef void (* nfc_mifare_authenticate_with_keyB_completed_cb)(nfc_error_e result, void *user_data);
413
414 /**
415  * @brief Called after nfc_mifare_write_block() has completed
416  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
417  * @param [in] result The result of nfc_mifare_write_block()
418  * @param [in] user_data The user data passed from nfc_mifare_write_block()
419  * @see nfc_mifare_write_block()
420  */
421 typedef void (* nfc_mifare_write_block_completed_cb)(nfc_error_e result, void *user_data);
422
423 /**
424  * @brief Called after nfc_mifare_write_page() has completed
425  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
426  * @param [in] result The result of function call
427  * @param [in] user_data The user data passed from nfc_mifare_write_page()
428  * @see nfc_mifare_write_page()
429  */
430 typedef void (* nfc_mifare_write_page_completed_cb)(nfc_error_e result, void *user_data);
431
432 /**
433  * @brief Called after nfc_mifare_read_block() has completed
434  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
435  *
436  * @remarks @a buffer will be automatically destroyed when the callback function returns. (Do not release @a buffer.)
437  *
438  * @param [in] result The result of function call
439  * @param [in] buffer Thre read buffer
440  * @param [in] size The size of buffer in bytes
441  * @param [in] user_data The user data passed from nfc_mifare_read_block()
442  * @see nfc_mifare_read_block()
443  */
444 typedef void (* nfc_mifare_read_block_completed_cb)(nfc_error_e result, unsigned char *buffer, int bufer_size, void *user_data);
445
446 /**
447  * @brief Called after nfc_mifare_read_page() has completed
448  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
449  *
450  * @remarks @a buffer will be automatically destroyed when the callback function returns. (Do not release @a buffer.)
451  *
452  * @param [in] result The result of nfc_mifare_read_page()
453  * @param [in] buffer The read buffer
454  * @param [in] size The size of read buffer in bytes
455  * @param [in] user_data The user data passed from nfc_mifare_read_page()
456  * @see nfc_mifare_read_page()
457  */
458 typedef void (* nfc_mifare_read_page_completed_cb)(nfc_error_e result, unsigned char *buffer, int bufer_size, void *user_data);
459
460 /**
461  * @brief Called after nfc_mifare_increment() has completed
462  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
463  * @param [in] result The result of nfc_mifare_increment()
464  * @param [in] user_data The user data passed from nfc_mifare_increment()
465  * @see nfc_mifare_increment()
466  */
467 typedef void (* nfc_mifare_increment_completed_cb)(nfc_error_e result, void *user_data);
468
469 /**
470  * @brief Called after nfc_mifare_decrement() has completed
471  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
472  * @param [in] result The result of nfc_mifare_decrement()
473  * @param [in] user_data The user data passed from nfc_mifare_decrement()
474  * @see nfc_mifare_decrement()
475  */
476 typedef void (* nfc_mifare_decrement_completed_cb)(nfc_error_e result, void *user_data);
477
478 /**
479  * @brief Called after nfc_mifare_transfer() has completed
480  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
481  * @param [in] result The result of nfc_mifare_transfer()
482  * @param [in] user_data The user data passed from nfc_mifare_transfer()
483  * @see nfc_mifare_transfer()
484  */
485 typedef void (* nfc_mifare_transfer_completed_cb)(nfc_error_e result, void *user_data);
486
487 /**
488  * @brief Called after nfc_mifare_restore() has completed
489  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
490  * @param [in] result The result of nfc_mifare_restore()
491  * @param [in] user_data The user data passed from nfc_mifare_restore()
492  * @see nfc_mifare_restore()
493  */
494 typedef void (* nfc_mifare_restore_completed_cb)(nfc_error_e result, void *user_data);
495
496
497
498 /**
499  * @brief Called when NFC peer-to-peer target appeared or disappeared
500  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
501  * @param [in] type The discovered type attached or detached
502  * @param [in] target The handle to p2p target
503  * @param [in] user_data The user data passed from nfc_manager_set_p2p_target_discovered_cb()
504  *
505  * @see nfc_manager_set_p2p_target_discovered_cb()
506  * @see nfc_manager_unset_p2p_target_discovered_cb()
507  */
508 typedef void (*nfc_p2p_target_discovered_cb)(nfc_discovered_type_e type, nfc_p2p_target_h target, void *user_data);
509
510 /**
511  * @brief Called when receiving  Secure Element (SIM/UICC(Universal Integrated Circuit Card)) event.
512  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
513  * @param [in] event The Secure Element event
514  * @param [in] user_data The user data passed from nfc_manager_set_se_event_cb()
515  *
516  * @see nfc_manager_set_se_event_cb()
517  * @see nfc_manager_unset_se_event_cb()
518  */
519 typedef void (*nfc_se_event_cb)(nfc_se_event_e event , void *user_data);
520
521
522 /**
523  * @brief Called when receiving Secure Element(SIM/UICC(Universal Integrated Circuit Card)) transaction event data
524  * @remarks This event  notifies , external reader trys to access secure element.
525  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
526  * @param [in] aid Application Id, specified in ISO/IEC 7816-4
527  * @param [in] aid_size The size of aid (5~16)
528  * @param [in] param The parameter list, specified in ISO/IEC 8825-1
529  * @param [in] param The size of param (0~65535)
530  * @param [in] user_data The user data passed from nfc_manager_set_se_transaction_event_cb()
531  *
532  * @see nfc_manager_set_se_transaction_event_cb()
533  * @see nfc_manager_unset_se_transaction_event_cb()
534  */
535 typedef void (*nfc_se_transaction_event_cb)(unsigned char* aid, int aid_size , unsigned char* param, int param_size,  void *user_data);
536
537
538
539 /**
540  * @brief Called after nfc_p2p_send() has completed.
541  * @ingroup CAPI_NETWORK_NFC_P2P_MODULE
542  * @param [in] result The result of function call
543  * @param [in] user_data The user data passed from nfc_p2p_send()
544  *
545  * @see nfc_p2p_send()
546  */
547 typedef void (*nfc_p2p_send_completed_cb)(nfc_error_e result, void *user_data);
548
549
550 /**
551  * @brief Called after nfc_p2p_send() has completed.
552  * @ingroup CAPI_NETWORK_NFC_P2P_MODULE
553  *
554  * @remarks @a message will be automatically destroyed when the callback function returns. (Do not release @a message.)
555  *
556  * @param [in] target The handle to p2p target
557  * @param [in] message The recevied message
558  * @param [in] user_data The user data passed from nfc_p2p_set_recv_cb()
559  *
560  * @see nfc_p2p_set_data_received_cb()
561  * @see nfc_p2p_unset_data_received_cb()
562  */
563 typedef void (*nfc_p2p_data_recived_cb)(nfc_p2p_target_h target, nfc_ndef_message_h message, void *user_data);
564
565
566 /**
567  * @brief Called after nfc_p2p_connection_handover() has completed.
568  * @ingroup CAPI_NETWORK_NFC_P2P_MODULE
569  *
570  * @remark To use the @a ac_data outside this function, copy the @a ac_data.
571  * @remark @a ac_data could be NULL, if nfc_p2p_connection_handover failed.
572  * @remark If @a carrior is #NFC_AC_TYPE_BT, @ac_data should be converted to 'char *' type. This is bluetooth address information.
573  *
574  * @param [in] result The result of function call
575  * @param [in] carrior The type of Alternative Carrior
576  * @param [in] ac_data The connected remote device AC(Alternative Carrior) information data
577  * @param [in] ac_data_size The connected remote device AC(Alternative Carrior) information data size
578  * @param [in] user_data The user data passed from nfc_p2p_connection_handover()
579  *
580  * @see nfc_p2p_connection_handover()
581  */
582 typedef void (*nfc_p2p_connection_handover_completed_cb)(nfc_error_e result, nfc_ac_type_e carrior, void * ac_data, int ac_data_size , void *user_data);
583
584 /**
585  * @brief Gets the value that indicates whether NFC is supported.
586  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
587  *
588  * @remarks This function can executed Regardless of nfc_manager_initialize state.
589  *
590  * @return true on NFC supported,  otherwise false
591  * @see nfc_manager_set_activation()
592  */
593 bool nfc_manager_is_supported(void);
594
595 /**
596  * @brief Sets NFC Activation
597  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
598  *
599  * @param [in] activation The NFC state for setting
600  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
601  * @param [in] user_data The user data to be passed to the callback function
602  *
603  * @return 0 on success, otherwise a negative error value.
604  * @retval #NFC_ERROR_NONE Successful
605  * @retval #NFC_ERROR_OPERATION_FAILED Operation fail
606  * @retval #NFC_ERROR_NOT_SUPPORTED Not supported NFC
607  * @retval #NFC_ERROR_ALREADY_ACTIVATED Already activated
608  * @retval #NFC_ERROR_ALREADY_DEACTIVATED Already deactivated
609  * @see nfc_manager_is_activated()
610  * @see nfc_activation_completed_cb()
611  */
612 int nfc_manager_set_activation(bool activation, nfc_activation_completed_cb callback, void *user_data);
613
614 /**
615  * @brief Set NFC Activation state changed callback
616  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
617  *
618  * @param [in] callback The callback function to invoke when activation state is changed.
619  * @param [in] user_data The user data to be passed to the callback function
620  *
621  * @return 0 on success, otherwise a negative error value.
622  * @retval #NFC_ERROR_NONE Successful
623  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
624  *
625  * @see nfc_activation_changed_cb()
626  * @see nfc_manager_unset_activation_changed_cb()
627  */
628 int nfc_manager_set_activation_changed_cb(nfc_activation_changed_cb callback , void *user_data);
629
630 /**
631  * @brief Unregisters the callback function.
632  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
633  *
634  * @see nfc_manager_set_activation_changed_cb()
635  * @see nfc_activation_changed_cb()
636  */
637 void nfc_manager_unset_activation_changed_cb(void);
638
639
640 /**
641  * @brief Gets NFC Activation state
642  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
643  *
644  * @remarks This function can executed Regardless of nfc_manager_initialize state.
645  *
646  * @return true on NFC activated,  otherwise false
647  * @see nfc_manager_set_activation()
648  */
649
650 bool nfc_manager_is_activated(void);
651
652 /**
653  * @brief Initializes NFC Manager.
654  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
655  * @remarks This function must be called before proceeding any other nfc functions\n
656  *      Internally it makes socket connection to NFC manager.\n
657  *      When an application crashes or exits without the deinitialization. NFC manager automatically deinitializes the process itself.\n
658  *
659  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
660  * @param [in] user_data The user data to be passed to the callback function
661  *
662  * @return 0 on success, otherwise a negative error value.
663  * @retval #NFC_ERROR_NONE Successful
664  * @retval #NFC_ERROR_OPERATION_FAILED Operation fail
665  * @see nfc_manager_deinitialize()
666  */
667 int nfc_manager_initialize(nfc_initialize_completed_cb callback, void *user_data);
668
669
670 /**
671  * @brief Releases all the resource of the NFC Manager and disconnecst the session between an application and NFC Manager.
672  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
673  *
674  * @return 0 on success, otherwise a negative error value.
675  * @retval #NFC_ERROR_NONE Successful
676  * @retval #NFC_ERROR_OPERATION_FAILED Operation fail
677  * @see nfc_manager_initialize()
678  */
679 int nfc_manager_deinitialize(void);
680
681 /**
682  * @brief Registers a callback function for receiving tag discovered notification.
683  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
684  *
685  * @param [in] callback The callback function called when a tag is appeared or disappeared
686  * @param [in] user_data The user data to be passed to the callback function
687  *
688  * @return 0 on success, otherwise a negative error value.
689  * @retval #NFC_ERROR_NONE Successful
690  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
691  * @see nfc_manager_unset_tag_discovered_cb()
692  * @see nfc_tag_discovered_cb()
693  */
694 int nfc_manager_set_tag_discovered_cb(nfc_tag_discovered_cb callback, void *user_data);
695
696 /**
697  * @brief Unregisters the callback function.
698  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
699  *
700  * @see nfc_manager_set_tag_discovered_cb()
701  * @see nfc_tag_discovered_cb()
702  */
703 void nfc_manager_unset_tag_discovered_cb(void);
704
705 /**
706  * @brief Registers a callback function for receiving NDEF Message discovered notification
707  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
708  *
709  * @param [in] callback The callback function called when NDEF Message is discovered
710  * @param [in] user_data The user data to be passed to the callback function
711  *
712  * @return 0 on success, otherwise a negative error value.
713  * @retval #NFC_ERROR_NONE Successful
714  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
715  * @see nfc_manager_unset_ndef_discovered_cb()
716  * @see nfc_ndef_discovered_cb()
717  */
718 int nfc_manager_set_ndef_discovered_cb(nfc_ndef_discovered_cb callback, void *user_data);
719
720 /**
721  * @brief Unregisters the callback function.
722  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
723  *
724  * @see nfc_manager_set_ndef_discovered_cb()
725  * @see nfc_ndef_discovered_cb()
726  */
727 void nfc_manager_unset_ndef_discovered_cb(void);
728
729 /**
730  * @brief Registers a callback function for receiving NFC peer-to-peer target discovered notification.
731  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
732  *
733  * @param [in] callback The callback function called when NFC peer-to-peer target is discovered
734  * @param [in] user_data The user data to be passed to the callback function
735  *
736  * @return 0 on success, otherwise a negative error value.
737  * @retval #NFC_ERROR_NONE Successful
738  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
739  *
740  * @see nfc_manager_unset_ndef_discovered_cb()
741  * @see nfc_p2p_target_discovered_cb()
742  */
743 int nfc_manager_set_p2p_target_discovered_cb(nfc_p2p_target_discovered_cb callback, void *user_data);
744
745 /**
746  * @brief Unregisters the callback function.
747  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
748  *
749  * @see nfc_manager_set_p2p_target_discovered_cb()
750  * @see nfc_p2p_target_discovered_cb()
751  */
752 void nfc_manager_unset_p2p_target_discovered_cb(void);
753
754
755 /**
756  * @brief Registers a callback function for receiving  Secure Element (SIM/UICC(Universal Integrated Circuit Card)) event.
757  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
758  *
759  * @param [in] callback The callback function called when occurred Secure Element (SIM/UICC(Universal Integrated Circuit Card)) event.
760  * @param [in] user_data The user data to be passed to the callback function
761  *
762  * @return 0 on success, otherwise a negative error value.
763  * @retval #NFC_ERROR_NONE Successful
764  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
765  *
766  * @see nfc_se_event_cb()
767  * @see nfc_manager_unset_se_event_cb()
768  */
769
770 int nfc_manager_set_se_event_cb(nfc_se_event_cb callback, void *user_data);
771
772 /**
773  * @brief Unregisters the callback function.
774  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
775  *
776  * @see nfc_se_event_cb()
777  * @see nfc_manager_set_se_event_cb()
778  */
779 void nfc_manager_unset_se_event_cb(void);
780
781 /**
782  * @brief Registers a callback function for receiving  Secure Element (SIM/UICC(Universal Integrated Circuit Card)) transaction event(#NFC_SE_EVENT_TRANSACTION) data.
783  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
784  *
785  * @param [in] callback The callback function called when occurred SE transaction event.
786  * @param [in] user_data The user data to be passed to the callback function
787  *
788  * @return 0 on success, otherwise a negative error value.
789  * @retval #NFC_ERROR_NONE Successful
790  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
791  *
792  * @see nfc_se_transaction_event_cb()
793  * @see nfc_manager_unset_se_transaction_event_cb()
794  */
795 int nfc_manager_set_se_transaction_event_cb(nfc_se_transaction_event_cb callback, void *user_data);
796
797 /**
798  * @brief Unregisters the callback function.
799  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
800  *
801  * @see nfc_se_transaction_event_cb()
802  * @see nfc_manager_set_se_transaction_event_cb()
803  */
804 void nfc_manager_unset_se_transaction_event_cb(void);
805
806 /**
807  * @brief Gets NDEF message cached when the tag is detected or when data received from NFC peer-to-peer target.
808  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
809  *
810  * @remarks This function is used to get the ndef message that was read before launched your application.
811  * @param [out] ndef_message The cached NDEF message
812  *
813  * @return 0 on success, otherwise a negative error value.
814  * @retval #NFC_ERROR_NONE Successful
815  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
816  * @retval #NFC_ERROR_INVALID_NDEF_MESSAGE The cached message does not exist
817  *
818  */
819 int nfc_manager_get_cached_message(nfc_ndef_message_h *ndef_message);
820
821
822 /**
823  * @brief Sets filter of target types.
824  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
825  * @remarks Bit operator OR(|) can be used in the config parameter (like  NFC_TAG_FILTER_ISO14443A_ENABLE | NFC_TAG_FILTER_ISO14443B_ENABLE)
826  *      or you may choose "NFC_TAG_ALL_ENABLE" enum value to get all result.
827  *      It prevent getting tag types from RF level.
828  *      If the client api does call this function, default is always NFC_TAG_ALL_ENABLE.
829  *
830  * @param [in] filter The filter value with bits operation #nfc_tag_filter_e
831  *
832  * @see nfc_manager_get_tag_filter()
833  * @see nfc_tag_discovered_cb()
834  */
835 void nfc_manager_set_tag_filter(int filter);
836
837 /**
838  * @brief Gets the current filter status.
839  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
840  *
841  * @remarks Bit operation OR(|) is used in return data\n
842  * The default value is NFC_TAG_FILTER_ALL_ENABLE
843  * @return The filter which is set #nfc_tag_filter_e
844  * @see nfc_manager_set_tag_filter()
845  */
846 int nfc_manager_get_tag_filter(void);
847
848 /**
849  * @brief Gets current connected tag.
850  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
851  *
852  * @param [out] tag The connected tag
853  *
854  * @return 0 on success, otherwise a negative error value.
855  * @retval #NFC_ERROR_NONE Successful
856  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
857  * @retval #NFC_ERROR_NO_DEVICE There is no connected tag
858  *
859  */
860 int nfc_manager_get_connected_tag(nfc_tag_h *tag);
861
862 /**
863  * @brief Gets current connected p2p target
864  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
865  *
866  * @param [out] target The connected target
867  *
868  * @return 0 on success, otherwise a negative error value.
869  * @retval #NFC_ERROR_NONE Successful
870  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
871  * @retval #NFC_ERROR_NO_DEVICE There is no connected target
872  *
873  */
874 int nfc_manager_get_connected_target(nfc_p2p_target_h *target);
875
876
877 /**
878  * @brief Enable or disable the system handling for tag and target discovered event
879  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
880  * @remarks In default, The system handling is enabled.
881  *
882  * @param [in] enable The state of enable
883  *
884  * @return 0 on success, otherwise a negative error value.
885  * @retval #NFC_ERROR_NONE Successful
886  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
887  *
888  * @see nfc_manager_is_system_handler_enabled()
889  */
890 int nfc_manager_set_system_handler_enable(bool enable);
891
892 /**
893  * @brief Gets the state of the system handler
894  * @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
895  * @remarks In default, The system handling is enabled.
896  *
897  * @return true on enabled, otherwise false.
898  *
899  * @see nfc_manager_set_system_handler_enable()
900  */
901 bool nfc_manager_is_system_handler_enabled(void);
902
903
904 /**
905  * @brief Creates a record with given parameter value.
906  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
907  *
908  * @remarks Every data buffer is deeply copied.\n
909  * Every data is a byte array(binary data).
910  *
911  * @param [out] record A handle to record
912  * @param [in] tnf The type name format
913  * @param [in] type The specified type name
914  * @param [in] type_size The byte size of type
915  * @param [in] id The record ID
916  * @param [in] id_size The byte size of ID
917  * @param [in] payload The payload of this record
918  * @param [in] payload_size The byte size of payload
919  *
920  * @return 0 on success, otherwise a negative error value.
921  * @retval #NFC_ERROR_NONE Successful
922  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
923  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
924  * @see nfc_ndef_record_create_text()
925  * @see nfc_ndef_record_create_uri()
926  * @see nfc_ndef_record_create_mime()
927  * @see nfc_ndef_record_destroy()
928  */
929 int nfc_ndef_record_create(nfc_ndef_record_h *record, nfc_record_tnf_e tnf, const unsigned char *type, int type_size, const unsigned char *id, int id_size, const unsigned char *payload, int payload_size);
930
931
932 /**
933  * @brief Creates a record with text type payload
934  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
935  *
936  * @remarks This function does not encode the text. @a text will be assumed as that it is already encoded with encode type.\n
937  * The text buffer will be deeply copied.\n
938  * The record is created in this format\n
939  * - TNF : NFC_RECORD_TNF_WELL_KNOWN\n
940  * - type : "T"\n
941  * - payload : encode and header information + language code + text \n
942  * Defined in Record Type Definition Technical Specifications.
943  *
944  * @param [out] record A handle to record
945  * @param [in] text The encoded text
946  * @param [in] lang_code The language code string value followed by IANA[RFC 3066] (ex: en-US, ko-KR)
947  * @param [in] encode The encoding type
948  *
949  * @return 0 on success, otherwise a negative error value.
950  * @retval #NFC_ERROR_NONE Successful
951  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
952  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
953  * @see nfc_ndef_record_create()
954  * @see nfc_ndef_record_create_uri()
955  * @see nfc_ndef_record_create_mime()
956  * @see nfc_ndef_record_destroy()
957  * @see nfc_ndef_record_get_text()
958  * @see nfc_ndef_record_get_langcode()
959  * @see nfc_ndef_record_get_encode_type()
960  */
961 int nfc_ndef_record_create_text(nfc_ndef_record_h *record, const char *text, const char *lang_code, nfc_encode_type_e encode);
962
963 /**
964  * @brief Creates a record with URI type payload
965  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
966  *
967  * @remarks The uri string will be deep copied.\n
968  * The record is created in this format\n
969  * - TNF : NFC_RECORD_TNF_WELL_KNOWN\n
970  * - type : "U"\n
971  * - payload : procotol scheme + uri\n
972  * Defined in Record Type Definition Technical Specifications.
973  *
974  * @param [out] record A handle to record
975  * @param [in] protocol_scheme  The protocol scheme
976  * @param [in] uri      The URI string that will be stored in the payload
977  *
978  * @return 0 on success, otherwise a negative error value.
979  * @retval #NFC_ERROR_NONE Successful
980  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
981  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
982  * @see nfc_ndef_record_create()
983  * @see nfc_ndef_record_create_text()
984  * @see nfc_ndef_record_create_mime()
985  * @see nfc_ndef_record_destroy()
986  * @see nfc_ndef_record_get_uri()
987  */
988 int nfc_ndef_record_create_uri(nfc_ndef_record_h* record, const char *uri);
989
990
991 /**
992  * @brief Creates a record with MIME type payload
993  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
994  *
995  * @remarks The data buffer will be deep copied.\n
996  * The data are bytes array(binary data).\n
997  * The mime_type string will deep copied.\n
998  * The record is created in this format\n
999  * - TNF : NFC_RECORD_TNF_MIME_MEDIA\n
1000  * - type : mime type\n
1001  * - payload : data\n
1002  * Defined in Record Type Definition Technical Specifications.
1003  *
1004  * @param [out] record A handle to record
1005  * @param [in] mime_type        The mime type [RFC 2046] (ex. text/plain, image/jpeg )\nThis value is stored in type field
1006  * @param [in] data     The pointer of data
1007  * @param [in] data_size        The size of data
1008  *
1009  * @return 0 on success, otherwise a negative error value.
1010  * @retval #NFC_ERROR_NONE Successful
1011  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1012  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1013  * @see nfc_ndef_record_create()
1014  * @see nfc_ndef_record_create_uri()
1015  * @see nfc_ndef_record_create_text()
1016  * @see nfc_ndef_record_destroy()
1017  * @see nfc_ndef_record_get_mime_type()
1018  */
1019 int nfc_ndef_record_create_mime(nfc_ndef_record_h* record, const char *mime_type, const unsigned char *data, int data_size);
1020
1021
1022 /**
1023  * @brief Destroys the record handle
1024  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
1025  *
1026  * @param [in] record The handle to record
1027  *
1028  * @return 0 on success, otherwise a negative error value.
1029  * @retval #NFC_ERROR_NONE Successful
1030  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1031  * @see nfc_ndef_record_create()
1032  * @see nfc_ndef_record_create_text()
1033  * @see nfc_ndef_record_create_uri()
1034  * @see nfc_ndef_record_create_mime()
1035  */
1036 int nfc_ndef_record_destroy(nfc_ndef_record_h record);
1037
1038 /**
1039  * @brief Sets record ID
1040  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
1041  *
1042  * @remarks The ID buffer are deep copied.
1043  *
1044  * @param [in] record The handle to record
1045  * @param [in] id The record ID
1046  * @param [in] id_size The size of ID in bytes
1047  * @return 0 on success, otherwise a negative error value.
1048  * @retval      #NFC_ERROR_NONE Successful
1049  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1050  * @see nfc_ndef_record_get_id()
1051  */
1052 int nfc_ndef_record_set_id(nfc_ndef_record_h record, unsigned char *id, int id_size);
1053
1054 /**
1055  * @brief Gets record ID
1056  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
1057  *
1058  * @remarks It may return NULL pointer if the ID is not exist\n
1059  *  This function gives you  the pointer of ID that is contained by record\n
1060  *  Do not free the ID. It will be released when @a record is destroyed by nfc_ndef_record_destroy().
1061  *
1062  * @param [in] record The handle to record
1063  * @param [out] id The record ID ( do not free )
1064  * @param [out] id_size The size of ID in bytes
1065  *
1066  * @return 0 on success, otherwise a negative error value.
1067  * @retval #NFC_ERROR_NONE Successful
1068  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1069  * @see nfc_ndef_record_set_id()
1070  */
1071 int nfc_ndef_record_get_id(nfc_ndef_record_h record, unsigned char **id, int *size);
1072
1073 /**
1074  * @brief Gets record payload.
1075  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
1076  *
1077  * @remarks This function gives you  the pointer of pyaload that is contained by record\n
1078  * Do not free the payload. it will be freed when @a record is destroyed by nfc_ndef_record_destroy().
1079  *
1080  * @param [in] record The handle to record
1081  * @param [out] payload The payload  ( do not free this pointer )
1082  * @param [out] size the size of payload in byte
1083  *
1084  * @return 0 on success, otherwise a negative error value.
1085  * @retval #NFC_ERROR_NONE Successful
1086  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1087  */
1088 int nfc_ndef_record_get_payload(nfc_ndef_record_h record, unsigned char ** payload, int *size);
1089
1090 /**
1091  * @brief Gets record type.
1092  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
1093  *
1094  * @remarks This function gives you  the pointer of type that is contained by record.\n
1095  * Do not free the type. it will be freed when the record is freed.
1096  *
1097  * @param [in] record The handle to record
1098  * @param [out] type    The record type  ( do not free this pointer )
1099  * @param [out] size The size of type in byte
1100  *
1101  * @return 0 on success, otherwise a negative error value.
1102  * @retval #NFC_ERROR_NONE Successful
1103  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1104  */
1105 int nfc_ndef_record_get_type(nfc_ndef_record_h record, unsigned char **type, int *size);
1106
1107 /**
1108  * @brief Gets record TNF(Type Name Format) value.
1109  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
1110  *
1111  * @param [in] record The handle to record
1112  * @param [out] tnf The TNF(Type Name Format) value
1113  *
1114  * @return 0 on success, otherwise a negative error value.
1115  * @retval #NFC_ERROR_NONE Successful
1116  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1117  */
1118 int nfc_ndef_record_get_tnf(nfc_ndef_record_h record, nfc_record_tnf_e *tnf);
1119
1120 /**
1121  * @brief Gets text from text record
1122  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
1123  *
1124  * @remarks This function returns newly allocated string, this value must be deallocated by caller.\n
1125  * This function is valid only for text type record.\n
1126  * The text type record 's tnf is NFC_RECORD_TNF_WELL_KNOWN and it's type is "T"
1127  *
1128  * @param [in] record The handle to record
1129  * @param [out] text The text in record payload ( should be freed by caller )
1130  *
1131  * @return 0 on success, otherwise a negative error value.
1132  * @retval #NFC_ERROR_NONE Successful
1133  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1134  * @retval #NFC_ERROR_INVALID_RECORD_TYPE Invalid record type
1135  * @see nfc_ndef_record_create_text()
1136  */
1137 int nfc_ndef_record_get_text(nfc_ndef_record_h record, char **text);
1138
1139 /**
1140  * @brief Gets language code from text record
1141  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
1142  * @remarks This function returns newly allocated string, this value must be deallocated by caller.\n
1143  * This function is valid only for text type record.\n
1144  * The text type record 's tnf is NFC_RECORD_TNF_WELL_KNOWN and it's type is "T"
1145  *
1146  * @param [in] record   The handle to record
1147  * @param [out] lang_code lang code ( should be freed by caller )
1148  *
1149  * @return 0 on success, otherwise a negative error value.
1150  * @retval #NFC_ERROR_NONE Successful
1151  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1152  * @retval #NFC_ERROR_INVALID_RECORD_TYPE Invalid record type
1153  * @see nfc_ndef_record_create_text()
1154  */
1155 int nfc_ndef_record_get_langcode(nfc_ndef_record_h record, char **lang_code);
1156
1157 /**
1158  * @brief Gets encoding type from text record
1159  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
1160  *
1161  * @remarks  This function is valid only for text type record.\n
1162  * The text type record 's tnf is NFC_RECORD_TNF_WELL_KNOWN and it's type is "T"
1163  *
1164  * @param [in] record   The handle to record
1165  * @param [out] encode encode type #nfc_encode_type_e
1166  *
1167  * @return 0 on success, otherwise a negative error value.
1168  * @retval #NFC_ERROR_NONE Successful
1169  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1170  * @retval #NFC_ERROR_INVALID_RECORD_TYPE Invalid record type
1171  * @see nfc_ndef_record_create_text()
1172  */
1173 int nfc_ndef_record_get_encode_type(nfc_ndef_record_h record, nfc_encode_type_e *encode);
1174
1175 /**
1176  * @brief Gets URI from uri record
1177  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
1178  *
1179  * @remarks The function returns newly allocated string, this value must be deallocated by caller.\n
1180  * This function is valid only for uri type record.
1181  * The uri type record 's tnf is NFC_RECORD_TNF_WELL_KNOWN and it's type is "U"
1182  *
1183  * @param [in] record   The handle to record
1184  * @param [out] uri     The uri in record payload ( should be freed by caller )
1185  *
1186  * @return 0 on success, otherwise a negative error value.
1187  * @retval #NFC_ERROR_NONE Successful
1188  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1189  * @retval #NFC_ERROR_INVALID_RECORD_TYPE Invalid record type
1190  * @see nfc_ndef_record_create_uri()
1191  */
1192 int nfc_ndef_record_get_uri(nfc_ndef_record_h record, char **uri);
1193
1194
1195 /**
1196  * @brief Gets mime type from mime type record
1197  * @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
1198  *
1199  * @remarks The function returns newly allocated string, this value must be deallocated by caller.\n
1200  * This function is valid only for mime type record.\n
1201  * The uri type record 's tnf is NFC_RECORD_TNF_MIME_MEDIA.
1202  *
1203  * @param [in] record   The handle to record
1204  * @param [out] mime_type       The mime type in record payload ( should be freed by caller )
1205  *
1206  * @return 0 on success, otherwise a negative error value.
1207  * @retval #NFC_ERROR_NONE Successful
1208  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1209  * @retval #NFC_ERROR_INVALID_RECORD_TYPE Invalid record type
1210  * @see nfc_ndef_record_create_mime()
1211  */
1212 int nfc_ndef_record_get_mime_type(nfc_ndef_record_h record, char **mime_type);
1213
1214
1215 /**
1216  * @brief Creates NDEF message handle
1217  * @ingroup CAPI_NETWORK_NFC_NDEF_MESSAGE_MODULE
1218  *
1219  * @param [out] ndef_message A handle to NDEF message
1220  *
1221  * @return 0 on success, otherwise a negative error value.
1222  * @retval #NFC_ERROR_NONE Successful
1223  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1224  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1225  * @see nfc_ndef_message_create_from_rawdata()
1226  * @see nfc_ndef_message_destroy()
1227  *
1228  */
1229 int nfc_ndef_message_create(nfc_ndef_message_h *ndef_message);
1230
1231 /**
1232  * @brief Creates NDEF message handle from raw serial bytes.
1233  * @ingroup CAPI_NETWORK_NFC_NDEF_MESSAGE_MODULE
1234  *
1235  * @remarks It consumes the bytes array until get the ME(Message End) flag*. It returns error if the bytes array does not have ME flag.\n
1236  * *The ME flag is a 1-bit field that when set indicates the end of an NDEF message.
1237  *
1238  * @param [out] ndef_message The handle to NDEF message
1239  * @param [in] rawdata The NDEF message in form of bytes array
1240  * @param [in] rawdata_size The size of bytes array
1241  *
1242  * @return 0 on success, otherwise a negative error value.
1243  * @retval #NFC_ERROR_NONE Successful
1244  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1245  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1246  * @see nfc_ndef_message_create()
1247  * @see nfc_ndef_message_destroy()
1248  * @see nfc_ndef_message_get_rawdata()
1249  *
1250  */
1251 int nfc_ndef_message_create_from_rawdata(nfc_ndef_message_h *ndef_message, const unsigned char *rawdata, int rawdata_size);
1252
1253 /**
1254  * @brief Destroys NDEF message handle
1255  * @ingroup CAPI_NETWORK_NFC_NDEF_MESSAGE_MODULE
1256  *
1257  * @remarks This function will free all these memory including record handles.
1258  *
1259  * @param [in] ndef_message The handle to NDEF message to destroy
1260  *
1261  * @return 0 on success, otherwise a negative error value.
1262  * @retval #NFC_ERROR_NONE Successful
1263  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1264  * @see nfc_ndef_message_create()
1265  * @see nfc_ndef_message_create_from_rawdata()
1266  */
1267 int nfc_ndef_message_destroy(nfc_ndef_message_h ndef_message);
1268
1269 /**
1270  * @brief Gets the number of record in NDEF message
1271  * @ingroup CAPI_NETWORK_NFC_NDEF_MESSAGE_MODULE
1272  *
1273  * @param [in] ndef_message The handle to NDEF message
1274  * @param [out] count The number of record
1275  *
1276  * @return 0 on success, otherwise a negative error value.
1277  * @retval #NFC_ERROR_NONE Successful
1278  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1279  *
1280  */
1281 int nfc_ndef_message_get_record_count(nfc_ndef_message_h ndef_message, int *count);
1282
1283 /**
1284  * @brief Gets serial bytes array of NDEF message.
1285  * @ingroup CAPI_NETWORK_NFC_NDEF_MESSAGE_MODULE
1286  *
1287  * @remarks It gets copy of the rawdata bytes from NDEF message. @a rawdata must be released with free() by you.
1288  *
1289  * @param [in] ndef_message The handle to NDEF message
1290  * @param [out] rawdata The bytes array of rawdata
1291  * @param [out] rawdata_size The size of rawdata in byte
1292  *
1293  * @return 0 on success, otherwise a negative error value.
1294  * @retval #NFC_ERROR_NONE Successful
1295  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1296  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1297  * @retval #NFC_ERROR_INVALID_NDEF_MESSAGE Invalid NDEF message
1298  *
1299  * @see nfc_ndef_message_create_from_rawdata()
1300  */
1301 int nfc_ndef_message_get_rawdata(nfc_ndef_message_h ndef_message, unsigned char **rawdata, int *rawdata_size);
1302
1303 /**
1304  * @brief Appends a record into NDEF message
1305  * @ingroup CAPI_NETWORK_NFC_NDEF_MESSAGE_MODULE
1306  *
1307  * @remarks Appended record is handled by frameworks. The record is released by frameworks when message is released.
1308  *
1309  * @param [in] ndef_message The handle to NDEF message
1310  * @param [in] record The record that will be appended into NDEF message
1311  *
1312  * @return 0 on success, otherwise a negative error value.
1313  * @retval #NFC_ERROR_NONE Successful
1314  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1315  * @see nfc_ndef_message_insert_record()
1316  * @see nfc_ndef_message_remove_record()
1317  */
1318 int nfc_ndef_message_append_record(nfc_ndef_message_h ndef_message, nfc_ndef_record_h record);
1319
1320 /**
1321  * @brief Inserts a record at index into NDEF message
1322  * @ingroup CAPI_NETWORK_NFC_NDEF_MESSAGE_MODULE
1323  *
1324  * @remarks Appended record is handled by frameworks. The record is released by frameworks when message is released.\n
1325  * The index value should not bigger than nfc_ndef_message_get_record_count()
1326  *
1327  * @param [in] ndef_message The handle to NDEF message
1328  * @param [in] index The index of record ( starts from 0 )
1329  * @param [in] record The record that will be appended into NDEF message
1330  *
1331  * @return 0 on success, otherwise a negative error value.
1332  * @retval #NFC_ERROR_NONE Successful
1333  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1334  * @retval #NFC_ERROR_INVALID_NDEF_MESSAGE      Invalid NDEF message
1335  * @see nfc_ndef_message_append_record()
1336  * @see nfc_ndef_message_remove_record()
1337  */
1338 int nfc_ndef_message_insert_record(nfc_ndef_message_h ndef_message, int index, nfc_ndef_record_h record);
1339
1340 /**
1341  * @brief Removes the record that indicated by index number and this deleted record will be freed.
1342  * @ingroup CAPI_NETWORK_NFC_NDEF_MESSAGE_MODULE
1343  *
1344  * @param [in] ndef_message The handle to NDEF message
1345  * @param [in] index    The index of record ( starts from 0 )
1346  *
1347  * @return 0 on success, otherwise a negative error value.
1348  * @retval #NFC_ERROR_NONE Successful
1349  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1350  * @retval #NFC_ERROR_INVALID_NDEF_MESSAGE      Invalid NDEF message
1351  * @see nfc_ndef_message_append_record()
1352  * @see nfc_ndef_message_insert_record()
1353  */
1354 int nfc_ndef_message_remove_record(nfc_ndef_message_h ndef_message, int index);
1355
1356 /**
1357  * @brief Gets record by index.
1358  * @ingroup CAPI_NETWORK_NFC_NDEF_MESSAGE_MODULE
1359  *
1360  * @remarks This function just return the pointer of record. if you change the record value it directly affects the NDEF message
1361  *
1362  * @param [in] ndef_message The handle to NDEF message
1363  * @param [in] index The index of record ( starts from 0 )
1364  * @param [out] record The handle to record
1365  *
1366  * @return 0 on success, otherwise a negative error value.
1367  * @retval #NFC_ERROR_NONE Successful
1368  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1369  *
1370  */
1371 int nfc_ndef_message_get_record(nfc_ndef_message_h ndef_message, int index, nfc_ndef_record_h *record);
1372
1373 /**
1374  * @brief Gets the type of NFC tag
1375  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
1376  *
1377  * @param [in] tag The handle to NFC tag
1378  * @param [out] type The type of NFC tag
1379  *
1380  * @return 0 on success, otherwise a negative error value.
1381  * @retval #NFC_ERROR_NONE Successful
1382  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1383  *
1384  */
1385 int nfc_tag_get_type(nfc_tag_h tag, nfc_tag_type_e *type);
1386
1387 /**
1388  * @brief Checks whether the given NFC tag supports NDEF messages.
1389  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
1390  *
1391  * @param [in] tag The handle to NFC tag
1392  * @param [out] is_supported @c true when NFC tag supports NDEF messages, otherwise @c false
1393  *
1394  * @return 0 on success, otherwise a negative error value.
1395  * @retval #NFC_ERROR_NONE Successful
1396  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1397  *
1398  * @see nfc_tag_read_ndef()
1399  */
1400 int nfc_tag_is_support_ndef(nfc_tag_h tag, bool *is_supported);
1401
1402 /**
1403  * @brief Gets the maximum NDEF message size that can be stored in NFC tag.
1404  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
1405  *
1406  * @remarks This max size indicates the maximum size of NDEF message that can be stored in this detected tag.
1407  *
1408  * @param [in] tag The handle to NFC tag
1409  * @param [out] maximum_ndef_bytes_size The maximum bytes size of NDEF message that can be stored in this detected tag.
1410  *
1411  * @return 0 on success, otherwise a negative error value.
1412  * @retval #NFC_ERROR_NONE Successful
1413  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1414  *
1415  */
1416 int nfc_tag_get_maximum_ndef_size(nfc_tag_h tag, unsigned int *maximum_ndef_bytes_size);
1417
1418 /**
1419  * @brief Gets size of NDEF message that stored in the tag
1420  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
1421  *
1422  * @param [in] tag The handle to NFC tag
1423  * @param [out] ndef_bytes_size The NDEF message bytes size that stored in the tag
1424  *
1425  * @return 0 on success, otherwise a negative error value.
1426  * @retval #NFC_ERROR_NONE Successful
1427  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1428  *
1429  */
1430 int nfc_tag_get_ndef_size(nfc_tag_h tag, unsigned int *ndef_bytes_size);
1431
1432
1433 /**
1434  * @brief Retrieves all tag information
1435  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
1436  *
1437  * @param[in] tag The handle to NFC tag
1438  * @param[in] callback  The callback function to invoke
1439  * @param[in] user_data The user data to be passed to the callback function
1440  *
1441  * @return 0 on success, otherwise a negative error value.
1442  * @retval #NFC_ERROR_NONE Successful
1443  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1444  *
1445  */
1446 int nfc_tag_foreach_information(nfc_tag_h tag, nfc_tag_information_cb callback, void *user_data);
1447
1448
1449 /**
1450  * @brief Transceives the data of the raw format card.
1451  * @details This function is the only way to access the raw format card (not formated),
1452         each tag type requires own command to access tags. \n
1453         This function provides the low level access of tag operation and you require the knowlege of each tag technology.
1454 * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
1455 *
1456 * @param [in] tag The handle to NFC tag
1457 * @param [in] buffer The binary data for parameter or additional commands
1458 * @param [in] buffer_size The size of buffer in bytes
1459 * @param [in] callback The callback function to invoke after this function has completed\n It can be null if a notification is not required
1460 * @param [in] user_data The user data to be passed to the callback funcation
1461 *
1462 * @return 0 on success, otherwise a negative error value.
1463 * @retval #NFC_ERROR_NONE Successful
1464 * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1465 * @retval #NFC_ERROR_INVALID_PARAMETER  Invalid parameter
1466 * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1467 * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1468 * @retval #NFC_ERROR_TIMED_OUT Timeout is reached while communicating with tag
1469 * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1470 *
1471 * @post It invokes nfc_tag_transceive_completed_cb() when it has completed to t
1472 * @see nfc_tag_read_ndef()
1473 * @see nfc_tag_is_support_ndef()
1474 */
1475 int nfc_tag_transceive(nfc_tag_h tag, unsigned char *buffer, int buffer_size, nfc_tag_transceive_completed_cb callback, void *user_data);
1476
1477 /**
1478  * @brief Reads NDEF formatted data from NFC tag.
1479  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
1480  *
1481  * @param [in] tag The handle to NFC tag
1482  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
1483  * @param [in] user_data The user data to be passed to the callback funcation
1484  *
1485  * @return 0 on success, otherwise a negative error value.
1486  * @retval #NFC_ERROR_NONE Successful
1487  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1488  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1489  * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1490  * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1491  * @retval #NFC_ERROR_TIMED_OUT Timeout is reached while communicating with tag
1492  * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1493  * @retval #NFC_ERROR_NOT_NDEF_FORMAT Not ndef format tag
1494  *
1495  * @post It invokes nfc_tag_read_completed_cb() when it has completed to read NDEF formatted data.
1496  *
1497  * @see nfc_tag_transceive()
1498  * @see nfc_tag_is_support_ndef()
1499  * @see nfc_tag_write_ndef()
1500  */
1501 int nfc_tag_read_ndef(nfc_tag_h tag, nfc_tag_read_completed_cb callback, void *user_data);
1502
1503 /**
1504  * @brief Writes NDEF formatted data.
1505  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
1506  *
1507  * @param [in] tag The handle to NFC tag
1508  * @param [in] msg The message will be write to the tag
1509  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
1510  * @param [in] user_dataa The user data to be passed to the callback funcation
1511  *
1512  * @return 0 on success, otherwise a negative error value.
1513  * @retval #NFC_ERROR_NONE Successful
1514  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1515  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1516
1517  * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1518  * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1519  * @retval #NFC_ERROR_TIMED_OUT Timeout is reached while communicating with tag
1520  * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1521  * @retval #NFC_ERROR_NOT_NDEF_FORMAT Not ndef format tag
1522  *
1523  * @post It invokes nfc_tag_write_completed_cb() when it has completed to write NDEF data.
1524  * @see nfc_tag_is_support_ndef()
1525  * @see nfc_tag_read_ndef()
1526  */
1527 int nfc_tag_write_ndef(nfc_tag_h tag, nfc_ndef_message_h msg, nfc_tag_write_completed_cb callback, void *user_data);
1528
1529 /**
1530  * @brief Formats the detected tag that can store NDEF message.
1531  * @details Some tags are required authentication. If the detected target doesn't need authentication, @a key can be NULL.
1532  * @ingroup CAPI_NETWORK_NFC_TAG_MODULE
1533  *
1534  * @param [in] tag The handle to NFC tag
1535  * @param [in] key The key value that may need to format the tag
1536  * @param [in] key_size The size of key in byte
1537  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
1538  * @param [in] user_data The user data to be passed to the callback funcation
1539  *
1540  * @return 0 on success, otherwise a negative error value.
1541  * @retval #NFC_ERROR_NONE Successful
1542  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1543  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1544  * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1545  * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1546  * @retval #NFC_ERROR_TIMED_OUT Timeout is reached while communicating with tag
1547  * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1548  * @retval #NFC_ERROR_NOT_NDEF_FORMAT Not ndef format tag
1549  *
1550  * @post It invokes nfc_tag_format_completed_cb() when it has completed to format the NFC tag.
1551  *
1552  * @see nfc_tag_is_support_ndef()
1553  */
1554 int nfc_tag_format_ndef(nfc_tag_h tag, unsigned char *key, int key_size, nfc_tag_format_completed_cb callback, void *user_data);
1555
1556 /**
1557  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
1558  * @brief Authenticates a sector with key A.
1559  * @remarks I/O operations(read / write / increment / decrement / transfer / restore) will be available after successful authentication.\n
1560  * This function is only available for MIFARE classic.\n
1561  *      \n
1562  *      MIFARE CLASSIC MINI \n
1563  *              => 0 ~ 4 : 5 sectors having 4 block each with block size of 16 bytes \n
1564  *      \n
1565  *      MIFARE CLASSIC 1K \n
1566  *              => 0 ~ 15 : 16 sectors having 4 block each with block size of 16 bytes \n
1567  *      \n
1568  *      MIFARE CLASSIC 4K \n
1569  *              => 0 ~ 31 : 32 sectors having 4 block each with block size of 16 bytes  \n
1570  *              => 32 ~ 39 : 8 sectors having 16 block each with block size of 16 bytes
1571  *
1572  * @param[in] tag The handle to NFC tag
1573  * @param[in] sector_index The index of sector to authenticate with key A, starting from 0
1574  * @param[in] auth_key 6-byte authentication key
1575  * @param[in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
1576  * @param[in] user_data The user data to be passed to the callback funcation
1577  *
1578  * @return 0 on success, otherwise a negative error value.
1579  * @retval #NFC_ERROR_NONE Successful
1580  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1581  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1582  * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1583  * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1584  * @retval #NFC_ERROR_TIMED_OUT Timeout is reached while communicating with tag
1585  * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1586  *
1587  * @post It invokes nfc_mifare_authenticate_with_keyA_completed_cb() when it has completed to authenticate the given sector with key A.
1588  * @see nfc_mifare_authenticate_with_keyB()
1589  * @see nfc_mifare_read_block()
1590  * @see nfc_mifare_read_page()
1591  * @see nfc_mifare_write_block()
1592  * @see nfc_mifare_write_page()
1593  * @see nfc_mifare_increment()
1594  * @see nfc_mifare_decrement()
1595 */
1596 int nfc_mifare_authenticate_with_keyA(nfc_tag_h tag, int sector_index, unsigned char *auth_key, nfc_mifare_authenticate_with_keyA_completed_cb callback, void *user_data);
1597
1598
1599 /**
1600  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
1601  * @brief Authenticates a sector with key B.
1602  * @remarks I/O operations(read / write / increment / decrement / transfer / restore) will be available after successful authentication.\n
1603  * This function is only available for MIFARE classic.\n
1604  *      \n
1605  *      MIFARE CLASSIC MINI\n
1606  *              => 0 ~ 4 : 5 sector and 4 block with 16 bytes\n
1607  *      \n
1608  *      MIFARE CLASSIC 1K \n
1609  *              => 0 ~ 15 : 16 sector and 4 block with 16 bytes\n
1610  *      \n
1611  *      MIFARE CLASSIC 4K\n
1612  *              => 0 ~ 31 : 32 sector and 4 block with 16 bytes \n
1613  *              => 32 ~ 39 : 8 sector and 16 block with 16 bytes
1614  *
1615  * @param [in] tag The handle to NFC tag
1616  * @param [in] sector_index The index of sector to authenticate with key B, starting from 0
1617  * @param [in] auth_key 6-byte authentication key
1618  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
1619  * @param [in] user_data The user data to be passed to the callback funcation
1620  *
1621  * @return 0 on success, otherwise a negative error value.
1622  * @retval #NFC_ERROR_NONE Successful
1623  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1624  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1625  * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1626  * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1627  * @retval #NFC_ERROR_TIMED_OUT Timeout is reached while communicating with tag
1628  * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1629  *
1630  * @post It invokes nfc_mifare_authenticate_with_keyB_completed_cb() when it has completed to authenticate the given sector with key B.
1631  * @see nfc_mifare_authenticate_with_keyA()
1632  * @see nfc_mifare_read_block()
1633  * @see nfc_mifare_read_page()
1634  * @see nfc_mifare_write_block()
1635  * @see nfc_mifare_write_page()
1636  * @see nfc_mifare_increment()
1637  * @see nfc_mifare_decrement()
1638 */
1639 int nfc_mifare_authenticate_with_keyB(nfc_tag_h tag, int sector_index, unsigned char *auth_key, nfc_mifare_authenticate_with_keyB_completed_cb callback, void *user_data);
1640
1641
1642 /**
1643  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
1644  * @brief Reads a 16-byte block.
1645  * @remarks This function is only available for MIFARE classic.
1646  *
1647  * @param [in] tag The handle to NFC tag
1648  * @param [in] block_index The block or starting page number
1649  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
1650  * @param [in] user_data The user data to be passed to the callback funcation
1651  *
1652  * @return 0 on success, otherwise a negative error value.
1653  * @retval #NFC_ERROR_NONE Successful
1654  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1655  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1656  * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1657  * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1658  * @retval #NFC_ERROR_TIMED_OUT Timeout is reached while communicating with tag
1659  * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1660  *
1661  * @post It invokes nfc_mifare_read_block_completed_cb() when it has completed to read a block.
1662  * @see nfc_mifare_read_page()
1663  * @see nfc_mifare_write_block()
1664 */
1665 int nfc_mifare_read_block(nfc_tag_h tag, int block_index, nfc_mifare_read_block_completed_cb callback, void *user_data);
1666
1667 /**
1668  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
1669  * @brief Reads 4 pages(16 bytes).
1670  * @remarks This function is only available for MIFARE Ultra light.\n
1671  * The MIFARE Ultralight protocol always reads 4 pages at a time, to reduce the number of commands required to read an entire tag.
1672  *
1673  * @param [in] tag The handle to NFC tag
1674  * @param [in] page_index  The index of page to read, starting from 0
1675  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
1676  * @param [in] user_data The user data to be passed to the callback funcation
1677  *
1678  *
1679  * @return 0 on success, otherwise a negative error value.
1680  * @retval #NFC_ERROR_NONE Successful
1681  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1682  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1683  * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1684  * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1685  * @retval #NFC_ERROR_TIMED_OUT Timeout is reached while communicating with tag
1686  * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1687  *
1688  * @post It invokes nfc_mifare_read_page_completed_cb() when it has completed to read a page.
1689  * @see nfc_mifare_read_block()
1690  * @see nfc_mifare_write_page()
1691 */
1692 int nfc_mifare_read_page(nfc_tag_h tag, int page_index, nfc_mifare_read_page_completed_cb callback, void *user_data);
1693
1694 /**
1695  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
1696  * @brief Writes block (16 byte) of data to the tag at a given block index.
1697  * @remarks This function is only available for MIFARE classic.
1698  *
1699  * @param [in] tag The handle to NFC tag
1700  * @param [in] block_index The index of block to read, starting from 0
1701  * @param [in] buffer 16 bytes of data to write
1702  * @param [in] buffer_size The size of buffer in bytes
1703  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
1704  * @param [in] user_data The user data to be passed to the callback funcation
1705  *
1706  * @return 0 on success, otherwise a negative error value.
1707  * @retval #NFC_ERROR_NONE Successful
1708  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1709  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1710  * @retval #NFC_ERROR_NOT_INITIALIZED Not initialized
1711  * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1712  * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1713  * @retval #NFC_ERROR_TIMED_OUT Timeout is reached while communicating with tag
1714  * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1715  *
1716  * @post It invokes nfc_mifare_write_block_completed_cb() when it hase completed to write a block.
1717  *
1718  * @see nfc_mifare_write_page()
1719  * @see nfc_mifare_read_block()
1720 */
1721 int nfc_mifare_write_block(nfc_tag_h tag, int block_index, unsigned char *buffer, int buffer_size, nfc_mifare_write_block_completed_cb callback, void *user_data);
1722
1723 /**
1724  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
1725  * @brief Writes a page (4 bytes) of data to the tag at a given page index
1726  * @remarks This function is only available for MIFARE Ultra light
1727  *
1728  * @param [in] tag The handle to NFC tag
1729  * @param [in] page_index The index of page to write, starting from 0
1730  * @param [in] buffer 4 bytes of data to write
1731  * @param [in] buffer_size The size of buffer in bytes
1732  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
1733  * @param [in] user_data The user data to be passed to the callback funcation
1734  *
1735  * @return 0 on success, otherwise a negative error value.
1736  * @retval #NFC_ERROR_NONE Successful
1737  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1738  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1739  * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1740  * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1741  * @retval #NFC_ERROR_TIMED_OUT Timeout is reached while communicating with tag
1742  * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1743  *
1744  * @post It invokes nfc_mifare_write_page_completed_cb() when it has completed to write a page.
1745  *
1746  * @see nfc_mifare_write_block()
1747  * @see nfc_mifare_read_page()
1748 */
1749 int nfc_mifare_write_page(nfc_tag_h tag, int page_index, unsigned char *buffer, int buffer_size, nfc_mifare_write_page_completed_cb callback, void *user_data);
1750
1751 /**
1752  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
1753  * @brief Increases a value block, storing the result in the temporary block on the tag.
1754  * @remarks This function is only available for MIFARE classic
1755  *
1756  * @param [in] tag The handle to NFC tag
1757  * @param [in] block_index The index of block to increase, starting from 0
1758  * @param [in] value Non-negative to increment by
1759  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
1760  * @param [in] user_data The user data to be passed to the callback function
1761  *
1762  * @return 0 on success, otherwise a negative error value.
1763  * @retval #NFC_ERROR_NONE Successful
1764  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1765  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1766  * @retval #NFC_ERROR_NOT_INITIALIZED Not initialized
1767  * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1768  * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1769  * @retval #NFC_ERROR_TIMED_OUT Timeout is reached while communicating with tag
1770  * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1771  *
1772  * @see nfc_mifare_decrement()
1773  * @see nfc_mifare_write_block()
1774 */
1775 int nfc_mifare_increment(nfc_tag_h tag, int block_index, int value, nfc_mifare_increment_completed_cb callback, void *user_data);
1776
1777 /**
1778  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
1779  * @brief Decreases a value block, storing the result in the temporary block on the tag.
1780  * @remarks  This function is only available for MIFARE classic
1781  *
1782  * @param [in] tag The handle to NFC tag
1783  * @param [in] block_index The index of block to decrease, starting from 0
1784  * @param [in] value non-negative to decrement by
1785  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
1786  * @param [in] user_data The user data to be passed to the callback funcation
1787  *
1788  * @return 0 on success, otherwise a negative error value.
1789  * @retval #NFC_ERROR_NONE Successful
1790  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1791  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1792  * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1793  * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1794  * @retval #NFC_ERROR_TIMED_OUT Timeout is reached while communicating with tag
1795  * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1796  *
1797  * @see nfc_mifare_increment()
1798  * @see nfc_mifare_write_block()
1799 */
1800 int nfc_mifare_decrement(nfc_tag_h tag, int block_index, int value, nfc_mifare_decrement_completed_cb callback, void *user_data);
1801
1802 /**
1803  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
1804  * @brief Copys from the temporary block to the specified block.
1805  * @remarks This function is only available for MIFARE classic
1806  *
1807  * @param [in] tag The handle to NFC tag
1808  * @param [in] block_index The index of block to copy to, starting from 0
1809  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
1810  * @param [in] user_data The user data to be passed to the callback funcation
1811  *
1812  * @return 0 on success, otherwise a negative error value.
1813  * @retval #NFC_ERROR_NONE Successful
1814  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1815  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1816  * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1817  * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1818  * @retval #NFC_ERROR_TIMED_OUT Timeout is reached while communicating with tag
1819  * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1820  *
1821  * @see nfc_mifare_restore()
1822 */
1823 int nfc_mifare_transfer(nfc_tag_h tag, int block_index, nfc_mifare_transfer_completed_cb callback, void *user_data);
1824
1825 /**
1826  * @ingroup CAPI_NETWORK_NFC_TAG_MIFARE_MODULE
1827  * @brief Copys from a value block to the temporary block.
1828  * @remarks This function is only available for MIFARE classic
1829  *
1830  * @param [in] tag The handle to NFC tag
1831  * @param [in] block_index The index of block to copy from, starting from 0
1832  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
1833  * @param [in] user_data The user data to be passed to the callback funcation
1834  *
1835  * @return 0 on success, otherwise a negative error value.
1836  * @retval #NFC_ERROR_NONE Successful
1837  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1838  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1839  * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1840  * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1841  * @retval #NFC_ERROR_TIMED_OUT Timeout is reached while communicating with tag
1842  * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1843  *
1844  * @see nfc_mifare_transfer()
1845 */
1846 int nfc_mifare_restore(nfc_tag_h tag, int block_index, nfc_mifare_restore_completed_cb callback, void *user_data);
1847
1848
1849 /**
1850  * @brief Registers a callback function for receiving data from NFC peer-to-peer target.
1851  * @ingroup CAPI_NETWORK_NFC_P2P_MODULE
1852  *
1853  * @param [in] target The handle to peer target
1854  * @param [in] callback The callback function to invoke when an NDEF Message is discovered
1855  * @param [in] user_data The user data to be passed to the callback function
1856  *
1857  * @return 0 on success, otherwise a negative error value.
1858  * @retval #NFC_ERROR_NONE Successful
1859  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1860  *
1861  * @see nfc_p2p_unset_data_received_cb()
1862  * @see nfc_p2p_data_recived_cb()
1863  * @see nfc_p2p_target_discovered_cb()
1864  */
1865 int nfc_p2p_set_data_received_cb(nfc_p2p_target_h target, nfc_p2p_data_recived_cb callback, void *user_data);
1866
1867 /**
1868  * @brief Unregisters the callback function.
1869  * @ingroup CAPI_NETWORK_NFC_P2P_MODULE
1870  *
1871  * @param [in] target The handle to peer target
1872  *
1873  * @return 0 on success, otherwise a negative error value.
1874  * @retval #NFC_ERROR_NONE Successful
1875  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1876  *
1877  * @see nfc_p2p_set_data_received_cb()
1878  * @see nfc_p2p_data_recived_cb()
1879  * @see nfc_p2p_target_discovered_cb()
1880  */
1881 int nfc_p2p_unset_data_received_cb(nfc_p2p_target_h target);
1882
1883 /**
1884  * @brief Sends data to NFC peer-to-peer target
1885  * @ingroup CAPI_NETWORK_NFC_P2P_MODULE
1886  *
1887  * @param [in] tag The handle to NFC tag
1888  * @param [in] message The message to send
1889  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
1890  * @param [in] user_data The user data to be passed to the callback funcation
1891  *
1892  * @return 0 on success, otherwise a negative error value.
1893  * @retval #NFC_ERROR_NONE Successful
1894  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1895  * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1896  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1897  * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1898  * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1899  *
1900  * @see nfc_p2p_send_completed_cb()
1901  * @see @see nfc_p2p_target_discovered_cb()
1902 */
1903 int nfc_p2p_send(nfc_p2p_target_h target, nfc_ndef_message_h message, nfc_p2p_send_completed_cb callback, void *user_data);
1904
1905
1906
1907
1908 /**
1909  * @brief NFC Connetionhandover between NFC peer-to-peer target
1910  * @ingroup CAPI_NETWORK_NFC_P2P_MODULE
1911  *
1912  * @param [in] target The handle to NFC device
1913  * @param [in] type Prepered Alternative Carrior
1914  * @param [in] callback The callback function to invoke after this function has completed\n It can be null if notification is not required
1915  * @param [in] user_data The user data to be passed to the callback function
1916  *
1917  * @return 0 on success, otherwise a negative error value.
1918  * @retval #NFC_ERROR_NONE Successful
1919  * @retval #NFC_ERROR_OUT_OF_MEMORY Out of memory
1920  * @retval #NFC_ERROR_OPERATION_FAILED Operation failed
1921  * @retval #NFC_ERROR_INVALID_PARAMETER Invalid parameter
1922  * @retval #NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request
1923  * @retval #NFC_ERROR_NOT_ACTIVATED NFC is not activated
1924  *
1925  * @see nfc_p2p_connection_handover_completed_cb()
1926  * @see @see nfc_p2p_connection_handover_completed_cb()
1927
1928 */
1929 int nfc_p2p_connection_handover(nfc_p2p_target_h target , nfc_ac_type_e type, nfc_p2p_connection_handover_completed_cb callback, void *user_data);
1930
1931
1932
1933 /**
1934  * @brief Check available Alternative Carrior(AC) for NFC handover between NFC peer-to-peer target
1935  * @ingroup CAPI_NETWORK_NFC_P2P_MODULE
1936  *
1937  * @param [in] carrior Alternative Carrior whan to be checked whether supported or not
1938  *
1939  * @retval #true Supported
1940  * @retval #false Not Supported
1941  *
1942  * @see nfc_p2p_is_supported_ac_type()
1943  *
1944 */
1945 bool nfc_p2p_is_supported_ac_type( nfc_ac_type_e carrior);
1946
1947
1948 #ifdef __cplusplus
1949 }
1950 #endif
1951
1952
1953 #endif /* __NFC_H__ */
1954