correct for coding convention 26/64426/1 accepted/tizen/common/20160401.075743 accepted/tizen/ivi/20160405.011652 accepted/tizen/mobile/20160405.011602 accepted/tizen/tv/20160405.011621 accepted/tizen/wearable/20160405.011634 submit/tizen/20160401.064004
authorJihoon Jung <jh8801.jung@samsung.com>
Fri, 1 Apr 2016 06:35:47 +0000 (15:35 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Fri, 1 Apr 2016 06:37:04 +0000 (15:37 +0900)
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
Change-Id: I70943d4c0e55e284a0361215dd25c651e61c4530

include/nfc.h
include/nfc_common.h
include/nfc_internal.h
packaging/capi-network-nfc.spec
src/nfc_card_emulation.c
src/nfc_p2p_handover.c

index a9d78a8..0a5648c 100755 (executable)
@@ -71,7 +71,7 @@ typedef enum {
 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 */
@@ -131,7 +131,7 @@ typedef enum {
        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;
 
 /**
@@ -149,7 +149,7 @@ typedef enum {
  * @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. */
@@ -165,7 +165,7 @@ typedef enum{
  * @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 */
@@ -178,7 +178,7 @@ typedef enum{
  * @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;
@@ -212,7 +212,7 @@ typedef enum {
  * @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;
@@ -222,7 +222,7 @@ typedef enum{
  * @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 */
@@ -350,7 +350,7 @@ extern const unsigned char NFC_RECORD_HANDOVER_SELECT_TYPE[2];
  *
  * @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.
@@ -370,7 +370,7 @@ typedef void (*nfc_activation_changed_cb)(bool activated , void *user_data);
  * @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
@@ -380,7 +380,7 @@ typedef void (*nfc_activation_changed_cb)(bool activated , void *user_data);
  * @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
@@ -395,7 +395,7 @@ typedef void (* nfc_tag_discovered_cb)(nfc_discovered_type_e type, nfc_tag_h tag
  * @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);
 
 
 /**
@@ -433,7 +433,7 @@ typedef bool (*nfc_tag_information_cb)(const char *key, const unsigned char *val
  *
  * @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.
@@ -445,7 +445,7 @@ typedef void (* nfc_tag_transceive_completed_cb)(nfc_error_e result, unsigned ch
  *
  * @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.
@@ -460,7 +460,7 @@ typedef void (* nfc_tag_write_completed_cb)(nfc_error_e result, void *user_data)
  *
  * @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.
@@ -472,7 +472,7 @@ typedef void (* nfc_tag_read_completed_cb)(nfc_error_e result, nfc_ndef_message_
  *
  * @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);
 
 
 /**
@@ -485,7 +485,7 @@ 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
@@ -497,7 +497,7 @@ typedef void (* nfc_mifare_authenticate_with_keyA_completed_cb)(nfc_error_e resu
  *
  * @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
@@ -509,7 +509,7 @@ typedef void (* nfc_mifare_authenticate_with_keyB_completed_cb)(nfc_error_e resu
  *
  * @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
@@ -521,7 +521,7 @@ typedef void (* nfc_mifare_write_block_completed_cb)(nfc_error_e result, void *u
  *
  * @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
@@ -537,7 +537,7 @@ typedef void (* nfc_mifare_write_page_completed_cb)(nfc_error_e result, void *us
  *
  * @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
@@ -553,7 +553,7 @@ typedef void (* nfc_mifare_read_block_completed_cb)(nfc_error_e result, unsigned
  *
  * @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
@@ -565,7 +565,7 @@ typedef void (* nfc_mifare_read_page_completed_cb)(nfc_error_e result, unsigned
  *
  * @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
@@ -577,7 +577,7 @@ typedef void (* nfc_mifare_increment_completed_cb)(nfc_error_e result, void *use
  *
  * @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
@@ -589,7 +589,7 @@ typedef void (* nfc_mifare_decrement_completed_cb)(nfc_error_e result, void *use
  *
  * @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
@@ -601,7 +601,7 @@ typedef void (* nfc_mifare_transfer_completed_cb)(nfc_error_e result, void *user
  *
  * @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);
 
 
 
@@ -2243,7 +2243,7 @@ int nfc_mifare_authenticate_with_keyA(nfc_tag_h tag, int sector_index, unsigned
  * @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
index 045e75b..7090317 100644 (file)
 #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;
@@ -161,4 +154,4 @@ bool nfc_common_is_initialized();
 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__ */
index 22f7ce0..8b79a81 100755 (executable)
@@ -29,8 +29,8 @@ extern "C" {
  * @ingroup CAPI_NETWORK_NFC_HANDOVER_MODULE
  */
 typedef enum {
-    NFC_HANDOVER_EVENT_START = 0x00, /**< handover started */
-    NFC_HANDOVER_EVENT_FINISH = 0x01, /**< handover finished */
+       NFC_HANDOVER_EVENT_START = 0x00, /**< handover started */
+       NFC_HANDOVER_EVENT_FINISH = 0x01, /**< handover finished */
 } nfc_handover_event_e;
 
 /**
@@ -53,9 +53,9 @@ typedef enum {
        NFC_AC_STATE_ACTIVATE, /**<  activated */
        NFC_AC_STATE_ACTIVATING,/**< now activating */
        NFC_AC_STATE_UNKNOWN, /**< unknown */
-} nfc_ac_state_e ;
+} nfc_ac_state_e;
 
-typedef enum{
+typedef enum {
        NFC_SE_POWER_MODE_SLEEP = 0x00, /**< sleep mode */
        NFC_SE_POWER_MODE_ON = 0x01, /**< Power On */
        NFC_SE_POWER_MODE_OFF = 0x02, /**< Power Off */
index 248263c..974a110 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-network-nfc
 Summary:    A NFC library in Native API
-Version:    0.2.3
+Version:    0.2.4
 Release:    0
 Group:      Network & Connectivity/NFC
 License:    Apache-2.0
index 1cc60c2..c18af86 100755 (executable)
@@ -500,4 +500,5 @@ int nfc_se_unset_preferred_handler()
 
        return nfc_common_convert_error_code(__func__, result);
        /* LCOV_EXCL_STOP */
-}
\ No newline at end of file
+}
+
index 174b1a7..df933d8 100755 (executable)
@@ -255,11 +255,10 @@ bool nfc_p2p_is_supported_ac_type(nfc_ac_type_e carrier)
        if (carrier == NFC_AC_TYPE_BT)
                _is_support_ac_type = true;
 
-       if (_is_support_ac_type) {
+       if (_is_support_ac_type)
                set_last_result(NFC_ERROR_NONE);
-       } else {
+       else
                set_last_result(NFC_ERROR_NOT_SUPPORTED);
-       }
 
        return _is_support_ac_type;
        /* LCOV_EXCL_STOP */