Tizen Native API
3.0
|
NFC Manager API provides access to NFC Events.
Required Header
#include <nfc.h>
Overview
The nfc manager api provides functions to connect nfc-server and register event listener
- control connection with nfc-server.
- register / deregister event listeners for detecting tag, ndef, llcp, secure element
- set / unset tag filter to be listened only in case of specific tag.
Related Features
This API is related with the following features:
- http://tizen.org/feature/network.nfc
- http://tizen.org/feature/network.nfc.tag
- http://tizen.org/feature/network.nfc.p2p
- http://tizen.org/feature/network.nfc.card_emulation
- http://tizen.org/feature/network.secure_element.uicc
- http://tizen.org/feature/network.secure_element.ese
It is recommended to design feature related codes in your application for reliability.
You can check if a devrice supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
Functions | |
bool | nfc_manager_is_supported (void) |
Gets the value that indicates whether NFC is supported. | |
int | nfc_manager_set_activation_changed_cb (nfc_activation_changed_cb callback, void *user_data) |
Set NFC Activation state changed callback. | |
void | nfc_manager_unset_activation_changed_cb (void) |
Unregisters the callback function. | |
int | nfc_manager_set_activation (bool activation, nfc_activation_completed_cb callback, void *user_data) |
Sets NFC Activation. | |
bool | nfc_manager_is_activated (void) |
Gets NFC Activation state. | |
int | nfc_manager_initialize (void) |
Initializes NFC Manager. | |
int | nfc_manager_deinitialize (void) |
Releases all the resource of the NFC Manager and disconnect the session between an application and NFC Manager. | |
int | nfc_manager_set_tag_discovered_cb (nfc_tag_discovered_cb callback, void *user_data) |
Registers a callback function for receiving tag discovered notification. | |
void | nfc_manager_unset_tag_discovered_cb (void) |
Unregisters the callback function. | |
int | nfc_manager_set_ndef_discovered_cb (nfc_ndef_discovered_cb callback, void *user_data) |
Registers a callback function for receiving NDEF Message discovered notification. | |
void | nfc_manager_unset_ndef_discovered_cb (void) |
Unregisters the callback function. | |
int | nfc_manager_set_p2p_target_discovered_cb (nfc_p2p_target_discovered_cb callback, void *user_data) |
Registers a callback function for receiving NFC peer-to-peer target discovered notification. | |
void | nfc_manager_unset_p2p_target_discovered_cb (void) |
Unregisters the callback function. | |
int | nfc_manager_set_se_event_cb (nfc_se_event_cb callback, void *user_data) |
Registers a callback function for receiving Secure Element (SIM/UICC(Universal Integrated Circuit Card)) event. | |
void | nfc_manager_unset_se_event_cb (void) |
Unregisters the callback function. | |
int | nfc_manager_set_se_transaction_event_cb (nfc_se_type_e se_type, nfc_se_transaction_event_cb callback, void *user_data) |
Registers a callback function for receiving Secure Element (SIM/UICC(Universal Integrated Circuit Card)) transaction event(NFC_SE_EVENT_TRANSACTION) data. | |
void | nfc_manager_unset_se_transaction_event_cb (nfc_se_type_e se_type) |
Unregisters the callback function. | |
int | nfc_manager_set_hce_event_cb (nfc_hce_event_cb callback, void *user_data) |
Registers a callback function for receiving HCE(Host Card Emulation) event. | |
void | nfc_manager_unset_hce_event_cb (void) |
Unregisters the callback function. | |
int | nfc_manager_enable_transaction_fg_dispatch (void) |
give the priority to the foreground application when dispatching transaction event. | |
int | nfc_manager_disable_transaction_fg_dispatch (void) |
disable foreground dispatch for "EVT_TRANSACTION" to the givin application. | |
int | nfc_manager_get_cached_message (nfc_ndef_message_h *ndef_message) |
Gets NDEF message cached when the tag is detected or when data received from NFC peer-to-peer target. | |
void | nfc_manager_set_tag_filter (int filter) |
Sets filter of target types. | |
int | nfc_manager_get_tag_filter (void) |
Gets the current filter status. | |
int | nfc_manager_get_connected_tag (nfc_tag_h *tag) |
Gets current connected tag. | |
int | nfc_manager_get_connected_target (nfc_p2p_target_h *target) |
Gets current connected p2p target. | |
int | nfc_manager_set_system_handler_enable (bool enable) |
Enable or disable the system handling for tag and target discovered event. | |
bool | nfc_manager_is_system_handler_enabled (void) |
Gets the state of the system handler. | |
int | nfc_manager_set_se_type (nfc_se_type_e type) |
Sets the card emulation Secure Element type. | |
int | nfc_manager_get_se_type (nfc_se_type_e *type) |
Gets the card emulation Secure Element type. | |
Typedefs | |
typedef void(* | nfc_activation_completed_cb )(nfc_error_e error, void *user_data) |
Called after nfc_manager_set_activation() has completed. | |
typedef void(* | nfc_activation_changed_cb )(bool activated, void *user_data) |
Called when nfc activation state is changed. | |
typedef void(* | nfc_tag_discovered_cb )(nfc_discovered_type_e type, nfc_tag_h tag, void *user_data) |
Called when an NFC tag appears or disappears. | |
typedef void(* | nfc_ndef_discovered_cb )(nfc_ndef_message_h message, void *user_data) |
Called when an NDEF Message is discovered. | |
typedef void(* | nfc_p2p_target_discovered_cb )(nfc_discovered_type_e type, nfc_p2p_target_h target, void *user_data) |
Called when NFC peer-to-peer target appeared or disappeared. | |
typedef void(* | nfc_se_event_cb )(nfc_se_event_e event, void *user_data) |
Called when receiving Secure Element (SIM/UICC(Universal Integrated Circuit Card)) event. | |
typedef void(* | nfc_se_transaction_event_cb )(nfc_se_type_e se_type, unsigned char *aid, int aid_size, unsigned char *param, int param_size, void *user_data) |
Called when receiving Secure Element(SIM/UICC(Universal Integrated Circuit Card)) transaction event data. |
Typedef Documentation
typedef void(* nfc_activation_changed_cb)(bool activated, void *user_data) |
Called when nfc activation state is changed.
- Since :
- 2.3.1
- Parameters:
-
[in] activated The activation state [in] user_data The user data passed from the callback registration function
typedef void(* nfc_activation_completed_cb)(nfc_error_e error, void *user_data) |
Called after nfc_manager_set_activation() has completed.
- Since :
- 2.3.1
- Warning:
- This is not for use by third-party applications.
- Parameters:
-
[in] error The result [in] user_data The user data passed from the callback registration function
- See also:
- nfc_manager_set_activation()
typedef void(* nfc_ndef_discovered_cb)(nfc_ndef_message_h message, void *user_data) |
Called when an NDEF Message is discovered.
- Since :
- 2.3.1
- Remarks:
- message will be automatically destroyed when the callback function returns. (Do not release message.)
- Parameters:
-
[in] message The handle to NDEF message [in] user_data The user data passed from the callback registration function
typedef void(* nfc_p2p_target_discovered_cb)(nfc_discovered_type_e type, nfc_p2p_target_h target, void *user_data) |
Called when NFC peer-to-peer target appeared or disappeared.
- Since :
- 2.3.1
- Parameters:
-
[in] type The discovered type attached or detached [in] target The handle to p2p target [in] user_data The user data passed from nfc_manager_set_p2p_target_discovered_cb()
typedef void(* nfc_se_event_cb)(nfc_se_event_e event, void *user_data) |
Called when receiving Secure Element (SIM/UICC(Universal Integrated Circuit Card)) event.
- Since :
- 2.3.1
- Parameters:
-
[in] event The Secure Element event [in] user_data The user data passed from nfc_manager_set_se_event_cb()
typedef void(* nfc_se_transaction_event_cb)(nfc_se_type_e se_type, unsigned char *aid, int aid_size, unsigned char *param, int param_size, void *user_data) |
Called when receiving Secure Element(SIM/UICC(Universal Integrated Circuit Card)) transaction event data.
- Since :
- 2.3.1
- Remarks:
- This event notifies , external reader trys to access secure element.
- Parameters:
-
[in] se type [in] aid Application Id, specified in ISO/IEC 7816-4 [in] aid_size The size of aid (5~16) [in] param The parameter list, specified in ISO/IEC 8825-1 [in] param The size of param (0~65535) [in] user_data The user data passed from nfc_manager_set_se_transaction_event_cb()
typedef void(* nfc_tag_discovered_cb)(nfc_discovered_type_e type, nfc_tag_h tag, void *user_data) |
Called when an NFC tag appears or disappears.
- Since :
- 2.3.1
- Remarks:
- The tag handle does not have detail target info when an NFC tag disappeared.
So then do not use tag functions which use tag handle.
- Parameters:
-
[in] type The discovered type attached or detached [in] tag The handle to NFC tag [in] user_data The user data passed from the callback registration function
Enumeration Type Documentation
enum nfc_error_e |
Error codes reported by the NFC API.
- Since :
- 2.3.1
- Enumerator:
enum nfc_se_event_e |
Enumerations for NFC Secure Element (SIM/UICC(Universal Integrated Circuit Card)) event.
- Since :
- 2.3.1
- Enumerator:
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.
NFC_SE_EVENT_END_TRANSACTION This event notifies the terminal host that current transaction in process was ended.
NFC_SE_EVENT_CONNECTIVITY It's ready signal to communicate UICC(Universal Integrated Circuit Card) with terminal host. UICC(Universal Integrated Circuit Card) create pipe and open the pipe chanel. Then it sends the signal to terminal host or host controller.
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. When 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]
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. When there are multiple open card RF gates the CLF shall send the NFC_SE_EVENT_FIELD_OFF to one gate only.
NFC_SE_EVENT_TRANSACTION This event notifies , external reader trys to access secure element
NFC_SE_EVENT_SE_TYPE_CHANGED This event notifies, changing the emulated secure element type
NFC_SE_EVENT_CARD_EMULATION_CHANGED This event notifies, changing the card emulation mode
enum nfc_se_type_e |
Enumerations for NFC Secure Element (SIM/UICC(Universal Integrated Circuit Card)) type.
- Since :
- 2.3.1
enum nfc_tag_filter_e |
Enumerations for NFC Tag filter.
- Since :
- 2.3.1
- Enumerator:
Function Documentation
int nfc_manager_deinitialize | ( | void | ) |
Releases all the resource of the NFC Manager and disconnect the session between an application and NFC Manager.
- Since :
- 2.3.1
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_OPERATION_FAILED Operation fail
- See also:
- nfc_manager_initialize()
int nfc_manager_disable_transaction_fg_dispatch | ( | void | ) |
disable foreground dispatch for "EVT_TRANSACTION" to the givin application.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/nfc.cardemulation
- Remarks:
- After calling "nfc_manager_enable_transaction_fg_dispatch", an application must call this api when it go out from foureground.
-
Security level can be determined by the manufacturer usage.
If a security issue is occurred, contact with the manufacturer of the product.
If you want to know about security level in detail, See the GSMA specification.
(http://www.gsma.com/digitalcommerce/wp-content/uploads/2013/12/GSMA-NFC05-NFC-Handset-APIs-Requirement-Specification-version-4-1.pdf)
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_PERMISSION_DENIED Security restricted by SMACK NFC_ERROR_OUT_OF_MEMORY Out of memory NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request NFC_ERROR_SECURITY_RESTRICTED Security restricted by Access Control NFC_ERROR_ILLEGAL_STATE Illegal state NFC_ERROR_OPERATION_FAILED IPC fail
int nfc_manager_enable_transaction_fg_dispatch | ( | void | ) |
give the priority to the foreground application when dispatching transaction event.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/nfc.cardemulation
- Remarks:
- This function must be called only when the application is in the foreground.
If the application go out from foreground, application must call "nfc_manager_disable_transaction_fg_dispatch" to disable foreground dispatch
-
Security level can be determined by the manufacturer usage.
If a security issue is occurred, contact with the manufacturer of the product.
If you want to know about security level in detail, See the GSMA specification.
(http://www.gsma.com/digitalcommerce/wp-content/uploads/2013/12/GSMA-NFC05-NFC-Handset-APIs-Requirement-Specification-version-4-1.pdf)
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_PERMISSION_DENIED Security restricted by SMACK NFC_ERROR_OUT_OF_MEMORY Out of memory NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request NFC_ERROR_SECURITY_RESTRICTED Security restricted by Access Control NFC_ERROR_ILLEGAL_STATE Illegal state NFC_ERROR_OPERATION_FAILED IPC fail
int nfc_manager_get_cached_message | ( | nfc_ndef_message_h * | ndef_message | ) |
Gets NDEF message cached when the tag is detected or when data received from NFC peer-to-peer target.
- Since :
- 2.3.1
- Remarks:
- This function is used to get the ndef message that was read before launched your application.
- Parameters:
-
[out] ndef_message The cached NDEF message
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_OUT_OF_MEMORY Out of memory NFC_ERROR_INVALID_PARAMETER Invalid parameter NFC_ERROR_NO_NDEF_MESSAGE The cached message does not exist NFC_ERROR_OPERATION_FAILED Operation failed
- See also:
- nfc_manager_initialize()
int nfc_manager_get_connected_tag | ( | nfc_tag_h * | tag | ) |
Gets current connected tag.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/nfc
- Parameters:
-
[out] tag The connected tag
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_INVALID_PARAMETER Invalid parameter NFC_ERROR_NOT_ACTIVATED NFC is not activated NFC_ERROR_NO_DEVICE There is no connected target NFC_ERROR_PERMISSION_DENIED Security restricted by SMACK NFC_ERROR_OUT_OF_MEMORY Out of memory NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request NFC_ERROR_NO_DEVICE There is no connected tag NFC_ERROR_OPERATION_FAILED Operation failed
- See also:
- nfc_manager_initialize()
int nfc_manager_get_connected_target | ( | nfc_p2p_target_h * | target | ) |
Gets current connected p2p target.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/nfc
- Parameters:
-
[out] target The connected target
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_INVALID_PARAMETER Invalid parameter NFC_ERROR_NOT_ACTIVATED NFC is not activated NFC_ERROR_NO_DEVICE There is no connected target NFC_ERROR_PERMISSION_DENIED Security restricted by SMACK NFC_ERROR_OUT_OF_MEMORY Out of memory NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request NFC_ERROR_NO_DEVICE There is no connected tag NFC_ERROR_OPERATION_FAILED Operation failed
- See also:
- nfc_manager_initialize()
int nfc_manager_get_se_type | ( | nfc_se_type_e * | type | ) |
Gets the card emulation Secure Element type.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/nfc.cardemulation
- Parameters:
-
[out] type The type of Secure Element
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_INVALID_PARAMETER Invalid parameter NFC_ERROR_NOT_ACTIVATED NFC is not activated NFC_ERROR_PERMISSION_DENIED Security restricted by SMACK NFC_ERROR_OUT_OF_MEMORY Out of memory NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request NFC_ERROR_OPERATION_FAILED Operation failed
- See also:
- nfc_manager_initialize()
int nfc_manager_get_tag_filter | ( | void | ) |
Gets the current filter status.
- Since :
- 2.3.1
- Remarks:
- Bit operation OR(|) is used in return data
The default value is NFC_TAG_FILTER_ALL_ENABLE - The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Returns:
- The filter which is set nfc_tag_filter_e
- Exceptions:
-
NFC_ERROR_NONE Success NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC
int nfc_manager_initialize | ( | void | ) |
Initializes NFC Manager.
- Since :
- 2.3.1
- Remarks:
- This function must be called before proceeding any other nfc functions
When an application crashes or exits without the deinitialization. NFC manager automatically deinitializes the process itself.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_OPERATION_FAILED Operation fail
- See also:
- nfc_manager_deinitialize()
bool nfc_manager_is_activated | ( | void | ) |
Gets NFC Activation state.
- Since :
- 2.3.1
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- This function can executed Regardless of nfc_manager_initialize state.
- Returns:
- true on NFC activated, otherwise false
- Exceptions:
-
NFC_ERROR_NONE Success NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_ILLEGAL_STATE Illegal state NFC_ERROR_OPERATION_FAILED Operation fail
bool nfc_manager_is_supported | ( | void | ) |
Gets the value that indicates whether NFC is supported.
- Since :
- 2.3.1
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- This function can executed Regardless of nfc_manager_initialize state.
- Returns:
- true on NFC supported, otherwise false
- Exceptions:
-
NFC_ERROR_NONE Success NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_ILLEGAL_STATE Illegal state NFC_ERROR_OPERATION_FAILED Operation fail
bool nfc_manager_is_system_handler_enabled | ( | void | ) |
Gets the state of the system handler.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/nfc
- Remarks:
- In default, The system handling is enabled.
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Returns:
- true on enabled, otherwise false.
- Exceptions:
-
NFC_ERROR_NONE Success NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_INVALID_PARAMETER Invalid parameter NFC_ERROR_NOT_ACTIVATED NFC is not activated NFC_ERROR_PERMISSION_DENIED Security restricted by SMACK NFC_ERROR_OPERATION_FAILED Operation failed
int nfc_manager_set_activation | ( | bool | activation, |
nfc_activation_completed_cb | callback, | ||
void * | user_data | ||
) |
Sets NFC Activation.
- Since :
- 2.3.1
- Privilege Level:
- platform
- Privilege:
- http://tizen.org/privilege/nfc.admin
- Warning:
- This is not for use by third-party applications.
- Parameters:
-
[in] activation The NFC state for setting [in] callback The callback function to invoke after this function has completed
It can be null if notification is not required[in] user_data The user data to be passed to the callback function
- Postcondition:
- It invokes nfc_activation_completed_cb() when it has completed to set activation.
The Callback can receive error code when process is done.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_ALREADY_ACTIVATED Already activated NFC_ERROR_ALREADY_DEACTIVATED Already deactivated NFC_ERROR_OUT_OF_MEMORY Out of memory NFC_ERROR_OPERATION_FAILED Operation fail
int nfc_manager_set_activation_changed_cb | ( | nfc_activation_changed_cb | callback, |
void * | user_data | ||
) |
Set NFC Activation state changed callback.
- Since :
- 2.3.1
- Parameters:
-
[in] callback The callback function to invoke when activation state is changed. [in] user_data The user data to be passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_INVALID_PARAMETER Invalid parameter
int nfc_manager_set_hce_event_cb | ( | nfc_hce_event_cb | callback, |
void * | user_data | ||
) |
Registers a callback function for receiving HCE(Host Card Emulation) event.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/nfc.cardemulation
- Parameters:
-
[in] callback The callback function called when HCE(Host Card Emulation) event occurred. [in] user_data The user data to be passed to the callback function
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_INVALID_PARAMETER Invalid parameter NFC_ERROR_PERMISSION_DENIED Permission denied
int nfc_manager_set_ndef_discovered_cb | ( | nfc_ndef_discovered_cb | callback, |
void * | user_data | ||
) |
Registers a callback function for receiving NDEF Message discovered notification.
- Since :
- 2.3.1
- Parameters:
-
[in] callback The callback function called when NDEF Message is discovered [in] user_data The user data to be passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_INVALID_PARAMETER Invalid parameter
int nfc_manager_set_p2p_target_discovered_cb | ( | nfc_p2p_target_discovered_cb | callback, |
void * | user_data | ||
) |
Registers a callback function for receiving NFC peer-to-peer target discovered notification.
- Since :
- 2.3.1
- Parameters:
-
[in] callback The callback function called when NFC peer-to-peer target is discovered [in] user_data The user data to be passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_INVALID_PARAMETER Invalid parameter
int nfc_manager_set_se_event_cb | ( | nfc_se_event_cb | callback, |
void * | user_data | ||
) |
Registers a callback function for receiving Secure Element (SIM/UICC(Universal Integrated Circuit Card)) event.
- Since :
- 2.3.1
- Parameters:
-
[in] callback The callback function called when occurred Secure Element (SIM/UICC(Universal Integrated Circuit Card)) event. [in] user_data The user data to be passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_INVALID_PARAMETER Invalid parameter
int nfc_manager_set_se_transaction_event_cb | ( | nfc_se_type_e | se_type, |
nfc_se_transaction_event_cb | callback, | ||
void * | user_data | ||
) |
Registers a callback function for receiving Secure Element (SIM/UICC(Universal Integrated Circuit Card)) transaction event(NFC_SE_EVENT_TRANSACTION) data.
- Since :
- 2.3.1
- Parameters:
-
[in] se_type The type of secure element. [in] callback The callback function called when occurred SE transaction event. [in] user_data The user data to be passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_INVALID_PARAMETER Invalid parameter
int nfc_manager_set_se_type | ( | nfc_se_type_e | type | ) |
Sets the card emulation Secure Element type.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/nfc.cardemulation
- Remarks:
- Security level can be determined by the manufacturer usage.
If a security issue is occurred, contact with the manufacturer of the product.
If you want to know about security level in detail, See the GSMA specification.
(http://www.gsma.com/digitalcommerce/wp-content/uploads/2013/12/GSMA-NFC05-NFC-Handset-APIs-Requirement-Specification-version-4-1.pdf)
- Parameters:
-
[in] type The type of Secure Element
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_INVALID_PARAMETER Invalid parameter NFC_ERROR_NOT_ACTIVATED NFC is not activated NFC_ERROR_PERMISSION_DENIED Security restricted by SMACK NFC_ERROR_OUT_OF_MEMORY Out of memory NFC_ERROR_DEVICE_BUSY Device is too busy to handle your request NFC_ERROR_SECURITY_RESTRICTED Security restricted by Access Control NFC_ERROR_ILLEGAL_STATE Illegal state NFC_ERROR_OPERATION_FAILED Operation failed
- See also:
- nfc_manager_initialize()
int nfc_manager_set_system_handler_enable | ( | bool | enable | ) |
Enable or disable the system handling for tag and target discovered event.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/nfc
- Remarks:
- In default, The system handling is enabled.
- Parameters:
-
[in] enable The state of enable
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_NOT_ACTIVATED NFC is not activated NFC_ERROR_PERMISSION_DENIED Security restricted by SMACK NFC_ERROR_OPERATION_FAILED Operation failed
int nfc_manager_set_tag_discovered_cb | ( | nfc_tag_discovered_cb | callback, |
void * | user_data | ||
) |
Registers a callback function for receiving tag discovered notification.
- Parameters:
-
[in] callback The callback function called when a tag is appeared or disappeared [in] user_data The user data to be passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
NFC_ERROR_NONE Successful NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_INVALID_PARAMETER Invalid parameter
void nfc_manager_set_tag_filter | ( | int | filter | ) |
Sets filter of target types.
- Since :
- 2.3.1
- Remarks:
- Bit operator OR(|) can be used in the configure parameter (like NFC_TAG_FILTER_ISO14443A_ENABLE | NFC_TAG_FILTER_ISO14443B_ENABLE) or you may choose "NFC_TAG_ALL_ENABLE" enum value to get all result. It prevent getting tag types from RF level. If the client api does call this function, default is always NFC_TAG_ALL_ENABLE.
- Parameters:
-
[in] filter The filter value with bits operation nfc_tag_filter_e
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Exceptions:
-
NFC_ERROR_NONE Success NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_INVALID_PARAMETER Invalid parameter
void nfc_manager_unset_activation_changed_cb | ( | void | ) |
Unregisters the callback function.
- Since :
- 2.3.1
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Exceptions:
-
NFC_ERROR_NONE Success NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC
void nfc_manager_unset_hce_event_cb | ( | void | ) |
Unregisters the callback function.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/nfc.cardemulation
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Exceptions:
-
NFC_ERROR_NONE Success NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC NFC_ERROR_PERMISSION_DENIED Permission denied
void nfc_manager_unset_ndef_discovered_cb | ( | void | ) |
Unregisters the callback function.
- Since :
- 2.3.1
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Exceptions:
-
NFC_ERROR_NONE Success NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC
void nfc_manager_unset_p2p_target_discovered_cb | ( | void | ) |
Unregisters the callback function.
- Since :
- 2.3.1
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Exceptions:
-
NFC_ERROR_NONE Success NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC
void nfc_manager_unset_se_event_cb | ( | void | ) |
Unregisters the callback function.
- Since :
- 2.3.1
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Exceptions:
-
NFC_ERROR_NONE Success NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC
void nfc_manager_unset_se_transaction_event_cb | ( | nfc_se_type_e | se_type | ) |
Unregisters the callback function.
- Since :
- 2.3.1
- Parameters:
-
[in] se_type The type of secure element.
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Exceptions:
-
NFC_ERROR_NONE Success NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC
void nfc_manager_unset_tag_discovered_cb | ( | void | ) |
Unregisters the callback function.
- Since :
- 2.3.1
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Exceptions:
-
NFC_ERROR_NONE Success NFC_ERROR_NOT_SUPPORTED Not supported NFC NFC_ERROR_NOT_INITIALIZED Not initialized NFC