From: Youngjae Shin Date: Thu, 29 Aug 2013 01:11:16 +0000 (+0900) Subject: code cleanup X-Git-Tag: submit/tizen/20130830.071135~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df2fac2b5970b47b8fd68fdbc320fc599de45329;p=platform%2Fcore%2Fconnectivity%2Fnfc-manager.git code cleanup remove test functions Change-Id: I975eadf8c3e865f95f8f8be96ae9cf7810684ccb --- diff --git a/client/include/net_nfc.h b/client/include/net_nfc.h index a6ab8dc..454332d 100644 --- a/client/include/net_nfc.h +++ b/client/include/net_nfc.h @@ -17,6 +17,10 @@ #ifndef __NET_NFC_H__ #define __NET_NFC_H__ +#ifdef __cplusplus +extern "C" { +#endif + #include "net_nfc_typedef.h" #include "net_nfc_data.h" #include "net_nfc_target_info.h" @@ -40,6 +44,9 @@ #include "net_nfc_client_tag_felica.h" #include "net_nfc_client_tag_jewel.h" #include "net_nfc_client_tag_mifare.h" -#include "net_nfc_client_test.h" + +#ifdef __cplusplus +} +#endif #endif //__NET_NFC_H__ diff --git a/client/include/net_nfc_client_context.h b/client/include/net_nfc_client_context.h index 36b9864..b7c556e 100644 --- a/client/include/net_nfc_client_context.h +++ b/client/include/net_nfc_client_context.h @@ -18,10 +18,6 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif - #define NET_NFC_SERVICE_EMPTY_TYPE \ "http://tizen.org/appcontrol/operation/nfc/empty" #define NET_NFC_SERVICE_WELL_KNOWN_TYPE \ @@ -42,8 +38,5 @@ net_nfc_error_e net_nfc_client_is_nfc_supported(int *state); net_nfc_error_e net_nfc_client_get_nfc_state(int *state); -#ifdef __cplusplus -} -#endif #endif //__NET_NFC_CLIENT_CONTEXT_H__ diff --git a/client/include/net_nfc_client_handover.h b/client/include/net_nfc_client_handover.h index 2cb2bbb..ef5681f 100644 --- a/client/include/net_nfc_client_handover.h +++ b/client/include/net_nfc_client_handover.h @@ -18,10 +18,6 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef void (*net_nfc_p2p_connection_handover_completed_cb)( net_nfc_error_e result, net_nfc_conn_handover_carrier_type_e carrier, @@ -61,8 +57,4 @@ net_nfc_error_e net_nfc_client_handover_init(void); void net_nfc_client_handover_deinit(void); -#ifdef __cplusplus -} -#endif - #endif //__NET_NFC_CLIENT_HANDOVER_H__ diff --git a/client/include/net_nfc_client_llcp.h b/client/include/net_nfc_client_llcp.h index d52a3fc..cc559a7 100644 --- a/client/include/net_nfc_client_llcp.h +++ b/client/include/net_nfc_client_llcp.h @@ -18,10 +18,6 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef void (*net_nfc_client_llcp_config_completed) (net_nfc_error_e result, void *user_data); @@ -60,10 +56,8 @@ typedef void (*net_nfc_client_llcp_close_completed) (net_nfc_error_e result, net_nfc_llcp_socket_t client_socket, void *user_data); -typedef void (*net_nfc_client_llcp_disconnect_completed) ( - net_nfc_error_e result, - net_nfc_llcp_socket_t client_socket, - void *user_data); +typedef void (*net_nfc_client_llcp_disconnect_completed)(net_nfc_error_e result, + net_nfc_llcp_socket_t client_socket, void *user_data); net_nfc_error_e net_nfc_client_llcp_config(net_nfc_llcp_config_info_h config, net_nfc_client_llcp_config_completed callback, @@ -244,22 +238,13 @@ net_nfc_error_e net_nfc_client_llcp_create_socket_option_default( net_nfc_llcp_socket_option_h *option); net_nfc_error_e net_nfc_client_llcp_connect_sap(net_nfc_llcp_socket_t socket, - sap_t sap, - net_nfc_client_llcp_connect_sap_completed callback, - void *user_data); + sap_t sap, net_nfc_client_llcp_connect_sap_completed callback, void *user_data); net_nfc_error_e net_nfc_client_llcp_connect_sap_sync( - net_nfc_llcp_socket_t socket, - sap_t sap, - net_nfc_llcp_socket_t *out_socket); - + net_nfc_llcp_socket_t socket, sap_t sap, net_nfc_llcp_socket_t *out_socket); net_nfc_error_e net_nfc_client_llcp_init(void); void net_nfc_client_llcp_deinit(void); -#ifdef __cplusplus -} -#endif - #endif //__NET_NFC_CLIENT_LLCP_H__ diff --git a/client/include/net_nfc_client_manager.h b/client/include/net_nfc_client_manager.h index 1d5d535..4fb5a55 100644 --- a/client/include/net_nfc_client_manager.h +++ b/client/include/net_nfc_client_manager.h @@ -18,10 +18,6 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef void (*net_nfc_client_manager_set_active_completed)( net_nfc_error_e result, void *user_data); @@ -53,15 +49,12 @@ net_nfc_error_e net_nfc_client_manager_get_server_state( net_nfc_error_e net_nfc_client_manager_get_server_state_sync( unsigned int *state); +bool net_nfc_client_manager_is_activated(void); + /* TODO : move to internal header */ net_nfc_error_e net_nfc_client_manager_init(void); void net_nfc_client_manager_deinit(void); -bool net_nfc_client_manager_is_activated(); - -#ifdef __cplusplus -} -#endif #endif //__NET_NFC_CLIENT_MANAGER_H__ diff --git a/client/include/net_nfc_client_ndef.h b/client/include/net_nfc_client_ndef.h index 950ac1c..68791e7 100644 --- a/client/include/net_nfc_client_ndef.h +++ b/client/include/net_nfc_client_ndef.h @@ -18,10 +18,6 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef void (*net_nfc_client_ndef_read_completed) (net_nfc_error_e result, ndef_message_h message, void *user_data); @@ -73,8 +69,4 @@ net_nfc_error_e net_nfc_client_ndef_init(void); void net_nfc_client_ndef_deinit(void); -#ifdef __cplusplus -} -#endif - #endif //__NET_NFC_CLIENT_NDEF_H__ diff --git a/client/include/net_nfc_client_p2p.h b/client/include/net_nfc_client_p2p.h index cb35a1d..6ebdef3 100644 --- a/client/include/net_nfc_client_p2p.h +++ b/client/include/net_nfc_client_p2p.h @@ -18,10 +18,6 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif - /* p2p callbacks */ typedef void (*net_nfc_client_p2p_send_completed)(net_nfc_error_e result, @@ -73,8 +69,4 @@ net_nfc_error_e net_nfc_client_p2p_init(void); void net_nfc_client_p2p_deinit(void); -#ifdef __cplusplus -} -#endif - #endif //__NET_NFC_CLIENT_P2P_H__ diff --git a/client/include/net_nfc_client_se.h b/client/include/net_nfc_client_se.h index e1039b2..4ea3115 100644 --- a/client/include/net_nfc_client_se.h +++ b/client/include/net_nfc_client_se.h @@ -19,10 +19,6 @@ #include #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif - /*************Secure Element Callbacks*********/ typedef void (*net_nfc_se_set_se_cb)( net_nfc_error_e result, @@ -64,27 +60,22 @@ typedef void (*net_nfc_client_se_ese_detected_event)( /************* Secure Element API's*************/ net_nfc_error_e net_nfc_client_se_set_secure_element_type( - net_nfc_se_type_e se_type, - net_nfc_se_set_se_cb callback, - void *user_data); + net_nfc_se_type_e se_type, net_nfc_se_set_se_cb callback, void *user_data); net_nfc_error_e net_nfc_client_se_set_secure_element_type_sync( - net_nfc_se_type_e se_type); + net_nfc_se_type_e se_type); -net_nfc_error_e net_nfc_client_se_get_secure_element_type( - void *user_data); +net_nfc_error_e net_nfc_client_se_get_secure_element_type(void *user_data); net_nfc_error_e net_nfc_client_se_get_secure_element_type_sync( - gint *se_type); + gint *se_type); net_nfc_error_e net_nfc_client_se_open_internal_secure_element( - net_nfc_se_type_e se_type, - net_nfc_se_open_se_cb callback, - void *user_data); + net_nfc_se_type_e se_type, net_nfc_se_open_se_cb callback, void *user_data); net_nfc_error_e net_nfc_client_se_open_internal_secure_element_sync( @@ -129,19 +120,17 @@ net_nfc_error_e net_nfc_client_se_send_apdu_sync( /************* Secure Element CallBack Register/Deregister functions*************/ void net_nfc_client_se_set_ese_detection_cb( - net_nfc_client_se_ese_detected_event callback, - void *user_data); + net_nfc_client_se_ese_detected_event callback, void *user_data); void net_nfc_client_se_unset_ese_detection_cb(void); void net_nfc_client_se_set_transaction_event_cb( - net_nfc_client_se_transaction_event callback, - void *user_data); + net_nfc_client_se_transaction_event callback, void *user_data); void net_nfc_client_se_unset_transaction_event_cb(void); void net_nfc_client_se_set_event_cb(net_nfc_client_se_event callback, - void *user_data); + void *user_data); void net_nfc_client_se_unset_event_cb(void); @@ -151,11 +140,7 @@ void net_nfc_client_se_unset_event_cb(void); net_nfc_error_e net_nfc_client_se_init(void); - void net_nfc_client_se_deinit(void); -#ifdef __cplusplus -} -#endif #endif //__NET_NFC_CLIENT_SE_H__ diff --git a/client/include/net_nfc_client_snep.h b/client/include/net_nfc_client_snep.h index a822ee6..3fb918f 100644 --- a/client/include/net_nfc_client_snep.h +++ b/client/include/net_nfc_client_snep.h @@ -18,70 +18,59 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*net_nfc_client_snep_event_cb) ( - net_nfc_snep_handle_h target, - net_nfc_snep_type_t event, - net_nfc_error_e result, - ndef_message_h msg, - void *user_data); +typedef void (*net_nfc_client_snep_event_cb)( + net_nfc_snep_handle_h target, + net_nfc_snep_type_t event, + net_nfc_error_e result, + ndef_message_h msg, + void *user_data); net_nfc_error_e net_nfc_client_snep_start_server( - net_nfc_target_handle_h target, - const char *san, - sap_t sap, - net_nfc_client_snep_event_cb callback, - void *user_data); + net_nfc_target_handle_h target, + const char *san, + sap_t sap, + net_nfc_client_snep_event_cb callback, + void *user_data); net_nfc_error_e net_nfc_client_snep_start_client( - net_nfc_target_handle_h target, - const char *san, - sap_t sap, - net_nfc_client_snep_event_cb callback, - void *user_data); + net_nfc_target_handle_h target, + const char *san, + sap_t sap, + net_nfc_client_snep_event_cb callback, + void *user_data); net_nfc_error_e net_nfc_client_snep_send_client_request( - net_nfc_snep_handle_h handle, - net_nfc_snep_type_t snep_type, - ndef_message_h msg, - net_nfc_client_snep_event_cb callback, - void *user_data); + net_nfc_snep_handle_h handle, + net_nfc_snep_type_t snep_type, + ndef_message_h msg, + net_nfc_client_snep_event_cb callback, + void *user_data); net_nfc_error_e net_nfc_client_snep_send_client_request_sync( - net_nfc_target_handle_h target, - net_nfc_snep_type_t snep_type, - ndef_message_h msg, - net_nfc_snep_type_t *resp_type, - ndef_message_h *response); + net_nfc_target_handle_h target, + net_nfc_snep_type_t snep_type, + ndef_message_h msg, + net_nfc_snep_type_t *resp_type, + ndef_message_h *response); net_nfc_error_e net_nfc_client_snep_stop_service( - net_nfc_target_handle_h target, - net_nfc_snep_handle_h service, - net_nfc_client_snep_event_cb callback, - void *user_data); + net_nfc_target_handle_h target, + net_nfc_snep_handle_h service, + net_nfc_client_snep_event_cb callback, + void *user_data); net_nfc_error_e net_nfc_client_snep_stop_service_sync( - net_nfc_target_handle_h target, - net_nfc_snep_handle_h service); + net_nfc_target_handle_h target, net_nfc_snep_handle_h service); -net_nfc_error_e net_nfc_client_snep_register_server(const char *san, - sap_t sap, - net_nfc_client_snep_event_cb callback, - void *user_data); +net_nfc_error_e net_nfc_client_snep_register_server(const char *san, sap_t sap, + net_nfc_client_snep_event_cb callback, void *user_data); net_nfc_error_e net_nfc_client_snep_unregister_server(const char *san, - sap_t sap); + sap_t sap); /* TODO : move to internal header */ net_nfc_error_e net_nfc_client_snep_init(void); void net_nfc_client_snep_deinit(void); -#ifdef __cplusplus -} -#endif - #endif //__NET_NFC_CLIENT_SNEP_H__ diff --git a/client/include/net_nfc_client_system_handler.h b/client/include/net_nfc_client_system_handler.h index ceb4cf5..e928c38 100644 --- a/client/include/net_nfc_client_system_handler.h +++ b/client/include/net_nfc_client_system_handler.h @@ -18,10 +18,6 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef void (*net_nfc_client_popup_set_state_callback)( net_nfc_error_e result, void *user_data); @@ -50,8 +46,4 @@ net_nfc_error_e net_nfc_client_sys_handler_init(void); void net_nfc_client_sys_handler_deinit(void); -#ifdef __cplusplus -} -#endif - #endif //__NET_NFC_CLIENT_SYSTEM_HANDLER_H__ diff --git a/client/include/net_nfc_client_tag.h b/client/include/net_nfc_client_tag.h index cff9086..37572cf 100644 --- a/client/include/net_nfc_client_tag.h +++ b/client/include/net_nfc_client_tag.h @@ -18,61 +18,46 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif +typedef void (*net_nfc_client_tag_is_tag_connected_completed)( + net_nfc_error_e result, net_nfc_target_type_e dev_type, void *user_data); -typedef void (*net_nfc_client_tag_is_tag_connected_completed) ( - net_nfc_error_e result, - net_nfc_target_type_e dev_type, - void *user_data); +typedef void (*net_nfc_client_tag_get_current_tag_info_completed)( + net_nfc_error_e result, net_nfc_target_info_h info, void *user_data); -typedef void (*net_nfc_client_tag_get_current_tag_info_completed) ( - net_nfc_error_e result, - net_nfc_target_info_h info, - void *user_data); +typedef void (*net_nfc_client_tag_get_current_target_handle_completed)( + net_nfc_error_e result, net_nfc_target_handle_h handle, void *user_data); -typedef void (*net_nfc_client_tag_get_current_target_handle_completed) ( - net_nfc_error_e result, - net_nfc_target_handle_h handle, - void *user_data); - -typedef void (*net_nfc_client_tag_tag_discovered) (net_nfc_target_info_h info, - void *user_data); +typedef void (*net_nfc_client_tag_tag_discovered)(net_nfc_target_info_h info, + void *user_data); -typedef void (*net_nfc_client_tag_tag_detached) (void *user_data); +typedef void (*net_nfc_client_tag_tag_detached)(void *user_data); net_nfc_error_e net_nfc_client_tag_is_tag_connected( - net_nfc_client_tag_is_tag_connected_completed callback, - void *user_data); + net_nfc_client_tag_is_tag_connected_completed callback, void *user_data); net_nfc_error_e net_nfc_client_tag_is_tag_connected_sync( - net_nfc_target_type_e *dev_type); + net_nfc_target_type_e *dev_type); net_nfc_error_e net_nfc_client_tag_get_current_tag_info( - net_nfc_client_tag_get_current_tag_info_completed callback, - void *user_data); + net_nfc_client_tag_get_current_tag_info_completed callback, void *user_data); net_nfc_error_e net_nfc_client_tag_get_current_tag_info_sync( - net_nfc_target_info_h *info); + net_nfc_target_info_h *info); net_nfc_error_e net_nfc_client_tag_get_current_target_handle( - net_nfc_client_tag_get_current_target_handle_completed callback, - void *user_data); + net_nfc_client_tag_get_current_target_handle_completed callback, void *user_data); net_nfc_error_e net_nfc_client_tag_get_current_target_handle_sync( - net_nfc_target_handle_h *handle); + net_nfc_target_handle_h *handle); void net_nfc_client_tag_set_tag_discovered( - net_nfc_client_tag_tag_discovered callback, - void *user_data); + net_nfc_client_tag_tag_discovered callback, void *user_data); void net_nfc_client_tag_unset_tag_discovered(void); void net_nfc_client_tag_set_tag_detached( - net_nfc_client_tag_tag_detached callback, - void *user_data); + net_nfc_client_tag_tag_detached callback, void *user_data); void net_nfc_client_tag_unset_tag_detached(void); @@ -85,8 +70,4 @@ net_nfc_error_e net_nfc_client_tag_init(void); void net_nfc_client_tag_deinit(void); -#ifdef __cplusplus -} -#endif - #endif //__NET_NFC_CLIENT_TAG_H__ diff --git a/client/include/net_nfc_client_tag_felica.h b/client/include/net_nfc_client_tag_felica.h index b430ecc..1796dc3 100644 --- a/client/include/net_nfc_client_tag_felica.h +++ b/client/include/net_nfc_client_tag_felica.h @@ -19,10 +19,6 @@ #include "net_nfc_typedef.h" #include "net_nfc_client_transceive.h" -#ifdef __cplusplus -extern "C" { -#endif - /** @addtogroup NET_NFC_MANAGER_TAG @@ -257,10 +253,4 @@ net_nfc_error_e net_nfc_client_felica_request_system_code( @} */ - -#ifdef __cplusplus -} -#endif - - #endif //__NET_NFC_CLIENT_TAG_FELICA_H__ diff --git a/client/include/net_nfc_client_tag_jewel.h b/client/include/net_nfc_client_tag_jewel.h index 0bfec95..90226b5 100644 --- a/client/include/net_nfc_client_tag_jewel.h +++ b/client/include/net_nfc_client_tag_jewel.h @@ -19,10 +19,6 @@ #include "net_nfc_typedef.h" #include "net_nfc_client_transceive.h" -#ifdef __cplusplus -extern "C" { -#endif - /** @addtogroup NET_NFC_MANAGER_TAG @@ -51,8 +47,7 @@ extern "C" { */ net_nfc_error_e net_nfc_client_jewel_read_id(net_nfc_target_handle_h handle, - nfc_transceive_data_callback callback, - void *user_data); + nfc_transceive_data_callback callback, void *user_data); /** read one byte of specific address . @@ -80,10 +75,7 @@ net_nfc_error_e net_nfc_client_jewel_read_id(net_nfc_target_handle_h handle, */ net_nfc_error_e net_nfc_client_jewel_read_byte(net_nfc_target_handle_h handle, - uint8_t block, - uint8_t byte, - nfc_transceive_data_callback callback, - void *user_data); + uint8_t block, uint8_t byte, nfc_transceive_data_callback callback, void *user_data); /** read all byte from tag . @@ -110,8 +102,7 @@ net_nfc_error_e net_nfc_client_jewel_read_byte(net_nfc_target_handle_h handle, net_nfc_error_e net_nfc_client_jewel_read_all(net_nfc_target_handle_h handle, - nfc_transceive_data_callback callback, - void *user_data); + nfc_transceive_data_callback callback, void *user_data); /** @@ -193,10 +184,4 @@ net_nfc_error_e net_nfc_client_jewel_write_with_no_erase( @} */ - -#ifdef __cplusplus -} -#endif - - #endif //__NET_NFC_CLIENT_TAG_JEWEL_H__ diff --git a/client/include/net_nfc_client_tag_mifare.h b/client/include/net_nfc_client_tag_mifare.h index 618814e..2c975fd 100644 --- a/client/include/net_nfc_client_tag_mifare.h +++ b/client/include/net_nfc_client_tag_mifare.h @@ -18,11 +18,6 @@ #include "net_nfc_typedef.h" - -#ifdef __cplusplus -extern "C" { -#endif - /** @addtogroup NET_NFC_MANAGER_TAG @@ -138,9 +133,7 @@ net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyB( */ net_nfc_error_e net_nfc_client_mifare_read(net_nfc_target_handle_h handle, - uint8_t addr, - void *callback, - void *user_data); + uint8_t addr, void *callback, void *user_data); /** write block (16 byte) to addr. Only 4 bytes will be written when tag is @@ -235,10 +228,7 @@ net_nfc_error_e net_nfc_client_mifare_write_page( */ net_nfc_error_e net_nfc_client_mifare_increment(net_nfc_target_handle_h handle, - uint8_t addr, - int value, - void *callback, - void *user_data); + uint8_t addr, int value, void *callback, void *user_data); /** Decrease a value block, storing the result in the temporary block on the tag @@ -266,10 +256,7 @@ net_nfc_error_e net_nfc_client_mifare_increment(net_nfc_target_handle_h handle, */ net_nfc_error_e net_nfc_client_mifare_decrement(net_nfc_target_handle_h handle, - uint8_t addr, - int value, - void *callback, - void *user_data); + uint8_t addr, int value, void *callback, void *user_data); /** Copy from the temporary block to a value block. @@ -297,9 +284,7 @@ net_nfc_error_e net_nfc_client_mifare_decrement(net_nfc_target_handle_h handle, */ net_nfc_error_e net_nfc_client_mifare_transfer(net_nfc_target_handle_h handle, - uint8_t addr, - void *callback, - void *user_data); + uint8_t addr, void *callback, void *user_data); /** Copy from a value block to the temporary block. @@ -327,9 +312,7 @@ net_nfc_error_e net_nfc_client_mifare_transfer(net_nfc_target_handle_h handle, */ net_nfc_error_e net_nfc_client_mifare_restore(net_nfc_target_handle_h handle, - uint8_t addr, - void *callback, - void *user_data); + uint8_t addr, void *callback, void *user_data); /** create default factory key. The key is 0xff, 0xff, 0xff, 0xff, 0xff, 0xff @@ -387,8 +370,4 @@ net_nfc_error_e net_nfc_client_mifare_create_net_nfc_forum_key(data_h* key); @} */ -#ifdef __cplusplus -} -#endif - #endif //__NET_NFC_TAG_MIFARE_H__ diff --git a/client/include/net_nfc_client_test.h b/client/include/net_nfc_client_test.h deleted file mode 100644 index b90b958..0000000 --- a/client/include/net_nfc_client_test.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd. - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __NET_NFC_CLIENT_TEST_H__ -#define __NET_NFC_CLIENT_TEST_H__ - -#include "net_nfc_typedef.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*net_nfc_client_test_sim_test_completed) (net_nfc_error_e result, - void *user_data); - -typedef void (*net_nfc_client_test_prbs_test_completed) ( - net_nfc_error_e result, - void *user_data); - -typedef void (*net_nfc_client_test_get_firmware_version_completed) ( - net_nfc_error_e result, - char *version, - void *user_data); -typedef void (*net_nfc_client_test_set_ee_data_completed) ( - net_nfc_error_e result, - void *user_data); - - -net_nfc_error_e net_nfc_client_test_sim_test( - net_nfc_client_test_sim_test_completed callback, - void *user_data); - -net_nfc_error_e net_nfc_client_test_sim_test_sync(void); - -net_nfc_error_e net_nfc_client_test_prbs_test(uint32_t tech, - uint32_t rate, - net_nfc_client_test_prbs_test_completed callback, - void *user_data); - -net_nfc_error_e net_nfc_client_test_prbs_test_sync(uint32_t tech, - uint32_t rate); - -net_nfc_error_e net_nfc_client_test_get_firmware_version( - net_nfc_client_test_get_firmware_version_completed callback, - void *user_data); - -net_nfc_error_e net_nfc_client_test_get_firmware_version_sync(char **version); - -net_nfc_error_e net_nfc_client_test_set_ee_data(int mode, - int reg_id, - data_h data, - net_nfc_client_test_set_ee_data_completed callback, - void *user_data); - -net_nfc_error_e net_nfc_client_test_set_ee_data_sync(int mode, - int reg_id, - data_h data); - - -/* TODO : move to internal header */ -net_nfc_error_e net_nfc_client_test_init(void); - -void net_nfc_client_test_deinit(void); - -#ifdef __cplusplus -} -#endif - -#endif //__NET_NFC_CLIENT_TEST_H__ diff --git a/client/include/net_nfc_client_transceive.h b/client/include/net_nfc_client_transceive.h index 39f8cca..ced0e28 100644 --- a/client/include/net_nfc_client_transceive.h +++ b/client/include/net_nfc_client_transceive.h @@ -18,10 +18,6 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef void (* nfc_transceive_callback)(net_nfc_error_e result, void *user_data); @@ -30,30 +26,20 @@ typedef void (* nfc_transceive_data_callback)(net_nfc_error_e result, void *user_data); net_nfc_error_e net_nfc_client_transceive(net_nfc_target_handle_h handle, - data_h rawdata, - nfc_transceive_callback callback, - void *user_data); + data_h rawdata, nfc_transceive_callback callback, void *user_data); net_nfc_error_e net_nfc_client_transceive_data(net_nfc_target_handle_h handle, - data_h rawdata, - nfc_transceive_data_callback callback, - void *user_data); + data_h rawdata, nfc_transceive_data_callback callback, void *user_data); net_nfc_error_e net_nfc_client_transceive_sync(net_nfc_target_handle_h handle, data_h rawdata); net_nfc_error_e net_nfc_client_transceive_data_sync( - net_nfc_target_handle_h handle, - data_h rawdata, - data_h *response); + net_nfc_target_handle_h handle, data_h rawdata, data_h *response); /* TODO : move to internal header */ net_nfc_error_e net_nfc_client_transceive_init(void); void net_nfc_client_transceive_deinit(void); -#ifdef __cplusplus -} -#endif - #endif //__NET_NFC_CLIENT_TRANSCEIVE_H__ diff --git a/client/include/net_nfc_data.h b/client/include/net_nfc_data.h index 1a102ab..51c5266 100644 --- a/client/include/net_nfc_data.h +++ b/client/include/net_nfc_data.h @@ -18,11 +18,6 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif - - /** @addtogroup NET_NFC_MANAGER_INFO @@ -31,7 +26,7 @@ extern "C" { NFC Manager defines are defined in - @li @c #net_nfc_initialize Initialize the nfc device. + @li @c #net_nfc_client_initialize Initialize the nfc device. */ @@ -132,8 +127,5 @@ net_nfc_error_e net_nfc_free_data (data_h data); /** @} */ -#ifdef __cplusplus -} -#endif #endif //__NET_NFC_DATA_H__ diff --git a/client/include/net_nfc_ndef_message.h b/client/include/net_nfc_ndef_message.h index 04d9e27..dfb9cd6 100644 --- a/client/include/net_nfc_ndef_message.h +++ b/client/include/net_nfc_ndef_message.h @@ -18,11 +18,6 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif - - /** @addtogroup NET_NFC_MANAGER_NDEF @@ -31,7 +26,7 @@ extern "C" { NFC Manager defines are defined in - @li @c #net_nfc_initialize Initialize the nfc device. + @li @c #net_nfc_client_initialize Initialize the nfc device. */ @@ -433,9 +428,4 @@ net_nfc_error_e net_nfc_retrieve_current_ndef_message (ndef_message_h* ndef_mess @} */ - -#ifdef __cplusplus -} -#endif - #endif //__NET_NFC_NDEF_MESSAGE_H__ diff --git a/client/include/net_nfc_ndef_message_handover.h b/client/include/net_nfc_ndef_message_handover.h index b7d51d4..2453e16 100644 --- a/client/include/net_nfc_ndef_message_handover.h +++ b/client/include/net_nfc_ndef_message_handover.h @@ -18,10 +18,6 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif - /** This function create wifi configure handler instance. @@ -408,10 +404,4 @@ net_nfc_error_e net_nfc_create_handover_select_message (ndef_message_h * message */ net_nfc_error_e net_nfc_create_handover_error_record (ndef_record_h * record, uint8_t reason, uint32_t data); - -#ifdef __cplusplus -} -#endif - - #endif //__NET_NFC_NDEF_MESSAGE_HANDOVER_H__ diff --git a/client/include/net_nfc_ndef_record.h b/client/include/net_nfc_ndef_record.h index 0e28fa2..165349f 100644 --- a/client/include/net_nfc_ndef_record.h +++ b/client/include/net_nfc_ndef_record.h @@ -18,11 +18,6 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif - - /** @addtogroup NET_NFC_MANAGER_RECORD @@ -113,7 +108,9 @@ uint8_t net_nfc_get_record_sr (uint8_t flag); } @endcode */ -net_nfc_error_e net_nfc_create_record(ndef_record_h* record, net_nfc_record_tnf_e tnf, data_h typeName, data_h id, data_h payload ); +net_nfc_error_e net_nfc_create_record(ndef_record_h* record, + net_nfc_record_tnf_e tnf, data_h typeName, data_h id, + data_h payload ); /** @@ -149,7 +146,8 @@ net_nfc_error_e net_nfc_create_record(ndef_record_h* record, net_nfc_record_tnf_ @endcode */ -net_nfc_error_e net_nfc_create_text_type_record(ndef_record_h* record, const char* text, const char* language_code_str, net_nfc_encode_type_e encode); +net_nfc_error_e net_nfc_create_text_type_record(ndef_record_h* record, + const char* text, const char* language_code_str, net_nfc_encode_type_e encode); /** this function helps to create URI type payload @@ -177,7 +175,8 @@ net_nfc_error_e net_nfc_create_text_type_record(ndef_record_h* record, const cha @endcode */ -net_nfc_error_e net_nfc_create_uri_type_record(ndef_record_h* record, const char * uri, net_nfc_schema_type_e protocol_schema); +net_nfc_error_e net_nfc_create_uri_type_record(ndef_record_h* record, + const char *uri, net_nfc_schema_type_e protocol_schema); /** this function is getter of record payload. @@ -192,7 +191,8 @@ net_nfc_error_e net_nfc_create_uri_type_record(ndef_record_h* record, const char @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illigal NULL pointer(s) */ -net_nfc_error_e net_nfc_get_record_payload (ndef_record_h record, data_h * payload); +net_nfc_error_e net_nfc_get_record_payload (ndef_record_h record, + data_h *payload); /** this function is getter of record type. @@ -236,7 +236,8 @@ net_nfc_error_e net_nfc_get_record_id (ndef_record_h record, data_h * id); */ -net_nfc_error_e net_nfc_get_record_tnf(ndef_record_h record, net_nfc_record_tnf_e * tnf); +net_nfc_error_e net_nfc_get_record_tnf(ndef_record_h record, + net_nfc_record_tnf_e *tnf); /** this function is getter of record flags. @@ -311,7 +312,8 @@ net_nfc_error_e net_nfc_free_record (ndef_record_h record); */ -net_nfc_error_e net_nfc_create_text_string_from_text_record(ndef_record_h record, char** buffer); +net_nfc_error_e net_nfc_create_text_string_from_text_record( + ndef_record_h record, char** buffer); /** this function get language code from text record. (ex: US-en) @@ -326,7 +328,8 @@ net_nfc_error_e net_nfc_create_text_string_from_text_record(ndef_record_h record */ -net_nfc_error_e net_nfc_get_languange_code_string_from_text_record (ndef_record_h record, char** lang_code_str); +net_nfc_error_e net_nfc_get_languange_code_string_from_text_record( + ndef_record_h record, char** lang_code_str); /** @@ -342,7 +345,8 @@ net_nfc_error_e net_nfc_get_languange_code_string_from_text_record (ndef_record_ */ -net_nfc_error_e net_nfc_get_encoding_type_from_text_record(ndef_record_h record, net_nfc_encode_type_e * encoding); +net_nfc_error_e net_nfc_get_encoding_type_from_text_record( + ndef_record_h record, net_nfc_encode_type_e * encoding); /** @@ -358,11 +362,7 @@ net_nfc_error_e net_nfc_get_encoding_type_from_text_record(ndef_record_h record, */ -net_nfc_error_e net_nfc_create_uri_string_from_uri_record(ndef_record_h record, char ** uri); - -#ifdef __cplusplus -} -#endif - +net_nfc_error_e net_nfc_create_uri_string_from_uri_record( + ndef_record_h record, char ** uri); #endif //__NET_NFC_NDEF_RECORD_H__ diff --git a/client/include/net_nfc_sign_record.h b/client/include/net_nfc_sign_record.h index 51a36aa..6a19314 100644 --- a/client/include/net_nfc_sign_record.h +++ b/client/include/net_nfc_sign_record.h @@ -18,12 +18,6 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" -{ -#endif - - /** @addtogroup NET_NFC_MANAGER_RECORD @@ -58,7 +52,8 @@ extern "C" net_nfc_sign_records(msg, 0, 1, "/tmp/cert.p12", "abcdef"); @endcode */ -net_nfc_error_e net_nfc_sign_records(ndef_message_h msg, int begin_index, int end_index, char *cert_file, char *password); +net_nfc_error_e net_nfc_sign_records(ndef_message_h msg, int begin_index, + int end_index, char *cert_file, char *password); /** this function make the signature of whole records in NDEF message @@ -81,7 +76,8 @@ net_nfc_error_e net_nfc_sign_records(ndef_message_h msg, int begin_index, int en net_nfc_sign_ndef_message(msg, "/tmp/cert.p12", "abcdef"); @endcode */ -net_nfc_error_e net_nfc_sign_ndef_message(ndef_message_h msg, char *cert_file, char *password); +net_nfc_error_e net_nfc_sign_ndef_message(ndef_message_h msg, char *cert_file, + char *password); /** This function does verify signature of records @@ -112,7 +108,8 @@ net_nfc_error_e net_nfc_sign_ndef_message(ndef_message_h msg, char *cert_file, c return (error == NET_NFC_OK); @endcode */ -net_nfc_error_e net_nfc_verify_signature_records(ndef_record_h begin_record, ndef_record_h sign_record); +net_nfc_error_e net_nfc_verify_signature_records(ndef_record_h begin_record, + ndef_record_h sign_record); /** This function does verify signature in NDEF message @@ -140,9 +137,4 @@ net_nfc_error_e net_nfc_verify_signature_records(ndef_record_h begin_record, nde */ net_nfc_error_e net_nfc_verify_signature_ndef_message(ndef_message_h msg); -#ifdef __cplusplus -} -#endif - - #endif //__NET_NFC_SIGN_RECORD_H__ diff --git a/client/include/net_nfc_target_info.h b/client/include/net_nfc_target_info.h index 19aef2d..77cb39d 100644 --- a/client/include/net_nfc_target_info.h +++ b/client/include/net_nfc_target_info.h @@ -18,10 +18,6 @@ #include "net_nfc_typedef.h" -#ifdef __cplusplus -extern "C" { -#endif - /** @addtogroup NET_NFC_MANAGER_INFO @@ -53,7 +49,8 @@ extern "C" { */ -net_nfc_error_e net_nfc_get_tag_type (net_nfc_target_info_h target_info, net_nfc_target_type_e * type); +net_nfc_error_e net_nfc_get_tag_type (net_nfc_target_info_h target_info, + net_nfc_target_type_e * type); /** type getter from targte info handler @@ -70,7 +67,8 @@ net_nfc_error_e net_nfc_get_tag_type (net_nfc_target_info_h target_info, net_nfc */ -net_nfc_error_e net_nfc_get_tag_handle(net_nfc_target_info_h target_info, net_nfc_target_handle_h * handle); +net_nfc_error_e net_nfc_get_tag_handle(net_nfc_target_info_h target_info, + net_nfc_target_handle_h * handle); /** this API returns the NDEF support boolean value. @@ -88,7 +86,8 @@ net_nfc_error_e net_nfc_get_tag_handle(net_nfc_target_info_h target_info, net_nf */ -net_nfc_error_e net_nfc_get_tag_ndef_support (net_nfc_target_info_h target_info, bool * is_support); +net_nfc_error_e net_nfc_get_tag_ndef_support (net_nfc_target_info_h target_info, + bool * is_support); /** The max size getter from targte info handler. This max size indicates the maximum size of NDEF message that can be stored in this detected tag. @@ -105,7 +104,8 @@ net_nfc_error_e net_nfc_get_tag_ndef_support (net_nfc_target_info_h target_info, */ -net_nfc_error_e net_nfc_get_tag_max_data_size (net_nfc_target_info_h target_info, uint32_t * max_size); +net_nfc_error_e net_nfc_get_tag_max_data_size (net_nfc_target_info_h target_info, + uint32_t * max_size); /** this function return the actual NDEF message size that stored in the tag @@ -122,7 +122,8 @@ net_nfc_error_e net_nfc_get_tag_max_data_size (net_nfc_target_info_h target_info */ -net_nfc_error_e net_nfc_get_tag_actual_data_size (net_nfc_target_info_h target_info, uint32_t * actual_data); +net_nfc_error_e net_nfc_get_tag_actual_data_size( + net_nfc_target_info_h target_info, uint32_t * actual_data); /** @@ -172,7 +173,8 @@ net_nfc_error_e net_nfc_get_tag_actual_data_size (net_nfc_target_info_h target_i */ -net_nfc_error_e net_nfc_get_tag_info_keys(net_nfc_target_info_h target_info, char ***keys, int* number_of_keys); +net_nfc_error_e net_nfc_get_tag_info_keys(net_nfc_target_info_h target_info, + char ***keys, int* number_of_keys); /** this function return value which is matched key @@ -219,7 +221,8 @@ net_nfc_error_e net_nfc_get_tag_info_keys(net_nfc_target_info_h target_info, cha @exception NET_NFC_NO_DATA_FOUND No data is returned */ -net_nfc_error_e net_nfc_get_tag_info_value(net_nfc_target_info_h target_info, const char* key, data_h* value); +net_nfc_error_e net_nfc_get_tag_info_value(net_nfc_target_info_h target_info, + const char* key, data_h* value); /** Duplicate a handle of target information @@ -256,7 +259,8 @@ net_nfc_error_e net_nfc_get_tag_info_value(net_nfc_target_info_h target_info, co @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s) */ -net_nfc_error_e net_nfc_duplicate_target_info(net_nfc_target_info_h origin, net_nfc_target_info_h *result); +net_nfc_error_e net_nfc_duplicate_target_info(net_nfc_target_info_h origin, + net_nfc_target_info_h *result); /** After using net_nfc_target_info_h handle, you should release its resource by this function. @@ -291,10 +295,4 @@ net_nfc_error_e net_nfc_release_tag_info(net_nfc_target_info_h target_info); @} */ - -#ifdef __cplusplus -} -#endif - - #endif //__NET_NFC_TARGET_INFO_H__ diff --git a/client/net_nfc_client.c b/client/net_nfc_client.c index 2d0e476..449fd12 100644 --- a/client/net_nfc_client.c +++ b/client/net_nfc_client.c @@ -31,7 +31,6 @@ #include "net_nfc_client_llcp.h" #include "net_nfc_client_snep.h" #include "net_nfc_client_p2p.h" -#include "net_nfc_client_test.h" #include "net_nfc_client_system_handler.h" #include "net_nfc_client_handover.h" @@ -98,8 +97,6 @@ void net_nfc_client_gdbus_init(void) return; if (net_nfc_client_se_init() != NET_NFC_OK) return; - if (net_nfc_client_test_init() != NET_NFC_OK) - return; if(net_nfc_client_handover_init() != NET_NFC_OK) return; } @@ -107,7 +104,6 @@ void net_nfc_client_gdbus_init(void) void net_nfc_client_gdbus_deinit(void) { net_nfc_client_handover_deinit(); - net_nfc_client_test_deinit(); net_nfc_client_se_deinit(); net_nfc_client_sys_handler_deinit(); net_nfc_client_p2p_deinit(); diff --git a/client/net_nfc_client.h b/client/net_nfc_client.h index 107cdd9..70ea5e8 100644 --- a/client/net_nfc_client.h +++ b/client/net_nfc_client.h @@ -18,19 +18,11 @@ #include -#ifdef __cplusplus -extern "C" { -#endif -/* TODO : change to internal header */ void net_nfc_client_gdbus_init(void); void net_nfc_client_gdbus_deinit(void); GVariant *net_nfc_client_gdbus_get_privilege(); -#ifdef __cplusplus -} -#endif - #endif //__NET_NFC_CLIENT_H__ diff --git a/client/net_nfc_client_test.c b/client/net_nfc_client_test.c deleted file mode 100644 index d4eb0f4..0000000 --- a/client/net_nfc_client_test.c +++ /dev/null @@ -1,526 +0,0 @@ -/* - * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd. - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "net_nfc_debug_internal.h" -#include "net_nfc_util_gdbus_internal.h" -#include "net_nfc_gdbus.h" -#include "net_nfc_client.h" -#include "net_nfc_client_manager.h" -#include "net_nfc_client_test.h" - -typedef struct _TestFuncData TestFuncData; - -struct _TestFuncData -{ - gpointer callback; - gpointer user_data; -}; - -static void test_call_sim_test_callback(GObject *source_object, - GAsyncResult *res, - gpointer user_data); - -static void test_call_prbs_test_callback(GObject *source_object, - GAsyncResult *res, - gpointer user_data); - -static void test_call_get_firmware_version_callback(GObject *source_object, - GAsyncResult *res, - gpointer user_data); - -static void test_call_set_ee_data_callback(GObject *source_object, - GAsyncResult *res, - gpointer user_data); - -static NetNfcGDbusTest *test_proxy = NULL; - - -static void test_call_sim_test_callback(GObject *source_object, - GAsyncResult *res, - gpointer user_data) -{ - TestFuncData *func_data; - - net_nfc_error_e out_result = NET_NFC_OK; - GError *error = NULL; - - net_nfc_client_test_sim_test_completed callback; - gpointer data; - - if (net_nfc_gdbus_test_call_sim_test_finish( - NET_NFC_GDBUS_TEST(source_object), - (gint *)&out_result, - res, - &error) == FALSE) - { - - out_result = NET_NFC_UNKNOWN_ERROR; - - DEBUG_ERR_MSG("Can not finish sim_test: %s", - error->message); - g_error_free(error); - } - - func_data = user_data; - if (func_data == NULL) - return; - - if (func_data->callback == NULL) - { - g_free(func_data); - return; - } - - callback = (net_nfc_client_test_sim_test_completed)func_data->callback; - data = func_data->user_data; - - callback(out_result, data); - - g_free(func_data); -} - -static void test_call_prbs_test_callback(GObject *source_object, - GAsyncResult *res, - gpointer user_data) -{ - TestFuncData *func_data; - - net_nfc_error_e out_result = NET_NFC_OK; - GError *error = NULL; - - net_nfc_client_test_prbs_test_completed callback; - gpointer data; - - if (net_nfc_gdbus_test_call_prbs_test_finish( - NET_NFC_GDBUS_TEST(source_object), - (gint *)&out_result, - res, - &error) == FALSE) - { - - out_result = NET_NFC_UNKNOWN_ERROR; - - DEBUG_ERR_MSG("Can not finish prbs test: %s", - error->message); - g_error_free(error); - } - - func_data = user_data; - if (func_data == NULL) - return; - - if (func_data->callback == NULL) - { - g_free(func_data); - return; - } - - callback = (net_nfc_client_test_prbs_test_completed) - func_data->callback; - data = func_data->user_data; - - callback(out_result, data); - - g_free(func_data); -} - -static void test_call_get_firmware_version_callback(GObject *source_object, - GAsyncResult *res, - gpointer user_data) -{ - TestFuncData *func_data; - - net_nfc_error_e out_result = NET_NFC_OK; - gchar *out_version = NULL; - GError *error = NULL; - - net_nfc_client_test_get_firmware_version_completed callback; - gpointer data; - - if (net_nfc_gdbus_test_call_get_firmware_version_finish( - NET_NFC_GDBUS_TEST(source_object), - (gint *)&out_result, - &out_version, - res, - &error) == FALSE) - { - - out_result = NET_NFC_UNKNOWN_ERROR; - - DEBUG_ERR_MSG("Can not finish get_firmware_version: %s", - error->message); - g_error_free(error); - } - - func_data = user_data; - if (func_data == NULL) - return; - - if (func_data->callback == NULL) - { - g_free(out_version); - g_free(func_data); - return; - } - - callback = (net_nfc_client_test_get_firmware_version_completed) - func_data->callback; - data = func_data->user_data; - - callback(out_result, out_version, data); - - g_free(out_version); - g_free(func_data); -} - -static void test_call_set_ee_data_callback(GObject *source_object, - GAsyncResult *res, - gpointer user_data) -{ - TestFuncData *func_data; - - net_nfc_error_e out_result = NET_NFC_OK; - - GError *error = NULL; - - net_nfc_client_test_set_ee_data_completed callback; - - if (net_nfc_gdbus_test_call_set_ee_data_finish( - NET_NFC_GDBUS_TEST(source_object), - (gint *)&out_result, - res, - &error) == FALSE) - { - out_result = NET_NFC_UNKNOWN_ERROR; - - DEBUG_ERR_MSG("Can not finish set_ee_data: %s\n", - error->message); - g_error_free(error); - } - - func_data = user_data; - - if (func_data->callback == NULL) - { - g_free(func_data); - return; - } - - callback = (net_nfc_client_test_set_ee_data_completed) - func_data->callback; - - callback(out_result, func_data->user_data); - - g_free(func_data); -} - - -API net_nfc_error_e net_nfc_client_test_sim_test( - net_nfc_client_test_sim_test_completed callback, - void *user_data) -{ - TestFuncData *func_data; - - if (test_proxy == NULL) - return NET_NFC_UNKNOWN_ERROR; - - /* prevent executing daemon when nfc is off */ - if (net_nfc_client_manager_is_activated() == false) { - return NET_NFC_INVALID_STATE; - } - - func_data = g_new0(TestFuncData, 1); - if (func_data == NULL) - return NET_NFC_UNKNOWN_ERROR; - - func_data->callback = (gpointer)callback; - func_data->user_data = user_data; - - net_nfc_gdbus_test_call_sim_test(test_proxy, - net_nfc_client_gdbus_get_privilege(), - NULL, - test_call_sim_test_callback, - func_data); - - return NET_NFC_OK; -} - -API net_nfc_error_e net_nfc_client_test_sim_test_sync(void) -{ - GError *error = NULL; - net_nfc_error_e out_result = NET_NFC_OK; - - if (test_proxy == NULL) - return NET_NFC_UNKNOWN_ERROR; - - /* prevent executing daemon when nfc is off */ - if (net_nfc_client_manager_is_activated() == false) { - return NET_NFC_INVALID_STATE; - } - - if (net_nfc_gdbus_test_call_sim_test_sync(test_proxy, - net_nfc_client_gdbus_get_privilege(), - (gint *)&out_result, - NULL, - &error) == FALSE) - { - DEBUG_CLIENT_MSG("can not call SimTest: %s", - error->message); - g_error_free(error); - return NET_NFC_UNKNOWN_ERROR; - } - - return out_result; -} - -API net_nfc_error_e net_nfc_client_test_prbs_test(uint32_t tech, - uint32_t rate, - net_nfc_client_test_prbs_test_completed callback, - void *user_data) -{ - TestFuncData *func_data; - - if (test_proxy == NULL) - return NET_NFC_UNKNOWN_ERROR; - - /* prevent executing daemon when nfc is off */ - if (net_nfc_client_manager_is_activated() == false) { - return NET_NFC_INVALID_STATE; - } - - func_data = g_new0(TestFuncData, 1); - if (func_data == NULL) - return NET_NFC_UNKNOWN_ERROR; - - func_data->callback = (gpointer)callback; - func_data->user_data = user_data; - - net_nfc_gdbus_test_call_prbs_test(test_proxy, - tech, - rate, - net_nfc_client_gdbus_get_privilege(), - NULL, - test_call_prbs_test_callback, - func_data); - - return NET_NFC_OK; -} - -API net_nfc_error_e net_nfc_client_test_prbs_test_sync(uint32_t tech, - uint32_t rate) -{ - GError *error = NULL; - net_nfc_error_e out_result = NET_NFC_OK; - - if (test_proxy == NULL) - return NET_NFC_UNKNOWN_ERROR; - - /* prevent executing daemon when nfc is off */ - if (net_nfc_client_manager_is_activated() == false) { - return NET_NFC_INVALID_STATE; - } - - if (net_nfc_gdbus_test_call_prbs_test_sync(test_proxy, - tech, - rate, - net_nfc_client_gdbus_get_privilege(), - (gint *)&out_result, - NULL, - &error) == FALSE) - { - DEBUG_CLIENT_MSG("can not call PrbsTest: %s", - error->message); - g_error_free(error); - return NET_NFC_UNKNOWN_ERROR; - } - - return out_result; -} - -API net_nfc_error_e net_nfc_client_test_get_firmware_version( - net_nfc_client_test_get_firmware_version_completed callback, - void *user_data) -{ - TestFuncData *func_data; - - if (test_proxy == NULL) - return NET_NFC_UNKNOWN_ERROR; - - /* prevent executing daemon when nfc is off */ - if (net_nfc_client_manager_is_activated() == false) { - return NET_NFC_INVALID_STATE; - } - - func_data = g_new0(TestFuncData, 1); - if (func_data == NULL) - return NET_NFC_UNKNOWN_ERROR; - - func_data->callback = (gpointer)callback; - func_data->user_data = user_data; - - net_nfc_gdbus_test_call_get_firmware_version(test_proxy, - net_nfc_client_gdbus_get_privilege(), - NULL, - test_call_get_firmware_version_callback, - func_data); - - return NET_NFC_OK; -} - -API net_nfc_error_e net_nfc_client_test_get_firmware_version_sync(char **version) -{ - gchar *out_version = NULL; - GError *error = NULL; - - net_nfc_error_e out_result = NET_NFC_OK; - - if (test_proxy == NULL) - return NET_NFC_UNKNOWN_ERROR; - - /* prevent executing daemon when nfc is off */ - if (net_nfc_client_manager_is_activated() == false) { - return NET_NFC_INVALID_STATE; - } - - if (net_nfc_gdbus_test_call_get_firmware_version_sync(test_proxy, - net_nfc_client_gdbus_get_privilege(), - (gint *)out_result, - &out_version, - NULL, - &error) == FALSE) - { - DEBUG_CLIENT_MSG("can not call PrbsTest: %s", - error->message); - g_error_free(error); - return NET_NFC_UNKNOWN_ERROR; - } - - if (version != NULL) - *version = out_version; - - return out_result; -} - -API net_nfc_error_e net_nfc_client_test_set_ee_data(int mode, - int reg_id, - data_h data, - net_nfc_client_test_set_ee_data_completed callback, - void *user_data) -{ - TestFuncData *func_data; - GVariant *variant = NULL; - - if (test_proxy == NULL) - return NET_NFC_UNKNOWN_ERROR; - - /* prevent executing daemon when nfc is off */ - if (net_nfc_client_manager_is_activated() == false) { - return NET_NFC_INVALID_STATE; - } - - func_data = g_new0(TestFuncData, 1); - func_data->callback = (gpointer)callback; - func_data->user_data = user_data; - - variant = net_nfc_util_gdbus_data_to_variant((data_s *)data); - - net_nfc_gdbus_test_call_set_ee_data(test_proxy, - mode, - reg_id, - variant, - net_nfc_client_gdbus_get_privilege(), - NULL, - test_call_set_ee_data_callback, - func_data); - - return NET_NFC_OK; -} - -API net_nfc_error_e net_nfc_client_test_set_ee_data_sync(int mode, - int reg_id, - data_h data) -{ - GVariant *variant = NULL; - GError *error = NULL; - - net_nfc_error_e out_result = NET_NFC_OK; - - if (test_proxy == NULL) - return NET_NFC_UNKNOWN_ERROR; - - /* prevent executing daemon when nfc is off */ - if (net_nfc_client_manager_is_activated() == false) { - return NET_NFC_INVALID_STATE; - } - - variant = net_nfc_util_gdbus_data_to_variant((data_s *)data); - - if (net_nfc_gdbus_test_call_set_ee_data_sync(test_proxy, - mode, - reg_id, - variant, - net_nfc_client_gdbus_get_privilege(), - (gint *)&out_result, - NULL, - &error) == FALSE) - { - DEBUG_CLIENT_MSG("can not call SetEeTest: %s", - error->message); - g_error_free(error); - return NET_NFC_UNKNOWN_ERROR; - } - - return out_result; -} - -net_nfc_error_e net_nfc_client_test_init(void) -{ - GError *error = NULL; - - if (test_proxy) - { - DEBUG_CLIENT_MSG("Already initialized"); - - return NET_NFC_OK; - } - - test_proxy = net_nfc_gdbus_test_proxy_new_for_bus_sync( - G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_NONE, - "org.tizen.NetNfcService", - "/org/tizen/NetNfcService/Test", - NULL, - &error); - - if (test_proxy == NULL) - { - DEBUG_ERR_MSG("Can not create proxy : %s", error->message); - g_error_free(error); - - return NET_NFC_UNKNOWN_ERROR; - } - - return NET_NFC_OK; -} - -void net_nfc_client_test_deinit(void) -{ - if (test_proxy) - { - g_object_unref(test_proxy); - test_proxy = NULL; - } -} diff --git a/common/include/net_nfc_oem_controller.h b/common/include/net_nfc_oem_controller.h index 980acee..c00d4b2 100644 --- a/common/include/net_nfc_oem_controller.h +++ b/common/include/net_nfc_oem_controller.h @@ -20,62 +20,159 @@ typedef bool (*net_nfc_oem_controller_init)(net_nfc_error_e *result); typedef bool (*net_nfc_oem_controller_deinit)(void); -typedef bool (*net_nfc_oem_controller_register_listener)(target_detection_listener_cb target_detection_listener, se_transaction_listener_cb se_transaction_listener, llcp_event_listener_cb llcp_event_listener, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_register_listener)( + target_detection_listener_cb target_detection_listener, + se_transaction_listener_cb se_transaction_listener, + llcp_event_listener_cb llcp_event_listener, + net_nfc_error_e *result); typedef bool (*net_nfc_oem_controller_unregister_listener)(void); typedef bool (*net_nfc_oem_controller_support_nfc)(net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_get_firmware_version)(data_s **data, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_check_firmware_version)(net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_get_firmware_version)(data_s **data, + net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_check_firmware_version)( + net_nfc_error_e *result); typedef bool (*net_nfc_oem_controller_update_firmware)(net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_get_stack_information)(net_nfc_stack_information_s *stack_info, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_configure_discovery)(net_nfc_discovery_mode_e mode, net_nfc_event_filter_e config, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_get_stack_information)( + net_nfc_stack_information_s *stack_info, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_configure_discovery)( + net_nfc_discovery_mode_e mode, + net_nfc_event_filter_e config, + net_nfc_error_e *result); typedef bool (*net_nfc_oem_controller_exception_handler)(void); /* tag api */ -typedef bool (*net_nfc_oem_controller_connect)(net_nfc_target_handle_s *handle, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_disconnect)(net_nfc_target_handle_s *handle, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_check_target_presence)(net_nfc_target_handle_s *handle, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_check_ndef)(net_nfc_target_handle_s *handle, uint8_t *ndef_card_state, int *max_data_size, int *real_data_size, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_read_ndef)(net_nfc_target_handle_s *handle, data_s **data, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_write_ndef)(net_nfc_target_handle_s *handle, data_s *data, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_make_read_only_ndef)(net_nfc_target_handle_s *handle, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_format_ndef)(net_nfc_target_handle_s *handle, data_s *secure_key, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_transceive)(net_nfc_target_handle_s *handle, net_nfc_transceive_info_s *info, data_s **data, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_connect)(net_nfc_target_handle_s *handle, + net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_disconnect)(net_nfc_target_handle_s *handle, + net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_check_target_presence)( + net_nfc_target_handle_s *handle, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_check_ndef)(net_nfc_target_handle_s *handle, + uint8_t *ndef_card_state, + int *max_data_size, + int *real_data_size, + net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_read_ndef)(net_nfc_target_handle_s *handle, + data_s **data, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_write_ndef)(net_nfc_target_handle_s *handle, + data_s *data, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_make_read_only_ndef)( + net_nfc_target_handle_s *handle, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_format_ndef)( + net_nfc_target_handle_s *handle, data_s *secure_key, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_transceive)(net_nfc_target_handle_s *handle, + net_nfc_transceive_info_s *info, data_s **data, net_nfc_error_e *result); typedef bool (*net_nfc_oem_controller_is_ready)(net_nfc_error_e *result); /* llcp api */ -typedef bool (*net_nfc_oem_controller_llcp_config)(net_nfc_llcp_config_info_s *config, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_llcp_check_llcp)(net_nfc_target_handle_s *handle, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_llcp_activate_llcp)(net_nfc_target_handle_s *handle, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_llcp_create_socket)(net_nfc_llcp_socket_t *socket, net_nfc_socket_type_e socketType, uint16_t miu, uint8_t rw, net_nfc_error_e *result, void *user_param); -typedef bool (*net_nfc_oem_controller_llcp_bind)(net_nfc_llcp_socket_t socket, uint8_t service_access_point, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_llcp_listen)(net_nfc_target_handle_s *handle, uint8_t *service_access_name, net_nfc_llcp_socket_t socket, net_nfc_error_e *result, void *user_param); -typedef bool (*net_nfc_oem_controller_llcp_accept)(net_nfc_llcp_socket_t socket, net_nfc_error_e *result, void *user_param); -typedef bool (*net_nfc_oem_controller_llcp_connect_by_url)(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, uint8_t *service_access_name, net_nfc_error_e *result, void *user_param); -typedef bool (*net_nfc_oem_controller_llcp_connect)(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, uint8_t service_access_point, net_nfc_error_e *result, void *user_param); -typedef bool (*net_nfc_oem_controller_llcp_disconnect)(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, net_nfc_error_e *result, void *user_param); -typedef bool (*net_nfc_oem_controller_llcp_socket_close)(net_nfc_llcp_socket_t socket, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_llcp_recv)(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, data_s *data, net_nfc_error_e *result, void *user_param); -typedef bool (*net_nfc_oem_controller_llcp_send)(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, data_s *data, net_nfc_error_e *result, void *user_param); -typedef bool (*net_nfc_oem_controller_llcp_recv_from)(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, data_s *data, net_nfc_error_e *result, void *user_param); -typedef bool (*net_nfc_oem_controller_llcp_send_to)(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, data_s *data, uint8_t service_access_point, net_nfc_error_e *result, void *user_param); -typedef bool (*net_nfc_oem_controller_llcp_reject)(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_llcp_get_remote_config)(net_nfc_target_handle_s *handle, net_nfc_llcp_config_info_s *config, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_llcp_get_remote_socket_info)(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, net_nfc_llcp_socket_option_s *option, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_llcp_config)( + net_nfc_llcp_config_info_s *config, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_llcp_check_llcp)( + net_nfc_target_handle_s *handle, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_llcp_activate_llcp)( + net_nfc_target_handle_s *handle, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_llcp_create_socket)( + net_nfc_llcp_socket_t *socket, + net_nfc_socket_type_e socketType, + uint16_t miu, + uint8_t rw, + net_nfc_error_e *result, + void *user_param); +typedef bool (*net_nfc_oem_controller_llcp_bind)(net_nfc_llcp_socket_t socket, + uint8_t service_access_point, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_llcp_listen)( + net_nfc_target_handle_s *handle, + uint8_t *service_access_name, + net_nfc_llcp_socket_t socket, + net_nfc_error_e *result, + void *user_param); +typedef bool (*net_nfc_oem_controller_llcp_accept)(net_nfc_llcp_socket_t socket, + net_nfc_error_e *result, void *user_param); +typedef bool (*net_nfc_oem_controller_llcp_connect_by_url)( + net_nfc_target_handle_s *handle, + net_nfc_llcp_socket_t socket, + uint8_t *service_access_name, + net_nfc_error_e *result, + void *user_param); +typedef bool (*net_nfc_oem_controller_llcp_connect)( + net_nfc_target_handle_s *handle, + net_nfc_llcp_socket_t socket, + uint8_t service_access_point, + net_nfc_error_e *result, + void *user_param); +typedef bool (*net_nfc_oem_controller_llcp_disconnect)( + net_nfc_target_handle_s *handle, + net_nfc_llcp_socket_t socket, + net_nfc_error_e *result, + void *user_param); +typedef bool (*net_nfc_oem_controller_llcp_socket_close)( + net_nfc_llcp_socket_t socket, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_llcp_recv)(net_nfc_target_handle_s *handle, + net_nfc_llcp_socket_t socket, + data_s *data, + net_nfc_error_e *result, + void *user_param); +typedef bool (*net_nfc_oem_controller_llcp_send)(net_nfc_target_handle_s *handle, + net_nfc_llcp_socket_t socket, + data_s *data, + net_nfc_error_e *result, + void *user_param); +typedef bool (*net_nfc_oem_controller_llcp_recv_from)( + net_nfc_target_handle_s *handle, + net_nfc_llcp_socket_t socket, + data_s *data, + net_nfc_error_e *result, + void *user_param); +typedef bool (*net_nfc_oem_controller_llcp_send_to)( + net_nfc_target_handle_s *handle, + net_nfc_llcp_socket_t socket, + data_s *data, + uint8_t service_access_point, + net_nfc_error_e *result, + void *user_param); +typedef bool (*net_nfc_oem_controller_llcp_reject)( + net_nfc_target_handle_s *handle, + net_nfc_llcp_socket_t socket, + net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_llcp_get_remote_config)( + net_nfc_target_handle_s *handle, + net_nfc_llcp_config_info_s *config, + net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_llcp_get_remote_socket_info)( + net_nfc_target_handle_s *handle, + net_nfc_llcp_socket_t socket, + net_nfc_llcp_socket_option_s *option, + net_nfc_error_e *result); /* secure element api */ -typedef bool (*net_nfc_oem_controller_get_secure_element_list)(net_nfc_secure_element_info_s *list, int* count, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_set_secure_element_mode)(net_nfc_secure_element_type_e element_type, net_nfc_secure_element_mode_e mode, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_secure_element_open)(net_nfc_secure_element_type_e element_type, net_nfc_target_handle_s **handle, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_secure_element_get_atr)(net_nfc_target_handle_s *handle, data_s **atr, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_secure_element_send_apdu)(net_nfc_target_handle_s *handle, data_s *command, data_s **response, net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_secure_element_close)(net_nfc_target_handle_s *handle, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_get_secure_element_list)( + net_nfc_secure_element_info_s *list, int* count, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_set_secure_element_mode)( + net_nfc_secure_element_type_e element_type, + net_nfc_secure_element_mode_e mode, + net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_secure_element_open)( + net_nfc_secure_element_type_e element_type, + net_nfc_target_handle_s **handle, + net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_secure_element_get_atr)( + net_nfc_target_handle_s *handle, data_s **atr, net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_secure_element_send_apdu)( + net_nfc_target_handle_s *handle, + data_s *command, + data_s **response, + net_nfc_error_e *result); +typedef bool (*net_nfc_oem_controller_secure_element_close)( + net_nfc_target_handle_s *handle, net_nfc_error_e *result); /* test api */ typedef bool (*net_nfc_oem_controller_sim_test)(net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_prbs_test)(net_nfc_error_e *result , int tech , int rate); +typedef bool (*net_nfc_oem_controller_prbs_test)(net_nfc_error_e *result, + int tech, int rate); typedef bool (*net_nfc_oem_controller_test_mode_on)(net_nfc_error_e *result); typedef bool (*net_nfc_oem_controller_test_mode_off)(net_nfc_error_e *result); -typedef bool (*net_nfc_oem_controller_eedata_register_set)(net_nfc_error_e *result , uint32_t mode , uint32_t reg_id , data_s *data); +typedef bool (*net_nfc_oem_controller_eedata_register_set)( + net_nfc_error_e *result , uint32_t mode , uint32_t reg_id , data_s *data); typedef struct _net_nfc_oem_interface_s { diff --git a/common/include/net_nfc_typedef.h b/common/include/net_nfc_typedef.h index 8ab97f6..e0384e7 100644 --- a/common/include/net_nfc_typedef.h +++ b/common/include/net_nfc_typedef.h @@ -23,11 +23,6 @@ #include #include -#ifdef __cplusplus -extern "C" -{ -#endif - /** NFC Manager NFC Manager controls the nfc device with high level APIs such as SmartPoster and Connection handover. @@ -391,8 +386,6 @@ typedef struct _ndef_message_s *ndef_message_h; typedef struct _net_nfc_target_info_s *net_nfc_target_info_h; -typedef uint32_t net_nfc_traceive_cmd; - typedef struct _net_nfc_llcp_config_info_s *net_nfc_llcp_config_info_h; typedef struct _net_nfc_llcp_socket_option_s *net_nfc_llcp_socket_option_h; @@ -408,14 +401,18 @@ typedef uint32_t net_nfc_llcp_socket_t; typedef void *net_nfc_snep_handle_h; // LLCP Callback -typedef void (*net_nfc_llcp_socket_cb)(net_nfc_llcp_message_e message, net_nfc_error_e result, void *data, void *user_data, void *trans_data); +typedef void (*net_nfc_llcp_socket_cb)(net_nfc_llcp_message_e message, + net_nfc_error_e result, void *data, void *user_data, void *trans_data); // Main Callback -typedef void (*net_nfc_response_cb)(net_nfc_message_e message, net_nfc_error_e result, void *data, void *user_param, void *trans_data); +typedef void (*net_nfc_response_cb)(net_nfc_message_e message, + net_nfc_error_e result, void *data, void *user_param, void *trans_data); -typedef void (*net_nfc_internal_se_response_cb)(net_nfc_message_e message, net_nfc_error_e result, void *data, void *user_param, void *trans_data); +typedef void (*net_nfc_internal_se_response_cb)(net_nfc_message_e message, + net_nfc_error_e result, void *data, void *user_param, void *trans_data); -typedef void (* net_nfc_set_activation_completed_cb)(net_nfc_error_e error, void *user_data); +typedef void (* net_nfc_set_activation_completed_cb)(net_nfc_error_e error, + void *user_data); // for data exchanger @@ -555,10 +552,6 @@ typedef enum } net_nfc_card_emulation_mode_t; -#ifdef __cplusplus -} -#endif - /** @} */ diff --git a/common/include/net_nfc_util_handover.h b/common/include/net_nfc_util_handover.h index ec776f8..0f71d21 100644 --- a/common/include/net_nfc_util_handover.h +++ b/common/include/net_nfc_util_handover.h @@ -18,11 +18,6 @@ #include "net_nfc_typedef_internal.h" -#ifdef __cplusplus -extern "C" -{ -#endif - #define CH_MAJOR_VER 1 #define CH_MINOR_VER 2 #define CH_VERSION ((CH_MAJOR_VER << 4) | CH_MINOR_VER) @@ -96,8 +91,4 @@ net_nfc_error_e net_nfc_util_create_handover_error_record(ndef_record_s **record net_nfc_error_e net_nfc_util_get_selector_power_status(ndef_message_s *message, net_nfc_conn_handover_carrier_state_e *power_state); -#ifdef __cplusplus -} -#endif - #endif //__NET_NFC_UTIL_HANDOVER_H__ diff --git a/common/include/net_nfc_util_ndef_message.h b/common/include/net_nfc_util_ndef_message.h index 1ddf31e..7b0bae5 100644 --- a/common/include/net_nfc_util_ndef_message.h +++ b/common/include/net_nfc_util_ndef_message.h @@ -50,12 +50,14 @@ /* convert rawdata into ndef message structure */ -net_nfc_error_e net_nfc_util_convert_rawdata_to_ndef_message(data_s *rawdata, ndef_message_s *ndef); +net_nfc_error_e net_nfc_util_convert_rawdata_to_ndef_message(data_s *rawdata, + ndef_message_s *ndef); /* this util function converts into rawdata from ndef message structure */ -net_nfc_error_e net_nfc_util_convert_ndef_message_to_rawdata(ndef_message_s *ndef, data_s *rawdata); +net_nfc_error_e net_nfc_util_convert_ndef_message_to_rawdata( + ndef_message_s *ndef, data_s *rawdata); /* get total bytes of ndef message in serial form @@ -70,7 +72,8 @@ net_nfc_error_e net_nfc_util_free_ndef_message(ndef_message_s *msg); /* append record into ndef message */ -net_nfc_error_e net_nfc_util_append_record(ndef_message_s *msg, ndef_record_s *record); +net_nfc_error_e net_nfc_util_append_record(ndef_message_s *msg, + ndef_record_s *record); /* print out ndef structure value with printf function. this is for just debug purpose @@ -79,14 +82,19 @@ void net_nfc_util_print_ndef_message(ndef_message_s *msg); net_nfc_error_e net_nfc_util_create_ndef_message(ndef_message_s **ndef_message); -net_nfc_error_e net_nfc_util_search_record_by_type(ndef_message_s *ndef_message, net_nfc_record_tnf_e tnf, data_s *type, ndef_record_s **record); +net_nfc_error_e net_nfc_util_search_record_by_type(ndef_message_s *ndef_message, + net_nfc_record_tnf_e tnf, data_s *type, ndef_record_s **record); -net_nfc_error_e net_nfc_util_append_record_by_index(ndef_message_s *ndef_message, int index, ndef_record_s *record); +net_nfc_error_e net_nfc_util_append_record_by_index( + ndef_message_s *ndef_message, int index, ndef_record_s *record); -net_nfc_error_e net_nfc_util_get_record_by_index(ndef_message_s *ndef_message, int index, ndef_record_s **record); +net_nfc_error_e net_nfc_util_get_record_by_index(ndef_message_s *ndef_message, + int index, ndef_record_s **record); -net_nfc_error_e net_nfc_util_remove_record_by_index(ndef_message_s *ndef_message, int index); +net_nfc_error_e net_nfc_util_remove_record_by_index( + ndef_message_s *ndef_message, int index); -net_nfc_error_e net_nfc_util_search_record_by_id(ndef_message_s *ndef_message, data_s *id, ndef_record_s **record); +net_nfc_error_e net_nfc_util_search_record_by_id(ndef_message_s *ndef_message, + data_s *id, ndef_record_s **record); #endif //__NET_NFC_UTIL_NDEF_MESSAGE_H__ diff --git a/common/include/net_nfc_util_ndef_record.h b/common/include/net_nfc_util_ndef_record.h index a16a938..97b5044 100644 --- a/common/include/net_nfc_util_ndef_record.h +++ b/common/include/net_nfc_util_ndef_record.h @@ -26,12 +26,14 @@ net_nfc_error_e net_nfc_util_create_record(net_nfc_record_tnf_e recordType, data /* create text type record */ -net_nfc_error_e net_nfc_util_create_text_type_record(const char *text, const char *lang_code_str, net_nfc_encode_type_e encode, ndef_record_s **record); +net_nfc_error_e net_nfc_util_create_text_type_record(const char *text, + const char *lang_code_str, net_nfc_encode_type_e encode, ndef_record_s **record); /* this utility function help to create uri type record */ -net_nfc_error_e net_nfc_util_create_uri_type_record(const char *uri, net_nfc_schema_type_e protocol_schema, ndef_record_s **record); +net_nfc_error_e net_nfc_util_create_uri_type_record(const char *uri, + net_nfc_schema_type_e protocol_schema, ndef_record_s **record); /* free ndef record. it free all the buffered data @@ -41,7 +43,8 @@ net_nfc_error_e net_nfc_util_free_record(ndef_record_s *record); /* convert schema enum value to character string. */ -net_nfc_error_e net_nfc_util_set_record_id(ndef_record_s *record, uint8_t *data, int length); +net_nfc_error_e net_nfc_util_set_record_id(ndef_record_s *record, uint8_t *data, + int length); /* get total bytes of ndef record in serial form @@ -51,6 +54,7 @@ uint32_t net_nfc_util_get_record_length(ndef_record_s *record); /* create uri string from record */ -net_nfc_error_e net_nfc_util_create_uri_string_from_uri_record(ndef_record_s *record, char **uri); +net_nfc_error_e net_nfc_util_create_uri_string_from_uri_record( + ndef_record_s *record, char **uri); #endif //__NET_NFC_UTIL_NDEF_RECORD_H__ diff --git a/common/net_nfc.xml b/common/net_nfc.xml index 2bf7c6d..92bf069 100644 --- a/common/net_nfc.xml +++ b/common/net_nfc.xml @@ -437,43 +437,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -