Add internal API for NFC HCE operation 55/72255/1 accepted/tizen/common/20160603.150535 accepted/tizen/common/20160606.141617 accepted/tizen/ivi/20160606.121058 accepted/tizen/mobile/20160606.120709 accepted/tizen/tv/20160606.120853 accepted/tizen/wearable/20160606.121021 submit/tizen/20160602.020711 submit/tizen/20160603.011501
authorJihoon Jung <jh8801.jung@samsung.com>
Tue, 31 May 2016 08:45:58 +0000 (17:45 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Tue, 31 May 2016 08:46:42 +0000 (17:46 +0900)
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
Change-Id: I321de7780744f217f82fdd7d6fe932e525ed9c2a

include/nfc_internal.h
src/nfc_card_emulation.c

index 87d56f7..03966c3 100755 (executable)
@@ -119,6 +119,8 @@ typedef void (*nfc_p2p_connection_handover_completed_cb)(nfc_error_e result, nfc
  */
 typedef void (*nfc_connection_handover_event_cb)(nfc_error_e result, nfc_handover_event_e event, nfc_ac_type_e carrier, char *address, nfc_ndef_message_h msg, void *user_data);
 
+typedef bool (*nfc_se_registered_handler_cb)(const char *handler, int count,
+        void *user_data);
 
 /**
  * @brief NFC Connection handover between NFC peer-to-peer target
@@ -556,8 +558,9 @@ int nfc_manager_initialize_sync(void);
  */
 int nfc_se_get_registered_aids_count(nfc_se_type_e se_type, nfc_card_emulation_category_type_e category, int *count);
 
-int nfc_se_get_conflict_handlers_internal(const char *package, nfc_card_emulation_category_type_e category,
-                       const char *aid, char ***handlers);
+int nfc_se_get_conflict_handlers_internal(const char *package, nfc_card_emulation_category_type_e category, const char *aid, char ***handlers);
+
+int nfc_se_foreach_registered_handlers(nfc_card_emulation_category_type_e category, nfc_se_registered_handler_cb callback, void *user_data);
 
 #ifdef __cplusplus
 }
index 8e844f4..a0b9ba6 100755 (executable)
@@ -381,9 +381,10 @@ int nfc_se_get_registered_aids_count(nfc_se_type_e se_type, nfc_card_emulation_c
        /* LCOV_EXCL_START */
        CHECK_INIT();
        CHECK_INVALID(count == NULL);
+       CHECK_ACTIVATED();
 
        result = net_nfc_client_se_get_registered_aids_count_sync(
-                       (net_nfc_se_type_e)NFC_SE_TYPE_HCE,
+                       (net_nfc_se_type_e)se_type,
                        (net_nfc_card_emulation_category_t)category,
                        (size_t *)count);
 
@@ -466,6 +467,24 @@ int nfc_se_remove_route_for_aid_internal(const char* pkg_name, const char *aid)
        /* LCOV_EXCL_STOP */
 }
 
+int nfc_se_foreach_registered_handlers(
+       nfc_card_emulation_category_type_e category,
+       nfc_se_registered_handler_cb callback, void *user_data)
+{
+       net_nfc_error_e result;
+
+       LOG_BEGIN();
+
+       CHECK_SUPPORTED(NFC_CE_HCE_FEATURE);
+       CHECK_INIT();
+       CHECK_INVALID(callback == NULL);
+
+       result = net_nfc_client_se_foreach_registered_handlers_sync(category,
+               callback, user_data);
+
+       return nfc_common_convert_error_code(__func__, result);
+}
+
 int nfc_se_set_preferred_handler()
 {
        net_nfc_error_e result;