typedef enum {
NFC_RECORD_TNF_EMPTY = 0x00, /**< Empty */
NFC_RECORD_TNF_WELL_KNOWN = 0x01, /**< RTD(Record Type Definition) type format [NFC RTD] */
- NFC_RECORD_TNF_MIME_MEDIA= 0x02, /**< MIME Media types in RFC 2046 [RFC 2046] */
+ NFC_RECORD_TNF_MIME_MEDIA = 0x02, /**< MIME Media types in RFC 2046 [RFC 2046] */
NFC_RECORD_TNF_URI = 0x03, /**< Absolute URI as defined in RFC 3986 [RFC 3986] */
NFC_RECORD_TNF_EXTERNAL_RTD = 0x04, /**< NFC Forum external type [NFC RTD] */
NFC_RECORD_TNF_UNKNOWN = 0x05, /**< Unknown\n The payload type is unknown */
NFC_TAG_FILTER_FELICA_ENABLE = 0x0008, /**< FELICA enable */
NFC_TAG_FILTER_JEWEL_ENABLE = 0x0010, /**< JEWEL enable */
NFC_TAG_FILTER_IP_ENABLE = 0x0020, /**< IP enable */
- NFC_TAG_FILTER_ALL_ENABLE= ~0, /**< All enable */
+ NFC_TAG_FILTER_ALL_ENABLE = ~0, /**< All enable */
} nfc_tag_filter_e;
/**
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
*/
-typedef enum{
+typedef enum {
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. */
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
*/
-typedef enum{
+typedef enum {
NFC_SE_TYPE_DISABLE = 0x00, /**< Disable card emulation */
NFC_SE_TYPE_ESE = 0x01, /**< SmartMX type card emulation */
NFC_SE_TYPE_UICC = 0x02, /**< UICC type card emulation */
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
*/
-typedef enum{
+typedef enum {
NFC_SE_CARD_EMULATION_MODE_OFF = 0x00, /**< Card Emulation mode OFF */
NFC_SE_CARD_EMULATION_MODE_ON = 0x01, /**< Card Emulation mode ON */
} nfc_se_card_emulation_mode_type_e;
* @since_tizen 2.3.1
* @ingroup CAPI_NETWORK_NFC_SE_MODULE
*/
-typedef enum{
+typedef enum {
NFC_CARD_EMULATION_CATEGORY_PAYMENT = 0x01, /**< Category used for NFC payment services */
NFC_CARD_EMULATION_CATEGORY_OTHER = 0x02, /**< Category that can be used for all other card emulation services */
} nfc_card_emulation_category_type_e;
* @since_tizen 2.3.1
* @ingroup CAPI_NETWORK_NFC_SE_MODULE
*/
-typedef enum{
+typedef enum {
NFC_HCE_EVENT_DEACTIVATED = 0x00, /**< HCE Deactivated */
NFC_HCE_EVENT_ACTIVATED = 0x01, /**< HCE Activated */
NFC_HCE_EVENT_APDU_RECEIVED = 0x02, /**< HCE APDU Received */
*
* @see nfc_manager_set_activation()
*/
-typedef void (* nfc_activation_completed_cb)(nfc_error_e error, void *user_data);
+typedef void (*nfc_activation_completed_cb)(nfc_error_e error, void *user_data);
/**
* @brief Called when nfc activation state is changed.
* @ingroup CAPI_NETWORK_NFC_MANAGER_MODULE
*
* @remarks The tag handle does not have detail target info when an NFC tag disappeared.\n
- * So then do not use tag functions which use tag handle.
+ * So then do not use tag functions which use tag handle.
*
* @param [in] type The discovered type attached or detached
* @param [in] tag The handle to NFC tag
* @see nfc_manager_unset_tag_discovered_cb()
* @see nfc_manager_set_tag_filter()
*/
-typedef void (* nfc_tag_discovered_cb)(nfc_discovered_type_e type, nfc_tag_h tag, void *user_data);
+typedef void (*nfc_tag_discovered_cb)(nfc_discovered_type_e type, nfc_tag_h tag, void *user_data);
/**
* @brief Called when an NDEF Message is discovered
* @see nfc_manager_set_ndef_discovered_cb()
* @see nfc_manager_unset_ndef_discovered_cb()
*/
-typedef void (* nfc_ndef_discovered_cb)(nfc_ndef_message_h message, void *user_data);
+typedef void (*nfc_ndef_discovered_cb)(nfc_ndef_message_h message, void *user_data);
/**
*
* @see nfc_tag_transceive()
*/
-typedef void (* nfc_tag_transceive_completed_cb)(nfc_error_e result, unsigned char *buffer, int buffer_size, void *user_data);
+typedef void (*nfc_tag_transceive_completed_cb)(nfc_error_e result, unsigned char *buffer, int buffer_size, void *user_data);
/**
* @brief Called after the nfc_tag_write_ndef() has completed.
*
* @see nfc_tag_write_ndef()
*/
-typedef void (* nfc_tag_write_completed_cb)(nfc_error_e result, void *user_data);
+typedef void (*nfc_tag_write_completed_cb)(nfc_error_e result, void *user_data);
/**
* @brief Called after the nfc_tag_read_ndef() has completed.
*
* @see nfc_tag_read_ndef()
*/
-typedef void (* nfc_tag_read_completed_cb)(nfc_error_e result, nfc_ndef_message_h message, void *user_data);
+typedef void (*nfc_tag_read_completed_cb)(nfc_error_e result, nfc_ndef_message_h message, void *user_data);
/**
* @brief Called after the nfc_tag_format_ndef() has completed.
*
* @see nfc_tag_format_ndef()
*/
-typedef void (* nfc_tag_format_completed_cb)(nfc_error_e result, void *user_data);
+typedef void (*nfc_tag_format_completed_cb)(nfc_error_e result, void *user_data);
/**
*
* @see nfc_mifare_authenticate_with_keyA()
*/
-typedef void (* nfc_mifare_authenticate_with_keyA_completed_cb)(nfc_error_e result, void *user_data);
+typedef void (*nfc_mifare_authenticate_with_keyA_completed_cb)(nfc_error_e result, void *user_data);
/**
* @brief Called after nfc_mifare_authenticate_with_keyB() has completed
*
* @see nfc_mifare_authenticate_with_keyB()
*/
-typedef void (* nfc_mifare_authenticate_with_keyB_completed_cb)(nfc_error_e result, void *user_data);
+typedef void (*nfc_mifare_authenticate_with_keyB_completed_cb)(nfc_error_e result, void *user_data);
/**
* @brief Called after nfc_mifare_write_block() has completed
*
* @see nfc_mifare_write_block()
*/
-typedef void (* nfc_mifare_write_block_completed_cb)(nfc_error_e result, void *user_data);
+typedef void (*nfc_mifare_write_block_completed_cb)(nfc_error_e result, void *user_data);
/**
* @brief Called after nfc_mifare_write_page() has completed
*
* @see nfc_mifare_write_page()
*/
-typedef void (* nfc_mifare_write_page_completed_cb)(nfc_error_e result, void *user_data);
+typedef void (*nfc_mifare_write_page_completed_cb)(nfc_error_e result, void *user_data);
/**
* @brief Called after nfc_mifare_read_block() has completed
*
* @see nfc_mifare_read_block()
*/
-typedef void (* nfc_mifare_read_block_completed_cb)(nfc_error_e result, unsigned char *buffer, int bufer_size, void *user_data);
+typedef void (*nfc_mifare_read_block_completed_cb)(nfc_error_e result, unsigned char *buffer, int bufer_size, void *user_data);
/**
* @brief Called after nfc_mifare_read_page() has completed
*
* @see nfc_mifare_read_page()
*/
-typedef void (* nfc_mifare_read_page_completed_cb)(nfc_error_e result, unsigned char *buffer, int bufer_size, void *user_data);
+typedef void (*nfc_mifare_read_page_completed_cb)(nfc_error_e result, unsigned char *buffer, int bufer_size, void *user_data);
/**
* @brief Called after nfc_mifare_increment() has completed
*
* @see nfc_mifare_increment()
*/
-typedef void (* nfc_mifare_increment_completed_cb)(nfc_error_e result, void *user_data);
+typedef void (*nfc_mifare_increment_completed_cb)(nfc_error_e result, void *user_data);
/**
* @brief Called after nfc_mifare_decrement() has completed
*
* @see nfc_mifare_decrement()
*/
-typedef void (* nfc_mifare_decrement_completed_cb)(nfc_error_e result, void *user_data);
+typedef void (*nfc_mifare_decrement_completed_cb)(nfc_error_e result, void *user_data);
/**
* @brief Called after nfc_mifare_transfer() has completed
*
* @see nfc_mifare_transfer()
*/
-typedef void (* nfc_mifare_transfer_completed_cb)(nfc_error_e result, void *user_data);
+typedef void (*nfc_mifare_transfer_completed_cb)(nfc_error_e result, void *user_data);
/**
* @brief Called after nfc_mifare_restore() has completed
*
* @see nfc_mifare_restore()
*/
-typedef void (* nfc_mifare_restore_completed_cb)(nfc_error_e result, void *user_data);
+typedef void (*nfc_mifare_restore_completed_cb)(nfc_error_e result, void *user_data);
* @privilege %http://tizen.org/privilege/nfc
* @remarks I/O operations(read / write / increment / decrement / transfer / restore) will be available after successful authentication.\n
* This function is only available for MIFARE classic.\n
- * \n
+ * \n
* MIFARE CLASSIC MINI\n
* => 0 ~ 4 : 5 sector and 4 block with 16 bytes\n
* \n
#define NFC_CE_HCE_FEATURE "http://tizen.org/feature/network.nfc.card_emulation.hce"
#define CHECK_INIT() \
- do{\
- if(nfc_common_is_initialized() == false) \
- { \
+ do { \
+ if (nfc_common_is_initialized() == false) { \
LOG_ERR("[ERROR][%s] NFC not initialized", __func__); \
return NFC_ERROR_NOT_INITIALIZED; \
} \
- }while(0)
+ } while (0)
#define CHECK_SUPPORTED(str) \
- do{\
- if(nfc_common_is_supported(str) == false) \
- { \
+ do { \
+ if (nfc_common_is_supported(str) == false) { \
LOG_ERR("[ERROR][%s] NFC not supported", __func__); \
return NFC_ERROR_NOT_SUPPORTED; \
} \
- }while(0)
+ } while (0)
#define CHECK_ACTIVATED() \
- do{\
- if (!nfc_manager_is_activated()) \
- { \
+ do { \
+ if (!nfc_manager_is_activated()) { \
LOG_ERR("[ERROR][%s] NFC not activated", __func__); \
return NFC_ERROR_NOT_ACTIVATED; \
} \
- } while(0)
+ } while (0)
#define CHECK_INVALID(expr) \
- do{\
- if (expr) \
- { \
+ do { \
+ if (expr) { \
LOG_ERR("[ERROR][%s] INVALID PARAMETER (%s)", __func__, #expr); \
return NFC_ERROR_INVALID_PARAMETER; \
} \
- } while(0)
+ } while (0)
#define CHECK_APP_PERMISSION() \
- do{\
- if (nfc_common_check_app_permission() == false) \
- { \
+ do {\
+ if (nfc_common_check_app_permission() == false) { \
LOG_ERR("[ERROR][%s] Permission check fail", __func__); \
return NFC_ERROR_SECURITY_RESTRICTED; \
} \
- } while(0)
+ } while (0)
#ifdef LOG_TAG
#undef LOG_TAG
LOGD(COLOR_BLUE"END <<<<"COLOR_END); \
} while (0)
-typedef struct
-{
+typedef struct {
bool initialized;
bool on_activation_doing;
net_nfc_target_info_h current_tag;
- //net_nfc_target_handle_s current_target;
net_nfc_target_handle_h current_target;
nfc_tag_discovered_cb on_tag_discovered_cb;
bool nfc_common_is_supported(char *str);
int nfc_common_get_rawdata_size(nfc_ndef_message_h ndef_message, unsigned int *byte_size);
-#endif // __NFC_LOG_H__
+#endif /* __NFC_LOG_H__ */