revise directory organization.
authorYoungjae Shin <yj99.shin@samsung.com>
Fri, 23 Aug 2013 06:07:16 +0000 (15:07 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Thu, 29 Aug 2013 09:19:54 +0000 (18:19 +0900)
revise file name.
revise indent.
revise makefiles.
cleanup code.

Change-Id: Ic7c714c0916c6d35ff07839aedef81a281bcb8af

228 files changed:
CMakeLists.txt
TC/_export_env.sh [deleted file]
TC/_export_target_env.sh [deleted file]
TC/build.sh [deleted file]
TC/clean.sh [deleted file]
TC/config.default [deleted file]
TC/execute.sh [deleted file]
TC/testcase/Makefile [deleted file]
TC/testcase/tslist [deleted file]
TC/testcase/utc_net_nfc_client_data.c [deleted file]
TC/testcase/utc_net_nfc_client_exchanger.c [deleted file]
TC/testcase/utc_net_nfc_client_internal_se.c [deleted file]
TC/testcase/utc_net_nfc_client_ndef_message.c [deleted file]
TC/testcase/utc_net_nfc_client_ndef_record.c [deleted file]
TC/testcase/utc_net_nfc_client_nfc.c [deleted file]
TC/testcase/utc_net_nfc_client_tag.c [deleted file]
TC/testcase/utc_net_nfc_client_tag_felica.c [deleted file]
TC/testcase/utc_net_nfc_client_tag_jewel.c [deleted file]
TC/testcase/utc_net_nfc_client_tag_mifare.c [deleted file]
TC/testcase/utc_net_nfc_client_target_info.c [deleted file]
TC/tet_scen [deleted file]
TC/tetbuild.cfg [deleted file]
TC/tetclean.cfg [deleted file]
TC/tetexec.cfg [deleted file]
client/CMakeLists.txt [new file with mode: 0644]
client/include/net_nfc.h [moved from src/clientlib/include/net_nfc.h with 97% similarity]
client/include/net_nfc_client_context.h [moved from src/clientlib/include/net_nfc_client_context.h with 100% similarity]
client/include/net_nfc_client_exchanger.h [moved from src/clientlib/include/net_nfc_client_exchanger.h with 100% similarity]
client/include/net_nfc_client_handover.h [moved from src/clientlib/include/net_nfc_client_handover.h with 100% similarity]
client/include/net_nfc_client_llcp.h [moved from src/clientlib/include/net_nfc_client_llcp.h with 100% similarity]
client/include/net_nfc_client_manager.h [moved from src/clientlib/include/net_nfc_client_manager.h with 100% similarity]
client/include/net_nfc_client_ndef.h [moved from src/clientlib/include/net_nfc_client_ndef.h with 100% similarity]
client/include/net_nfc_client_p2p.h [moved from src/clientlib/include/net_nfc_client_p2p.h with 100% similarity]
client/include/net_nfc_client_se.h [moved from src/clientlib/include/net_nfc_client_se.h with 100% similarity]
client/include/net_nfc_client_snep.h [moved from src/clientlib/include/net_nfc_client_snep.h with 100% similarity]
client/include/net_nfc_client_system_handler.h [moved from src/clientlib/include/net_nfc_client_system_handler.h with 100% similarity]
client/include/net_nfc_client_tag.h [moved from src/clientlib/include/net_nfc_client_tag.h with 100% similarity]
client/include/net_nfc_client_tag_felica.h [moved from src/clientlib/include/net_nfc_client_tag_felica.h with 100% similarity]
client/include/net_nfc_client_tag_jewel.h [moved from src/clientlib/include/net_nfc_client_tag_jewel.h with 100% similarity]
client/include/net_nfc_client_tag_mifare.h [moved from src/clientlib/include/net_nfc_tag_mifare.h with 100% similarity]
client/include/net_nfc_client_test.h [moved from src/clientlib/include/net_nfc_client_test.h with 100% similarity]
client/include/net_nfc_client_transceive.h [moved from src/clientlib/include/net_nfc_client_transceive.h with 100% similarity]
client/include/net_nfc_data.h [moved from src/clientlib/include/net_nfc_data.h with 99% similarity]
client/include/net_nfc_ndef_message.h [moved from src/clientlib/include/net_nfc_ndef_message.h with 100% similarity]
client/include/net_nfc_ndef_message_handover.h [moved from src/clientlib/include/net_nfc_ndef_message_handover.h with 100% similarity]
client/include/net_nfc_ndef_record.h [moved from src/clientlib/include/net_nfc_ndef_record.h with 100% similarity]
client/include/net_nfc_sign_record.h [moved from src/clientlib/include/net_nfc_sign_record.h with 100% similarity]
client/include/net_nfc_target_info.h [moved from src/clientlib/include/net_nfc_target_info.h with 99% similarity]
client/net_nfc_client.c [moved from src/clientlib/net_nfc_client.c with 95% similarity]
client/net_nfc_client.h [moved from src/clientlib/include/net_nfc_client.h with 100% similarity]
client/net_nfc_client_context.c [moved from src/clientlib/net_nfc_client_context.c with 77% similarity]
client/net_nfc_client_data.c [moved from src/clientlib/net_nfc_client_data.c with 77% similarity]
client/net_nfc_client_exchanger.c [moved from src/clientlib/net_nfc_client_exchanger.c with 55% similarity]
client/net_nfc_client_handover.c [moved from src/clientlib/net_nfc_client_handover.c with 71% similarity]
client/net_nfc_client_llcp.c [moved from src/clientlib/net_nfc_client_llcp.c with 75% similarity]
client/net_nfc_client_manager.c [moved from src/clientlib/net_nfc_client_manager.c with 80% similarity]
client/net_nfc_client_ndef.c [moved from src/clientlib/net_nfc_client_ndef.c with 82% similarity]
client/net_nfc_client_ndef_message.c [moved from src/clientlib/net_nfc_client_ndef_message.c with 58% similarity]
client/net_nfc_client_ndef_message_handover.c [new file with mode: 0644]
client/net_nfc_client_ndef_record.c [moved from src/clientlib/net_nfc_client_ndef_record.c with 73% similarity]
client/net_nfc_client_p2p.c [moved from src/clientlib/net_nfc_client_p2p.c with 81% similarity]
client/net_nfc_client_se.c [moved from src/clientlib/net_nfc_client_se.c with 74% similarity]
client/net_nfc_client_sign_record.c [new file with mode: 0644]
client/net_nfc_client_snep.c [moved from src/clientlib/net_nfc_client_snep.c with 70% similarity]
client/net_nfc_client_system_handler.c [moved from src/clientlib/net_nfc_client_system_handler.c with 73% similarity]
client/net_nfc_client_tag.c [moved from src/clientlib/net_nfc_client_tag.c with 76% similarity]
client/net_nfc_client_tag_felica.c [moved from src/clientlib/net_nfc_client_tag_felica.c with 82% similarity]
client/net_nfc_client_tag_internal.h [moved from src/clientlib/include/net_nfc_client_tag_internal.h with 100% similarity]
client/net_nfc_client_tag_jewel.c [moved from src/clientlib/net_nfc_client_tag_jewel.c with 80% similarity]
client/net_nfc_client_tag_mifare.c [moved from src/clientlib/net_nfc_client_tag_mifare.c with 77% similarity]
client/net_nfc_client_target_info.c [moved from src/clientlib/net_nfc_client_target_info.c with 83% similarity]
client/net_nfc_client_test.c [moved from src/clientlib/net_nfc_client_test.c with 76% similarity]
client/net_nfc_client_transceive.c [moved from src/clientlib/net_nfc_client_transceive.c with 76% similarity]
client/nfc.pc.in [new file with mode: 0644]
common/CMakeLists.txt [new file with mode: 0644]
common/include/net_nfc_oem_controller.h [moved from src/commonlib/include/net_nfc_oem_controller.h with 100% similarity]
common/include/net_nfc_typedef.h [moved from src/commonlib/include/net_nfc_typedef.h with 99% similarity]
common/include/net_nfc_typedef_internal.h [moved from src/commonlib/include/net_nfc_typedef_internal.h with 100% similarity]
common/include/net_nfc_util_handover.h [moved from src/commonlib/include/net_nfc_util_handover.h with 100% similarity]
common/include/net_nfc_util_ndef_message.h [moved from src/commonlib/include/net_nfc_util_ndef_message.h with 100% similarity]
common/include/net_nfc_util_ndef_record.h [moved from src/commonlib/include/net_nfc_util_ndef_record.h with 100% similarity]
common/include/net_nfc_util_sign_record.h [moved from src/commonlib/include/net_nfc_util_sign_record.h with 100% similarity]
common/net_nfc.xml [moved from src/commonlib/net_nfc.xml with 100% similarity]
common/net_nfc_debug_internal.h [moved from src/commonlib/include/net_nfc_debug_internal.h with 98% similarity]
common/net_nfc_util.c [moved from src/commonlib/net_nfc_util.c with 85% similarity]
common/net_nfc_util_defines.h [moved from src/commonlib/include/net_nfc_util_defines.h with 100% similarity]
common/net_nfc_util_gdbus.c [moved from src/commonlib/net_nfc_util_gdbus.c with 79% similarity]
common/net_nfc_util_gdbus_internal.h [moved from src/commonlib/include/net_nfc_util_gdbus_internal.h with 100% similarity]
common/net_nfc_util_handover.c [moved from src/commonlib/net_nfc_util_handover.c with 97% similarity]
common/net_nfc_util_internal.h [moved from src/commonlib/include/net_nfc_util_internal.h with 94% similarity]
common/net_nfc_util_ipc.c [moved from src/commonlib/net_nfc_util_ipc.c with 100% similarity]
common/net_nfc_util_ipc.h [moved from src/commonlib/include/net_nfc_util_ipc.h with 100% similarity]
common/net_nfc_util_ndef_message.c [moved from src/commonlib/net_nfc_util_ndef_message.c with 94% similarity]
common/net_nfc_util_ndef_record.c [moved from src/commonlib/net_nfc_util_ndef_record.c with 90% similarity]
common/net_nfc_util_openssl.c [moved from src/commonlib/net_nfc_util_openssl.c with 96% similarity]
common/net_nfc_util_openssl_internal.h [moved from src/commonlib/include/net_nfc_util_openssl_internal.h with 100% similarity]
common/net_nfc_util_sign_record.c [moved from src/commonlib/net_nfc_util_sign_record.c with 95% similarity]
common/nfc-common.pc.in [new file with mode: 0644]
daemon/CMakeLists.txt [new file with mode: 0644]
daemon/net_nfc_server.c [moved from src/manager/net_nfc_server.c with 54% similarity]
daemon/net_nfc_server.h [moved from src/manager/include/net_nfc_server.h with 90% similarity]
daemon/net_nfc_server_common.c [moved from src/manager/net_nfc_server_common.c with 90% similarity]
daemon/net_nfc_server_common.h [moved from src/manager/include/net_nfc_server_common.h with 100% similarity]
daemon/net_nfc_server_context.c [moved from src/manager/net_nfc_server_context.c with 90% similarity]
daemon/net_nfc_server_context.h [moved from src/manager/include/net_nfc_server_context_internal.h with 94% similarity]
daemon/net_nfc_server_controller.c [moved from src/manager/net_nfc_controller.c with 90% similarity]
daemon/net_nfc_server_controller.h [moved from src/manager/include/net_nfc_controller_internal.h with 98% similarity]
daemon/net_nfc_server_handover.c [moved from src/manager/net_nfc_server_handover.c with 80% similarity]
daemon/net_nfc_server_handover.h [moved from src/manager/include/net_nfc_server_handover.h with 100% similarity]
daemon/net_nfc_server_handover_bss.c [moved from src/manager/net_nfc_server_handover_bss.c with 98% similarity]
daemon/net_nfc_server_handover_bss.h [moved from src/manager/include/net_nfc_server_handover_bss.h with 81% similarity]
daemon/net_nfc_server_handover_bt.c [moved from src/manager/net_nfc_server_handover_bt.c with 81% similarity]
daemon/net_nfc_server_handover_bt.h [moved from src/manager/include/net_nfc_server_handover_internal.h with 73% similarity]
daemon/net_nfc_server_llcp.c [moved from src/manager/net_nfc_server_llcp.c with 76% similarity]
daemon/net_nfc_server_llcp.h [moved from src/manager/include/net_nfc_server_llcp.h with 100% similarity]
daemon/net_nfc_server_manager.c [moved from src/manager/net_nfc_server_manager.c with 85% similarity]
daemon/net_nfc_server_manager.h [moved from src/manager/include/net_nfc_server_manager.h with 100% similarity]
daemon/net_nfc_server_ndef.c [moved from src/manager/net_nfc_server_ndef.c with 80% similarity]
daemon/net_nfc_server_ndef.h [moved from src/manager/include/net_nfc_server_ndef.h with 100% similarity]
daemon/net_nfc_server_p2p.c [moved from src/manager/net_nfc_server_p2p.c with 80% similarity]
daemon/net_nfc_server_p2p.h [moved from src/manager/include/net_nfc_server_p2p.h with 100% similarity]
daemon/net_nfc_server_process_handover.c [moved from src/manager/net_nfc_server_process_handover.c with 76% similarity]
daemon/net_nfc_server_process_handover.h [moved from src/manager/include/net_nfc_server_process_handover.h with 100% similarity]
daemon/net_nfc_server_process_npp.c [moved from src/manager/net_nfc_server_process_npp.c with 80% similarity]
daemon/net_nfc_server_process_npp.h [moved from src/manager/include/net_nfc_server_process_npp.h with 100% similarity]
daemon/net_nfc_server_process_snep.c [moved from src/manager/net_nfc_server_process_snep.c with 72% similarity]
daemon/net_nfc_server_process_snep.h [moved from src/manager/include/net_nfc_server_process_snep.h with 100% similarity]
daemon/net_nfc_server_se.c [moved from src/manager/net_nfc_server_se.c with 77% similarity]
daemon/net_nfc_server_se.h [moved from src/manager/include/net_nfc_server_se.h with 100% similarity]
daemon/net_nfc_server_snep.c [moved from src/manager/net_nfc_server_snep.c with 67% similarity]
daemon/net_nfc_server_snep.h [moved from src/manager/include/net_nfc_server_snep.h with 100% similarity]
daemon/net_nfc_server_system_handler.c [moved from src/manager/net_nfc_server_system_handler.c with 70% similarity]
daemon/net_nfc_server_system_handler.h [moved from src/manager/include/net_nfc_server_system_handler.h with 100% similarity]
daemon/net_nfc_server_tag.c [moved from src/manager/net_nfc_server_tag.c with 85% similarity]
daemon/net_nfc_server_tag.h [moved from src/manager/include/net_nfc_server_tag.h with 100% similarity]
daemon/net_nfc_server_test.c [moved from src/manager/net_nfc_server_test.c with 78% similarity]
daemon/net_nfc_server_test.h [moved from src/manager/include/net_nfc_server_test.h with 100% similarity]
daemon/net_nfc_server_transceive.c [moved from src/manager/net_nfc_server_transceive.c with 77% similarity]
daemon/net_nfc_server_transceive.h [moved from src/manager/include/net_nfc_server_transceive.h with 100% similarity]
daemon/net_nfc_server_util.c [moved from src/manager/net_nfc_app_util.c with 84% similarity]
daemon/net_nfc_server_util.h [moved from src/manager/include/net_nfc_app_util_internal.h with 83% similarity]
daemon/net_nfc_server_vconf.c [moved from src/manager/net_nfc_server_vconf.c with 96% similarity]
daemon/net_nfc_server_vconf.h [moved from src/manager/include/net_nfc_server_vconf.h with 100% similarity]
daemon/nfc-manager.xml [moved from src/manager/nfc-manager.xml with 100% similarity]
daemon/org.tizen.NetNfcService.service [moved from src/manager/org.tizen.NetNfcService.service with 100% similarity]
daemon/sounds/Operation_sdk.wav [moved from src/manager/sounds/Operation_sdk.wav with 100% similarity]
debian/changelog [deleted file]
debian/compat [deleted file]
debian/control [deleted file]
debian/libnfc-common-lib-0.install.in [deleted file]
debian/libnfc-common-lib-0.postinst.in [deleted file]
debian/libnfc-common-lib-dbg.install.in [deleted file]
debian/libnfc-common-lib-dev.install.in [deleted file]
debian/libnfc-manager-0.init.in [deleted file]
debian/libnfc-manager-0.install.in [deleted file]
debian/libnfc-manager-0.postinst.in [deleted file]
debian/libnfc-manager-dbg.install.in [deleted file]
debian/libnfc-manager-dev.install.in [deleted file]
debian/rules [deleted file]
doxygen/doxygen.conf
packaging/libnfc-manager-0.init.in [deleted file]
packaging/nfc-manager.spec
src/clientlib/CMakeLists.txt [deleted file]
src/clientlib/net_nfc_client_ndef_message_handover.c [deleted file]
src/clientlib/net_nfc_client_sign_record.c [deleted file]
src/clientlib/net_nfc_client_util.c [deleted file]
src/clientlib/nfc.pc.in [deleted file]
src/commonlib/CMakeLists.txt [deleted file]
src/commonlib/nfc-common-lib.pc.in [deleted file]
src/manager/CMakeLists.txt [deleted file]
src/manager/include/net_nfc_manager.h [deleted file]
src/manager/include/net_nfc_manager_util_internal.h [deleted file]
src/manager/net_nfc_manager.c [deleted file]
src/manager/net_nfc_manager_util.c [deleted file]
test_clinet_app/bt_paring/Makefile [deleted file]
test_clinet_app/bt_paring/bt_paring.c [deleted file]
test_clinet_app/ndef-tool/CMakeLists.txt [deleted file]
test_clinet_app/nfc_client/CMakeLists.txt [deleted file]
test_clinet_app/nfc_client/Makefile [deleted file]
tests/CMakeLists.txt
tests/include/net_nfc_test_client.h [deleted file]
tests/include/net_nfc_test_llcp.h [deleted file]
tests/include/net_nfc_test_sys_handler.h [deleted file]
tests/main.c
tests/net_nfc_test_client.c
tests/net_nfc_test_client.h [new file with mode: 0644]
tests/net_nfc_test_exchanger.c
tests/net_nfc_test_exchanger.h [moved from tests/include/net_nfc_test_exchanger.h with 96% similarity]
tests/net_nfc_test_handover.c
tests/net_nfc_test_handover.h [moved from tests/include/net_nfc_test_handover.h with 96% similarity]
tests/net_nfc_test_jewel.c
tests/net_nfc_test_jewel.h [moved from tests/include/net_nfc_test_jewel.h with 100% similarity]
tests/net_nfc_test_llcp.c
tests/net_nfc_test_llcp.h [new file with mode: 0644]
tests/net_nfc_test_manager.c
tests/net_nfc_test_manager.h [moved from tests/include/net_nfc_test_manager.h with 100% similarity]
tests/net_nfc_test_ndef.c
tests/net_nfc_test_ndef.h [moved from tests/include/net_nfc_test_ndef.h with 100% similarity]
tests/net_nfc_test_p2p.c
tests/net_nfc_test_p2p.h [moved from tests/include/net_nfc_test_p2p.h with 100% similarity]
tests/net_nfc_test_se.c
tests/net_nfc_test_se.h [moved from tests/include/net_nfc_test_se.h with 100% similarity]
tests/net_nfc_test_snep.c
tests/net_nfc_test_snep.h [moved from tests/include/net_nfc_test_snep.h with 100% similarity]
tests/net_nfc_test_sys_handler.c [changed mode: 0755->0644]
tests/net_nfc_test_sys_handler.h [moved from src/clientlib/include/net_nfc_client_util_internal.h with 65% similarity]
tests/net_nfc_test_tag.c
tests/net_nfc_test_tag.h [moved from tests/include/net_nfc_test_tag.h with 100% similarity]
tests/net_nfc_test_tag_felica.c
tests/net_nfc_test_tag_felica.h [moved from tests/include/net_nfc_test_tag_felica.h with 100% similarity]
tests/net_nfc_test_tag_mifare.c
tests/net_nfc_test_tag_mifare.h [moved from tests/include/net_nfc_test_tag_mifare.h with 100% similarity]
tests/net_nfc_test_test.c
tests/net_nfc_test_test.h [moved from tests/include/net_nfc_test_test.h with 100% similarity]
tests/net_nfc_test_transceive.c
tests/net_nfc_test_transceive.h [moved from tests/include/net_nfc_test_transceive.h with 100% similarity]
tests/net_nfc_test_util.h [moved from tests/include/net_nfc_test_util.h with 100% similarity]
tools/bt-paring/CMakeLists.txt [new file with mode: 0644]
tools/bt-paring/bt_paring.c [new file with mode: 0644]
tools/ndef-tool/CMakeLists.txt [new file with mode: 0644]
tools/ndef-tool/ndef-tool-display.c [moved from test_clinet_app/ndef-tool/ndef-tool-display.c with 96% similarity]
tools/ndef-tool/ndef-tool-sign.c [moved from test_clinet_app/ndef-tool/ndef-tool-sign.c with 64% similarity]
tools/ndef-tool/ndef-tool-tag.c [moved from test_clinet_app/ndef-tool/ndef-tool-tag.c with 91% similarity]
tools/ndef-tool/ndef-tool.c [moved from test_clinet_app/ndef-tool/ndef-tool.c with 95% similarity]
tools/ndef-tool/ndef-tool.h [moved from test_clinet_app/ndef-tool/ndef-tool.h with 99% similarity]
tools/nfc-client/CMakeLists.txt [new file with mode: 0644]
tools/nfc-client/main.c [moved from test_clinet_app/nfc_client/main.c with 95% similarity]
tools/nfc-client/nfc_api_test.h [moved from test_clinet_app/nfc_client/nfc_api_test.h with 98% similarity]

index 590da23..dbe25c2 100644 (file)
@@ -1,17 +1,36 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(nfc-manager C)
 
-MESSAGE("build nfc-common-lib and nfc-manager")
+INCLUDE(FindPkgConfig)
+
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wall -Werror-implicit-function-declaration")
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fPIC -fvisibility=hidden")
+#SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fno-strict-aliasing")
+
+#SET(ARM_CFLAGS "-mabi=aapcs-linux -fno-common")
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+IF("${ARCH}" MATCHES "^arm.*")
+       ADD_DEFINITIONS("-DTARGET")
+       MESSAGE("add -DTARGET")
+       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARM_CFLAGS}")
+ENDIF()
+
+SET(CMAKE_SHARED_LINKER_FLAGS " -Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
+SET(CMAKE_EXE_LINKER_FLAGS " -Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-SET(LIBDIR "${PREFIX}/lib")
-SET(MODULEDIR "${LIBDIR}/nfc")
 
-ADD_DEFINITIONS("-D_GNU_SOURCE")
+ADD_DEFINITIONS("-DNFC_MANAGER_MODULEDIR=\"${LIB_INSTALL_DIR}/nfc\"")
+
 #ADD_DEFINITIONS("-DSECURITY_SERVER")
+ADD_DEFINITIONS("-DUSE_FULL_URI")
+#ADD_DEFINITIONS("-DESE_ALWAYS_ON")
 
-ADD_SUBDIRECTORY(src/commonlib)
-ADD_SUBDIRECTORY(src/clientlib)
-ADD_SUBDIRECTORY(src/manager)
-#ADD_SUBDIRECTORY(test_clinet_app/ndef-tool)
-#ADD_SUBDIRECTORY(test_clinet_app/nfc_client)
+ADD_SUBDIRECTORY(common)
+ADD_SUBDIRECTORY(client)
+ADD_SUBDIRECTORY(daemon)
 ADD_SUBDIRECTORY(tests)
+#ADD_SUBDIRECTORY(tools/ndef-tool)
+#ADD_SUBDIRECTORY(tools/nfc-client)
diff --git a/TC/_export_env.sh b/TC/_export_env.sh
deleted file mode 100755 (executable)
index bb07f7e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-. ./config
-export TET_INSTALL_PATH=$TET_INSTALL_HOST_PATH
-export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target # tetware target path
-export PATH=$TET_TARGET_PATH/bin:$PATH
-export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
-export TET_ROOT=$TET_TARGET_PATH
diff --git a/TC/_export_target_env.sh b/TC/_export_target_env.sh
deleted file mode 100755 (executable)
index 5ddaa53..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-. ./config
-export TET_INSTALL_PATH=$TET_INSTALL_TARGET_PATH # path to path
-export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
-export PATH=$TET_TARGET_PATH/bin:$PATH
-export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
-export TET_ROOT=$TET_TARGET_PATH
diff --git a/TC/build.sh b/TC/build.sh
deleted file mode 100755 (executable)
index 72aad6c..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-. ./_export_env.sh                              # setting environment variables
-
-export TET_SUITE_ROOT=`pwd`
-FILE_NAME_EXTENSION=`date +%s`
-
-RESULT_DIR=results
-HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
-
-mkdir -p $RESULT_DIR
-
-tcc -c -p ./
-tcc -b -j $JOURNAL_RESULT -p ./
-grw -c 7 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
diff --git a/TC/clean.sh b/TC/clean.sh
deleted file mode 100755 (executable)
index 29743e0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-. ./_export_env.sh                              # setting environment variables
-
-export TET_SUITE_ROOT=`pwd`
-RESULT_DIR=results
-
-tcc -c -p ./                                # executing tcc, with clean option (-c)
-rm -r $RESULT_DIR
-rm -r tet_tmp_dir
-rm testcase/tet_captured
diff --git a/TC/config.default b/TC/config.default
deleted file mode 100644 (file)
index 12ac1e2..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CAPI_PROJECT_ROOT=/home/abyss/capi
-TET_INSTALL_HOST_PATH=/home/abyss/TETware
-TET_INSTALL_TARGET_PATH=/mnt/nfs/TETware
diff --git a/TC/execute.sh b/TC/execute.sh
deleted file mode 100755 (executable)
index a4f6095..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-. ./_export_target_env.sh                    # setting environment variables
-
-export TET_SUITE_ROOT=`pwd`
-FILE_NAME_EXTENSION=`date +%s`
-
-RESULT_DIR=results
-HTML_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.journal
-
-mkdir -p $RESULT_DIR
-
-tcc -e -j $JOURNAL_RESULT -p ./
-grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
diff --git a/TC/testcase/Makefile b/TC/testcase/Makefile
deleted file mode 100644 (file)
index 6c0560f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-CC ?= gcc
-
-C_FILES = $(shell ls *.c)
-
-ifeq ($(ARCH),target)
-       PKG_CONFIG_PATH=/usr/lib/pkgconfig
-       export PKG_CONFIG_PATH
-       CC=arm-linux-gcc -Wall
-       CXX=arm-linux-g++ -Wall
-else
-       PKG_CONFIG_PATH=/usr/lib/pkgconfig
-       export PKG_CONFIG_PATH
-       CC=gcc -Wall
-    CXX=gcc -Wall
-endif
-
-
-LDFLAGS = `pkg-config --libs nfc nfc-common-lib glib-2.0`
-LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
-LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
-LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s
-
-CFLAGS = -I. `pkg-config --cflags nfc nfc-common-lib glib-2.0`
-CFLAGS += -I$(TET_ROOT)/inc/tet3
-CFLAGS += -Wall
-
-TCS := $(shell ls -1 *.c | cut -d. -f1)
-
-all: $(TCS)
-
-%: %.c
-       $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-clean:
-       rm -f $(TCS)
diff --git a/TC/testcase/tslist b/TC/testcase/tslist
deleted file mode 100644 (file)
index 65c1406..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/testcase/utc_net_nfc_client_data
-/testcase/utc_net_nfc_client_exchanger
-/testcase/utc_net_nfc_client_internal_se
-/testcase/utc_net_nfc_client_ndef_message
-/testcase/utc_net_nfc_client_ndef_record
-/testcase/utc_net_nfc_client_nfc
-/testcase/utc_net_nfc_client_tag
-/testcase/utc_net_nfc_client_tag_felica
-/testcase/utc_net_nfc_client_tag_jewel
-/testcase/utc_net_nfc_client_tag_mifare
-/testcase/utc_net_nfc_client_target_info
-
diff --git a/TC/testcase/utc_net_nfc_client_data.c b/TC/testcase/utc_net_nfc_client_data.c
deleted file mode 100644 (file)
index 41b22bb..0000000
+++ /dev/null
@@ -1,297 +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 <tet_api.h>
-#include <stdint.h>
-
-#include <net_nfc_data.h>
-#include <net_nfc_typedef.h>
-#include <net_nfc_typedef_internal.h>
-#include <net_nfc_util_internal.h>
-
-
-enum {
-       POSITIVE_TC_IDX = 0x01,
-       NEGATIVE_TC_IDX,
-};
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_net_nfc_create_data_only_p(void);
-static void utc_net_nfc_create_data_only_n(void);
-static void utc_net_nfc_create_data_p(void);
-static void utc_net_nfc_create_data_n(void);
-static void utc_net_nfc_get_data_p(void);
-static void utc_net_nfc_get_data_n(void);
-static void utc_net_nfc_set_data_p(void);
-static void utc_net_nfc_set_data_n(void);
-static void utc_net_nfc_get_data_length_p(void);
-static void utc_net_nfc_get_data_length_n(void);
-static void utc_net_nfc_get_data_buffer_p(void);
-static void utc_net_nfc_get_data_buffer_n(void);
-static void utc_net_nfc_free_data_p(void);
-static void utc_net_nfc_free_data_n(void);
-
-
-
-
-struct tet_testlist tet_testlist[] = {
-       { utc_net_nfc_create_data_only_p , POSITIVE_TC_IDX },
-       { utc_net_nfc_create_data_only_n , NEGATIVE_TC_IDX },
-       { utc_net_nfc_create_data_p, POSITIVE_TC_IDX },
-       { utc_net_nfc_create_data_n , NEGATIVE_TC_IDX},
-       { utc_net_nfc_get_data_p, 1},
-       { utc_net_nfc_get_data_n, 2 },
-       { utc_net_nfc_set_data_p, 1},
-       { utc_net_nfc_set_data_n, 2},
-       { utc_net_nfc_get_data_length_p, 1},
-       { utc_net_nfc_get_data_length_n, 2},
-       { utc_net_nfc_get_data_buffer_p, 1},
-       { utc_net_nfc_get_data_buffer_n, 2},
-       { utc_net_nfc_free_data_p, 1},
-       { utc_net_nfc_free_data_n, 2},
-       { NULL, 0 },
-};
-
-//this method is called only once in start
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-static void utc_net_nfc_create_data_only_p(void)
-{
-       int ret=0;
-       data_h* config = NULL;
-
-       config = calloc(1 , sizeof(data_h));
-
-       ret = net_nfc_create_data_only(config);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_create_data_only is failed");
-}
-
-static void utc_net_nfc_create_data_only_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_create_data_only(NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_create_data not allow null");
-}
-
-static void utc_net_nfc_create_data_p(void)
-{
-       int ret=0;
-       data_h* config = NULL;
-       uint8_t* sec_param = NULL;
-
-       config = calloc(1, sizeof(data_h));
-       sec_param = calloc(1, sizeof(uint8_t));
-       memcpy(sec_param , "U" , sizeof(uint8_t));
-
-       ret = net_nfc_create_data(config , sec_param/*"U"*/ , 1);
-
-       free(config);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_create_data is failed");
-}
-
-static void utc_net_nfc_create_data_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_create_data(NULL , NULL , 0);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_create_data_only not allow null");
-}
-
-static void utc_net_nfc_get_data_p(void)
-{
-       int ret=0;
-       data_h data = NULL;
-       uint8_t* byte = NULL;
-       uint32_t length;
-
-       byte = calloc(10, sizeof(uint8_t));
-
-       data = calloc(1, sizeof(data_s));
-
-       ret = net_nfc_get_data(data , &byte  , &length);
-
-       free(data);
-       free(byte);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_get_data is failed");
-}
-
-static void utc_net_nfc_get_data_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_get_data(NULL , NULL , NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_get_data not allow null");
-}
-
-static void utc_net_nfc_set_data_p(void)
-{
-       int ret=0;
-       data_h data = NULL;
-       uint8_t main_record_name[] = "samsung.com:allshare";
-
-       data = calloc(1, sizeof(data_h));
-
-       ret = net_nfc_set_data (data, main_record_name, 20);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_set_data is failed");
-}
-
-static void utc_net_nfc_set_data_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_set_data(NULL , NULL , 0);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_set_data not allow null");
-}
-
-static void utc_net_nfc_get_data_length_p(void)
-{
-       int ret=0;
-       int length = 0;
-       data_s* data = NULL;
-       //uint8_t temp_data[] = "www.samsung.com";
-       uint32_t temp_size = 16;
-
-       data = calloc(1, sizeof(data_s));
-
-       //data->buffer = temp_data;
-       data->length = temp_size;
-
-       length = net_nfc_get_data_length ((data_h)data);
-
-       if(length > 0)
-       {
-               ret = NET_NFC_OK;
-       }
-       else
-       {
-               ret = NET_NFC_UNKNOWN_ERROR;
-       }
-
-       free(data);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_get_data_length is failed");
-}
-
-static void utc_net_nfc_get_data_length_n(void)
-{
-       int ret=0;
-       int length = 0;
-
-       length = net_nfc_get_data_length(NULL);
-
-       if(length > 0)
-       {
-               ret = NET_NFC_OK;
-       }
-       else
-       {
-               ret = NET_NFC_UNKNOWN_ERROR;
-       }
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_get_data_length not allow null");
-}
-
-static void utc_net_nfc_get_data_buffer_p(void)
-{
-       int ret=0;
-       uint8_t* buffer = NULL;
-       data_s* data = NULL;
-       uint8_t temp_data[] = "www.samsung.com";
-       int temp_size = 16;
-
-       data = calloc(1, sizeof(data_s));
-
-       data->buffer = temp_data;
-       data->length = temp_size;
-
-       buffer = net_nfc_get_data_buffer ((data_h)data);
-
-       if(buffer != NULL)
-       {
-               ret = NET_NFC_OK;
-       }
-       else
-       {
-               ret = NET_NFC_UNKNOWN_ERROR;
-       }
-
-       free(data);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_get_data_buffer is failed");
-}
-
-static void utc_net_nfc_get_data_buffer_n(void)
-{
-       int ret=0;
-       uint8_t* buffer = NULL;
-
-       buffer = net_nfc_get_data_buffer(NULL);
-
-       if(buffer != NULL)
-       {
-               ret = NET_NFC_OK;
-       }
-       else
-       {
-               ret = NET_NFC_UNKNOWN_ERROR;
-       }
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_get_data_buffer not allow null");
-}
-
-static void utc_net_nfc_free_data_p(void)
-{
-       int ret=0;
-       data_h data = NULL;
-       //uint8_t temp_data[] = "www.samsung.com";
-       //uint32_t temp_size = 16;
-
-       data = calloc(1, sizeof(data_h));
-
-       ret = net_nfc_free_data (data);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_free_data is failed");
-}
-
-static void utc_net_nfc_free_data_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_free_data(NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_free_data not allow null");
-}
diff --git a/TC/testcase/utc_net_nfc_client_exchanger.c b/TC/testcase/utc_net_nfc_client_exchanger.c
deleted file mode 100644 (file)
index 61237b7..0000000
+++ /dev/null
@@ -1,130 +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 <tet_api.h>
-#include <net_nfc_data.h>
-#include <stdint.h>
-
-#include <net_nfc_exchanger.h>
-#include <net_nfc_typedef.h>
-#include <net_nfc_typedef_internal.h>
-#include <net_nfc_util_internal.h>
-
-
-enum {
-       POSITIVE_TC_IDX = 0x01,
-       NEGATIVE_TC_IDX,
-};
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_net_nfc_create_exchanger_data_p(void);
-static void utc_net_nfc_create_exchanger_data_n(void);
-static void utc_net_nfc_free_exchanger_data_p(void);
-static void utc_net_nfc_free_exchanger_data_n(void);
-static void utc_net_nfc_set_exchanger_cb_p(void);
-static void utc_net_nfc_set_exchanger_cb_n(void);
-static void utc_net_nfc_unset_exchanger_cb_p(void);
-static void utc_net_nfc_unset_exchanger_cb_n(void);
-
-
-
-
-
-struct tet_testlist tet_testlist[] = {
-       { utc_net_nfc_create_exchanger_data_p , POSITIVE_TC_IDX},
-       { utc_net_nfc_create_exchanger_data_n , NEGATIVE_TC_IDX},
-       { utc_net_nfc_free_exchanger_data_p, 1},
-       { utc_net_nfc_free_exchanger_data_n, 2 },
-       { utc_net_nfc_set_exchanger_cb_p, 1},
-       { utc_net_nfc_set_exchanger_cb_n, 2},
-       { utc_net_nfc_unset_exchanger_cb_p, 1},
-       { utc_net_nfc_unset_exchanger_cb_n, 2},
-       { NULL, 0 },
-};
-
-//this method is called only once in start
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-static void utc_net_nfc_create_exchanger_data_p(void)
-{
-       int ret=0;
-       net_nfc_exchanger_data_h* ex_data = NULL;
-       char temp[] = "http://www.samsung.com";
-       data_s payload;
-
-       payload.length= 23;
-
-       payload.buffer = calloc(1 , 23*sizeof(char));
-
-       memcpy(payload.buffer , temp , sizeof(temp));
-
-       ex_data = calloc(1 , sizeof(ex_data));
-
-       ret = net_nfc_create_exchanger_data(ex_data , (data_h)&payload);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_create_exchanger_url_type_data is failed");
-}
-
-static void utc_net_nfc_create_exchanger_data_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_create_exchanger_data(NULL , NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_create_exchanger_url_type_data not allow null");
-}
-
-static void utc_net_nfc_free_exchanger_data_p(void)
-{
-       int ret=0;
-       net_nfc_exchanger_data_h ex_data = NULL;
-       char temp[] = "http://www.samsung.com";
-       data_s payload;
-
-       payload.length= 23;
-
-       payload.buffer = calloc(1 , 23*sizeof(char));
-
-       memcpy(payload.buffer , temp , sizeof(temp));
-
-       net_nfc_create_exchanger_data(&ex_data , (data_h)&payload );
-
-       ret = net_nfc_free_exchanger_data(ex_data);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "utc_net_nfc_free_exchanger_data_p is failed");
-}
-
-static void utc_net_nfc_free_exchanger_data_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_free_exchanger_data(NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "utc_net_nfc_free_exchanger_data_p not allow null");
-}
-
diff --git a/TC/testcase/utc_net_nfc_client_internal_se.c b/TC/testcase/utc_net_nfc_client_internal_se.c
deleted file mode 100644 (file)
index 8882cf0..0000000
+++ /dev/null
@@ -1,169 +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 <tet_api.h>
-
-#include "net_nfc_tag.h"
-#include "net_nfc_typedef_internal.h"
-#include "net_nfc_internal_se.h"
-#include "net_nfc_util_internal.h"
-#include "net_nfc_data.h"
-
-
-enum {
-       POSITIVE_TC_IDX = 0x01,
-       NEGATIVE_TC_IDX,
-};
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_net_nfc_set_secure_element_type_p(void);
-static void utc_net_nfc_set_secure_element_type_n(void);
-static void utc_net_nfc_get_secure_element_type_p(void);
-static void utc_net_nfc_get_secure_element_type_n(void);
-static void utc_net_nfc_open_internal_secure_element_p(void);
-static void utc_net_nfc_open_internal_secure_element_n(void);
-static void utc_net_nfc_close_internal_secure_element_p(void);
-static void utc_net_nfc_close_internal_secure_element_n(void);
-static void utc_net_nfc_send_apdu_p(void);
-static void utc_net_nfc_send_apdu_n(void);
-
-
-
-struct tet_testlist tet_testlist[] = {
-       { utc_net_nfc_set_secure_element_type_p , POSITIVE_TC_IDX },
-       { utc_net_nfc_set_secure_element_type_n , NEGATIVE_TC_IDX },
-       { utc_net_nfc_get_secure_element_type_p, POSITIVE_TC_IDX },
-       { utc_net_nfc_get_secure_element_type_n , NEGATIVE_TC_IDX},
-       { utc_net_nfc_open_internal_secure_element_p, 1},
-       { utc_net_nfc_open_internal_secure_element_n, 2 },
-       { utc_net_nfc_close_internal_secure_element_p, 1},
-       { utc_net_nfc_close_internal_secure_element_n, 2},
-       { utc_net_nfc_send_apdu_p, 1},
-       { utc_net_nfc_send_apdu_n, 2},
-       { NULL, 0 },
-};
-
-//this method is called only once in start
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-static void utc_net_nfc_set_secure_element_type_p(void)
-{
-       int ret=0;
-
-       ret = net_nfc_set_secure_element_type(NET_NFC_SE_TYPE_UICC, NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_set_secure_element_type_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_set_secure_element_type( -1 , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_secure_element_type_p(void)
-{
-       int ret=0;
-
-       ret = net_nfc_get_secure_element_type(NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_secure_element_type_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_get_secure_element_type(NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_open_internal_secure_element_p(void)
-{
-       net_nfc_open_internal_secure_element(NET_NFC_SE_TYPE_ESE, NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_open_internal_secure_element_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_open_internal_secure_element(NET_NFC_SE_TYPE_ESE, NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_close_internal_secure_element_p(void)
-{
-       int ret=0;
-       void * trans_data = NULL;
-
-       ret = net_nfc_close_internal_secure_element ((net_nfc_target_handle_h)trans_data, NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_close_internal_secure_element_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_close_internal_secure_element(NULL , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_send_apdu_p(void)
-{
-       int ret ;
-       net_nfc_target_handle_h data = NULL;
-       data_h apdu = NULL;
-       uint8_t apdu_cmd[4] = {0x00, 0xA4, 0x00, 0x0C} ; // CLA 0-> use default channel and no secure message. 0xA4 -> select instruction
-
-       //data->connection_id = 1;
-       //data->connection_type = NET_NFC_SE_CONNECTION;
-
-       net_nfc_create_data(&apdu, apdu_cmd, 4);
-
-       ret = net_nfc_send_apdu((net_nfc_target_handle_h)(data), apdu, data);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_send_apdu_n(void)
-{
-       int ret ;
-
-       ret = net_nfc_send_apdu(NULL , NULL , NULL );
-
-       dts_pass(__func__, "PASS");
-}
diff --git a/TC/testcase/utc_net_nfc_client_ndef_message.c b/TC/testcase/utc_net_nfc_client_ndef_message.c
deleted file mode 100644 (file)
index 25d6bc4..0000000
+++ /dev/null
@@ -1,258 +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 <tet_api.h>
-#include <stdint.h>
-
-#include "net_nfc_ndef_message.h"
-#include "net_nfc_util_internal.h"
-#include "net_nfc.h" // to use net_nfc_data
-
-
-enum {
-       POSITIVE_TC_IDX = 0x01,
-       NEGATIVE_TC_IDX,
-};
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_net_nfc_create_ndef_message_p(void);
-static void utc_net_nfc_create_ndef_message_n(void);
-static void utc_net_nfc_create_rawdata_from_ndef_message_p(void);
-static void utc_net_nfc_create_rawdata_from_ndef_message_n(void);
-static void utc_net_nfc_create_ndef_message_from_rawdata_p(void);
-static void utc_net_nfc_create_ndef_message_from_rawdata_n(void);
-static void utc_net_nfc_get_ndef_message_byte_length_p(void);
-static void utc_net_nfc_get_ndef_message_byte_length_n(void);
-static void utc_net_nfc_append_record_to_ndef_message_p(void);
-static void utc_net_nfc_append_record_to_ndef_message_n(void);
-static void utc_net_nfc_free_ndef_message_p(void);
-static void utc_net_nfc_free_ndef_message_n(void);
-static void utc_net_nfc_get_ndef_message_record_count_p(void);
-static void utc_net_nfc_get_ndef_message_record_count_n(void);
-
-
-
-
-struct tet_testlist tet_testlist[] = {
-       { utc_net_nfc_create_ndef_message_p , POSITIVE_TC_IDX },
-       { utc_net_nfc_create_ndef_message_n , NEGATIVE_TC_IDX },
-       { utc_net_nfc_create_rawdata_from_ndef_message_p, POSITIVE_TC_IDX },
-       { utc_net_nfc_create_rawdata_from_ndef_message_n , NEGATIVE_TC_IDX},
-       { utc_net_nfc_create_ndef_message_from_rawdata_p, 1},
-       { utc_net_nfc_create_ndef_message_from_rawdata_n, 2 },
-       { utc_net_nfc_get_ndef_message_byte_length_p, 1},
-       { utc_net_nfc_get_ndef_message_byte_length_n, 2},
-       { utc_net_nfc_append_record_to_ndef_message_p, 1},
-       { utc_net_nfc_append_record_to_ndef_message_n, 2},
-       { utc_net_nfc_free_ndef_message_p, 1},
-       { utc_net_nfc_free_ndef_message_n, 2},
-       { utc_net_nfc_get_ndef_message_record_count_p, 1},
-       { utc_net_nfc_get_ndef_message_record_count_n, 2},
-       { NULL, 0 },
-};
-
-//this method is called only once in start
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-static void utc_net_nfc_create_ndef_message_p(void)
-{
-       int ret ;
-       ndef_message_h message;
-
-       ret = net_nfc_create_ndef_message(&message);
-       net_nfc_free_ndef_message(message);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_create_ndef_message is failed");
-}
-
-static void utc_net_nfc_create_ndef_message_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_create_ndef_message( NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_create_ndef_message not allow null");
-}
-
-static void utc_net_nfc_create_rawdata_from_ndef_message_p(void)
-{
-       int ret ;
-       char url[] = "samsung.com";
-       ndef_record_h record = NULL;
-       ndef_message_h msg = NULL;
-       data_h rawdata = NULL;
-
-       net_nfc_create_uri_type_record(&record, url, NET_NFC_SCHEMA_HTTPS_WWW);
-
-       net_nfc_create_ndef_message(&msg);
-
-       net_nfc_append_record_to_ndef_message(msg, record);
-
-       ret = net_nfc_create_rawdata_from_ndef_message (msg, &rawdata);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_create_rawdata_from_ndef_message is failed");
-}
-
-static void utc_net_nfc_create_rawdata_from_ndef_message_n(void)
-{
-       int ret ;
-
-       ret = net_nfc_create_rawdata_from_ndef_message (NULL, NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_create_rawdata_from_ndef_message not allow null");
-}
-
-static void utc_net_nfc_create_ndef_message_from_rawdata_p(void)
-{
-       int ret ;
-       uint8_t url[] = "samsung.com";
-       ndef_message_s* msg = NULL;
-       data_s* rawdata = NULL;
-
-       rawdata = calloc(1, sizeof(data_s));
-       msg = calloc(1, sizeof(ndef_message_s));
-
-       rawdata->buffer = url;
-       rawdata->length = 11;
-
-       ret = net_nfc_create_ndef_message_from_rawdata ((ndef_message_h*)msg, (data_h)rawdata);
-
-       net_nfc_free_ndef_message((ndef_message_h)msg);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_create_ndef_message_from_rawdata is failed");
-}
-
-static void utc_net_nfc_create_ndef_message_from_rawdata_n(void)
-{
-       int ret ;
-
-       ret = net_nfc_create_ndef_message_from_rawdata (NULL, NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK,"net_nfc_create_ndef_message_from_rawdata not allow null");
-}
-
-static void utc_net_nfc_get_ndef_message_byte_length_p(void)
-{
-       int ret ;
-       char url[] = "samsung.com";
-       ndef_record_h record = NULL;
-       ndef_message_h msg = NULL;
-       uint32_t length = 0;
-
-       net_nfc_create_uri_type_record(&record, url, NET_NFC_SCHEMA_HTTPS_WWW);
-
-       net_nfc_create_ndef_message(&msg);
-
-       net_nfc_append_record_to_ndef_message(msg, record);
-
-       ret = net_nfc_get_ndef_message_byte_length(msg , &length);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_get_ndef_message_byte_length is failed");
-}
-
-static void utc_net_nfc_get_ndef_message_byte_length_n(void)
-{
-       int ret ;
-
-       ret = net_nfc_get_ndef_message_byte_length (NULL, NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK,"net_nfc_get_ndef_message_byte_length not allow null");
-}
-
-static void utc_net_nfc_append_record_to_ndef_message_p(void)
-{
-       int ret ;
-       char url[] = "samsung.com";
-       ndef_record_h record = NULL;
-       ndef_message_h msg = NULL;
-
-       net_nfc_create_uri_type_record(&record, url, NET_NFC_SCHEMA_HTTPS_WWW);
-
-       net_nfc_create_ndef_message(&msg);
-
-       ret = net_nfc_append_record_to_ndef_message(msg, record);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_append_record_to_ndef_message is failed");
-}
-
-static void utc_net_nfc_append_record_to_ndef_message_n(void)
-{
-       int ret ;
-
-       ret = net_nfc_append_record_to_ndef_message (NULL, NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK,"net_nfc_append_record_to_ndef_message not allow null");
-}
-
-static void utc_net_nfc_free_ndef_message_p(void)
-{
-       int ret ;
-       ndef_message_h message;
-
-       net_nfc_create_ndef_message(&message);
-       ret = net_nfc_free_ndef_message(message);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "utc_net_nfc_free_ndef_message_n is failed");
-}
-
-static void utc_net_nfc_free_ndef_message_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_free_ndef_message( NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "utc_net_nfc_free_ndef_message_n not allow null");
-}
-
-static void utc_net_nfc_get_ndef_message_record_count_p(void)
-{
-       int ret ;
-       char url[] = "samsung.com";
-       ndef_record_h record = NULL;
-       ndef_message_h msg = NULL;
-       int count = 0;
-
-       net_nfc_create_uri_type_record(&record, url, NET_NFC_SCHEMA_HTTPS_WWW);
-
-       net_nfc_create_ndef_message(&msg);
-
-       net_nfc_append_record_to_ndef_message(msg, record);
-
-       ret = net_nfc_get_ndef_message_record_count( msg , &count );
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_get_ndef_message_record_count is failed");
-}
-
-static void utc_net_nfc_get_ndef_message_record_count_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_get_ndef_message_record_count( NULL , NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_get_ndef_message_record_count not allow null");
-}
diff --git a/TC/testcase/utc_net_nfc_client_ndef_record.c b/TC/testcase/utc_net_nfc_client_ndef_record.c
deleted file mode 100644 (file)
index efd9de8..0000000
+++ /dev/null
@@ -1,571 +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 <tet_api.h>
-#include <stdint.h>
-
-#include "net_nfc_ndef_record.h"
-#include "net_nfc_ndef_message.h"
-#include "net_nfc_util_internal.h"
-#include "net_nfc_data.h"
-//#include "net_nfc_debug_internal.h"
-#include "net_nfc_util_internal.h"
-
-
-enum {
-       POSITIVE_TC_IDX = 0x01,
-       NEGATIVE_TC_IDX,
-};
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_net_nfc_create_record_p(void);
-static void utc_net_nfc_create_record_n(void);
-static void utc_net_nfc_create_text_type_record_p(void);
-static void utc_net_nfc_create_text_type_record_n(void);
-static void utc_net_nfc_create_uri_type_record_p(void);
-static void utc_net_nfc_create_uri_type_record_n(void);
-static void utc_net_nfc_free_record_p(void);
-static void utc_net_nfc_free_record_n(void);
-static void utc_net_nfc_get_record_payload_p(void);
-static void utc_net_nfc_get_record_payload_n(void);
-static void utc_net_nfc_get_record_type_p(void);
-static void utc_net_nfc_get_record_type_n(void);
-static void utc_net_nfc_set_record_id_p(void);
-static void utc_net_nfc_set_record_id_n(void);
-static void utc_net_nfc_get_record_id_p(void);
-static void utc_net_nfc_get_record_id_n(void);
-static void utc_net_nfc_get_record_tnf_p(void);
-static void utc_net_nfc_get_record_tnf_n(void);
-static void utc_net_nfc_get_record_flags_p(void);
-static void utc_net_nfc_get_record_flags_n(void);
-static void utc_net_nfc_get_record_mb_p(void);
-static void utc_net_nfc_get_record_mb_n(void);
-static void utc_net_nfc_get_record_me_p(void);
-static void utc_net_nfc_get_record_me_n(void);
-static void utc_net_nfc_get_record_cf_p(void);
-static void utc_net_nfc_get_record_cf_n(void);
-static void utc_net_nfc_get_record_il_p(void);
-static void utc_net_nfc_get_record_il_n(void);
-static void utc_net_nfc_get_record_sr_p(void);
-static void utc_net_nfc_get_record_sr_n(void);
-static void utc_net_nfc_create_text_string_from_text_record_p(void);
-static void utc_net_nfc_create_text_string_from_text_record_n(void);
-static void utc_net_nfc_get_languange_code_string_from_text_record_p(void);
-static void utc_net_nfc_get_languange_code_string_from_text_record_n(void);
-static void utc_net_nfc_get_encoding_type_from_text_record_p(void);
-static void utc_net_nfc_get_encoding_type_from_text_record_n(void);
-static void utc_net_nfc_create_uri_string_from_uri_record_p(void);
-static void utc_net_nfc_create_uri_string_from_uri_record_n(void);
-
-
-
-
-
-
-
-struct tet_testlist tet_testlist[] = {
-       { utc_net_nfc_create_record_p , POSITIVE_TC_IDX },
-       { utc_net_nfc_create_record_n , NEGATIVE_TC_IDX },
-       { utc_net_nfc_create_text_type_record_p, POSITIVE_TC_IDX },
-       { utc_net_nfc_create_text_type_record_n , NEGATIVE_TC_IDX},
-       { utc_net_nfc_create_uri_type_record_p, 1},
-       { utc_net_nfc_create_uri_type_record_n, 2 },
-       { utc_net_nfc_free_record_p, 1},
-       { utc_net_nfc_free_record_n, 2},
-       { utc_net_nfc_get_record_payload_p, 1},
-       { utc_net_nfc_get_record_payload_n, 2},
-       { utc_net_nfc_get_record_type_p, 1},
-       { utc_net_nfc_get_record_type_n, 2},
-       { utc_net_nfc_set_record_id_p, 1},
-       { utc_net_nfc_set_record_id_n, 2},
-       { utc_net_nfc_get_record_id_p, 1},
-       { utc_net_nfc_get_record_id_n, 2},
-       { utc_net_nfc_get_record_tnf_p, 1},
-       { utc_net_nfc_get_record_tnf_n, 2},
-       { utc_net_nfc_get_record_flags_p, 1},
-       { utc_net_nfc_get_record_flags_n, 2},
-       { utc_net_nfc_get_record_mb_p, 1},
-       { utc_net_nfc_get_record_mb_n, 2},
-       { utc_net_nfc_get_record_me_p, 1},
-       { utc_net_nfc_get_record_me_n, 2},
-       { utc_net_nfc_get_record_cf_p, 1},
-       { utc_net_nfc_get_record_cf_n, 2},
-       { utc_net_nfc_get_record_il_p, 1},
-       { utc_net_nfc_get_record_il_n, 2},
-       { utc_net_nfc_get_record_sr_p, 1},
-       { utc_net_nfc_get_record_sr_n, 2},
-       { utc_net_nfc_create_text_string_from_text_record_p, 1},
-       { utc_net_nfc_create_text_string_from_text_record_n, 2},
-       { utc_net_nfc_get_languange_code_string_from_text_record_p, 1},
-       { utc_net_nfc_get_languange_code_string_from_text_record_n, 2},
-       { utc_net_nfc_get_encoding_type_from_text_record_p, 1},
-       { utc_net_nfc_get_encoding_type_from_text_record_n, 2},
-       { utc_net_nfc_create_uri_string_from_uri_record_p, 1},
-       { utc_net_nfc_create_uri_string_from_uri_record_n, 2},
-       { NULL, 0 },
-};
-
-//this method is called only once in start
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-static void utc_net_nfc_create_record_p(void)
-{
-       int ret ;
-       ndef_record_h record = NULL;
-       data_s* payload = NULL;
-       data_s* typeName = NULL;
-       uint8_t url[] = "samsung.com";
-       uint8_t temp[] = "U";
-
-       typeName = calloc(1, sizeof(data_s));
-       payload = calloc(1, sizeof(data_s));
-
-       typeName->buffer = temp;
-       typeName->length = 1;
-
-       payload->buffer = url;
-       payload->length = 11;
-
-       ret = net_nfc_create_record(&record,  NET_NFC_RECORD_WELL_KNOWN_TYPE, (data_h)typeName, NULL, (data_h)payload);
-
-       net_nfc_free_record(record);
-
-       free(payload);
-       free(typeName);
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_create_record is failed");
-}
-
-static void utc_net_nfc_create_record_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_create_record( NULL , 0 , NULL , NULL , NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_create_record not allow null");
-}
-
-static void utc_net_nfc_create_text_type_record_p(void)
-{
-       int ret ;
-       ndef_record_h record = NULL;
-
-       ret = net_nfc_create_text_type_record(&record, "This is real NFC", "en-US", NET_NFC_ENCODE_UTF_8);
-
-       net_nfc_free_record(record);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_create_text_type_record is failed");
-}
-
-static void utc_net_nfc_create_text_type_record_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_create_text_type_record( NULL , NULL , NULL , 0 );
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_create_text_type_record not allow null");
-}
-
-static void utc_net_nfc_create_uri_type_record_p(void)
-{
-       int ret ;
-       ndef_record_h record = NULL;
-
-       ret = net_nfc_create_uri_type_record(&record ,"http://www.naver.com", NET_NFC_SCHEMA_FULL_URI);
-
-       net_nfc_free_record(record);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_create_uri_type_record is failed");
-}
-
-static void utc_net_nfc_create_uri_type_record_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_create_uri_type_record( NULL , NULL , 0 );
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_create_uri_type_record not allow null");
-}
-
-static void utc_net_nfc_free_record_p(void)
-{
-       int ret ;
-       ndef_record_h record = NULL;
-
-       net_nfc_create_uri_type_record(&record ,"http://www.naver.com", NET_NFC_SCHEMA_FULL_URI);
-
-       ret = net_nfc_free_record(record);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_free_record is failed");
-}
-
-static void utc_net_nfc_free_record_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_free_record(NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_free_record not allow null");
-}
-
-static void utc_net_nfc_get_record_payload_p(void)
-{
-       int ret ;
-       ndef_record_h record = NULL;
-       data_h payload = NULL;
-
-       net_nfc_create_uri_type_record(&record ,"http://www.naver.com", NET_NFC_SCHEMA_FULL_URI);
-
-       ret = net_nfc_get_record_payload(record, &payload);
-
-       net_nfc_free_record(record);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_get_record_payload is failed");
-}
-
-static void utc_net_nfc_get_record_payload_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_get_record_payload(NULL, NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_get_record_payload not allow null");
-}
-
-static void utc_net_nfc_get_record_type_p(void)
-{
-       int ret ;
-       ndef_record_h record = NULL;
-       data_h record_type = NULL;
-
-       net_nfc_create_uri_type_record(&record ,"http://www.naver.com", NET_NFC_SCHEMA_FULL_URI);
-
-       ret = net_nfc_get_record_type(record, &record_type);
-
-       net_nfc_free_record(record);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_get_record_type is failed");
-}
-
-static void utc_net_nfc_get_record_type_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_get_record_type(NULL, NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_get_record_type not allow null");
-}
-
-static void utc_net_nfc_set_record_id_p(void)
-{
-       int ret ;
-       ndef_record_h record = NULL;
-       data_s* id = NULL;
-       uint8_t temp[] = "test";
-
-       net_nfc_create_uri_type_record(&record ,"http://www.naver.com", NET_NFC_SCHEMA_FULL_URI);
-
-       id = calloc(1, sizeof(data_s));
-       id->buffer = temp;
-       id->length = 4;
-
-       ret = net_nfc_set_record_id(record, (data_h)id);
-
-       net_nfc_free_record(record);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_set_record_id is failed");
-}
-
-static void utc_net_nfc_set_record_id_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_set_record_id(NULL, NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_set_record_id not allow null");
-}
-
-static void utc_net_nfc_get_record_id_p(void)
-{
-       int ret ;
-       ndef_record_h record = NULL;
-       data_s* id = NULL;
-       data_h id_data = NULL;
-       uint8_t temp[] = "test";
-
-       net_nfc_create_uri_type_record(&record ,"http://www.naver.com", NET_NFC_SCHEMA_FULL_URI);
-
-       id = calloc(1, sizeof(data_s));
-       id->buffer = temp;
-       id->length = 4;
-
-       net_nfc_set_record_id(record, (data_h)id);
-
-       ret = net_nfc_get_record_id(record, &id_data);
-
-       net_nfc_free_record(record);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_get_record_id is failed");
-}
-
-static void utc_net_nfc_get_record_id_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_get_record_id(NULL, NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_get_record_id not allow null");
-}
-
-static void utc_net_nfc_get_record_tnf_p(void)
-{
-       int ret ;
-       ndef_record_h record = NULL;
-       net_nfc_record_tnf_e* tnf = NULL;
-
-       record = calloc( 1 , sizeof(ndef_record_h));
-
-       net_nfc_create_uri_type_record(&record ,"http://www.naver.com", NET_NFC_SCHEMA_FULL_URI);
-
-       tnf = calloc( 1 , sizeof(net_nfc_record_tnf_e));
-
-       ret = net_nfc_get_record_tnf(record, tnf);
-
-       net_nfc_free_record(record);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_get_record_tnf is failed");
-}
-
-static void utc_net_nfc_get_record_tnf_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_get_record_tnf(NULL, NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_get_record_tnf not allow null");
-}
-
-static void utc_net_nfc_get_record_flags_p(void)
-{
-       net_nfc_error_e ret=0;
-       ndef_record_s* record = NULL;
-       uint8_t temp = 0x80;
-
-       record = calloc(1, sizeof(ndef_record_s));
-
-       net_nfc_create_uri_type_record((ndef_record_h*)&record ,"http://www.naver.com", NET_NFC_SCHEMA_FULL_URI);
-
-       ret = net_nfc_get_record_flags((ndef_record_h)record, &temp);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_get_record_flags is failed");
-}
-
-static void utc_net_nfc_get_record_flags_n(void)
-{
-       net_nfc_error_e ret=0;
-
-       ret = net_nfc_get_record_flags(NULL, NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_get_record_flags is failed");
-}
-
-static void utc_net_nfc_get_record_mb_p(void)
-{
-       unsigned char ret=0;
-       unsigned char flag = 0x80;
-
-       ret = net_nfc_get_record_mb (flag);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_record_mb_n(void)
-{
-       unsigned char ret=0;
-
-       ret = net_nfc_get_record_mb(0x00);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_record_me_p(void)
-{
-       unsigned char ret=0;
-
-       ret = net_nfc_get_record_me(0xff);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_record_me_n(void)
-{
-       unsigned char ret=0;
-
-       ret = net_nfc_get_record_me(0xff);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_record_cf_p(void)
-{
-       unsigned char ret=0;
-
-       ret = net_nfc_get_record_cf(0xff);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_record_cf_n(void)
-{
-       unsigned char ret=0;
-
-       ret = net_nfc_get_record_cf(0xff);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_record_il_p(void)
-{
-       unsigned char ret=0;
-
-       ret = net_nfc_get_record_il(0xff);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_record_il_n(void)
-{
-       unsigned char ret=0;
-
-       ret = net_nfc_get_record_il(0xff);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_record_sr_p(void)
-{
-       unsigned char ret=0;
-
-       ret = net_nfc_get_record_sr (0xff);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_record_sr_n(void)
-{
-       unsigned char ret=0;
-
-       ret = net_nfc_get_record_sr(0xff);
-
-       dts_pass(__func__, "PASS");
-}
-static void utc_net_nfc_create_text_string_from_text_record_p(void)
-{
-       int ret ;
-       ndef_record_h record = NULL;
-       char *disp_text = NULL;
-
-       net_nfc_create_text_type_record(&record, "This is real NFC", "en-US", NET_NFC_ENCODE_UTF_8);
-
-       ret = net_nfc_create_text_string_from_text_record (record, &disp_text);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_create_text_string_from_text_record is failed");
-}
-
-static void utc_net_nfc_create_text_string_from_text_record_n(void)
-{
-       int ret ;
-
-       ret = net_nfc_create_text_string_from_text_record (NULL, NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_create_text_string_from_text_record not allow null");
-}
-
-static void utc_net_nfc_get_languange_code_string_from_text_record_p(void)
-{
-       int ret ;
-       ndef_record_h record = NULL;
-       char* language_code_str = NULL;
-
-       net_nfc_create_text_type_record(&record, "This is real NFC", "en-US", NET_NFC_ENCODE_UTF_8);
-
-       ret = net_nfc_get_languange_code_string_from_text_record (record, &language_code_str);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_get_languange_code_string_from_text_record is failed");
-}
-
-static void utc_net_nfc_get_languange_code_string_from_text_record_n(void)
-{
-       int ret ;
-
-       ret = net_nfc_get_languange_code_string_from_text_record (NULL, NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_get_languange_code_string_from_text_record not allow null");
-}
-
-static void utc_net_nfc_get_encoding_type_from_text_record_p(void)
-{
-       int ret ;
-       ndef_record_h record = NULL;
-       net_nfc_encode_type_e utf;
-
-       net_nfc_create_text_type_record(&record, "This is real NFC", "en-US", NET_NFC_ENCODE_UTF_8);
-
-       ret = net_nfc_get_encoding_type_from_text_record (record, &utf);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_get_encoding_type_from_text_record is failed");
-}
-
-static void utc_net_nfc_get_encoding_type_from_text_record_n(void)
-{
-       int ret ;
-
-       ret = net_nfc_get_encoding_type_from_text_record (NULL, NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_get_encoding_type_from_text_record not allow null");
-}
-
-static void utc_net_nfc_create_uri_string_from_uri_record_p(void)
-{
-       int ret=0;
-       ndef_record_h record = NULL;
-       char *disp_text = NULL;
-
-       net_nfc_create_uri_type_record(&record ,"http://www.naver.com", NET_NFC_SCHEMA_FULL_URI);
-
-       net_nfc_create_uri_string_from_uri_record(record, &disp_text);
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_create_uri_string_from_uri_record is failed");
-}
-
-static void utc_net_nfc_create_uri_string_from_uri_record_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_create_uri_string_from_uri_record(NULL, NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_create_uri_string_from_uri_record is failed");
-}
diff --git a/TC/testcase/utc_net_nfc_client_nfc.c b/TC/testcase/utc_net_nfc_client_nfc.c
deleted file mode 100644 (file)
index a8431fe..0000000
+++ /dev/null
@@ -1,161 +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 <tet_api.h>
-
-#include "net_nfc.h"
-#include "net_nfc_typedef.h"
-#include "net_nfc_util_internal.h"
-
-#ifdef SECURITY_SERVER
-#include <security-server.h>
-#endif
-
-
-enum {
-       POSITIVE_TC_IDX = 0x01,
-       NEGATIVE_TC_IDX,
-};
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_net_nfc_initialize_p(void);
-static void utc_net_nfc_initialize_n(void);
-static void utc_net_nfc_deinitialize_p(void);
-static void utc_net_nfc_deinitialize_n(void);
-static void utc_net_nfc_set_response_callback_p(void);
-static void utc_net_nfc_set_response_callback_n(void);
-static void utc_net_nfc_unset_response_callback_p(void);
-static void utc_net_nfc_unset_response_callback_n(void);
-
-static void net_nfc_test_client_cb(net_nfc_message_e message, net_nfc_error_e result, void* data, void* user_param, void * trans_data )
-{
-};
-
-
-
-struct tet_testlist tet_testlist[] = {
-       { utc_net_nfc_initialize_p , POSITIVE_TC_IDX },
-       { utc_net_nfc_initialize_n , NEGATIVE_TC_IDX },
-       { utc_net_nfc_deinitialize_p, POSITIVE_TC_IDX },
-       { utc_net_nfc_deinitialize_n , NEGATIVE_TC_IDX},
-       { utc_net_nfc_set_response_callback_p, 1},
-       { utc_net_nfc_set_response_callback_n, 2 },
-       { utc_net_nfc_unset_response_callback_p, 1},
-       { utc_net_nfc_unset_response_callback_n, 2},
-       { NULL, 0 },
-};
-
-//this method is called only once in start
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-static void utc_net_nfc_initialize_p(void)
-{
-       int ret ;
-
-       ret = net_nfc_initialize();
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_initialize_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_initialize();
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_deinitialize_p(void)
-{
-       int ret ;
-
-       net_nfc_initialize();
-       ret = net_nfc_deinitialize();
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_deinitialize is failed");
-}
-
-static void utc_net_nfc_deinitialize_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_deinitialize();
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_deinitialize not allow null");
-}
-
-static void utc_net_nfc_set_response_callback_p(void)
-{
-       int ret ;
-       //net_nfc_response_cb cb;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_set_response_callback(net_nfc_test_client_cb, NULL);
-
-       net_nfc_unset_response_callback();
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_set_response_callback is failed");
-}
-
-static void utc_net_nfc_set_response_callback_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_set_response_callback(NULL, NULL);
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_set_response_callback not allow null");
-}
-
-static void utc_net_nfc_unset_response_callback_p(void)
-{
-       int ret ;
-       //net_nfc_response_cb cb;
-
-       net_nfc_initialize();
-
-       net_nfc_set_response_callback(net_nfc_test_client_cb, NULL);
-
-       ret = net_nfc_unset_response_callback();
-
-       net_nfc_deinitialize();
-
-       dts_check_eq(__func__, ret, NET_NFC_OK, "net_nfc_unset_response_callback is failed");
-}
-
-static void utc_net_nfc_unset_response_callback_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_unset_response_callback();
-
-       dts_check_ne(__func__, ret, NET_NFC_OK, "net_nfc_unset_response_callback not allow null");
-}
diff --git a/TC/testcase/utc_net_nfc_client_tag.c b/TC/testcase/utc_net_nfc_client_tag.c
deleted file mode 100644 (file)
index b3cfe7b..0000000
+++ /dev/null
@@ -1,256 +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 <tet_api.h>
-#include <stdint.h>
-
-#include "net_nfc_typedef_internal.h"
-#include "net_nfc_util_internal.h"
-#include "net_nfc.h"
-
-
-enum {
-       POSITIVE_TC_IDX = 0x01,
-       NEGATIVE_TC_IDX,
-};
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_net_nfc_format_ndef_p(void);
-static void utc_net_nfc_format_ndef_n(void);
-static void utc_net_nfc_set_tag_filter_p(void);
-static void utc_net_nfc_set_tag_filter_n(void);
-static void utc_net_nfc_get_tag_filter_p(void);
-static void utc_net_nfc_get_tag_filter_n(void);
-static void utc_net_nfc_transceive_p(void);
-static void utc_net_nfc_transceive_n(void);
-static void utc_net_nfc_read_ndef_p(void);
-static void utc_net_nfc_read_ndef_n(void);
-static void utc_net_nfc_write_ndef_p(void);
-static void utc_net_nfc_write_ndef_n(void);
-static void utc_net_nfc_make_read_only_ndef_tag_p(void);
-static void utc_net_nfc_make_read_only_ndef_tag_n(void);
-
-
-struct tet_testlist tet_testlist[] = {
-       { utc_net_nfc_format_ndef_p , POSITIVE_TC_IDX },
-       { utc_net_nfc_format_ndef_n , NEGATIVE_TC_IDX },
-       { utc_net_nfc_set_tag_filter_p, POSITIVE_TC_IDX },
-       { utc_net_nfc_set_tag_filter_n , NEGATIVE_TC_IDX},
-       { utc_net_nfc_get_tag_filter_p, 1},
-       { utc_net_nfc_get_tag_filter_n, 2 },
-       { utc_net_nfc_transceive_p, 1},
-       { utc_net_nfc_transceive_n, 2},
-       { utc_net_nfc_read_ndef_p, 1},
-       { utc_net_nfc_read_ndef_n, 2},
-       { utc_net_nfc_write_ndef_p, 1},
-       { utc_net_nfc_write_ndef_n, 2},
-       { utc_net_nfc_make_read_only_ndef_tag_p, 1},
-       { utc_net_nfc_make_read_only_ndef_tag_n, 2},
-       { NULL, 0 },
-};
-
-//this method is called only once in start
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-
-static void utc_net_nfc_format_ndef_p(void)
-{
-       int ret=0;
-       data_h key;
-       uint8_t data [] = {0xff,0xff,0xff,0xff,0xff,0xff};
-
-       net_nfc_initialize();
-
-       net_nfc_create_data (&key, data, 6);
-
-       ret = net_nfc_format_ndef((net_nfc_target_handle_h) 0x302023, key, NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_format_ndef_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_format_ndef(NULL, NULL, NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_set_tag_filter_p(void)
-{
-       int ret=0;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_set_tag_filter(NET_NFC_ISO14443A_ENABLE);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_set_tag_filter_n(void)
-{
-       int ret=0;
-       net_nfc_event_filter_e config = NET_NFC_ALL_ENABLE;
-
-       ret = net_nfc_set_tag_filter(config);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_tag_filter_p(void)
-{
-       net_nfc_event_filter_e ret=0;
-
-       net_nfc_initialize();
-
-       net_nfc_set_tag_filter(NET_NFC_ISO14443A_ENABLE);
-
-       ret = net_nfc_get_tag_filter();
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_tag_filter_n(void)
-{
-       net_nfc_event_filter_e ret=0;
-
-       ret = net_nfc_get_tag_filter();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_transceive_p(void)
-{
-       int ret ;
-       net_nfc_target_handle_h handle = NULL;
-       void* trans_param = NULL;
-       unsigned char send_buffer[6] = {0x00, };
-
-       send_buffer[0] = 0x06;
-       send_buffer[1] = 0x00;
-
-       // use wild card for system code
-       send_buffer[2] = 0xff;
-       send_buffer[3] = 0xff;
-
-       send_buffer[4] = 0xff;
-       send_buffer[5] = 0xff;
-
-       data_s rawdata;
-
-       rawdata.buffer = send_buffer;
-       rawdata.length = 6;
-
-       ret = net_nfc_transceive(handle, (data_h)&rawdata, trans_param);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_transceive_n(void)
-{
-       int ret ;
-
-       ret = net_nfc_transceive(NULL, NULL, NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_read_ndef_p(void)
-{
-       int ret ;
-
-       ret = net_nfc_read_tag((net_nfc_target_handle_h) 0x302023, NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_read_ndef_n(void)
-{
-       int ret ;
-
-       ret = net_nfc_read_tag(NULL, NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_write_ndef_p(void)
-{
-       int ret ;
-       ndef_message_h message = NULL;
-       ndef_record_h record = NULL;
-
-       net_nfc_initialize();
-
-       net_nfc_create_ndef_message (&message);
-       net_nfc_create_text_type_record (&record, "abc" ,"en-US" ,NET_NFC_ENCODE_UTF_8);
-       net_nfc_append_record_to_ndef_message (message ,record);
-
-       ret = net_nfc_write_ndef ((net_nfc_target_handle_h)0x302023 ,message ,NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_write_ndef_n(void)
-{
-       int ret ;
-
-       ret = net_nfc_write_ndef(NULL, NULL , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_make_read_only_ndef_tag_p(void)
-{
-       int ret ;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_make_read_only_ndef_tag ((net_nfc_target_handle_h)0x302023 , NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_make_read_only_ndef_tag_n(void)
-{
-       int ret;
-
-       ret = net_nfc_make_read_only_ndef_tag(NULL , NULL);
-
-       dts_pass(__func__, "PASS");
-}
diff --git a/TC/testcase/utc_net_nfc_client_tag_felica.c b/TC/testcase/utc_net_nfc_client_tag_felica.c
deleted file mode 100644 (file)
index d7dae1c..0000000
+++ /dev/null
@@ -1,242 +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 <tet_api.h>
-
-#include "net_nfc_ndef_record.h"
-#include "net_nfc_ndef_message.h"
-#include "net_nfc_util_internal.h"
-#include "net_nfc_data.h"
-#include "net_nfc.h"
-#include "net_nfc_tag_felica.h"
-
-
-enum {
-       POSITIVE_TC_IDX = 0x01,
-       NEGATIVE_TC_IDX,
-};
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_net_nfc_felica_poll_p(void);
-static void utc_net_nfc_felica_poll_n(void);
-static void utc_net_nfc_felica_request_service_p(void);
-static void utc_net_nfc_felica_request_service_n(void);
-static void utc_net_nfc_felica_request_response_p(void);
-static void utc_net_nfc_felica_request_response_n(void);
-static void utc_net_nfc_felica_read_without_encryption_p(void);
-static void utc_net_nfc_felica_read_without_encryption_n(void);
-static void utc_net_nfc_felica_write_without_encryption_p(void);
-static void utc_net_nfc_felica_write_without_encryption_n(void);
-static void utc_net_nfc_felica_request_system_code_p(void);
-static void utc_net_nfc_felica_request_system_code_n(void);
-
-
-struct tet_testlist tet_testlist[] = {
-       { utc_net_nfc_felica_poll_p , POSITIVE_TC_IDX },
-       { utc_net_nfc_felica_poll_n , NEGATIVE_TC_IDX },
-       { utc_net_nfc_felica_request_service_p, POSITIVE_TC_IDX },
-       { utc_net_nfc_felica_request_service_n , NEGATIVE_TC_IDX},
-       { utc_net_nfc_felica_request_response_p, 1},
-       { utc_net_nfc_felica_request_response_n, 2 },
-       { utc_net_nfc_felica_read_without_encryption_p, 1},
-       { utc_net_nfc_felica_read_without_encryption_n, 2},
-       { utc_net_nfc_felica_write_without_encryption_p, 1},
-       { utc_net_nfc_felica_write_without_encryption_n, 2},
-       { utc_net_nfc_felica_request_system_code_p, 1},
-       { utc_net_nfc_felica_request_system_code_n, 2},
-       { NULL, 0 },
-};
-
-//this method is called only once in start
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-
-static void utc_net_nfc_felica_poll_p(void)
-{
-       int ret=0;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_felica_poll((net_nfc_target_handle_h) 0x302023, NET_NFC_FELICA_POLL_COMM_SPEED_REQUEST , 0x0 , NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_felica_poll_n(void)
-{
-       int ret=0;
-       uint8_t temp[]= "a";
-
-       ret = net_nfc_felica_poll(NULL , NET_NFC_FELICA_POLL_NO_REQUEST , temp[0] , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_felica_request_service_p(void)
-{
-       int ret=0;
-       unsigned short service_code = 0xffff;
-
-       net_nfc_initialize();
-
-       net_nfc_felica_poll((net_nfc_target_handle_h) 0x302023, NET_NFC_FELICA_POLL_COMM_SPEED_REQUEST , 0x0 , NULL);
-
-       ret = net_nfc_felica_request_service((net_nfc_target_handle_h) 0x302023 , 1 , &service_code , 1 , NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_felica_request_service_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_felica_request_service(NULL , 1 , NULL , 1, NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_felica_request_response_p(void)
-{
-       int ret=0;
-
-       net_nfc_initialize();
-
-       net_nfc_felica_poll((net_nfc_target_handle_h) 0x302023, NET_NFC_FELICA_POLL_COMM_SPEED_REQUEST , 0x0 , NULL);
-
-       ret = net_nfc_felica_request_response((net_nfc_target_handle_h) 0x302023 ,  NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_felica_request_response_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_felica_request_response( NULL , NULL );
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_felica_read_without_encryption_p(void)
-{
-       int ret=0;
-       unsigned short service_code = 0xffff;
-       unsigned char blocks = 0x2;
-
-       net_nfc_initialize();
-
-       net_nfc_felica_poll((net_nfc_target_handle_h) 0x302023, NET_NFC_FELICA_POLL_COMM_SPEED_REQUEST , 0x0 , NULL);
-
-       ret = net_nfc_felica_read_without_encryption((net_nfc_target_handle_h) 0x302023, 1, &service_code, 1, &blocks, NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_felica_read_without_encryption_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_felica_read_without_encryption(NULL, 1, NULL, 1, NULL, NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_felica_write_without_encryption_p(void)
-{
-       int ret=0;
-       unsigned short service_code = 0xffff;
-       unsigned char blocks = 0x2;
-       unsigned char send_buffer[6] = {0x00, };
-
-       send_buffer[0] = 0x06;
-       send_buffer[1] = 0x00;
-
-       // use wild card for system code
-       send_buffer[2] = 0xff;
-       send_buffer[3] = 0xff;
-
-       send_buffer[4] = 0xff;
-       send_buffer[5] = 0xff;
-
-       data_h rawdata = NULL;
-
-       rawdata = calloc(1,sizeof(data_h));
-
-       net_nfc_initialize();
-
-       net_nfc_felica_poll((net_nfc_target_handle_h) 0x302023, NET_NFC_FELICA_POLL_COMM_SPEED_REQUEST , 0x0 , NULL);
-
-       ret = net_nfc_felica_write_without_encryption((net_nfc_target_handle_h) 0x302023, 1, &service_code, 1, &blocks, rawdata , NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_felica_write_without_encryption_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_felica_write_without_encryption(NULL, 1, NULL, 1, NULL, NULL , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_felica_request_system_code_p(void)
-{
-       int ret=0;
-       //unsigned short service_code = 0xffff;
-       //unsigned char blocks = 0x2;
-
-       net_nfc_initialize();
-
-       net_nfc_felica_poll((net_nfc_target_handle_h) 0x302023, NET_NFC_FELICA_POLL_COMM_SPEED_REQUEST , 0x0 , NULL);
-
-       ret = net_nfc_felica_request_system_code((net_nfc_target_handle_h) 0x302023 , NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_felica_request_system_code_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_felica_request_system_code(NULL, NULL);
-
-       dts_pass(__func__, "PASS");
-}
diff --git a/TC/testcase/utc_net_nfc_client_tag_jewel.c b/TC/testcase/utc_net_nfc_client_tag_jewel.c
deleted file mode 100644 (file)
index 8e5d702..0000000
+++ /dev/null
@@ -1,185 +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 <tet_api.h>
-
-#include "net_nfc_tag.h"
-#include "net_nfc_typedef_internal.h"
-#include "net_nfc_util_internal.h"
-#include "net_nfc_tag_jewel.h"
-#include "net_nfc_target_info.h"
-#include "net_nfc.h"
-
-#include <string.h>
-
-
-enum {
-       POSITIVE_TC_IDX = 0x01,
-       NEGATIVE_TC_IDX,
-};
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_net_nfc_jewel_read_id_p(void);
-static void utc_net_nfc_jewel_read_id_n(void);
-static void utc_net_nfc_jewel_read_byte_p(void);
-static void utc_net_nfc_jewel_read_byte_n(void);
-static void utc_net_nfc_jewel_read_all_p(void);
-static void utc_net_nfc_jewel_read_all_n(void);
-static void utc_net_nfc_jewel_write_with_erase_p(void);
-static void utc_net_nfc_jewel_write_with_erase_n(void);
-static void utc_net_nfc_jewel_write_with_no_erase_p(void);
-static void utc_net_nfc_jewel_write_with_no_erase_n(void);
-
-
-struct tet_testlist tet_testlist[] = {
-       { utc_net_nfc_jewel_read_id_p , POSITIVE_TC_IDX },
-       { utc_net_nfc_jewel_read_id_n , NEGATIVE_TC_IDX },
-       { utc_net_nfc_jewel_read_byte_p, POSITIVE_TC_IDX },
-       { utc_net_nfc_jewel_read_byte_n , NEGATIVE_TC_IDX},
-       { utc_net_nfc_jewel_read_all_p, 1},
-       { utc_net_nfc_jewel_read_all_n, 2 },
-       { utc_net_nfc_jewel_write_with_erase_p, 1},
-       { utc_net_nfc_jewel_write_with_erase_n, 2},
-       { utc_net_nfc_jewel_write_with_no_erase_p, 1},
-       { utc_net_nfc_jewel_write_with_no_erase_n, 2},
-       { NULL, 0 },
-};
-
-//this method is called only once in start
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-
-static void utc_net_nfc_jewel_read_id_p(void)
-{
-       int ret=0;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_jewel_read_id((net_nfc_target_handle_h) 0x302023,  NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_jewel_read_id_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_jewel_read_id(NULL , NULL );
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_jewel_read_byte_p(void)
-{
-       int ret=0;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_jewel_read_byte((net_nfc_target_handle_h) 0x302023 , 1 , 0 , NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_jewel_read_byte_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_jewel_read_byte(NULL , 0 , 0 , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_jewel_read_all_p(void)
-{
-       int ret=0;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_jewel_read_all((net_nfc_target_handle_h) 0x302023 ,  NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_jewel_read_all_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_jewel_read_all( NULL , NULL );
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_jewel_write_with_erase_p(void)
-{
-       int ret=0;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_jewel_write_with_erase((net_nfc_target_handle_h) 0x302023 , 1 , 0 , 0xff , NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_jewel_write_with_erase_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_jewel_write_with_erase(NULL, 0, 0, 0xff, NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_jewel_write_with_no_erase_p(void)
-{
-       int ret=0;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_jewel_write_with_no_erase((net_nfc_target_handle_h) 0x302023 , 1 , 0 , 0xff , NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_jewel_write_with_no_erase_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_jewel_write_with_no_erase(NULL, 0, 0, 0xff, NULL);
-
-       dts_pass(__func__, "PASS");
-}
diff --git a/TC/testcase/utc_net_nfc_client_tag_mifare.c b/TC/testcase/utc_net_nfc_client_tag_mifare.c
deleted file mode 100644 (file)
index 092978f..0000000
+++ /dev/null
@@ -1,369 +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 <tet_api.h>
-
-#include "net_nfc_tag.h"
-#include "net_nfc_typedef_internal.h"
-#include "net_nfc_util_internal.h"
-#include "net_nfc_tag_jewel.h"
-#include "net_nfc_target_info.h"
-#include "net_nfc.h"
-
-#include <string.h>
-
-
-enum {
-       POSITIVE_TC_IDX = 0x01,
-       NEGATIVE_TC_IDX,
-};
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_net_nfc_mifare_create_default_key_p(void);
-static void utc_net_nfc_mifare_create_default_key_n(void);
-static void utc_net_nfc_mifare_create_application_directory_key_p(void);
-static void utc_net_nfc_mifare_create_application_directory_key_n(void);
-static void utc_net_nfc_mifare_create_net_nfc_forum_key_p(void);
-static void utc_net_nfc_mifare_create_net_nfc_forum_key_n(void);
-static void utc_net_nfc_mifare_authenticate_with_keyA_p(void);
-static void utc_net_nfc_mifare_authenticate_with_keyA_n(void);
-static void utc_net_nfc_mifare_authenticate_with_keyB_p(void);
-static void utc_net_nfc_mifare_authenticate_with_keyB_n(void);
-static void utc_net_nfc_mifare_read_p(void);
-static void utc_net_nfc_mifare_read_n(void);
-static void utc_net_nfc_mifare_write_block_p(void);
-static void utc_net_nfc_mifare_write_block_n(void);
-static void utc_net_nfc_mifare_write_page_p(void);
-static void utc_net_nfc_mifare_write_page_n(void);
-static void utc_net_nfc_mifare_increment_p(void);
-static void utc_net_nfc_mifare_increment_n(void);
-static void utc_net_nfc_mifare_decrement_p(void);
-static void utc_net_nfc_mifare_decrement_n(void);
-static void utc_net_nfc_mifare_transfer_p(void);
-static void utc_net_nfc_mifare_transfer_n(void);
-static void utc_net_nfc_mifare_restore_p(void);
-static void utc_net_nfc_mifare_restore_n(void);
-
-
-
-struct tet_testlist tet_testlist[] = {
-       { utc_net_nfc_mifare_create_default_key_p , POSITIVE_TC_IDX },
-       { utc_net_nfc_mifare_create_default_key_n , NEGATIVE_TC_IDX },
-       { utc_net_nfc_mifare_create_application_directory_key_p, POSITIVE_TC_IDX },
-       { utc_net_nfc_mifare_create_application_directory_key_n , NEGATIVE_TC_IDX},
-       { utc_net_nfc_mifare_create_net_nfc_forum_key_p, 1},
-       { utc_net_nfc_mifare_create_net_nfc_forum_key_n, 2 },
-       { utc_net_nfc_mifare_authenticate_with_keyA_p, 1},
-       { utc_net_nfc_mifare_authenticate_with_keyA_n, 2},
-       { utc_net_nfc_mifare_authenticate_with_keyB_p, 1},
-       { utc_net_nfc_mifare_authenticate_with_keyB_n, 2},
-       { utc_net_nfc_mifare_read_p, 1},
-       { utc_net_nfc_mifare_read_n, 2},
-       { utc_net_nfc_mifare_write_block_p, 1},
-       { utc_net_nfc_mifare_write_block_n, 2},
-       { utc_net_nfc_mifare_write_page_p, 1},
-       { utc_net_nfc_mifare_write_page_n, 2},
-       { utc_net_nfc_mifare_increment_p, 1},
-       { utc_net_nfc_mifare_increment_n, 2},
-       { utc_net_nfc_mifare_decrement_p, 1},
-       { utc_net_nfc_mifare_decrement_n, 2},
-       { utc_net_nfc_mifare_transfer_p, 1},
-       { utc_net_nfc_mifare_transfer_n, 2},
-       { utc_net_nfc_mifare_restore_p, 1},
-       { utc_net_nfc_mifare_restore_n, 2},
-       { NULL, 0 },
-};
-
-//this method is called only once in start
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-
-static void utc_net_nfc_mifare_create_default_key_p(void)
-{
-       int ret=0;
-       data_h default_key = NULL;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_mifare_create_default_key(&default_key);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_create_default_key_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_mifare_create_default_key(NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_create_application_directory_key_p(void)
-{
-       int ret=0;
-       data_h mad_key = NULL;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_mifare_create_application_directory_key(&mad_key);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_create_application_directory_key_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_mifare_create_application_directory_key(NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_create_net_nfc_forum_key_p(void)
-{
-       int ret=0;
-       data_h net_nfc_forum_key = NULL;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_mifare_create_net_nfc_forum_key(&net_nfc_forum_key);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_create_net_nfc_forum_key_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_mifare_create_net_nfc_forum_key( NULL );
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_authenticate_with_keyA_p(void)
-{
-       data_h default_key = NULL;
-       int sector = 1;
-       data_h key = NULL;
-
-       net_nfc_initialize();
-
-       net_nfc_mifare_create_default_key(&default_key);
-
-       key = default_key;
-
-       net_nfc_mifare_authenticate_with_keyA((net_nfc_target_handle_h) 0x302023, sector, default_key, NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_authenticate_with_keyA_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_mifare_authenticate_with_keyA(NULL , 0 , NULL , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_authenticate_with_keyB_p(void)
-{
-       data_h default_key = NULL;
-       int sector = 1;
-       data_h key = NULL;
-
-       net_nfc_initialize();
-
-       net_nfc_mifare_create_default_key(&default_key);
-
-       key = default_key;
-
-       net_nfc_mifare_authenticate_with_keyB((net_nfc_target_handle_h) 0x302023, sector, key, NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_authenticate_with_keyB_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_mifare_authenticate_with_keyB(NULL , 0 , NULL , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_read_p(void)
-{
-       net_nfc_initialize();
-
-       net_nfc_mifare_read((net_nfc_target_handle_h) 0x302023 , 5, NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_read_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_mifare_read(NULL , 0 , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_write_block_p(void)
-{
-       net_nfc_initialize();
-
-       net_nfc_mifare_write_block((net_nfc_target_handle_h) 0x302023 , 5, NULL , NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_write_block_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_mifare_write_block(NULL , 0 , NULL , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_write_page_p(void)
-{
-       net_nfc_initialize();
-
-       net_nfc_mifare_write_block((net_nfc_target_handle_h) 0x302023 , 5, NULL , NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_write_page_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_mifare_write_block(NULL , 0 , NULL , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_increment_p(void)
-{
-       net_nfc_initialize();
-
-       net_nfc_mifare_increment((net_nfc_target_handle_h) 0x302023 , 5 , 0 , NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_increment_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_mifare_increment(NULL , 5 , 0 , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_decrement_p(void)
-{
-       net_nfc_initialize();
-
-       net_nfc_mifare_decrement((net_nfc_target_handle_h) 0x302023 , 5 , 0 , NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_decrement_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_mifare_decrement(NULL , 5 , 0 , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_transfer_p(void)
-{
-       net_nfc_initialize();
-
-       net_nfc_mifare_transfer((net_nfc_target_handle_h) 0x302023 , 5, NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_transfer_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_mifare_transfer(NULL , 5 , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_restore_p(void)
-{
-       net_nfc_initialize();
-
-       net_nfc_mifare_restore((net_nfc_target_handle_h) 0x302023 , 5, NULL);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_mifare_restore_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_mifare_restore(NULL , 5 , NULL);
-
-       dts_pass(__func__, "PASS");
-}
diff --git a/TC/testcase/utc_net_nfc_client_target_info.c b/TC/testcase/utc_net_nfc_client_target_info.c
deleted file mode 100644 (file)
index c8aaf7e..0000000
+++ /dev/null
@@ -1,296 +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 <tet_api.h>
-
-#include "net_nfc_typedef.h"
-#include "net_nfc_typedef_internal.h"
-#include "net_nfc_target_info.h"
-#include "net_nfc_data.h"
-#include <stdbool.h>
-#include "net_nfc.h"
-
-enum {
-       POSITIVE_TC_IDX = 0x01,
-       NEGATIVE_TC_IDX,
-};
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_net_nfc_get_tag_type_p(void);
-static void utc_net_nfc_get_tag_type_n(void);
-static void utc_net_nfc_get_tag_handle_p(void);
-static void utc_net_nfc_get_tag_handle_n(void);
-static void utc_net_nfc_get_tag_ndef_support_p(void);
-static void utc_net_nfc_get_tag_ndef_support_n(void);
-static void utc_net_nfc_get_tag_max_data_size_p(void);
-static void utc_net_nfc_get_tag_max_data_size_n(void);
-static void utc_net_nfc_get_tag_actual_data_size_p(void);
-static void utc_net_nfc_get_tag_actual_data_size_n(void);
-static void utc_net_nfc_get_tag_info_keys_p(void);
-static void utc_net_nfc_get_tag_info_keys_n(void);
-static void utc_net_nfc_get_tag_info_value_p(void);
-static void utc_net_nfc_get_tag_info_value_n(void);
-
-
-struct tet_testlist tet_testlist[] = {
-       { utc_net_nfc_get_tag_type_p , POSITIVE_TC_IDX },
-       { utc_net_nfc_get_tag_type_n , NEGATIVE_TC_IDX },
-       { utc_net_nfc_get_tag_handle_p, POSITIVE_TC_IDX },
-       { utc_net_nfc_get_tag_handle_n , NEGATIVE_TC_IDX},
-       { utc_net_nfc_get_tag_ndef_support_p, 1},
-       { utc_net_nfc_get_tag_ndef_support_n, 2 },
-       { utc_net_nfc_get_tag_max_data_size_p, 1},
-       { utc_net_nfc_get_tag_max_data_size_n, 2},
-       { utc_net_nfc_get_tag_actual_data_size_p, 1},
-       { utc_net_nfc_get_tag_actual_data_size_n, 2},
-       { utc_net_nfc_get_tag_info_keys_p, 1},
-       { utc_net_nfc_get_tag_info_keys_n, 2},
-       { utc_net_nfc_get_tag_info_value_p, 1},
-       { utc_net_nfc_get_tag_info_value_n, 2},
-       { NULL, 0 },
-};
-
-//this method is called only once in start
-static void startup(void)
-{
-       /* start of TC */
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-
-static void utc_net_nfc_get_tag_type_p(void)
-{
-       int ret=0;
-       net_nfc_target_info_s* target_info;
-       net_nfc_target_type_e type;
-
-       target_info = calloc(1, sizeof(net_nfc_target_info_s));
-
-       target_info->devType = NET_NFC_GENERIC_PICC;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_get_tag_type((net_nfc_target_info_h)target_info , &type);
-
-       net_nfc_deinitialize();
-
-       free(target_info);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_tag_type_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_get_tag_type(NULL , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_tag_handle_p(void)
-{
-       int ret=0;
-       net_nfc_target_info_s* target_info;
-       net_nfc_target_handle_h id;
-
-       target_info = calloc(1, sizeof(net_nfc_target_info_s));
-
-       target_info->handle = (net_nfc_target_handle_s*)0x302023;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_get_tag_handle((net_nfc_target_info_h)target_info , &id);
-
-       net_nfc_deinitialize();
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_tag_handle_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_get_tag_handle(NULL , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_tag_ndef_support_p(void)
-{
-       int ret=0;
-       net_nfc_target_info_s* target_info;
-       bool is_ndef;
-
-       target_info = calloc(1, sizeof(net_nfc_target_info_s));
-       target_info->is_ndef_supported = 1;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_get_tag_ndef_support((net_nfc_target_info_h)target_info , &is_ndef);
-
-       net_nfc_deinitialize();
-
-       free(target_info);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_tag_ndef_support_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_get_tag_ndef_support(NULL , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_tag_max_data_size_p(void)
-{
-       int ret=0;
-       net_nfc_target_info_s* target_info;
-       net_nfc_target_type_e max_size = 0;
-
-       target_info = calloc(1, sizeof(net_nfc_target_info_s));
-       target_info->maxDataSize = 128;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_get_tag_max_data_size((net_nfc_target_info_h)target_info , &max_size);
-
-       net_nfc_deinitialize();
-
-       free(target_info);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_tag_max_data_size_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_get_tag_max_data_size(NULL , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_tag_actual_data_size_p(void)
-{
-       int ret=0;
-       net_nfc_target_info_s* target_info;
-       net_nfc_target_type_e size = 0;
-
-       target_info = calloc(1, sizeof(net_nfc_target_info_s));
-       target_info->actualDataSize = 128;
-
-       net_nfc_initialize();
-
-       ret = net_nfc_get_tag_actual_data_size((net_nfc_target_info_h)target_info , &size);
-
-       net_nfc_deinitialize();
-
-       free(target_info);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_tag_actual_data_size_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_get_tag_actual_data_size(NULL , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_tag_info_keys_p(void)
-{
-       int ret=0;
-       net_nfc_target_info_s* target_info;
-       char** keys = NULL;
-       int nok = 0;
-
-       target_info = calloc(1, sizeof(net_nfc_target_info_s));
-
-       net_nfc_initialize();
-
-       ret = net_nfc_get_tag_info_keys((net_nfc_target_info_h)target_info, &keys, &nok);
-
-       net_nfc_deinitialize();
-
-       free(target_info);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_tag_info_keys_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_get_tag_info_keys(NULL ,  NULL , NULL);
-
-       dts_pass(__func__, "PASS");
-}
-static void utc_net_nfc_get_tag_info_value_p(void)
-{
-       net_nfc_target_info_s* target_info;
-       data_h* value = NULL;
-       char* keys = NULL;
-
-       keys = calloc( 1 , sizeof(char));
-
-       target_info = calloc(1, sizeof(net_nfc_target_info_s));
-       target_info->actualDataSize = 128;
-       target_info->tag_info_list = calloc(1 , sizeof(net_nfc_tag_info_s));
-
-       target_info->tag_info_list->key = '1';
-       target_info->tag_info_list->value = calloc(1 , sizeof(data_h));
-
-       value = calloc(1, sizeof(data_h));
-
-       net_nfc_initialize();
-
-       //net_nfc_get_tag_info_keys((net_nfc_target_info_h)target_info, &keys, &nok);
-
-       net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info , keys , value);
-
-       net_nfc_deinitialize();
-
-       free(target_info->tag_info_list->value);
-       free(target_info->tag_info_list);
-       free(target_info);
-       free(keys);
-       free(value);
-
-       dts_pass(__func__, "PASS");
-}
-
-static void utc_net_nfc_get_tag_info_value_n(void)
-{
-       int ret=0;
-
-       ret = net_nfc_get_tag_info_value(NULL , NULL , NULL);
-
-       dts_pass(__func__, "PASS");
-}
diff --git a/TC/tet_scen b/TC/tet_scen
deleted file mode 100644 (file)
index 03f029a..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-all
-       ^TEST
-##### Scenarios for TEST #####
-
-# Test scenario
-TEST
-       :include:/testcase/tslist
diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg
deleted file mode 100644 (file)
index f7eda55..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-TET_OUTPUT_CAPTURE=True # capture option for build operation checking
-TET_BUILD_TOOL=make # build with using make command
-TET_BUILD_FILE=-f Makefile # execution file (Makefile) for build
-TET_API_COMPLIANT=True # use TET API in Test Case ?
-TET_PASS_TC_NAME=True # report passed TC name in Journal file?
diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg
deleted file mode 100644 (file)
index 02d7030..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-TET_OUTPUT_CAPTURE=True # capture option
-TET_CLEAN_TOOL= make clean # clean tool
-TET_CLEAN_FILE= Makefile # file for clean
-TET_API_COMPLIANT=True # TET API useage 
-TET_PASS_TC_NAME=True # showing name , passed TC
diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg
deleted file mode 100644 (file)
index ef3e452..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-TET_OUTPUT_CAPTURE=True # capturing execution or not
-TET_EXEC_TOOL=  # ex) exec : execution tool set up/ Optional
-TET_EXEC_FILE=   # ex) exectool : execution file/ Optional
-TET_API_COMPLIANT=True # Test case or Tool usesTET API?
-TET_PASS_TC_NAME=True # showing Passed TC name ?
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2fbe8a8
--- /dev/null
@@ -0,0 +1,32 @@
+LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
+INCLUDE_DIRECTORIES(include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/manager/include)
+
+SET(NFC_CLIENT "nfc")
+
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} CLIENT_SRCS)
+
+pkg_check_modules(client_pkgs REQUIRED security-server dlog ecore-x vconf)
+
+FOREACH(flag ${client_pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+ADD_LIBRARY(${NFC_CLIENT} SHARED ${CLIENT_SRCS})
+TARGET_LINK_LIBRARIES(${NFC_CLIENT} ${client_pkgs_LDFLAGS} nfc-common)
+SET_TARGET_PROPERTIES(${NFC_CLIENT} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER})
+
+FILE(GLOB CLIENT_HEADER include/*.h)
+SET(CLIENT_HEADER ${CLIENT_HEADER} ${CMAKE_SOURCE_DIR}/common/include/net_nfc_typedef.h)
+
+CONFIGURE_FILE(${NFC_CLIENT}.pc.in ${NFC_CLIENT}.pc @ONLY)
+INSTALL(FILES ${NFC_CLIENT}.pc DESTINATION lib/pkgconfig)
+
+INSTALL(TARGETS ${NFC_CLIENT} DESTINATION lib)
+
+FOREACH(hfile ${CLIENT_HEADER})
+       INSTALL(FILES ${hfile} DESTINATION include/${NFC_CLIENT})
+ENDFOREACH(hfile)
similarity index 97%
rename from src/clientlib/include/net_nfc.h
rename to client/include/net_nfc.h
index 929705a..a6ab8dc 100644 (file)
@@ -39,7 +39,7 @@
 #include "net_nfc_client_se.h"
 #include "net_nfc_client_tag_felica.h"
 #include "net_nfc_client_tag_jewel.h"
-#include "net_nfc_tag_mifare.h"
+#include "net_nfc_client_tag_mifare.h"
 #include "net_nfc_client_test.h"
 
 #endif //__NET_NFC_H__
similarity index 99%
rename from src/clientlib/include/net_nfc_data.h
rename to client/include/net_nfc_data.h
index 7fc68cd..1a102ab 100644 (file)
@@ -16,7 +16,7 @@
 #ifndef __NET_NFC_DATA_H__
 #define __NET_NFC_DATA_H__
 
-#include <net_nfc_typedef.h>
+#include "net_nfc_typedef.h"
 
 #ifdef __cplusplus
 extern "C" {
similarity index 99%
rename from src/clientlib/include/net_nfc_target_info.h
rename to client/include/net_nfc_target_info.h
index a14cc8e..19aef2d 100644 (file)
@@ -146,7 +146,6 @@ net_nfc_error_e net_nfc_get_tag_actual_data_size (net_nfc_target_info_h target_i
     switch(message)
     {
       case NET_NFC_MESSAGE_TAG_DISCOVERED:
-      {
         if(info != NULL)
         {
           net_nfc_target_info_h target_info = (net_nfc_target_info_h)data;
@@ -165,7 +164,6 @@ net_nfc_error_e net_nfc_get_tag_actual_data_size (net_nfc_target_info_h target_i
 
           free(keys);
         }
-      }
     }
   }
   @endcode
@@ -192,7 +190,6 @@ net_nfc_error_e net_nfc_get_tag_info_keys(net_nfc_target_info_h target_info, cha
     switch(message)
     {
       case NET_NFC_MESSAGE_TAG_DISCOVERED:
-      {
         if(info != NULL)
         {
           net_nfc_target_info_h target_info = (net_nfc_target_info_h)data;
@@ -212,7 +209,6 @@ net_nfc_error_e net_nfc_get_tag_info_keys(net_nfc_target_info_h target_info, cha
             }
           }
         }
-      }
     }
   }
   @endcode
@@ -243,7 +239,6 @@ net_nfc_error_e net_nfc_get_tag_info_value(net_nfc_target_info_h target_info, co
     switch(message)
     {
       case NET_NFC_MESSAGE_TAG_DISCOVERED:
-      {
         net_nfc_target_info_h target_info = (net_nfc_target_info_h)data;
         net_nfc_target_info_h handle = NULL;
 
@@ -252,8 +247,7 @@ net_nfc_error_e net_nfc_get_tag_info_value(net_nfc_target_info_h target_info, co
         // do something...
 
         net_nfc_release_tag_info(handle);
-      }
-      break;
+        break;
     }
   }
   @endcode
similarity index 95%
rename from src/clientlib/net_nfc_client.c
rename to client/net_nfc_client.c
index f62b84a..2d0e476 100644 (file)
 #include "net_nfc_client_system_handler.h"
 #include "net_nfc_client_handover.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
 #ifdef SECURITY_SERVER
 static uint8_t *cookie;
 static size_t cookie_len;
@@ -51,8 +47,8 @@ static void _init_smack()
                        cookie = g_new0(uint8_t, cookie_len);
                        if (cookie != NULL) {
                                if (security_server_request_cookie(
-                                       (char *)cookie,
-                                       cookie_len) < 0) {
+                                                       (char *)cookie,
+                                                       cookie_len) < 0) {
                                        g_free(cookie);
                                        cookie = NULL;
                                }
similarity index 77%
rename from src/clientlib/net_nfc_client_context.c
rename to client/net_nfc_client_context.c
index c05e64b..1b2246e 100644 (file)
  */
 #include <vconf.h>
 
+#include "net_nfc_debug_internal.h"
 #include "net_nfc_typedef.h"
 #include "net_nfc_client.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
 
-
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_initialize()
+API net_nfc_error_e net_nfc_client_initialize()
 {
        net_nfc_error_e result = NET_NFC_OK;
 
@@ -34,8 +30,7 @@ net_nfc_error_e net_nfc_client_initialize()
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_deinitialize()
+API net_nfc_error_e net_nfc_client_deinitialize()
 {
        net_nfc_error_e result = NET_NFC_OK;
 
@@ -45,8 +40,7 @@ net_nfc_error_e net_nfc_client_deinitialize()
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_is_nfc_supported(int *state)
+API net_nfc_error_e net_nfc_client_is_nfc_supported(int *state)
 {
        net_nfc_error_e ret;
 
@@ -70,21 +64,16 @@ net_nfc_error_e net_nfc_client_is_nfc_supported(int *state)
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_get_nfc_state(int *state)
+API net_nfc_error_e net_nfc_client_get_nfc_state(int *state)
 {
        net_nfc_error_e ret;
 
        if (state != NULL)
        {
                if (vconf_get_bool(VCONFKEY_NFC_STATE, state) == 0)
-               {
                        ret = NET_NFC_OK;
-               }
                else
-               {
                        ret = NET_NFC_INVALID_STATE;
-               }
        }
        else
        {
similarity index 77%
rename from src/clientlib/net_nfc_client_data.c
rename to client/net_nfc_client_data.c
index 19817bb..7ea9693 100644 (file)
 #include "net_nfc_data.h"
 #include "net_nfc_typedef_internal.h"
 #include "net_nfc_util_internal.h"
+#include "net_nfc_debug_internal.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_data_only(data_h* data)
+API net_nfc_error_e net_nfc_create_data_only(data_h* data)
 {
        return net_nfc_create_data(data, NULL, 0);
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_data(data_h* data, const uint8_t* bytes, const uint32_t length)
+API net_nfc_error_e net_nfc_create_data(data_h* data,
+               const uint8_t* bytes, const uint32_t length)
 {
        data_s *tmp_data = NULL;
 
@@ -64,7 +62,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_data(data_h* data, const uint8
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_data(const data_h data, uint8_t** bytes, uint32_t * length)
+API net_nfc_error_e net_nfc_get_data(const data_h data, uint8_t** bytes, uint32_t * length)
 {
        if (data == NULL)
        {
@@ -78,7 +76,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_data(const data_h data, uint8_t**
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_set_data(const data_h data, const uint8_t* bytes, const uint32_t length)
+API net_nfc_error_e net_nfc_set_data(const data_h data, const uint8_t* bytes, const uint32_t length)
 {
        if (data == NULL)
        {
@@ -118,7 +116,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_set_data(const data_h data, const uin
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API uint32_t net_nfc_get_data_length(const data_h data)
+API uint32_t net_nfc_get_data_length(const data_h data)
 {
        if (data == NULL)
        {
@@ -129,7 +127,7 @@ NET_NFC_EXPORT_API uint32_t net_nfc_get_data_length(const data_h data)
        return tmp_data->length;
 }
 
-NET_NFC_EXPORT_API uint8_t * net_nfc_get_data_buffer(const data_h data)
+API uint8_t * net_nfc_get_data_buffer(const data_h data)
 {
        if (data == NULL)
        {
@@ -140,7 +138,7 @@ NET_NFC_EXPORT_API uint8_t * net_nfc_get_data_buffer(const data_h data)
        return tmp_data->buffer;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_free_data(data_h data)
+API net_nfc_error_e net_nfc_free_data(data_h data)
 {
        if (data == NULL)
        {
similarity index 55%
rename from src/clientlib/net_nfc_client_exchanger.c
rename to client/net_nfc_client_exchanger.c
index 3e1d5c7..ffe0655 100644 (file)
@@ -1,18 +1,18 @@
 /*
-* 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.
-*/
+ * 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 <pthread.h>
 
 
 static net_nfc_exchanger_cb gdbus_exch_cb = NULL;
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_create_exchanger_data(
-                       net_nfc_exchanger_data_h *ex_data,
-                       data_h payload)
+API net_nfc_error_e net_nfc_client_create_exchanger_data(
+               net_nfc_exchanger_data_h *ex_data,
+               data_h payload)
 {
        net_nfc_exchanger_data_s* tmp_ex_data = NULL;
 
@@ -44,8 +39,8 @@ net_nfc_error_e net_nfc_client_create_exchanger_data(
        }
 
        _net_nfc_util_alloc_mem(
-               tmp_ex_data,
-               sizeof(net_nfc_exchanger_data_s));
+                       tmp_ex_data,
+                       sizeof(net_nfc_exchanger_data_s));
 
        if (tmp_ex_data == NULL)
        {
@@ -55,8 +50,8 @@ net_nfc_error_e net_nfc_client_create_exchanger_data(
        tmp_ex_data->type = NET_NFC_EXCHANGER_RAW;
 
        _net_nfc_util_alloc_mem(
-               tmp_ex_data->binary_data.buffer,
-               ((data_s *)payload)->length);
+                       tmp_ex_data->binary_data.buffer,
+                       ((data_s *)payload)->length);
 
        if (tmp_ex_data->binary_data.buffer == NULL)
        {
@@ -66,8 +61,8 @@ net_nfc_error_e net_nfc_client_create_exchanger_data(
        }
 
        memcpy(tmp_ex_data->binary_data.buffer,
-                               ((data_s *)payload)->buffer,
-                               ((data_s *)payload)->length);
+                       ((data_s *)payload)->buffer,
+                       ((data_s *)payload)->length);
 
        tmp_ex_data->binary_data.length = ((data_s *)payload)->length;
 
@@ -77,9 +72,8 @@ net_nfc_error_e net_nfc_client_create_exchanger_data(
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_free_exchanger_data(
-                       net_nfc_exchanger_data_h ex_data)
+API net_nfc_error_e net_nfc_client_free_exchanger_data(
+               net_nfc_exchanger_data_h ex_data)
 {
        if (ex_data == NULL)
        {
@@ -89,7 +83,7 @@ net_nfc_error_e net_nfc_client_free_exchanger_data(
        if (((net_nfc_exchanger_data_s *)ex_data)->binary_data.buffer != NULL)
        {
                _net_nfc_util_free_mem(
-                       ((net_nfc_exchanger_data_s *)ex_data)->binary_data.buffer);
+                               ((net_nfc_exchanger_data_s *)ex_data)->binary_data.buffer);
        }
 
        _net_nfc_util_free_mem(ex_data);
@@ -97,14 +91,12 @@ net_nfc_error_e net_nfc_client_free_exchanger_data(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_exchanger_cb net_nfc_client_get_exchanger_cb()
+API net_nfc_exchanger_cb net_nfc_client_get_exchanger_cb()
 {
        return gdbus_exch_cb;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_unset_exchanger_cb()
+API net_nfc_error_e net_nfc_client_unset_exchanger_cb()
 {
 
        if (gdbus_exch_cb == NULL)
@@ -119,17 +111,16 @@ net_nfc_error_e net_nfc_client_unset_exchanger_cb()
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_send_exchanger_data(
-                       net_nfc_exchanger_data_h ex_handle,
-                       net_nfc_target_handle_h target_handle,
-                       void* trans_param)
+API net_nfc_error_e net_nfc_client_send_exchanger_data(
+               net_nfc_exchanger_data_h ex_handle,
+               net_nfc_target_handle_h target_handle,
+               void* trans_param)
 {
        net_nfc_error_e ret;
        net_nfc_exchanger_data_s *ex_data = (net_nfc_exchanger_data_s *)ex_handle;
 
        DEBUG_CLIENT_MSG("send reqeust :: exchanger data = "
-               "[%p] target_handle = [%p]", ex_handle, target_handle);
+                       "[%p] target_handle = [%p]", ex_handle, target_handle);
 
        /*Sync call is used because there is no callback provided*/
        ret = net_nfc_client_p2p_send_sync(ex_data,target_handle);
@@ -137,10 +128,9 @@ net_nfc_error_e net_nfc_client_send_exchanger_data(
        return ret;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_exchanger_request_connection_handover(
-                       net_nfc_target_handle_h target_handle,
-                       net_nfc_conn_handover_carrier_type_e type)
+API net_nfc_error_e net_nfc_client_exchanger_request_connection_handover(
+               net_nfc_target_handle_h target_handle,
+               net_nfc_conn_handover_carrier_type_e type)
 {
        net_nfc_error_e ret = NET_NFC_UNKNOWN_ERROR;
        net_nfc_conn_handover_carrier_type_e carrier_type;
@@ -152,17 +142,16 @@ net_nfc_error_e net_nfc_client_exchanger_request_connection_handover(
        }
 
        ret = net_nfc_client_p2p_connection_handover_sync(target_handle,
-                               type,
-                               &carrier_type,
-                               &data);
+                       type,
+                       &carrier_type,
+                       &data);
 
        return ret;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_exchanger_get_alternative_carrier_type(
-                       net_nfc_connection_handover_info_h info_handle,
-                       net_nfc_conn_handover_carrier_type_e *type)
+API net_nfc_error_e net_nfc_client_exchanger_get_alternative_carrier_type(
+               net_nfc_connection_handover_info_h info_handle,
+               net_nfc_conn_handover_carrier_type_e *type)
 {
        net_nfc_connection_handover_info_s *info = NULL;
 
@@ -176,10 +165,9 @@ net_nfc_error_e net_nfc_client_exchanger_get_alternative_carrier_type(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_exchanger_get_alternative_carrier_data(
-                       net_nfc_connection_handover_info_h info_handle,
-                       data_h *data)
+API net_nfc_error_e net_nfc_client_exchanger_get_alternative_carrier_data(
+               net_nfc_connection_handover_info_h info_handle,
+               data_h *data)
 {
        net_nfc_error_e result = NET_NFC_UNKNOWN_ERROR;
        net_nfc_connection_handover_info_s *info = NULL;
@@ -194,9 +182,8 @@ net_nfc_error_e net_nfc_client_exchanger_get_alternative_carrier_data(
        return result;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_exchanger_free_alternative_carrier_data(
-                       net_nfc_connection_handover_info_h info_handle)
+API net_nfc_error_e net_nfc_client_exchanger_free_alternative_carrier_data(
+               net_nfc_connection_handover_info_h info_handle)
 {
        net_nfc_error_e result = NET_NFC_UNKNOWN_ERROR;
        net_nfc_connection_handover_info_s *info = NULL;
similarity index 71%
rename from src/clientlib/net_nfc_client_handover.c
rename to client/net_nfc_client_handover.c
index 83d8a21..51478bd 100644 (file)
 #include "net_nfc_client_manager.h"
 #include "net_nfc_client_handover.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
 typedef struct _HandoverFuncData HandoverFuncData;
 
 struct _HandoverFuncData
@@ -40,12 +36,12 @@ struct _HandoverFuncData
 static NetNfcGDbusHandover *handover_proxy = NULL;
 
 static void p2p_connection_handover(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void p2p_connection_handover(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        HandoverFuncData *func_data;
        GVariant *data;
@@ -58,16 +54,16 @@ static void p2p_connection_handover(GObject *source_object,
        net_nfc_p2p_connection_handover_completed_cb callback;
 
        if(net_nfc_gdbus_handover_call_request_finish (handover_proxy,
-                                               (gint32 *)&event,
-                                               (gint32 *)&type,
-                                               &data,
-                                               res,
-                                               &error) == FALSE)
+                               (gint32 *)&event,
+                               (gint32 *)&type,
+                               &data,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_UNKNOWN_ERROR;
 
                DEBUG_ERR_MSG("Can not finish"
-                        " connection handover: %s", error->message);
+                               " connection handover: %s", error->message);
                g_error_free(error);
                return;
        }
@@ -89,12 +85,12 @@ static void p2p_connection_handover(GObject *source_object,
        net_nfc_util_gdbus_variant_to_data_s(data, &arg_data);
 
        callback = (net_nfc_p2p_connection_handover_completed_cb)
-                       func_data->handover_callback;
+               func_data->handover_callback;
 
        callback(result,
-               type,
-               &arg_data,
-               func_data->handover_data);
+                       type,
+                       &arg_data,
+                       func_data->handover_data);
 
        net_nfc_util_free_data(&arg_data);
 
@@ -102,9 +98,8 @@ static void p2p_connection_handover(GObject *source_object,
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_handover_free_alternative_carrier_data(
-                       net_nfc_connection_handover_info_h info_handle)
+API net_nfc_error_e net_nfc_client_handover_free_alternative_carrier_data(
+               net_nfc_connection_handover_info_h info_handle)
 {
        net_nfc_error_e result = NET_NFC_UNKNOWN_ERROR;
        net_nfc_connection_handover_info_s *info = NULL;
@@ -125,10 +120,9 @@ net_nfc_error_e net_nfc_client_handover_free_alternative_carrier_data(
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_handover_get_alternative_carrier_type(
-                       net_nfc_connection_handover_info_h info_handle,
-                       net_nfc_conn_handover_carrier_type_e *type)
+API net_nfc_error_e net_nfc_client_handover_get_alternative_carrier_type(
+               net_nfc_connection_handover_info_h info_handle,
+               net_nfc_conn_handover_carrier_type_e *type)
 {
        net_nfc_connection_handover_info_s *info = NULL;
 
@@ -142,10 +136,9 @@ net_nfc_error_e net_nfc_client_handover_get_alternative_carrier_type(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_handover_get_alternative_carrier_data(
-                       net_nfc_connection_handover_info_h info_handle,
-                       data_h *data)
+API net_nfc_error_e net_nfc_client_handover_get_alternative_carrier_data(
+               net_nfc_connection_handover_info_h info_handle,
+               data_h *data)
 {
        net_nfc_error_e result = NET_NFC_UNKNOWN_ERROR;
        net_nfc_connection_handover_info_s *info = NULL;
@@ -161,12 +154,11 @@ net_nfc_error_e net_nfc_client_handover_get_alternative_carrier_data(
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_p2p_connection_handover(
-                       net_nfc_target_handle_h handle,
-                       net_nfc_conn_handover_carrier_type_e arg_type,
-                       net_nfc_p2p_connection_handover_completed_cb callback,
-                       void *cb_data)
+API net_nfc_error_e net_nfc_client_p2p_connection_handover(
+               net_nfc_target_handle_h handle,
+               net_nfc_conn_handover_carrier_type_e arg_type,
+               net_nfc_p2p_connection_handover_completed_cb callback,
+               void *cb_data)
 {
 
        HandoverFuncData *funcdata = NULL;
@@ -191,23 +183,22 @@ net_nfc_error_e net_nfc_client_p2p_connection_handover(
        funcdata->handover_data = cb_data;
 
        net_nfc_gdbus_handover_call_request(handover_proxy,
-                                       GPOINTER_TO_UINT(tag_handle),
-                                       arg_type,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       NULL,
-                                       p2p_connection_handover,
-                                       funcdata);
+                       GPOINTER_TO_UINT(tag_handle),
+                       arg_type,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       p2p_connection_handover,
+                       funcdata);
 
        return NET_NFC_OK;
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_p2p_connection_handover_sync(
-                       net_nfc_target_handle_h handle,
-                       net_nfc_conn_handover_carrier_type_e arg_type,
-                       net_nfc_conn_handover_carrier_type_e *out_carrier,
-                       data_h *out_ac_data)
+API net_nfc_error_e net_nfc_client_p2p_connection_handover_sync(
+               net_nfc_target_handle_h handle,
+               net_nfc_conn_handover_carrier_type_e arg_type,
+               net_nfc_conn_handover_carrier_type_e *out_carrier,
+               data_h *out_ac_data)
 {
 
        net_nfc_target_handle_s *tag_handle = (net_nfc_target_handle_s *)handle;
@@ -228,14 +219,14 @@ net_nfc_error_e net_nfc_client_p2p_connection_handover_sync(
        }
 
        if(net_nfc_gdbus_handover_call_request_sync(handover_proxy,
-                                               GPOINTER_TO_UINT(tag_handle),
-                                               arg_type,
-                                               net_nfc_client_gdbus_get_privilege(),
-                                               (gint32 *)&out_event,
-                                               (gint32 *)&out_type,
-                                               &out_data,
-                                               NULL,
-                                               &error) == FALSE)
+                               GPOINTER_TO_UINT(tag_handle),
+                               arg_type,
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint32 *)&out_event,
+                               (gint32 *)&out_type,
+                               &out_data,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("handover (sync call) failed: %s",error->message);
                g_error_free(error);
@@ -256,8 +247,7 @@ net_nfc_error_e net_nfc_client_p2p_connection_handover_sync(
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_handover_init(void)
+API net_nfc_error_e net_nfc_client_handover_init(void)
 {
        GError *error = NULL;
 
@@ -268,12 +258,12 @@ net_nfc_error_e net_nfc_client_handover_init(void)
        }
 
        handover_proxy = net_nfc_gdbus_handover_proxy_new_for_bus_sync(
-                                       G_BUS_TYPE_SYSTEM,
-                                       G_DBUS_PROXY_FLAGS_NONE,
-                                       "org.tizen.NetNfcService",
-                                       "/org/tizen/NetNfcService/Handover",
-                                       NULL,
-                                       &error);
+                       G_BUS_TYPE_SYSTEM,
+                       G_DBUS_PROXY_FLAGS_NONE,
+                       "org.tizen.NetNfcService",
+                       "/org/tizen/NetNfcService/Handover",
+                       NULL,
+                       &error);
 
        if(handover_proxy == NULL)
        {
@@ -285,8 +275,7 @@ net_nfc_error_e net_nfc_client_handover_init(void)
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-void net_nfc_client_handover_deinit(void)
+API void net_nfc_client_handover_deinit(void)
 {
        if(handover_proxy)
        {
similarity index 75%
rename from src/clientlib/net_nfc_client_llcp.c
rename to client/net_nfc_client_llcp.c
index 5b7a65e..3fa98d3 100644 (file)
 #include "net_nfc_client_manager.h"
 #include "net_nfc_client_llcp.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
 typedef struct _LlcpFuncData LlcpFuncData;
 
 struct _LlcpFuncData
@@ -46,49 +42,48 @@ void llcp_socket_data_append(net_nfc_llcp_internal_socket_s *socket_data);
 
 void llcp_socket_data_remove(net_nfc_llcp_internal_socket_s *socket_data);
 
-net_nfc_llcp_internal_socket_s *llcp_socket_data_find
-                                               (net_nfc_llcp_socket_t socket);
+net_nfc_llcp_internal_socket_s *llcp_socket_data_find(net_nfc_llcp_socket_t socket);
 
 /* aysnc callback */
 static void llcp_call_config(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void llcp_call_listen(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void llcp_call_connect(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void llcp_call_connect_sap(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void llcp_call_send(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void llcp_call_send_to(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void llcp_call_receive(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void llcp_call_receive_from(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void llcp_call_close(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void llcp_call_disconnect(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 /* signal callback */
 static void llcp_error(NetNfcGDbusLlcp *object,
@@ -107,7 +102,7 @@ void llcp_socket_data_append(net_nfc_llcp_internal_socket_s *socket_data)
        if (socket_data)
        {
                socket_data_list = g_list_append(socket_data_list,
-                                               socket_data);
+                               socket_data);
        }
 }
 
@@ -119,15 +114,14 @@ void llcp_socket_data_remove(net_nfc_llcp_internal_socket_s *socket_data)
        if (socket_data)
        {
                socket_data_list = g_list_remove(socket_data_list,
-                                               socket_data);
+                               socket_data);
 
                g_free(socket_data->service_name);
                g_free(socket_data);
        }
 }
 
-net_nfc_llcp_internal_socket_s *llcp_socket_data_find
-                                               (net_nfc_llcp_socket_t socket)
+net_nfc_llcp_internal_socket_s *llcp_socket_data_find(net_nfc_llcp_socket_t socket)
 {
        GList *pos;
 
@@ -154,8 +148,8 @@ net_nfc_llcp_internal_socket_s *llcp_socket_data_find
 }
 
 static void llcp_call_config(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        LlcpFuncData *func_data;
 
@@ -165,9 +159,9 @@ static void llcp_call_config(GObject *source_object,
        net_nfc_client_llcp_config_completed callback;
 
        if (net_nfc_gdbus_llcp_call_config_finish(
-                                       NET_NFC_GDBUS_LLCP(source_object),
-                                       res,
-                                       &error) == FALSE)
+                               NET_NFC_GDBUS_LLCP(source_object),
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_UNKNOWN_ERROR;
 
@@ -195,8 +189,8 @@ static void llcp_call_config(GObject *source_object,
 }
 
 static void llcp_call_listen(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        LlcpFuncData *func_data;
 
@@ -211,11 +205,11 @@ static void llcp_call_listen(GObject *source_object,
        net_nfc_client_llcp_listen_completed callback;
 
        if (net_nfc_gdbus_llcp_call_listen_finish(
-                                       NET_NFC_GDBUS_LLCP(source_object),
-                                       &out_client_socket,
-                                       &out_oal_socket,
-                                       res,
-                                       &error) == FALSE)
+                               NET_NFC_GDBUS_LLCP(source_object),
+                               &out_client_socket,
+                               &out_oal_socket,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_UNKNOWN_ERROR;
 
@@ -252,8 +246,8 @@ static void llcp_call_listen(GObject *source_object,
 }
 
 static void llcp_call_connect(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        LlcpFuncData *func_data;
 
@@ -268,11 +262,11 @@ static void llcp_call_connect(GObject *source_object,
        net_nfc_client_llcp_connect_completed callback;
 
        if (net_nfc_gdbus_llcp_call_connect_finish(
-                                       NET_NFC_GDBUS_LLCP(source_object),
-                                       &out_client_socket,
-                                       &out_oal_socket,
-                                       res,
-                                       &error) == FALSE)
+                               NET_NFC_GDBUS_LLCP(source_object),
+                               &out_client_socket,
+                               &out_oal_socket,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_UNKNOWN_ERROR;
 
@@ -309,8 +303,8 @@ static void llcp_call_connect(GObject *source_object,
 }
 
 static void llcp_call_connect_sap(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        LlcpFuncData *func_data;
 
@@ -325,11 +319,11 @@ static void llcp_call_connect_sap(GObject *source_object,
        net_nfc_client_llcp_connect_sap_completed callback;
 
        if (net_nfc_gdbus_llcp_call_connect_sap_finish(
-                                       NET_NFC_GDBUS_LLCP(source_object),
-                                       &out_client_socket,
-                                       &out_oal_socket,
-                                       res,
-                                       &error) == FALSE)
+                               NET_NFC_GDBUS_LLCP(source_object),
+                               &out_client_socket,
+                               &out_oal_socket,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_UNKNOWN_ERROR;
 
@@ -362,14 +356,14 @@ static void llcp_call_connect_sap(GObject *source_object,
        }
 
        callback = (net_nfc_client_llcp_connect_sap_completed)
-                       func_data->callback;
+               func_data->callback;
        callback(result, out_client_socket, func_data->user_data);
 }
 
 
 static void llcp_call_send(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        LlcpFuncData *func_data;
 
@@ -381,10 +375,10 @@ static void llcp_call_send(GObject *source_object,
        net_nfc_client_llcp_send_completed callback;
 
        if (net_nfc_gdbus_llcp_call_send_finish(
-                                       NET_NFC_GDBUS_LLCP(source_object),
-                                       &out_client_socket,
-                                       res,
-                                       &error) == FALSE)
+                               NET_NFC_GDBUS_LLCP(source_object),
+                               &out_client_socket,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_UNKNOWN_ERROR;
 
@@ -413,8 +407,8 @@ static void llcp_call_send(GObject *source_object,
 }
 
 static void llcp_call_send_to(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        LlcpFuncData *func_data;
 
@@ -426,10 +420,10 @@ static void llcp_call_send_to(GObject *source_object,
        net_nfc_client_llcp_send_to_completed callback;
 
        if (net_nfc_gdbus_llcp_call_send_to_finish(
-                                       NET_NFC_GDBUS_LLCP(source_object),
-                                       &out_client_socket,
-                                       res,
-                                       &error) == FALSE)
+                               NET_NFC_GDBUS_LLCP(source_object),
+                               &out_client_socket,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_UNKNOWN_ERROR;
 
@@ -457,8 +451,8 @@ static void llcp_call_send_to(GObject *source_object,
 }
 
 static void llcp_call_receive(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        LlcpFuncData *func_data;
 
@@ -471,10 +465,10 @@ static void llcp_call_receive(GObject *source_object,
        net_nfc_client_llcp_receive_completed callback;
 
        if (net_nfc_gdbus_llcp_call_receive_finish(
-                                       NET_NFC_GDBUS_LLCP(source_object),
-                                       &variant,
-                                       res,
-                                       &error) == FALSE)
+                               NET_NFC_GDBUS_LLCP(source_object),
+                               &variant,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_UNKNOWN_ERROR;
 
@@ -509,8 +503,8 @@ static void llcp_call_receive(GObject *source_object,
 }
 
 static void llcp_call_receive_from(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        LlcpFuncData *func_data;
 
@@ -525,11 +519,11 @@ static void llcp_call_receive_from(GObject *source_object,
        net_nfc_client_llcp_receive_from_completed callback;
 
        if (net_nfc_gdbus_llcp_call_receive_from_finish(
-                                       NET_NFC_GDBUS_LLCP(source_object),
-                                       &sap,
-                                       &variant,
-                                       res,
-                                       &error) == FALSE)
+                               NET_NFC_GDBUS_LLCP(source_object),
+                               &sap,
+                               &variant,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_UNKNOWN_ERROR;
 
@@ -556,7 +550,7 @@ static void llcp_call_receive_from(GObject *source_object,
        net_nfc_util_gdbus_variant_to_data_s(variant, &data);
 
        callback = (net_nfc_client_llcp_receive_from_completed)
-                       func_data->callback;
+               func_data->callback;
        callback(result, sap, &data, func_data->user_data);
 
        net_nfc_util_free_data(&data);
@@ -565,8 +559,8 @@ static void llcp_call_receive_from(GObject *source_object,
 }
 
 static void llcp_call_close(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        LlcpFuncData *func_data;
 
@@ -580,10 +574,10 @@ static void llcp_call_close(GObject *source_object,
        net_nfc_client_llcp_close_completed callback;
 
        if (net_nfc_gdbus_llcp_call_close_finish(
-                                       NET_NFC_GDBUS_LLCP(source_object),
-                                       &out_client_socket,
-                                       res,
-                                       &error) == FALSE)
+                               NET_NFC_GDBUS_LLCP(source_object),
+                               &out_client_socket,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_UNKNOWN_ERROR;
 
@@ -618,8 +612,8 @@ static void llcp_call_close(GObject *source_object,
 }
 
 static void llcp_call_disconnect(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        LlcpFuncData *func_data;
 
@@ -633,10 +627,10 @@ static void llcp_call_disconnect(GObject *source_object,
        net_nfc_client_llcp_disconnect_completed callback;
 
        if (net_nfc_gdbus_llcp_call_disconnect_finish(
-                                       NET_NFC_GDBUS_LLCP(source_object),
-                                       &out_client_socket,
-                                       res,
-                                       &error) == FALSE)
+                               NET_NFC_GDBUS_LLCP(source_object),
+                               &out_client_socket,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_UNKNOWN_ERROR;
 
@@ -667,7 +661,7 @@ static void llcp_call_disconnect(GObject *source_object,
        }
 
        callback = (net_nfc_client_llcp_disconnect_completed)
-                       func_data->callback;
+               func_data->callback;
        callback(result, out_client_socket, func_data->user_data);
 }
 
@@ -683,10 +677,9 @@ static void llcp_error(NetNfcGDbusLlcp *object,
 }
 
 /* Public APIs */
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_config(net_nfc_llcp_config_info_h config,
-                               net_nfc_client_llcp_config_completed callback,
-                               void *user_data)
+API net_nfc_error_e net_nfc_client_llcp_config(net_nfc_llcp_config_info_h config,
+               net_nfc_client_llcp_config_completed callback,
+               void *user_data)
 {
        LlcpFuncData *func_data;
        GVariant *variant = NULL;
@@ -715,24 +708,23 @@ net_nfc_error_e net_nfc_client_llcp_config(net_nfc_llcp_config_info_h config,
        memcpy(&llcp_config, config, sizeof(net_nfc_llcp_config_info_s));
 
        variant = g_variant_new("(qqyy)",
-                               config->miu,
-                               config->wks,
-                               config->lto,
-                               config->option);
+                       config->miu,
+                       config->wks,
+                       config->lto,
+                       config->option);
 
        net_nfc_gdbus_llcp_call_config(llcp_proxy,
-                               variant,
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               llcp_call_config,
-                               func_data);
+                       variant,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       llcp_call_config,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_config_sync
-                                       (net_nfc_llcp_config_info_h config)
+API net_nfc_error_e net_nfc_client_llcp_config_sync
+(net_nfc_llcp_config_info_h config)
 {
        GVariant *variant = NULL;
        GError *error = NULL;
@@ -751,16 +743,16 @@ net_nfc_error_e net_nfc_client_llcp_config_sync
        memcpy(&llcp_config, config, sizeof(net_nfc_llcp_config_info_s));
 
        variant = g_variant_new("(qqyy)",
-                               config->miu,
-                               config->wks,
-                               config->lto,
-                               config->option);
+                       config->miu,
+                       config->wks,
+                       config->lto,
+                       config->option);
 
        if (net_nfc_gdbus_llcp_call_config_sync(llcp_proxy,
-                                               variant,
-                                               net_nfc_client_gdbus_get_privilege(),
-                                               NULL,
-                                               &error) == FALSE)
+                               variant,
+                               net_nfc_client_gdbus_get_privilege(),
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("can not config: %s",
                                error->message);
@@ -771,9 +763,8 @@ net_nfc_error_e net_nfc_client_llcp_config_sync
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_get_config
-                                       (net_nfc_llcp_config_info_h *config)
+API net_nfc_error_e net_nfc_client_llcp_get_config
+(net_nfc_llcp_config_info_h *config)
 {
        if (config == NULL)
                return NET_NFC_NULL_PARAMETER;
@@ -783,12 +774,11 @@ net_nfc_error_e net_nfc_client_llcp_get_config
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_listen(net_nfc_llcp_socket_t socket,
-                               const char *service_name,
-                               sap_t sap,
-                               net_nfc_client_llcp_listen_completed callback,
-                               void *user_data)
+       API net_nfc_error_e net_nfc_client_llcp_listen(net_nfc_llcp_socket_t socket,
+               const char *service_name,
+               sap_t sap,
+               net_nfc_client_llcp_listen_completed callback,
+               void *user_data)
 {
        LlcpFuncData *func_data;
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
@@ -826,27 +816,26 @@ net_nfc_error_e net_nfc_client_llcp_listen(net_nfc_llcp_socket_t socket,
        func_data->user_data = user_data;
 
        net_nfc_gdbus_llcp_call_listen(llcp_proxy,
-                               GPOINTER_TO_UINT(llcp_handle),
-                               socket_data->client_socket,
-                               socket_data->oal_socket,
-                               socket_data->miu,
-                               socket_data->rw,
-                               socket_data->type,
-                               socket_data->sap,
-                               service_name,
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               llcp_call_listen,
-                               func_data);
+                       GPOINTER_TO_UINT(llcp_handle),
+                       socket_data->client_socket,
+                       socket_data->oal_socket,
+                       socket_data->miu,
+                       socket_data->rw,
+                       socket_data->type,
+                       socket_data->sap,
+                       service_name,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       llcp_call_listen,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_listen_sync(net_nfc_llcp_socket_t socket,
-                                       const char *service_name,
-                                       sap_t sap,
-                                       net_nfc_llcp_socket_t *out_socket)
+       API net_nfc_error_e net_nfc_client_llcp_listen_sync(net_nfc_llcp_socket_t socket,
+               const char *service_name,
+               sap_t sap,
+               net_nfc_llcp_socket_t *out_socket)
 {
        GError *error = NULL;
        guint32 out_client_socket;
@@ -884,19 +873,19 @@ net_nfc_error_e net_nfc_client_llcp_listen_sync(net_nfc_llcp_socket_t socket,
        }
 
        if (net_nfc_gdbus_llcp_call_listen_sync(llcp_proxy,
-                                       GPOINTER_TO_UINT(llcp_handle),
-                                       socket_data->client_socket,
-                                       socket_data->oal_socket,
-                                       socket_data->miu,
-                                       socket_data->rw,
-                                       socket_data->type,
-                                       socket_data->sap,
-                                       service_name,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       &out_client_socket,
-                                       &out_oal_socket,
-                                       NULL,
-                                       &error) == FALSE)
+                               GPOINTER_TO_UINT(llcp_handle),
+                               socket_data->client_socket,
+                               socket_data->oal_socket,
+                               socket_data->miu,
+                               socket_data->rw,
+                               socket_data->type,
+                               socket_data->sap,
+                               service_name,
+                               net_nfc_client_gdbus_get_privilege(),
+                               &out_client_socket,
+                               &out_oal_socket,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("can not listen: %s",
                                error->message);
@@ -919,11 +908,10 @@ net_nfc_error_e net_nfc_client_llcp_listen_sync(net_nfc_llcp_socket_t socket,
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_connect(net_nfc_llcp_socket_t socket,
-                               const char *service_name,
-                               net_nfc_client_llcp_connect_completed callback,
-                               void *user_data)
+       API net_nfc_error_e net_nfc_client_llcp_connect(net_nfc_llcp_socket_t socket,
+               const char *service_name,
+               net_nfc_client_llcp_connect_completed callback,
+               void *user_data)
 {
        LlcpFuncData *func_data;
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
@@ -957,25 +945,24 @@ net_nfc_error_e net_nfc_client_llcp_connect(net_nfc_llcp_socket_t socket,
        func_data->user_data = user_data;
 
        net_nfc_gdbus_llcp_call_connect(llcp_proxy,
-                               GPOINTER_TO_UINT(llcp_handle),
-                               socket_data->client_socket,
-                               socket_data->oal_socket,
-                               socket_data->miu,
-                               socket_data->rw,
-                               socket_data->type,
-                               service_name,
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               llcp_call_connect,
-                               func_data);
+                       GPOINTER_TO_UINT(llcp_handle),
+                       socket_data->client_socket,
+                       socket_data->oal_socket,
+                       socket_data->miu,
+                       socket_data->rw,
+                       socket_data->type,
+                       service_name,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       llcp_call_connect,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_connect_sync(net_nfc_llcp_socket_t socket,
-                                       const char *service_name,
-                                       net_nfc_llcp_socket_t *out_socket)
+       API net_nfc_error_e net_nfc_client_llcp_connect_sync(net_nfc_llcp_socket_t socket,
+               const char *service_name,
+               net_nfc_llcp_socket_t *out_socket)
 {
        GError *error = NULL;
        guint32 out_client_socket;
@@ -1009,18 +996,18 @@ net_nfc_error_e net_nfc_client_llcp_connect_sync(net_nfc_llcp_socket_t socket,
        }
 
        if (net_nfc_gdbus_llcp_call_connect_sync(llcp_proxy,
-                                       GPOINTER_TO_UINT(llcp_handle),
-                                       socket_data->client_socket,
-                                       socket_data->oal_socket,
-                                       socket_data->miu,
-                                       socket_data->rw,
-                                       socket_data->type,
-                                       service_name,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       &out_client_socket,
-                                       &out_oal_socket,
-                                       NULL,
-                                       &error) == FALSE)
+                               GPOINTER_TO_UINT(llcp_handle),
+                               socket_data->client_socket,
+                               socket_data->oal_socket,
+                               socket_data->miu,
+                               socket_data->rw,
+                               socket_data->type,
+                               service_name,
+                               net_nfc_client_gdbus_get_privilege(),
+                               &out_client_socket,
+                               &out_oal_socket,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("can not connect: %s",
                                error->message);
@@ -1043,11 +1030,10 @@ net_nfc_error_e net_nfc_client_llcp_connect_sync(net_nfc_llcp_socket_t socket,
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-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)
+       API 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)
 {
        LlcpFuncData *func_data;
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
@@ -1075,26 +1061,25 @@ net_nfc_error_e net_nfc_client_llcp_connect_sap(net_nfc_llcp_socket_t socket,
        func_data->user_data = user_data;
 
        net_nfc_gdbus_llcp_call_connect_sap(llcp_proxy,
-                               GPOINTER_TO_UINT(llcp_handle),
-                               socket_data->client_socket,
-                               socket_data->oal_socket,
-                               socket_data->miu,
-                               socket_data->rw,
-                               socket_data->type,
-                               sap,
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               llcp_call_connect_sap,
-                               func_data);
+                       GPOINTER_TO_UINT(llcp_handle),
+                       socket_data->client_socket,
+                       socket_data->oal_socket,
+                       socket_data->miu,
+                       socket_data->rw,
+                       socket_data->type,
+                       sap,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       llcp_call_connect_sap,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-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)
+       API 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)
 {
        GError *error = NULL;
        guint32 out_client_socket;
@@ -1122,18 +1107,18 @@ net_nfc_error_e net_nfc_client_llcp_connect_sap_sync(
        }
 
        if (net_nfc_gdbus_llcp_call_connect_sap_sync(llcp_proxy,
-                                       GPOINTER_TO_UINT(llcp_handle),
-                                       socket_data->client_socket,
-                                       socket_data->oal_socket,
-                                       socket_data->miu,
-                                       socket_data->rw,
-                                       socket_data->type,
-                                       sap,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       &out_client_socket,
-                                       &out_oal_socket,
-                                       NULL,
-                                       &error) == FALSE)
+                               GPOINTER_TO_UINT(llcp_handle),
+                               socket_data->client_socket,
+                               socket_data->oal_socket,
+                               socket_data->miu,
+                               socket_data->rw,
+                               socket_data->type,
+                               sap,
+                               net_nfc_client_gdbus_get_privilege(),
+                               &out_client_socket,
+                               &out_oal_socket,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("can not connect: %s",
                                error->message);
@@ -1156,11 +1141,10 @@ net_nfc_error_e net_nfc_client_llcp_connect_sap_sync(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_send(net_nfc_llcp_socket_t socket,
-                               data_h data,
-                               net_nfc_client_llcp_send_completed callback,
-                               void *user_data)
+       API net_nfc_error_e net_nfc_client_llcp_send(net_nfc_llcp_socket_t socket,
+               data_h data,
+               net_nfc_client_llcp_send_completed callback,
+               void *user_data)
 {
        LlcpFuncData *func_data;
        GVariant *variant = NULL;
@@ -1203,22 +1187,21 @@ net_nfc_error_e net_nfc_client_llcp_send(net_nfc_llcp_socket_t socket,
        func_data->user_data = user_data;
 
        net_nfc_gdbus_llcp_call_send(llcp_proxy,
-                               GPOINTER_TO_UINT(llcp_handle),
-                               socket_data->client_socket,
-                               socket_data->oal_socket,
-                               variant,
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               llcp_call_send,
-                               func_data);
+                       GPOINTER_TO_UINT(llcp_handle),
+                       socket_data->client_socket,
+                       socket_data->oal_socket,
+                       variant,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       llcp_call_send,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_send_sync(net_nfc_llcp_socket_t socket,
-                                       data_h data,
-                                       net_nfc_llcp_socket_t *out_socket)
+       API net_nfc_error_e net_nfc_client_llcp_send_sync(net_nfc_llcp_socket_t socket,
+               data_h data,
+               net_nfc_llcp_socket_t *out_socket)
 {
        GVariant *variant;
        GError *error = NULL;
@@ -1259,14 +1242,14 @@ net_nfc_error_e net_nfc_client_llcp_send_sync(net_nfc_llcp_socket_t socket,
        }
 
        if (net_nfc_gdbus_llcp_call_send_sync(llcp_proxy,
-                                       GPOINTER_TO_UINT(llcp_handle),
-                                       socket_data->client_socket,
-                                       socket_data->oal_socket,
-                                       variant,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       &out_client_socket,
-                                       NULL,
-                                       &error) == FALSE)
+                               GPOINTER_TO_UINT(llcp_handle),
+                               socket_data->client_socket,
+                               socket_data->oal_socket,
+                               variant,
+                               net_nfc_client_gdbus_get_privilege(),
+                               &out_client_socket,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("can not call send: %s",
                                error->message);
@@ -1288,12 +1271,11 @@ net_nfc_error_e net_nfc_client_llcp_send_sync(net_nfc_llcp_socket_t socket,
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_send_to(net_nfc_llcp_socket_t socket,
-                               sap_t sap,
-                               data_h data,
-                               net_nfc_client_llcp_send_to_completed callback,
-                               void *user_data)
+       API net_nfc_error_e net_nfc_client_llcp_send_to(net_nfc_llcp_socket_t socket,
+               sap_t sap,
+               data_h data,
+               net_nfc_client_llcp_send_to_completed callback,
+               void *user_data)
 {
        LlcpFuncData *func_data;
        GVariant *variant = NULL;
@@ -1335,24 +1317,23 @@ net_nfc_error_e net_nfc_client_llcp_send_to(net_nfc_llcp_socket_t socket,
        func_data->user_data = user_data;
 
        net_nfc_gdbus_llcp_call_send_to(llcp_proxy,
-                               GPOINTER_TO_UINT(llcp_handle),
-                               socket_data->client_socket,
-                               socket_data->oal_socket,
-                               sap,
-                               variant,
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               llcp_call_send_to,
-                               func_data);
+                       GPOINTER_TO_UINT(llcp_handle),
+                       socket_data->client_socket,
+                       socket_data->oal_socket,
+                       sap,
+                       variant,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       llcp_call_send_to,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_send_to_sync(net_nfc_llcp_socket_t socket,
-                                       sap_t sap,
-                                       data_h data,
-                                       net_nfc_llcp_socket_t *out_socket)
+       API net_nfc_error_e net_nfc_client_llcp_send_to_sync(net_nfc_llcp_socket_t socket,
+               sap_t sap,
+               data_h data,
+               net_nfc_llcp_socket_t *out_socket)
 {
        GVariant *variant;
        GError *error = NULL;
@@ -1393,15 +1374,15 @@ net_nfc_error_e net_nfc_client_llcp_send_to_sync(net_nfc_llcp_socket_t socket,
        }
 
        if (net_nfc_gdbus_llcp_call_send_to_sync(llcp_proxy,
-                                       GPOINTER_TO_UINT(llcp_handle),
-                                       socket_data->client_socket,
-                                       socket_data->oal_socket,
-                                       sap,
-                                       variant,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       &out_client_socket,
-                                       NULL,
-                                       &error) == FALSE)
+                               GPOINTER_TO_UINT(llcp_handle),
+                               socket_data->client_socket,
+                               socket_data->oal_socket,
+                               sap,
+                               variant,
+                               net_nfc_client_gdbus_get_privilege(),
+                               &out_client_socket,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("can not call send to: %s",
                                error->message);
@@ -1422,11 +1403,10 @@ net_nfc_error_e net_nfc_client_llcp_send_to_sync(net_nfc_llcp_socket_t socket,
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_receive(net_nfc_llcp_socket_t socket,
-                               size_t request_length,
-                               net_nfc_client_llcp_receive_completed callback,
-                               void *user_data)
+       API net_nfc_error_e net_nfc_client_llcp_receive(net_nfc_llcp_socket_t socket,
+               size_t request_length,
+               net_nfc_client_llcp_receive_completed callback,
+               void *user_data)
 {
        LlcpFuncData *func_data;
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
@@ -1454,22 +1434,21 @@ net_nfc_error_e net_nfc_client_llcp_receive(net_nfc_llcp_socket_t socket,
        func_data->user_data = user_data;
 
        net_nfc_gdbus_llcp_call_receive(llcp_proxy,
-                               GPOINTER_TO_UINT(llcp_handle),
-                               socket_data->client_socket,
-                               socket_data->oal_socket,
-                               request_length,
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               llcp_call_receive,
-                               func_data);
+                       GPOINTER_TO_UINT(llcp_handle),
+                       socket_data->client_socket,
+                       socket_data->oal_socket,
+                       request_length,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       llcp_call_receive,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_receive_sync(net_nfc_llcp_socket_t socket,
-                                               size_t request_length,
-                                               data_h *out_data)
+       API net_nfc_error_e net_nfc_client_llcp_receive_sync(net_nfc_llcp_socket_t socket,
+               size_t request_length,
+               data_h *out_data)
 {
        GVariant *variant = NULL;
        GError *error = NULL;
@@ -1494,14 +1473,14 @@ net_nfc_error_e net_nfc_client_llcp_receive_sync(net_nfc_llcp_socket_t socket,
        }
 
        if (net_nfc_gdbus_llcp_call_receive_sync(llcp_proxy,
-                                       GPOINTER_TO_UINT(llcp_handle),
-                                       socket_data->client_socket,
-                                       socket_data->oal_socket,
-                                       request_length,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       &variant,
-                                       NULL,
-                                       &error) == FALSE)
+                               GPOINTER_TO_UINT(llcp_handle),
+                               socket_data->client_socket,
+                               socket_data->oal_socket,
+                               request_length,
+                               net_nfc_client_gdbus_get_privilege(),
+                               &variant,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("can not call receive: %s",
                                error->message);
@@ -1517,11 +1496,10 @@ net_nfc_error_e net_nfc_client_llcp_receive_sync(net_nfc_llcp_socket_t socket,
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_receive_from(net_nfc_llcp_socket_t socket,
-                       size_t request_length,
-                       net_nfc_client_llcp_receive_from_completed callback,
-                       void *user_data)
+       API net_nfc_error_e net_nfc_client_llcp_receive_from(net_nfc_llcp_socket_t socket,
+               size_t request_length,
+               net_nfc_client_llcp_receive_from_completed callback,
+               void *user_data)
 {
        LlcpFuncData *func_data;
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
@@ -1544,24 +1522,23 @@ net_nfc_error_e net_nfc_client_llcp_receive_from(net_nfc_llcp_socket_t socket,
        func_data->user_data = user_data;
 
        net_nfc_gdbus_llcp_call_receive_from(llcp_proxy,
-                               GPOINTER_TO_UINT(llcp_handle),
-                               socket_data->client_socket,
-                               socket_data->oal_socket,
-                               request_length,
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               llcp_call_receive_from,
-                               func_data);
+                       GPOINTER_TO_UINT(llcp_handle),
+                       socket_data->client_socket,
+                       socket_data->oal_socket,
+                       request_length,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       llcp_call_receive_from,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_receive_from_sync
-                                               (net_nfc_llcp_socket_t socket,
-                                                size_t request_length,
-                                                sap_t *out_sap,
-                                                data_h *out_data)
+API net_nfc_error_e net_nfc_client_llcp_receive_from_sync
+(net_nfc_llcp_socket_t socket,
+ size_t request_length,
+ sap_t *out_sap,
+ data_h *out_data)
 {
        GVariant *variant = NULL;
        GError *error = NULL;
@@ -1588,15 +1565,15 @@ net_nfc_error_e net_nfc_client_llcp_receive_from_sync
        }
 
        if (net_nfc_gdbus_llcp_call_receive_from_sync(llcp_proxy,
-                                       GPOINTER_TO_UINT(llcp_handle),
-                                       socket_data->client_socket,
-                                       socket_data->oal_socket,
-                                       request_length,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       &sap,
-                                       &variant,
-                                       NULL,
-                                       &error) == FALSE)
+                               GPOINTER_TO_UINT(llcp_handle),
+                               socket_data->client_socket,
+                               socket_data->oal_socket,
+                               request_length,
+                               net_nfc_client_gdbus_get_privilege(),
+                               &sap,
+                               &variant,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("can not call receive from: %s",
                                error->message);
@@ -1615,10 +1592,9 @@ net_nfc_error_e net_nfc_client_llcp_receive_from_sync
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_close(net_nfc_llcp_socket_t socket,
-                               net_nfc_client_llcp_close_completed callback,
-                               void *user_data)
+       API net_nfc_error_e net_nfc_client_llcp_close(net_nfc_llcp_socket_t socket,
+               net_nfc_client_llcp_close_completed callback,
+               void *user_data)
 {
        LlcpFuncData *func_data;
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
@@ -1646,20 +1622,19 @@ net_nfc_error_e net_nfc_client_llcp_close(net_nfc_llcp_socket_t socket,
        func_data->user_data = user_data;
 
        net_nfc_gdbus_llcp_call_close(llcp_proxy,
-                               GPOINTER_TO_UINT(llcp_handle),
-                               socket_data->client_socket,
-                               socket_data->oal_socket,
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               llcp_call_close,
-                               func_data);
+                       GPOINTER_TO_UINT(llcp_handle),
+                       socket_data->client_socket,
+                       socket_data->oal_socket,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       llcp_call_close,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_close_sync(net_nfc_llcp_socket_t socket,
-                                       net_nfc_llcp_socket_t *out_socket)
+       API net_nfc_error_e net_nfc_client_llcp_close_sync(net_nfc_llcp_socket_t socket,
+               net_nfc_llcp_socket_t *out_socket)
 {
        GError *error = NULL;
        guint32 out_client_socket;
@@ -1686,13 +1661,13 @@ net_nfc_error_e net_nfc_client_llcp_close_sync(net_nfc_llcp_socket_t socket,
        }
 
        if (net_nfc_gdbus_llcp_call_close_sync(llcp_proxy,
-                                       GPOINTER_TO_UINT(llcp_handle),
-                                       socket_data->client_socket,
-                                       socket_data->oal_socket,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       &out_client_socket,
-                                       NULL,
-                                       &error) == FALSE)
+                               GPOINTER_TO_UINT(llcp_handle),
+                               socket_data->client_socket,
+                               socket_data->oal_socket,
+                               net_nfc_client_gdbus_get_privilege(),
+                               &out_client_socket,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("can not close: %s",
                                error->message);
@@ -1713,10 +1688,9 @@ net_nfc_error_e net_nfc_client_llcp_close_sync(net_nfc_llcp_socket_t socket,
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_disconnect(net_nfc_llcp_socket_t socket,
-                       net_nfc_client_llcp_disconnect_completed callback,
-                       void *user_data)
+       API net_nfc_error_e net_nfc_client_llcp_disconnect(net_nfc_llcp_socket_t socket,
+               net_nfc_client_llcp_disconnect_completed callback,
+               void *user_data)
 {
        LlcpFuncData *func_data;
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
@@ -1744,21 +1718,20 @@ net_nfc_error_e net_nfc_client_llcp_disconnect(net_nfc_llcp_socket_t socket,
        func_data->user_data = user_data;
 
        net_nfc_gdbus_llcp_call_disconnect(llcp_proxy,
-                               GPOINTER_TO_UINT(llcp_handle),
-                               socket_data->client_socket,
-                               socket_data->oal_socket,
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               llcp_call_disconnect,
-                               func_data);
+                       GPOINTER_TO_UINT(llcp_handle),
+                       socket_data->client_socket,
+                       socket_data->oal_socket,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       llcp_call_disconnect,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_disconnect_sync(
-                                       net_nfc_llcp_socket_t socket,
-                                       net_nfc_llcp_socket_t *out_socket)
+       API net_nfc_error_e net_nfc_client_llcp_disconnect_sync(
+               net_nfc_llcp_socket_t socket,
+               net_nfc_llcp_socket_t *out_socket)
 {
        GError *error = NULL;
        guint32 out_client_socket;
@@ -1785,13 +1758,13 @@ net_nfc_error_e net_nfc_client_llcp_disconnect_sync(
        }
 
        if (net_nfc_gdbus_llcp_call_disconnect_sync(llcp_proxy,
-                                       GPOINTER_TO_UINT(llcp_handle),
-                                       socket_data->client_socket,
-                                       socket_data->oal_socket,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       &out_client_socket,
-                                       NULL,
-                                       &error) == FALSE)
+                               GPOINTER_TO_UINT(llcp_handle),
+                               socket_data->client_socket,
+                               socket_data->oal_socket,
+                               net_nfc_client_gdbus_get_privilege(),
+                               &out_client_socket,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("can not disconnect: %s",
                                error->message);
@@ -1812,9 +1785,8 @@ net_nfc_error_e net_nfc_client_llcp_disconnect_sync(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-void net_nfc_client_llcp_create_socket(net_nfc_llcp_socket_t *socket,
-                               net_nfc_llcp_socket_option_h option)
+API void net_nfc_client_llcp_create_socket(net_nfc_llcp_socket_t *socket,
+               net_nfc_llcp_socket_option_h option)
 {
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
 
@@ -1845,9 +1817,8 @@ void net_nfc_client_llcp_create_socket(net_nfc_llcp_socket_t *socket,
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_get_local_config(
-                                       net_nfc_llcp_config_info_h *config)
+       API net_nfc_error_e net_nfc_client_llcp_get_local_config(
+               net_nfc_llcp_config_info_h *config)
 {
        if (config == NULL)
        {
@@ -1859,10 +1830,9 @@ net_nfc_error_e net_nfc_client_llcp_get_local_config(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_get_local_socket_option(
-                                       net_nfc_llcp_socket_t socket,
-                                       net_nfc_llcp_socket_option_h *info)
+       API net_nfc_error_e net_nfc_client_llcp_get_local_socket_option(
+               net_nfc_llcp_socket_t socket,
+               net_nfc_llcp_socket_option_h *info)
 {
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
 
@@ -1877,12 +1847,11 @@ net_nfc_error_e net_nfc_client_llcp_get_local_socket_option(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_create_socket_option(
-                                       net_nfc_llcp_socket_option_h *option,
-                                       uint16_t miu,
-                                       uint8_t rw,
-                                       net_nfc_socket_type_e type)
+       API net_nfc_error_e net_nfc_client_llcp_create_socket_option(
+               net_nfc_llcp_socket_option_h *option,
+               uint16_t miu,
+               uint8_t rw,
+               net_nfc_socket_type_e type)
 {
        net_nfc_llcp_socket_option_s *struct_option = NULL;
 
@@ -1892,9 +1861,9 @@ net_nfc_error_e net_nfc_client_llcp_create_socket_option(
        }
 
        if (miu < 128 || miu > 1152 ||
-               rw < 1 || rw > 15 ||
-               type < NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONORIENTED ||
-               type > NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONLESS)
+                       rw < 1 || rw > 15 ||
+                       type < NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONORIENTED ||
+                       type > NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONLESS)
        {
                return NET_NFC_OUT_OF_BOUND;
        }
@@ -1916,21 +1885,19 @@ net_nfc_error_e net_nfc_client_llcp_create_socket_option(
        }
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_create_socket_option_default(
-                                       net_nfc_llcp_socket_option_h *option)
+       API net_nfc_error_e net_nfc_client_llcp_create_socket_option_default(
+               net_nfc_llcp_socket_option_h *option)
 {
        return net_nfc_client_llcp_create_socket_option(
-                                       option,
-                                       128,
-                                       1,
-                                       NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONORIENTED);
+                       option,
+                       128,
+                       1,
+                       NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONORIENTED);
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_get_socket_option_miu(
-                                       net_nfc_llcp_socket_option_h option,
-                                       uint16_t *miu)
+       API net_nfc_error_e net_nfc_client_llcp_get_socket_option_miu(
+               net_nfc_llcp_socket_option_h option,
+               uint16_t *miu)
 {
        if (option == NULL || miu == NULL)
        {
@@ -1942,10 +1909,9 @@ net_nfc_error_e net_nfc_client_llcp_get_socket_option_miu(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_set_socket_option_miu(
-                                       net_nfc_llcp_socket_option_h option,
-                                       uint16_t miu)
+       API net_nfc_error_e net_nfc_client_llcp_set_socket_option_miu(
+               net_nfc_llcp_socket_option_h option,
+               uint16_t miu)
 {
        if (option == NULL)
        {
@@ -1957,10 +1923,9 @@ net_nfc_error_e net_nfc_client_llcp_set_socket_option_miu(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_get_socket_option_rw(
-                                       net_nfc_llcp_socket_option_h option,
-                                       uint8_t *rw)
+       API net_nfc_error_e net_nfc_client_llcp_get_socket_option_rw(
+               net_nfc_llcp_socket_option_h option,
+               uint8_t *rw)
 {
        if (option == NULL || rw == NULL)
        {
@@ -1972,10 +1937,9 @@ net_nfc_error_e net_nfc_client_llcp_get_socket_option_rw(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_set_socket_option_rw(
-                                       net_nfc_llcp_socket_option_h option,
-                                       uint8_t rw)
+       API net_nfc_error_e net_nfc_client_llcp_set_socket_option_rw(
+               net_nfc_llcp_socket_option_h option,
+               uint8_t rw)
 {
        if (option == NULL)
        {
@@ -1987,10 +1951,9 @@ net_nfc_error_e net_nfc_client_llcp_set_socket_option_rw(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_get_socket_option_type(
-                                       net_nfc_llcp_socket_option_h option,
-                                       net_nfc_socket_type_e * type)
+       API net_nfc_error_e net_nfc_client_llcp_get_socket_option_type(
+               net_nfc_llcp_socket_option_h option,
+               net_nfc_socket_type_e * type)
 {
        if (option == NULL || type == NULL)
        {
@@ -2002,10 +1965,9 @@ net_nfc_error_e net_nfc_client_llcp_get_socket_option_type(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_set_socket_option_type(
-                                       net_nfc_llcp_socket_option_h option,
-                                       net_nfc_socket_type_e type)
+       API net_nfc_error_e net_nfc_client_llcp_set_socket_option_type(
+               net_nfc_llcp_socket_option_h option,
+               net_nfc_socket_type_e type)
 {
        if (option == NULL)
        {
@@ -2017,9 +1979,8 @@ net_nfc_error_e net_nfc_client_llcp_set_socket_option_type(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_free_socket_option(
-                                       net_nfc_llcp_socket_option_h option)
+       API net_nfc_error_e net_nfc_client_llcp_free_socket_option(
+               net_nfc_llcp_socket_option_h option)
 {
        if (option == NULL)
        {
@@ -2031,13 +1992,12 @@ net_nfc_error_e net_nfc_client_llcp_free_socket_option(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_create_config(
-                                       net_nfc_llcp_config_info_h *config,
-                                       uint16_t miu,
-                                       uint16_t wks,
-                                       uint8_t lto,
-                                       uint8_t option)
+       API net_nfc_error_e net_nfc_client_llcp_create_config(
+               net_nfc_llcp_config_info_h *config,
+               uint16_t miu,
+               uint16_t wks,
+               uint8_t lto,
+               uint8_t option)
 {
        if (config == NULL)
        {
@@ -2045,10 +2005,10 @@ net_nfc_error_e net_nfc_client_llcp_create_config(
        }
 
        net_nfc_llcp_config_info_s **tmp_config =
-                                               (net_nfc_llcp_config_info_s **)config;
+               (net_nfc_llcp_config_info_s **)config;
 
        _net_nfc_util_alloc_mem(*tmp_config,
-                                       sizeof(net_nfc_llcp_config_info_s));
+                       sizeof(net_nfc_llcp_config_info_s));
 
        if (*tmp_config == NULL)
                return NET_NFC_ALLOC_FAIL;
@@ -2061,16 +2021,14 @@ net_nfc_error_e net_nfc_client_llcp_create_config(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_create_config_default(net_nfc_llcp_config_info_h *config)
+       API net_nfc_error_e net_nfc_client_llcp_create_config_default(net_nfc_llcp_config_info_h *config)
 {
        return net_nfc_client_llcp_create_config(config, 128, 1, 10, 0);
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_get_config_miu(
-                                       net_nfc_llcp_config_info_h config,
-                                       uint16_t *miu)
+       API net_nfc_error_e net_nfc_client_llcp_get_config_miu(
+               net_nfc_llcp_config_info_h config,
+               uint16_t *miu)
 {
        if (config == NULL || miu == NULL)
        {
@@ -2078,17 +2036,16 @@ net_nfc_error_e net_nfc_client_llcp_get_config_miu(
        }
 
        net_nfc_llcp_config_info_s *tmp_config =
-                                               (net_nfc_llcp_config_info_s *)config;
+               (net_nfc_llcp_config_info_s *)config;
 
        *miu = tmp_config->miu;
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_get_config_wks(
-                                       net_nfc_llcp_config_info_h config,
-                                       uint16_t *wks)
+       API net_nfc_error_e net_nfc_client_llcp_get_config_wks(
+               net_nfc_llcp_config_info_h config,
+               uint16_t *wks)
 {
        if (config == NULL || wks == NULL)
        {
@@ -2096,17 +2053,16 @@ net_nfc_error_e net_nfc_client_llcp_get_config_wks(
        }
 
        net_nfc_llcp_config_info_s *tmp_config =
-                                               (net_nfc_llcp_config_info_s *)config;
+               (net_nfc_llcp_config_info_s *)config;
 
        *wks = tmp_config->wks;
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_get_config_lto(
-                                               net_nfc_llcp_config_info_h config,
-                                               uint8_t *lto)
+       API net_nfc_error_e net_nfc_client_llcp_get_config_lto(
+               net_nfc_llcp_config_info_h config,
+               uint8_t *lto)
 {
        if (config == NULL || lto == NULL)
        {
@@ -2114,17 +2070,16 @@ net_nfc_error_e net_nfc_client_llcp_get_config_lto(
        }
 
        net_nfc_llcp_config_info_s *tmp_config =
-                                               (net_nfc_llcp_config_info_s *)config;
+               (net_nfc_llcp_config_info_s *)config;
 
        *lto = tmp_config->lto;
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_get_config_option(
-                                       net_nfc_llcp_config_info_h config,
-                                       uint8_t *option)
+       API net_nfc_error_e net_nfc_client_llcp_get_config_option(
+               net_nfc_llcp_config_info_h config,
+               uint8_t *option)
 {
        if (config == NULL || option == NULL)
        {
@@ -2132,17 +2087,16 @@ net_nfc_error_e net_nfc_client_llcp_get_config_option(
        }
 
        net_nfc_llcp_config_info_s *tmp_config =
-                                               (net_nfc_llcp_config_info_s *)config;
+               (net_nfc_llcp_config_info_s *)config;
 
        *option = tmp_config->option;
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_set_config_miu(
-                                       net_nfc_llcp_config_info_h config,
-                                       uint16_t miu)
+       API net_nfc_error_e net_nfc_client_llcp_set_config_miu(
+               net_nfc_llcp_config_info_h config,
+               uint16_t miu)
 {
        if (config == NULL)
        {
@@ -2155,17 +2109,16 @@ net_nfc_error_e net_nfc_client_llcp_set_config_miu(
        }
 
        net_nfc_llcp_config_info_s * tmp_config =
-                                               (net_nfc_llcp_config_info_s *)config;
+               (net_nfc_llcp_config_info_s *)config;
 
        tmp_config->miu = miu;
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_set_config_wks(
-                                       net_nfc_llcp_config_info_h config,
-                                       uint16_t wks)
+       API net_nfc_error_e net_nfc_client_llcp_set_config_wks(
+               net_nfc_llcp_config_info_h config,
+               uint16_t wks)
 {
        if (config == NULL)
        {
@@ -2173,17 +2126,16 @@ net_nfc_error_e net_nfc_client_llcp_set_config_wks(
        }
 
        net_nfc_llcp_config_info_s *tmp_config =
-                                               (net_nfc_llcp_config_info_s *)config;
+               (net_nfc_llcp_config_info_s *)config;
 
        tmp_config->wks = wks;
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_set_config_lto(
-                                       net_nfc_llcp_config_info_h config,
-                                       uint8_t lto)
+       API net_nfc_error_e net_nfc_client_llcp_set_config_lto(
+               net_nfc_llcp_config_info_h config,
+               uint8_t lto)
 {
        if (config == NULL)
        {
@@ -2191,17 +2143,16 @@ net_nfc_error_e net_nfc_client_llcp_set_config_lto(
        }
 
        net_nfc_llcp_config_info_s *tmp_config =
-                                               (net_nfc_llcp_config_info_s *)config;
+               (net_nfc_llcp_config_info_s *)config;
 
        tmp_config->lto = lto;
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_set_config_option(
-                                       net_nfc_llcp_config_info_h config,
-                                       uint8_t option)
+       API net_nfc_error_e net_nfc_client_llcp_set_config_option(
+               net_nfc_llcp_config_info_h config,
+               uint8_t option)
 {
        if (config == NULL)
        {
@@ -2209,15 +2160,14 @@ net_nfc_error_e net_nfc_client_llcp_set_config_option(
        }
 
        net_nfc_llcp_config_info_s * tmp_config =
-                                               (net_nfc_llcp_config_info_s *)config;
+               (net_nfc_llcp_config_info_s *)config;
 
        tmp_config->option = option;
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_llcp_free_config(net_nfc_llcp_config_info_h config)
+       API net_nfc_error_e net_nfc_client_llcp_free_config(net_nfc_llcp_config_info_h config)
 {
        if (config == NULL)
        {
similarity index 80%
rename from src/clientlib/net_nfc_client_manager.c
rename to client/net_nfc_client_manager.c
index f6e981f..a0cccc0 100644 (file)
 #include "net_nfc_client_context.h"
 #include "net_nfc_client_manager.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
 typedef struct _ManagerFuncData ManagerFuncData;
 
 struct _ManagerFuncData
@@ -41,22 +37,22 @@ static ManagerFuncData *activated_func_data = NULL;
 static int is_activated = -1;
 
 static void manager_call_set_active_callback(GObject *source_object,
-                                       GAsyncResult *res,
-                                       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void manager_call_get_server_state_callback(GObject *source_object,
-                                               GAsyncResult *res,
-                                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 
 static void manager_activated(NetNfcGDbusManager *manager,
-                               gboolean activated,
-                               gpointer user_data);
+               gboolean activated,
+               gpointer user_data);
 
 
 static void manager_call_set_active_callback(GObject *source_object,
-                                       GAsyncResult *res,
-                                       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        ManagerFuncData *func_data;
 
@@ -76,7 +72,7 @@ static void manager_call_set_active_callback(GObject *source_object,
                result = NET_NFC_UNKNOWN_ERROR;
 
                DEBUG_ERR_MSG("Can not finish call_set_active: %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
        }
 
@@ -92,7 +88,7 @@ static void manager_call_set_active_callback(GObject *source_object,
 
 
        callback = (net_nfc_client_manager_set_active_completed)
-                       func_data->callback;
+               func_data->callback;
        data = func_data->user_data;
 
        callback(result, data);
@@ -101,8 +97,8 @@ static void manager_call_set_active_callback(GObject *source_object,
 }
 
 static void manager_call_get_server_state_callback(GObject *source_object,
-                                               GAsyncResult *res,
-                                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        ManagerFuncData *func_data;
 
@@ -123,7 +119,7 @@ static void manager_call_get_server_state_callback(GObject *source_object,
                result = NET_NFC_UNKNOWN_ERROR;
 
                DEBUG_ERR_MSG("Can not finish get_server_state: %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
        }
 
@@ -138,7 +134,7 @@ static void manager_call_get_server_state_callback(GObject *source_object,
        }
 
        callback = (net_nfc_client_manager_get_server_state_completed)
-                       func_data->callback;
+               func_data->callback;
        data = func_data->user_data;
 
        callback(result, out_state, data);
@@ -148,8 +144,8 @@ static void manager_call_get_server_state_callback(GObject *source_object,
 
 
 static void manager_activated(NetNfcGDbusManager *manager,
-                               gboolean activated,
-                               gpointer user_data)
+               gboolean activated,
+               gpointer user_data)
 {
        bool state = false;
 
@@ -171,17 +167,16 @@ static void manager_activated(NetNfcGDbusManager *manager,
                gpointer user_data;
 
                callback = (net_nfc_client_manager_activated)
-                               (activated_func_data->callback);
+                       (activated_func_data->callback);
                user_data = activated_func_data->user_data;
 
                callback(state, user_data);
        }
 }
 
-NET_NFC_EXPORT_API
-void net_nfc_client_manager_set_activated(
-                       net_nfc_client_manager_activated callback,
-                       void *user_data)
+API void net_nfc_client_manager_set_activated(
+               net_nfc_client_manager_activated callback,
+               void *user_data)
 {
        if (activated_func_data == NULL)
                activated_func_data = g_new0(ManagerFuncData, 1);
@@ -190,8 +185,7 @@ void net_nfc_client_manager_set_activated(
        activated_func_data->user_data = user_data;
 }
 
-NET_NFC_EXPORT_API
-void net_nfc_client_manager_unset_activated(void)
+API void net_nfc_client_manager_unset_activated(void)
 {
        if (activated_func_data == NULL)
        {
@@ -203,10 +197,9 @@ void net_nfc_client_manager_unset_activated(void)
        activated_func_data = NULL;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_manager_set_active(int state,
-                       net_nfc_client_manager_set_active_completed callback,
-                       void *user_data)
+API net_nfc_error_e net_nfc_client_manager_set_active(int state,
+               net_nfc_client_manager_set_active_completed callback,
+               void *user_data)
 {
        gboolean active = FALSE;
        ManagerFuncData *func_data;
@@ -241,8 +234,7 @@ net_nfc_error_e net_nfc_client_manager_set_active(int state,
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_manager_set_active_sync(int state)
+API net_nfc_error_e net_nfc_client_manager_set_active_sync(int state)
 {
        GError *error = NULL;
 
@@ -252,10 +244,10 @@ net_nfc_error_e net_nfc_client_manager_set_active_sync(int state)
        /* allow this function even nfc is off */
 
        if (net_nfc_gdbus_manager_call_set_active_sync(manager_proxy,
-                                               (gboolean)state,
-                                               net_nfc_client_gdbus_get_privilege(),
-                                               NULL,
-                                               &error) == FALSE)
+                               (gboolean)state,
+                               net_nfc_client_gdbus_get_privilege(),
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_CLIENT_MSG("can not call SetActive: %s",
                                error->message);
@@ -266,8 +258,7 @@ net_nfc_error_e net_nfc_client_manager_set_active_sync(int state)
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_manager_get_server_state(
+API net_nfc_error_e net_nfc_client_manager_get_server_state(
                net_nfc_client_manager_get_server_state_completed callback,
                void *user_data)
 {
@@ -289,17 +280,16 @@ net_nfc_error_e net_nfc_client_manager_get_server_state(
        func_data->user_data = user_data;
 
        net_nfc_gdbus_manager_call_get_server_state(manager_proxy,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       NULL,
-                                       manager_call_get_server_state_callback,
-                                       func_data);
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       manager_call_get_server_state_callback,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_manager_get_server_state_sync(
-                                                       unsigned int *state)
+API net_nfc_error_e net_nfc_client_manager_get_server_state_sync(
+               unsigned int *state)
 {
        GError *error = NULL;
        guint out_state;
@@ -313,10 +303,10 @@ net_nfc_error_e net_nfc_client_manager_get_server_state_sync(
        }
 
        if (net_nfc_gdbus_manager_call_get_server_state_sync(manager_proxy,
-                                                       net_nfc_client_gdbus_get_privilege(),
-                                                       &out_state,
-                                                       NULL,
-                                                       &error) == FALSE)
+                               net_nfc_client_gdbus_get_privilege(),
+                               &out_state,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_CLIENT_MSG("can not call GetServerState: %s",
                                error->message);
@@ -341,12 +331,12 @@ net_nfc_error_e net_nfc_client_manager_init(void)
        }
 
        manager_proxy = net_nfc_gdbus_manager_proxy_new_for_bus_sync(
-                                       G_BUS_TYPE_SYSTEM,
-                                       G_DBUS_PROXY_FLAGS_NONE,
-                                       "org.tizen.NetNfcService",
-                                       "/org/tizen/NetNfcService/Manager",
-                                       NULL,
-                                       &error);
+                       G_BUS_TYPE_SYSTEM,
+                       G_DBUS_PROXY_FLAGS_NONE,
+                       "org.tizen.NetNfcService",
+                       "/org/tizen/NetNfcService/Manager",
+                       NULL,
+                       &error);
 
        if (manager_proxy == NULL)
        {
similarity index 82%
rename from src/clientlib/net_nfc_client_ndef.c
rename to client/net_nfc_client_ndef.c
index c76886f..832abc7 100644 (file)
 #include "net_nfc_client_ndef.h"
 #include "net_nfc_client_tag_internal.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
 typedef struct _NdefFuncData NdefFuncData;
 
 struct _NdefFuncData
@@ -48,20 +44,20 @@ static GVariant *ndef_message_to_variant(ndef_message_h message);
 static gboolean ndef_is_supported_tag(void);
 
 static void ndef_call_read(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void ndef_call_write(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void ndef_call_make_read_only(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void ndef_call_format(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static ndef_message_h ndef_variant_to_message(GVariant *variant)
 {
@@ -73,7 +69,7 @@ static ndef_message_h ndef_variant_to_message(GVariant *variant)
        if (data.buffer && data.length > 0)
        {
                if (net_nfc_create_ndef_message_from_rawdata(&message, &data)
-                       != NET_NFC_OK)
+                               != NET_NFC_OK)
                {
                        DEBUG_ERR_MSG("memory alloc fail...");
                }
@@ -91,7 +87,7 @@ static GVariant *ndef_message_to_variant(ndef_message_h message)
        GVariant *variant = NULL;
 
        length = net_nfc_util_get_ndef_message_length(
-                                               (ndef_message_s *)message);
+                       (ndef_message_s *)message);
 
        if (length == 0)
        {
@@ -103,8 +99,8 @@ static GVariant *ndef_message_to_variant(ndef_message_h message)
        data.buffer = g_new0(guint8, length);
 
        if(net_nfc_util_convert_ndef_message_to_rawdata(
-                                               (ndef_message_s *)message,
-                                               &data) != NET_NFC_OK)
+                               (ndef_message_s *)message,
+                               &data) != NET_NFC_OK)
        {
                DEBUG_ERR_MSG("can not convert ndef_message to rawdata");
                return NULL;
@@ -131,24 +127,24 @@ static gboolean ndef_is_supported_tag(void)
 
        switch (target_info->devType)
        {
-               case NET_NFC_ISO14443_A_PICC :
-               case NET_NFC_MIFARE_MINI_PICC :
-               case NET_NFC_MIFARE_1K_PICC :
-               case NET_NFC_MIFARE_4K_PICC :
-               case NET_NFC_MIFARE_ULTRA_PICC :
-               case NET_NFC_JEWEL_PICC :
-                       return TRUE;
-                       break;
-               default:
-                       DEBUG_CLIENT_MSG(
+       case NET_NFC_ISO14443_A_PICC :
+       case NET_NFC_MIFARE_MINI_PICC :
+       case NET_NFC_MIFARE_1K_PICC :
+       case NET_NFC_MIFARE_4K_PICC :
+       case NET_NFC_MIFARE_ULTRA_PICC :
+       case NET_NFC_JEWEL_PICC :
+               return TRUE;
+               break;
+       default:
+               DEBUG_CLIENT_MSG(
                                "not supported tag for read only tag");
-                       return FALSE;
+               return FALSE;
        }
 }
 
 static void ndef_call_read(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        NdefFuncData *func_data;
 
@@ -200,8 +196,8 @@ static void ndef_call_read(GObject *source_object,
 }
 
 static void ndef_call_write(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        NdefFuncData *func_data;
 
@@ -243,8 +239,8 @@ static void ndef_call_write(GObject *source_object,
 }
 
 static void ndef_call_make_read_only(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        NdefFuncData *func_data;
 
@@ -281,15 +277,15 @@ static void ndef_call_make_read_only(GObject *source_object,
        }
 
        callback = (net_nfc_client_ndef_make_read_only_completed)
-                                                       func_data->callback;
+               func_data->callback;
        callback(out_result, func_data->user_data);
 
        g_free(func_data);
 }
 
 static void ndef_call_format(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        NdefFuncData *func_data;
 
@@ -330,10 +326,9 @@ static void ndef_call_format(GObject *source_object,
        g_free(func_data);
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_ndef_read(net_nfc_target_handle_h handle,
-                               net_nfc_client_ndef_read_completed callback,
-                               void *user_data)
+API net_nfc_error_e net_nfc_client_ndef_read(net_nfc_target_handle_h handle,
+               net_nfc_client_ndef_read_completed callback,
+               void *user_data)
 {
        NdefFuncData *func_data;
 
@@ -371,9 +366,8 @@ net_nfc_error_e net_nfc_client_ndef_read(net_nfc_target_handle_h handle,
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_ndef_read_sync(net_nfc_target_handle_h handle,
-                                       ndef_message_h *message)
+API net_nfc_error_e net_nfc_client_ndef_read_sync(net_nfc_target_handle_h handle,
+               ndef_message_h *message)
 {
        GVariant *out_data = NULL;
        GError *error = NULL;
@@ -400,12 +394,12 @@ net_nfc_error_e net_nfc_client_ndef_read_sync(net_nfc_target_handle_h handle,
                return NET_NFC_OPERATION_FAIL;
 
        if (net_nfc_gdbus_ndef_call_read_sync(ndef_proxy,
-                                       GPOINTER_TO_UINT(handle),
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       (gint *)&out_result,
-                                       &out_data,
-                                       NULL,
-                                       &error) == FALSE)
+                               GPOINTER_TO_UINT(handle),
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint *)&out_result,
+                               &out_data,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("can not call read: %s",
                                error->message);
@@ -418,11 +412,10 @@ net_nfc_error_e net_nfc_client_ndef_read_sync(net_nfc_target_handle_h handle,
        return out_result;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_ndef_write(net_nfc_target_handle_h handle,
-                               ndef_message_h message,
-                               net_nfc_client_ndef_write_completed callback,
-                               void *user_data)
+API net_nfc_error_e net_nfc_client_ndef_write(net_nfc_target_handle_h handle,
+               ndef_message_h message,
+               net_nfc_client_ndef_write_completed callback,
+               void *user_data)
 {
        NdefFuncData *func_data;
 
@@ -458,19 +451,18 @@ net_nfc_error_e net_nfc_client_ndef_write(net_nfc_target_handle_h handle,
                return NET_NFC_INVALID_PARAM;
 
        net_nfc_gdbus_ndef_call_write(ndef_proxy,
-                               GPOINTER_TO_UINT(handle),
-                               arg_data,
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               ndef_call_write,
-                               func_data);
+                       GPOINTER_TO_UINT(handle),
+                       arg_data,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       ndef_call_write,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_ndef_write_sync(net_nfc_target_handle_h handle,
-                                       ndef_message_h message)
+API net_nfc_error_e net_nfc_client_ndef_write_sync(net_nfc_target_handle_h handle,
+               ndef_message_h message)
 {
        GVariant *arg_data = NULL;
        GError *error = NULL;
@@ -502,12 +494,12 @@ net_nfc_error_e net_nfc_client_ndef_write_sync(net_nfc_target_handle_h handle,
                return NET_NFC_INVALID_PARAM;
 
        if (net_nfc_gdbus_ndef_call_write_sync(ndef_proxy ,
-                                       GPOINTER_TO_UINT(handle),
-                                       arg_data,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       (gint *)&out_result,
-                                       NULL,
-                                       &error) == FALSE)
+                               GPOINTER_TO_UINT(handle),
+                               arg_data,
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint *)&out_result,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("can not call write: %s",
                                error->message);
@@ -518,11 +510,10 @@ net_nfc_error_e net_nfc_client_ndef_write_sync(net_nfc_target_handle_h handle,
        return out_result;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_ndef_make_read_only(
-                       net_nfc_target_handle_h handle,
-                       net_nfc_client_ndef_make_read_only_completed callback,
-                       void *user_data)
+API net_nfc_error_e net_nfc_client_ndef_make_read_only(
+               net_nfc_target_handle_h handle,
+               net_nfc_client_ndef_make_read_only_completed callback,
+               void *user_data)
 {
        NdefFuncData *func_data;
 
@@ -552,18 +543,17 @@ net_nfc_error_e net_nfc_client_ndef_make_read_only(
        func_data->user_data = user_data;
 
        net_nfc_gdbus_ndef_call_make_read_only(ndef_proxy,
-                               GPOINTER_TO_UINT(handle),
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               ndef_call_make_read_only,
-                               func_data);
+                       GPOINTER_TO_UINT(handle),
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       ndef_call_make_read_only,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_ndef_make_read_only_sync(
-                                       net_nfc_target_handle_h handle)
+API net_nfc_error_e net_nfc_client_ndef_make_read_only_sync(
+               net_nfc_target_handle_h handle)
 {
        GError *error = NULL;
 
@@ -590,11 +580,11 @@ net_nfc_error_e net_nfc_client_ndef_make_read_only_sync(
                return NET_NFC_NOT_SUPPORTED;
 
        if (net_nfc_gdbus_ndef_call_make_read_only_sync(ndef_proxy,
-                                               GPOINTER_TO_UINT(handle),
-                                               net_nfc_client_gdbus_get_privilege(),
-                                               (gint *)&out_result,
-                                               NULL,
-                                               &error) == FALSE)
+                               GPOINTER_TO_UINT(handle),
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint *)&out_result,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("can not make read only: %s",
                                error->message);
@@ -605,11 +595,10 @@ net_nfc_error_e net_nfc_client_ndef_make_read_only_sync(
        return out_result;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_ndef_format(net_nfc_target_handle_h handle,
-                               data_h key,
-                               net_nfc_client_ndef_format_completed callback,
-                               void *user_data)
+API net_nfc_error_e net_nfc_client_ndef_format(net_nfc_target_handle_h handle,
+               data_h key,
+               net_nfc_client_ndef_format_completed callback,
+               void *user_data)
 {
        NdefFuncData *func_data;
        GVariant *arg_data = NULL;
@@ -648,20 +637,19 @@ net_nfc_error_e net_nfc_client_ndef_format(net_nfc_target_handle_h handle,
        func_data->user_data = user_data;
 
        net_nfc_gdbus_ndef_call_format(ndef_proxy ,
-                               GPOINTER_TO_UINT(handle),
-                               arg_data,
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               ndef_call_format,
-                               func_data);
+                       GPOINTER_TO_UINT(handle),
+                       arg_data,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       ndef_call_format,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_ndef_format_sync(
-                                       net_nfc_target_handle_h handle,
-                                       data_h key)
+API net_nfc_error_e net_nfc_client_ndef_format_sync(
+               net_nfc_target_handle_h handle,
+               data_h key)
 {
        GVariant *arg_data = NULL;
        GError *error = NULL;
@@ -696,12 +684,12 @@ net_nfc_error_e net_nfc_client_ndef_format_sync(
                return NET_NFC_INVALID_PARAM;
 
        if (net_nfc_gdbus_ndef_call_format_sync(ndef_proxy ,
-                                       GPOINTER_TO_UINT(handle),
-                                       arg_data,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       (gint *)&out_result,
-                                       NULL,
-                                       &error) == FALSE)
+                               GPOINTER_TO_UINT(handle),
+                               arg_data,
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint *)&out_result,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("can not call format: %s",
                                error->message);
@@ -723,12 +711,12 @@ net_nfc_error_e net_nfc_client_ndef_init(void)
        }
 
        ndef_proxy = net_nfc_gdbus_ndef_proxy_new_for_bus_sync(
-                               G_BUS_TYPE_SYSTEM,
-                               G_DBUS_PROXY_FLAGS_NONE,
-                               "org.tizen.NetNfcService",
-                               "/org/tizen/NetNfcService/Ndef",
-                               NULL,
-                               &error);
+                       G_BUS_TYPE_SYSTEM,
+                       G_DBUS_PROXY_FLAGS_NONE,
+                       "org.tizen.NetNfcService",
+                       "/org/tizen/NetNfcService/Ndef",
+                       NULL,
+                       &error);
 
        if (ndef_proxy == NULL)
        {
similarity index 58%
rename from src/clientlib/net_nfc_client_ndef_message.c
rename to client/net_nfc_client_ndef_message.c
index d967ff0..5d29581 100644 (file)
@@ -1,18 +1,18 @@
 /*
 * 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.
 */
+ * 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_internal.h"
 #include "net_nfc_data.h"
 
 
-
-#ifndef NET_NFC_MANAGER_DATA_PATH
-#define NET_NFC_MANAGER_DATA_PATH                      "/opt/data/nfc-manager-daemon"
-#endif
-
-#ifndef NET_NFC_MANAGER_DATA_PATH_MESSAGE
-#define NET_NFC_MANAGER_DATA_PATH_MESSAGE              "message"
-#endif
-
-#ifndef NET_NFC_MANAGER_NDEF_FILE_NAME
-#define NET_NFC_MANAGER_NDEF_FILE_NAME                 "ndef-message.txt"
-#endif
-
-
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
-
 /* public functions */
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_ndef_message(ndef_message_h *ndef_message)
+API net_nfc_error_e net_nfc_create_ndef_message(ndef_message_h *ndef_message)
 {
        return net_nfc_util_create_ndef_message((ndef_message_s **)ndef_message);
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_rawdata_from_ndef_message(ndef_message_h ndef_message, data_h *rawdata)
+API net_nfc_error_e net_nfc_create_rawdata_from_ndef_message(ndef_message_h ndef_message, data_h *rawdata)
 {
        uint32_t count;
        net_nfc_error_e result;
@@ -69,7 +50,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_rawdata_from_ndef_message(ndef
        }
 
        result = net_nfc_util_convert_ndef_message_to_rawdata(
-               (ndef_message_s *)ndef_message, (data_s *)data);
+                       (ndef_message_s *)ndef_message, (data_s *)data);
        if (result == NET_NFC_OK) {
                *rawdata = data;
        } else {
@@ -79,7 +60,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_rawdata_from_ndef_message(ndef
        return result;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_ndef_message_from_rawdata(ndef_message_h *ndef_message, data_h rawdata)
+API net_nfc_error_e net_nfc_create_ndef_message_from_rawdata(ndef_message_h *ndef_message, data_h rawdata)
 {
        net_nfc_error_e result;
        ndef_message_h msg;
@@ -96,7 +77,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_ndef_message_from_rawdata(ndef
        }
 
        result = net_nfc_util_convert_rawdata_to_ndef_message(
-               (data_s *)rawdata, (ndef_message_s *)msg);
+                       (data_s *)rawdata, (ndef_message_s *)msg);
        if (result == NET_NFC_OK) {
                *ndef_message = msg;
        } else {
@@ -106,7 +87,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_ndef_message_from_rawdata(ndef
        return result;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_ndef_message_byte_length(ndef_message_h ndef_message, uint32_t *length)
+API net_nfc_error_e net_nfc_get_ndef_message_byte_length(ndef_message_h ndef_message, uint32_t *length)
 {
        net_nfc_error_e result;
 
@@ -124,7 +105,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_ndef_message_byte_length(ndef_mes
        return result;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_append_record_to_ndef_message(ndef_message_h ndef_message, ndef_record_h  record)
+API net_nfc_error_e net_nfc_append_record_to_ndef_message(ndef_message_h ndef_message, ndef_record_h  record)
 {
        if (ndef_message == NULL || record == NULL){
                return NET_NFC_NULL_PARAMETER;
@@ -133,7 +114,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_append_record_to_ndef_message(ndef_me
        return net_nfc_util_append_record((ndef_message_s*)ndef_message, (ndef_record_s *)record);
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_free_ndef_message(ndef_message_h ndef_message)
+API net_nfc_error_e net_nfc_free_ndef_message(ndef_message_h ndef_message)
 {
        if (ndef_message == NULL) {
                return NET_NFC_NULL_PARAMETER;
@@ -142,7 +123,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_free_ndef_message(ndef_message_h ndef
        return net_nfc_util_free_ndef_message((ndef_message_s *)ndef_message);
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_ndef_message_record_count(ndef_message_h ndef_message, int *count)
+API net_nfc_error_e net_nfc_get_ndef_message_record_count(ndef_message_h ndef_message, int *count)
 {
        if (ndef_message == NULL || count == NULL) {
                return NET_NFC_NULL_PARAMETER;
@@ -155,33 +136,33 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_ndef_message_record_count(ndef_me
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API void net_nfc_ndef_print_message (ndef_message_h ndef_message )
+API void net_nfc_ndef_print_message (ndef_message_h ndef_message )
 {
        net_nfc_util_print_ndef_message ((ndef_message_s *)(ndef_message) );
 }
 
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_search_record_by_type (ndef_message_h ndef_message, net_nfc_record_tnf_e tnf, data_h type, ndef_record_h* record)
+API net_nfc_error_e net_nfc_search_record_by_type (ndef_message_h ndef_message, net_nfc_record_tnf_e tnf, data_h type, ndef_record_h* record)
 {
        return net_nfc_util_search_record_by_type ((ndef_message_s*)ndef_message, tnf, (data_s *)type, (ndef_record_s**)record);
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_append_record_by_index (ndef_message_h ndef_message, int index, ndef_record_h record)
+API net_nfc_error_e net_nfc_append_record_by_index (ndef_message_h ndef_message, int index, ndef_record_h record)
 {
        return net_nfc_util_append_record_by_index ((ndef_message_s *) ndef_message, index, (ndef_record_s *) record);
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_record_by_index (ndef_message_h ndef_message, int index, ndef_record_h*  record)
+API net_nfc_error_e net_nfc_get_record_by_index (ndef_message_h ndef_message, int index, ndef_record_h*  record)
 {
        return net_nfc_util_get_record_by_index ((ndef_message_s*) ndef_message, index, (ndef_record_s**) record);
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_remove_record_by_index (ndef_message_h ndef_message, int index)
+API net_nfc_error_e net_nfc_remove_record_by_index (ndef_message_h ndef_message, int index)
 {
        return net_nfc_util_remove_record_by_index ((ndef_message_s*)ndef_message, index);
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_retrieve_current_ndef_message(ndef_message_h* ndef_message)
+API net_nfc_error_e net_nfc_retrieve_current_ndef_message(ndef_message_h* ndef_message)
 {
        net_nfc_error_e result = NET_NFC_UNKNOWN_ERROR;
        char file_path[1024] = { 0, };
diff --git a/client/net_nfc_client_ndef_message_handover.c b/client/net_nfc_client_ndef_message_handover.c
new file mode 100644 (file)
index 0000000..3caad21
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+ * 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 <glib.h>
+
+#include "net_nfc_ndef_message_handover.h"
+#include "net_nfc_typedef_internal.h"
+#include "net_nfc_debug_internal.h"
+#include "net_nfc_util_internal.h"
+#include "net_nfc_util_handover.h"
+
+API net_nfc_error_e net_nfc_create_carrier_config (net_nfc_carrier_config_h * config, net_nfc_conn_handover_carrier_type_e type)
+{
+       return  net_nfc_util_create_carrier_config ((net_nfc_carrier_config_s **) config, type);
+}
+
+API net_nfc_error_e net_nfc_add_carrier_config_property (net_nfc_carrier_config_h config, uint16_t attribute, uint16_t size, uint8_t * data)
+{
+       return net_nfc_util_add_carrier_config_property ((net_nfc_carrier_config_s *) config, attribute, size, data);
+}
+
+API net_nfc_error_e net_nfc_remove_carrier_config_property (net_nfc_carrier_config_h config, uint16_t attribute)
+{
+       return net_nfc_util_remove_carrier_config_property ((net_nfc_carrier_config_s *) config, attribute);
+}
+
+API net_nfc_error_e net_nfc_get_carrier_config_property (net_nfc_carrier_config_h config, uint16_t attribute, uint16_t * size, uint8_t ** data)
+{
+       return net_nfc_util_get_carrier_config_property ((net_nfc_carrier_config_s *) config, attribute, size, data);
+}
+
+API net_nfc_error_e net_nfc_append_carrier_config_group (net_nfc_carrier_config_h config, net_nfc_property_group_h group)
+{
+       return net_nfc_util_append_carrier_config_group ((net_nfc_carrier_config_s *) config, (net_nfc_carrier_property_s *) group);
+}
+
+API net_nfc_error_e net_nfc_remove_carrier_config_group (net_nfc_carrier_config_h config, net_nfc_property_group_h group)
+{
+       return net_nfc_util_remove_carrier_config_group ((net_nfc_carrier_config_s *) config, (net_nfc_carrier_property_s *) group);
+}
+
+API net_nfc_error_e net_nfc_get_carrier_config_group (net_nfc_carrier_config_h config, int index, net_nfc_property_group_h * group)
+{
+       return net_nfc_util_get_carrier_config_group ((net_nfc_carrier_config_s *) config, index, (net_nfc_carrier_property_s **) group);
+}
+
+API net_nfc_error_e net_nfc_free_carrier_config (net_nfc_carrier_config_h config)
+{
+       return net_nfc_util_free_carrier_config ((net_nfc_carrier_config_s *) config);
+}
+
+API net_nfc_error_e net_nfc_create_carrier_config_group (net_nfc_property_group_h * group, uint16_t attribute)
+{
+       return net_nfc_util_create_carrier_config_group ((net_nfc_carrier_property_s **) group, attribute);
+}
+
+API net_nfc_error_e net_nfc_add_carrier_config_group_property (net_nfc_property_group_h group, uint16_t attribute, uint16_t size, uint8_t * data)
+{
+       return net_nfc_util_add_carrier_config_group_property ((net_nfc_carrier_property_s*) group, attribute, size, data);
+}
+
+API net_nfc_error_e net_nfc_get_carrier_config_group_property (net_nfc_property_group_h group, uint16_t attribute, uint16_t *size, uint8_t ** data)
+{
+       return net_nfc_util_get_carrier_config_group_property ((net_nfc_carrier_property_s*) group, attribute, size, data);
+}
+
+API net_nfc_error_e net_nfc_remove_carrier_config_group_property (net_nfc_property_group_h group, uint16_t attribute)
+{
+       return net_nfc_util_remove_carrier_config_group_property ((net_nfc_carrier_property_s*) group, attribute);
+}
+
+API net_nfc_error_e net_nfc_free_carrier_group (net_nfc_property_group_h group)
+{
+       return net_nfc_util_free_carrier_group ((net_nfc_carrier_property_s*) group);
+}
+
+API net_nfc_error_e net_nfc_create_ndef_record_with_carrier_config (ndef_record_h * record, net_nfc_carrier_config_h config)
+{
+       return net_nfc_util_create_ndef_record_with_carrier_config ((ndef_record_s**) record, (net_nfc_carrier_config_s *) config);
+}
+
+API net_nfc_error_e net_nfc_create_carrier_config_from_config_record (net_nfc_carrier_config_h * config, ndef_record_h record)
+{
+       return  net_nfc_util_create_carrier_config_from_config_record ((net_nfc_carrier_config_s **) config, (ndef_record_s *) record);
+
+}
+
+API net_nfc_error_e net_nfc_append_carrier_config_record (ndef_message_h message, ndef_record_h record, net_nfc_conn_handover_carrier_state_e power_status)
+{
+       return net_nfc_util_append_carrier_config_record ((ndef_message_s *) message, (ndef_record_s *) record, power_status);
+}
+
+API net_nfc_error_e net_nfc_remove_carrier_config_record (ndef_message_h message, ndef_record_h record)
+{
+       return net_nfc_util_remove_carrier_config_record ((ndef_message_s *) message, (ndef_record_s *) record);
+}
+
+API net_nfc_error_e net_nfc_get_carrier_config_record (ndef_message_h message, int index, ndef_record_h * record)
+{
+       return net_nfc_util_get_carrier_config_record ((ndef_message_s *) message, index, (ndef_record_s **) record);
+}
+
+API net_nfc_error_e net_nfc_get_handover_random_number(ndef_message_h message, unsigned short* random_number)
+{
+       return net_nfc_util_get_handover_random_number((ndef_message_s *) message,  random_number);
+}
+
+API net_nfc_error_e net_nfc_get_alternative_carrier_record_count (ndef_message_h message,  unsigned int * count)
+{
+       return net_nfc_util_get_alternative_carrier_record_count ((ndef_message_s *) message,  count);
+}
+
+API net_nfc_error_e net_nfc_get_alternative_carrier_power_status (ndef_message_h message, int index, net_nfc_conn_handover_carrier_state_e * power_state)
+{
+       return net_nfc_util_get_alternative_carrier_power_status ((ndef_message_s *) message, index, power_state);
+}
+
+API net_nfc_error_e net_nfc_set_alternative_carrier_power_status (ndef_message_h message, int index, net_nfc_conn_handover_carrier_state_e power_status)
+{
+       return net_nfc_util_set_alternative_carrier_power_status ((ndef_message_s *) message, index, power_status);
+}
+
+API net_nfc_error_e net_nfc_get_alternative_carrier_type (ndef_message_h message, int index, net_nfc_conn_handover_carrier_type_e * type)
+{
+       return net_nfc_util_get_alternative_carrier_type ((ndef_message_s *) message,  index, type);
+}
+
+API net_nfc_error_e net_nfc_create_handover_request_message (ndef_message_h * message)
+{
+       return net_nfc_util_create_handover_request_message ((ndef_message_s **) message);
+}
+
+API net_nfc_error_e net_nfc_create_handover_select_message (ndef_message_h * message)
+{
+       return net_nfc_util_create_handover_select_message((ndef_message_s **) message);
+}
+
+API net_nfc_error_e net_nfc_create_handover_error_record (ndef_record_h * record, uint8_t reason, uint32_t data)
+{
+       return net_nfc_util_create_handover_error_record ((ndef_record_s**) record, reason, data);
+}
+
+
similarity index 73%
rename from src/clientlib/net_nfc_client_ndef_record.c
rename to client/net_nfc_client_ndef_record.c
index e431d0f..c0d701a 100644 (file)
@@ -4,7 +4,7 @@
  * 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
 #include "net_nfc_util_internal.h"
 #include "net_nfc_util_ndef_record.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
-NET_NFC_EXPORT_API 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)
+API 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)
 {
        return net_nfc_util_create_record(tnf, (data_s*)typeName, (data_s*)id, (data_s*)payload, (ndef_record_s**)record);
 }
 
-NET_NFC_EXPORT_API 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)
+API 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)
 {
        return net_nfc_util_create_text_type_record(text, language_code_str, encode, (ndef_record_s**)record);
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_uri_type_record(ndef_record_h* record, const char* uri, net_nfc_schema_type_e protocol_schema)
+API net_nfc_error_e net_nfc_create_uri_type_record(ndef_record_h* record, const char* uri, net_nfc_schema_type_e protocol_schema)
 {
        return net_nfc_util_create_uri_type_record(uri, protocol_schema, (ndef_record_s**)record);
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_free_record(ndef_record_h record)
+API net_nfc_error_e net_nfc_free_record(ndef_record_h record)
 {
        return net_nfc_util_free_record((ndef_record_s*)record);
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_record_payload(ndef_record_h record, data_h * payload)
+API net_nfc_error_e net_nfc_get_record_payload(ndef_record_h record, data_h * payload)
 {
        if (record == NULL || payload == NULL)
        {
@@ -58,7 +54,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_record_payload(ndef_record_h reco
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_record_type(ndef_record_h record, data_h * type)
+API net_nfc_error_e net_nfc_get_record_type(ndef_record_h record, data_h * type)
 {
        if (record == NULL || type == NULL)
        {
@@ -72,7 +68,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_record_type(ndef_record_h record,
 
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_record_id(ndef_record_h record, data_h * id)
+API net_nfc_error_e net_nfc_get_record_id(ndef_record_h record, data_h * id)
 {
        if (record == NULL || id == NULL)
        {
@@ -86,7 +82,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_record_id(ndef_record_h record, d
 
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_record_tnf(ndef_record_h record, net_nfc_record_tnf_e * TNF)
+API net_nfc_error_e net_nfc_get_record_tnf(ndef_record_h record, net_nfc_record_tnf_e * TNF)
 {
        if (record == NULL || TNF == NULL)
        {
@@ -99,7 +95,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_record_tnf(ndef_record_h record,
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_set_record_id(ndef_record_h record, data_h id)
+API net_nfc_error_e net_nfc_set_record_id(ndef_record_h record, data_h id)
 {
 
        ndef_record_s * tmp_record = (ndef_record_s *)record;
@@ -112,7 +108,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_set_record_id(ndef_record_h record, d
        return net_nfc_util_set_record_id(tmp_record, tmp_id->buffer, tmp_id->length);
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_record_flags(ndef_record_h record, uint8_t * flag)
+API net_nfc_error_e net_nfc_get_record_flags(ndef_record_h record, uint8_t * flag)
 {
        if (record == NULL || flag == NULL)
        {
@@ -136,32 +132,32 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_record_flags(ndef_record_h record
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API uint8_t net_nfc_get_record_mb(uint8_t flag)
+API uint8_t net_nfc_get_record_mb(uint8_t flag)
 {
        return ((flag >> 7) & 0x01);
 }
 
-NET_NFC_EXPORT_API uint8_t net_nfc_get_record_me(uint8_t flag)
+API uint8_t net_nfc_get_record_me(uint8_t flag)
 {
        return ((flag >> 6) & 0x01);
 }
 
-NET_NFC_EXPORT_API uint8_t net_nfc_get_record_cf(uint8_t flag)
+API uint8_t net_nfc_get_record_cf(uint8_t flag)
 {
        return ((flag >> 5) & 0x01);
 }
 
-NET_NFC_EXPORT_API uint8_t net_nfc_get_record_sr(uint8_t flag)
+API uint8_t net_nfc_get_record_sr(uint8_t flag)
 {
        return ((flag >> 4) & 0x01);
 }
 
-NET_NFC_EXPORT_API uint8_t net_nfc_get_record_il(uint8_t flag)
+API uint8_t net_nfc_get_record_il(uint8_t flag)
 {
        return ((flag >> 3) & 0x01);
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_text_string_from_text_record(ndef_record_h record, char** buffer)
+API net_nfc_error_e net_nfc_create_text_string_from_text_record(ndef_record_h record, char** buffer)
 {
        if (record == NULL || buffer == NULL)
        {
@@ -204,7 +200,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_text_string_from_text_record(n
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_languange_code_string_from_text_record(ndef_record_h record, char** lang_code_str)
+API net_nfc_error_e net_nfc_get_languange_code_string_from_text_record(ndef_record_h record, char** lang_code_str)
 {
        if (record == NULL || lang_code_str == NULL)
        {
@@ -248,7 +244,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_languange_code_string_from_text_r
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_encoding_type_from_text_record(ndef_record_h record, net_nfc_encode_type_e * encoding)
+API net_nfc_error_e net_nfc_get_encoding_type_from_text_record(ndef_record_h record, net_nfc_encode_type_e * encoding)
 {
        if (record == NULL || encoding == NULL)
        {
@@ -286,7 +282,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_encoding_type_from_text_record(nd
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_uri_string_from_uri_record(ndef_record_h record, char **uri)
+API net_nfc_error_e net_nfc_create_uri_string_from_uri_record(ndef_record_h record, char **uri)
 {
        return net_nfc_util_create_uri_string_from_uri_record((ndef_record_s *)record, uri);
 }
similarity index 81%
rename from src/clientlib/net_nfc_client_p2p.c
rename to client/net_nfc_client_p2p.c
index 17c5dcc..6943b2a 100644 (file)
 #include "net_nfc_client_manager.h"
 #include "net_nfc_client_p2p.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
 typedef struct _P2pFuncData P2pFuncData;
 
 struct _P2pFuncData
@@ -54,22 +50,22 @@ static NetNfcGDbusP2p *p2p_proxy = NULL;
 static P2pSignalHandler *p2p_signal_handler = NULL;
 
 static void p2p_device_detached(GObject *source_object,
-                       gpointer user_data);
+               gpointer user_data);
 
 static void p2p_device_discovered(GObject *source_object,
-                       guint arg_handle,
-                       gpointer user_data);
+               guint arg_handle,
+               gpointer user_data);
 
 static void p2p_device_data_received(GObject *source_object,
-                       GVariant *arg_data,
-                       gpointer user_data);
+               GVariant *arg_data,
+               gpointer user_data);
 
 static void p2p_call_send(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void p2p_device_detached(GObject *source_object,
-                       gpointer user_data)
+               gpointer user_data)
 {
        INFO_MSG(">>> SIGNAL arrived");
 
@@ -90,8 +86,8 @@ static void p2p_device_detached(GObject *source_object,
 }
 
 static void p2p_device_discovered(GObject *source_object,
-                       guint arg_handle,
-                       gpointer user_data)
+               guint arg_handle,
+               gpointer user_data)
 {
        net_nfc_target_handle_s *handle_info = NULL;
 
@@ -110,8 +106,8 @@ static void p2p_device_discovered(GObject *source_object,
 }
 
 static void p2p_device_data_received(GObject *source_object,
-                       GVariant *arg_data,
-                       gpointer user_data)
+               GVariant *arg_data,
+               gpointer user_data)
 {
        INFO_MSG(">>> SIGNAL arrived");
 
@@ -132,8 +128,8 @@ static void p2p_device_data_received(GObject *source_object,
 }
 
 static void p2p_call_send(GObject *source_object,
-                       GAsyncResult *res,
-                       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        P2pFuncData *func_data;
 
@@ -143,10 +139,10 @@ static void p2p_call_send(GObject *source_object,
        net_nfc_client_p2p_send_completed callback;
 
        if (net_nfc_gdbus_p2p_call_send_finish(
-                                       NET_NFC_GDBUS_P2P(source_object),
-                                       (gint *)&out_result,
-                                       res,
-                                       &error) == FALSE)
+                               NET_NFC_GDBUS_P2P(source_object),
+                               (gint *)&out_result,
+                               res,
+                               &error) == FALSE)
        {
                out_result = NET_NFC_UNKNOWN_ERROR;
 
@@ -169,18 +165,17 @@ static void p2p_call_send(GObject *source_object,
        }
 
        callback = (net_nfc_client_p2p_send_completed)
-                                               func_data->p2p_send_callback;
+               func_data->p2p_send_callback;
        callback(out_result, func_data->p2p_send_data);
 
        g_free(func_data);
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_p2p_send(net_nfc_exchanger_data_h exchg_data,
-                               net_nfc_target_handle_h handle,
-                               net_nfc_client_p2p_send_completed callback,
-                               void *cb_data)
+API net_nfc_error_e net_nfc_client_p2p_send(net_nfc_exchanger_data_h exchg_data,
+               net_nfc_target_handle_h handle,
+               net_nfc_client_p2p_send_completed callback,
+               void *cb_data)
 {
 
        GVariant *arg_data = NULL;
@@ -208,23 +203,22 @@ net_nfc_error_e net_nfc_client_p2p_send(net_nfc_exchanger_data_h exchg_data,
        arg_data = net_nfc_util_gdbus_data_to_variant(&exch_data->binary_data);
 
        net_nfc_gdbus_p2p_call_send(p2p_proxy,
-                               exch_data->type,
-                               arg_data,
-                               GPOINTER_TO_UINT(handle),
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               p2p_call_send,
-                               func_data);
+                       exch_data->type,
+                       arg_data,
+                       GPOINTER_TO_UINT(handle),
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       p2p_call_send,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_p2p_send_sync(
-                               net_nfc_exchanger_data_h exchg_data,
-                               net_nfc_target_handle_h handle)
+API net_nfc_error_e net_nfc_client_p2p_send_sync(
+               net_nfc_exchanger_data_h exchg_data,
+               net_nfc_target_handle_h handle)
 {
        GVariant *arg_data = NULL;
        GError *error = NULL;
@@ -249,16 +243,16 @@ net_nfc_error_e net_nfc_client_p2p_send_sync(
        arg_data = net_nfc_util_gdbus_data_to_variant(&exch_data->binary_data);
 
        if (net_nfc_gdbus_p2p_call_send_sync(p2p_proxy,
-                       exch_data->type,
-                       arg_data,
-                       GPOINTER_TO_UINT(handle),
-                       net_nfc_client_gdbus_get_privilege(),
-                       (gint *)&out_result,
-                       NULL,
-                       &error) == FALSE)
+                               exch_data->type,
+                               arg_data,
+                               GPOINTER_TO_UINT(handle),
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint *)&out_result,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("p2p send (sync call) failed: %s",
-                       error->message);
+                               error->message);
 
                g_error_free(error);
                return NET_NFC_UNKNOWN_ERROR;
@@ -268,10 +262,9 @@ net_nfc_error_e net_nfc_client_p2p_send_sync(
 }
 
 
-NET_NFC_EXPORT_API
-void net_nfc_client_p2p_set_device_discovered(
-                       net_nfc_client_p2p_device_discovered callback,
-                       void *user_data)
+API void net_nfc_client_p2p_set_device_discovered(
+               net_nfc_client_p2p_device_discovered callback,
+               void *user_data)
 {
        if(p2p_signal_handler == NULL)
        {
@@ -283,10 +276,9 @@ void net_nfc_client_p2p_set_device_discovered(
 }
 
 
-NET_NFC_EXPORT_API
-void net_nfc_client_p2p_set_device_detached(
-                       net_nfc_client_p2p_device_detached callback,
-                       void *user_data)
+API void net_nfc_client_p2p_set_device_detached(
+               net_nfc_client_p2p_device_detached callback,
+               void *user_data)
 {
        if(p2p_signal_handler == NULL)
        {
@@ -298,10 +290,9 @@ void net_nfc_client_p2p_set_device_detached(
 }
 
 
-NET_NFC_EXPORT_API
-void net_nfc_client_p2p_set_data_received(
-                       net_nfc_client_p2p_data_received callback,
-                       void *user_data)
+API void net_nfc_client_p2p_set_data_received(
+               net_nfc_client_p2p_data_received callback,
+               void *user_data)
 {
        if(p2p_signal_handler == NULL)
        {
@@ -313,8 +304,7 @@ void net_nfc_client_p2p_set_data_received(
 }
 
 
-NET_NFC_EXPORT_API
-void net_nfc_client_p2p_unset_device_discovered(void)
+API void net_nfc_client_p2p_unset_device_discovered(void)
 {
        if(p2p_signal_handler == NULL)
        {
@@ -332,8 +322,7 @@ void net_nfc_client_p2p_unset_device_discovered(void)
 }
 
 
-NET_NFC_EXPORT_API
-void net_nfc_client_p2p_unset_device_detached(void)
+API void net_nfc_client_p2p_unset_device_detached(void)
 {
        if(p2p_signal_handler == NULL)
        {
@@ -349,8 +338,7 @@ void net_nfc_client_p2p_unset_device_detached(void)
 }
 
 
-NET_NFC_EXPORT_API
-void net_nfc_client_p2p_unset_data_received(void)
+API void net_nfc_client_p2p_unset_data_received(void)
 {
        if(p2p_signal_handler == NULL)
        {
@@ -377,12 +365,12 @@ net_nfc_error_e net_nfc_client_p2p_init(void)
        }
 
        p2p_proxy = net_nfc_gdbus_p2p_proxy_new_for_bus_sync(
-                               G_BUS_TYPE_SYSTEM,
-                               G_DBUS_PROXY_FLAGS_NONE,
-                               "org.tizen.NetNfcService",
-                               "/org/tizen/NetNfcService/P2p",
-                               NULL,
-                               &error);
+                       G_BUS_TYPE_SYSTEM,
+                       G_DBUS_PROXY_FLAGS_NONE,
+                       "org.tizen.NetNfcService",
+                       "/org/tizen/NetNfcService/P2p",
+                       NULL,
+                       &error);
        if (p2p_proxy == NULL)
        {
                DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
similarity index 74%
rename from src/clientlib/net_nfc_client_se.c
rename to client/net_nfc_client_se.c
index bd5f49a..9459a89 100644 (file)
 #include "net_nfc_client_manager.h"
 #include "net_nfc_client_se.h"
 
-
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
 typedef struct _SeFuncData SeFuncData;
 
 struct _SeFuncData
@@ -69,38 +64,38 @@ static SeTransEventHandler se_transeventhandler;
 static SeESEDetectedHandler se_esedetecthandler;
 
 static void se_ese_detected(GObject *source_object,
-                       guint arg_handle,
-                       gint arg_se_type,
-                       GVariant *arg_data);
+               guint arg_handle,
+               gint arg_se_type,
+               GVariant *arg_data);
 
 static void se_type_changed(GObject *source_object,
-                               gint arg_se_type);
+               gint arg_se_type);
 
 static void set_secure_element(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void open_secure_element(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void close_secure_element(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void send_apdu_secure_element(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void get_atr_secure_element(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 
 static void se_ese_detected(GObject *source_object,
-                       guint arg_handle,
-                       gint arg_se_type,
-                       GVariant *arg_data)
+               guint arg_handle,
+               gint arg_se_type,
+               GVariant *arg_data)
 {
        INFO_MSG(">>> SIGNAL arrived");
 
@@ -112,8 +107,8 @@ static void se_ese_detected(GObject *source_object,
                net_nfc_util_gdbus_variant_to_data_s(arg_data, &buffer_data);
 
                callback((net_nfc_target_handle_h)arg_handle,
-                       arg_se_type, &buffer_data,
-                       se_esedetecthandler.se_ese_detected_data);
+                               arg_se_type, &buffer_data,
+                               se_esedetecthandler.se_ese_detected_data);
 
                net_nfc_util_free_data(&buffer_data);
        }
@@ -121,7 +116,7 @@ static void se_ese_detected(GObject *source_object,
 
 
 static void se_type_changed(GObject *source_object,
-                       gint arg_se_type)
+               gint arg_se_type)
 {
        INFO_MSG(">>> SIGNAL arrived");
 
@@ -131,15 +126,15 @@ static void se_type_changed(GObject *source_object,
                        (net_nfc_client_se_event)se_eventhandler.se_event_cb;
 
                callback((net_nfc_message_e)arg_se_type,
-                       se_eventhandler.se_event_data);
+                               se_eventhandler.se_event_data);
        }
 }
 
 
 static void se_transaction_event(GObject *source_object,
-       gint arg_se_type,
-       GVariant *arg_aid,
-       GVariant *arg_param)
+               gint arg_se_type,
+               GVariant *arg_aid,
+               GVariant *arg_param)
 {
        INFO_MSG(">>> SIGNAL arrived");
 
@@ -153,7 +148,7 @@ static void se_transaction_event(GObject *source_object,
                net_nfc_util_gdbus_variant_to_data_s(arg_param, &param);
 
                callback(&aid, &param,
-                       se_transeventhandler.se_transaction_event_data);
+                               se_transeventhandler.se_transaction_event_data);
 
                net_nfc_util_free_data(&param);
                net_nfc_util_free_data(&aid);
@@ -162,8 +157,8 @@ static void se_transaction_event(GObject *source_object,
 
 
 static void set_secure_element(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        SeFuncData *func_data = (SeFuncData *)user_data;
        net_nfc_error_e result;
@@ -172,9 +167,9 @@ static void set_secure_element(GObject *source_object,
        g_assert(user_data != NULL);
 
        if (net_nfc_gdbus_secure_element_call_set_finish(se_proxy,
-               &result,
-               res,
-               &error) == FALSE)
+                               &result,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_IPC_FAIL;
 
@@ -197,8 +192,8 @@ static void set_secure_element(GObject *source_object,
 
 
 static void open_secure_element(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        SeFuncData *func_data = (SeFuncData *)user_data;
        net_nfc_error_e result;
@@ -208,11 +203,11 @@ static void open_secure_element(GObject *source_object,
        g_assert(user_data != NULL);
 
        if (net_nfc_gdbus_secure_element_call_open_secure_element_finish(
-               se_proxy,
-               &result,
-               &out_handle,
-               res,
-               &error) == FALSE)
+                               se_proxy,
+                               &result,
+                               &out_handle,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_IPC_FAIL;
 
@@ -228,8 +223,8 @@ static void open_secure_element(GObject *source_object,
                        (net_nfc_se_open_se_cb)func_data->se_callback;
 
                se_callback(result,
-                       (net_nfc_target_handle_h)out_handle,
-                       func_data->se_data);
+                               (net_nfc_target_handle_h)out_handle,
+                               func_data->se_data);
        }
 
        g_free(func_data);
@@ -237,8 +232,8 @@ static void open_secure_element(GObject *source_object,
 
 
 static void close_secure_element(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        SeFuncData *func_data = (SeFuncData *)user_data;
        net_nfc_error_e result;
@@ -247,10 +242,10 @@ static void close_secure_element(GObject *source_object,
        g_assert(user_data != NULL);
 
        if (net_nfc_gdbus_secure_element_call_close_secure_element_finish(
-               se_proxy,
-               &result,
-               res,
-               &error) == FALSE)
+                               se_proxy,
+                               &result,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_IPC_FAIL;
 
@@ -272,8 +267,8 @@ static void close_secure_element(GObject *source_object,
 
 
 static void send_apdu_secure_element(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        SeFuncData *func_data = (SeFuncData *)user_data;
        net_nfc_error_e result;
@@ -283,11 +278,11 @@ static void send_apdu_secure_element(GObject *source_object,
        g_assert(user_data != NULL);
 
        if (net_nfc_gdbus_secure_element_call_send_apdu_finish(
-               se_proxy,
-               &result,
-               &out_response,
-               res,
-               &error) == FALSE)
+                               se_proxy,
+                               &result,
+                               &out_response,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_IPC_FAIL;
 
@@ -314,8 +309,8 @@ static void send_apdu_secure_element(GObject *source_object,
 
 
 static void get_atr_secure_element(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        SeFuncData *func_data = (SeFuncData *)user_data;
        net_nfc_error_e result;
@@ -325,11 +320,11 @@ static void get_atr_secure_element(GObject *source_object,
        g_assert(user_data != NULL);
 
        if (net_nfc_gdbus_secure_element_call_get_atr_finish(
-               se_proxy,
-               &result,
-               &out_atr,
-               res,
-               &error) == FALSE)
+                               se_proxy,
+                               &result,
+                               &out_atr,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_IPC_FAIL;
 
@@ -355,11 +350,10 @@ static void get_atr_secure_element(GObject *source_object,
 }
 
 
-NET_NFC_EXPORT_API
-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)
+API 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)
 {
        SeFuncData *func_data;
 
@@ -383,20 +377,19 @@ net_nfc_error_e net_nfc_client_se_set_secure_element_type(
        func_data->se_data = user_data;
 
        net_nfc_gdbus_secure_element_call_set(
-                               se_proxy,
-                               (gint)se_type,
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               set_secure_element,
-                               func_data);
+                       se_proxy,
+                       (gint)se_type,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       set_secure_element,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_se_set_secure_element_type_sync(
-                               net_nfc_se_type_e se_type)
+API net_nfc_error_e net_nfc_client_se_set_secure_element_type_sync(
+               net_nfc_se_type_e se_type)
 {
        net_nfc_error_e result;
        GError *error = NULL;
@@ -414,12 +407,12 @@ net_nfc_error_e net_nfc_client_se_set_secure_element_type_sync(
        }
 
        if (net_nfc_gdbus_secure_element_call_set_sync(
-                       se_proxy,
-                       (gint)se_type,
-                       net_nfc_client_gdbus_get_privilege(),
-                       &result,
-                       NULL,
-                       &error) == FALSE)
+                               se_proxy,
+                               (gint)se_type,
+                               net_nfc_client_gdbus_get_privilege(),
+                               &result,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("Set secure element failed: %s", error->message);
 
@@ -432,11 +425,10 @@ net_nfc_error_e net_nfc_client_se_set_secure_element_type_sync(
 }
 
 
-NET_NFC_EXPORT_API
-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)
+API 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)
 {
        SeFuncData *func_data;
 
@@ -457,21 +449,20 @@ net_nfc_error_e net_nfc_client_se_open_internal_secure_element(
        func_data->se_data = user_data;
 
        net_nfc_gdbus_secure_element_call_open_secure_element(
-                                       se_proxy,
-                                       (gint)se_type,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       NULL,
-                                       open_secure_element,
-                                       user_data);
+                       se_proxy,
+                       (gint)se_type,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       open_secure_element,
+                       user_data);
 
        return NET_NFC_OK;
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_se_open_internal_secure_element_sync(
-                                       net_nfc_se_type_e se_type,
-                                       net_nfc_target_handle_h *handle)
+API net_nfc_error_e net_nfc_client_se_open_internal_secure_element_sync(
+               net_nfc_se_type_e se_type,
+               net_nfc_target_handle_h *handle)
 {
        net_nfc_error_e result;
        guint out_handle;
@@ -491,17 +482,17 @@ net_nfc_error_e net_nfc_client_se_open_internal_secure_element_sync(
        /* allow this function even nfc is off */
 
        if (net_nfc_gdbus_secure_element_call_open_secure_element_sync(
-                                       se_proxy,
-                                       se_type,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       &result,
-                                       &out_handle,
-                                       NULL,
-                                       &error) == true) {
+                               se_proxy,
+                               se_type,
+                               net_nfc_client_gdbus_get_privilege(),
+                               &result,
+                               &out_handle,
+                               NULL,
+                               &error) == true) {
                *handle = GUINT_TO_POINTER(out_handle);
        } else {
                DEBUG_ERR_MSG("Open internal secure element failed: %s",
-                                       error->message);
+                               error->message);
                g_error_free(error);
 
                result = NET_NFC_IPC_FAIL;
@@ -511,11 +502,10 @@ net_nfc_error_e net_nfc_client_se_open_internal_secure_element_sync(
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_se_close_internal_secure_element(
-                               net_nfc_target_handle_h handle,
-                               net_nfc_se_close_se_cb callback,
-                               void *user_data)
+API net_nfc_error_e net_nfc_client_se_close_internal_secure_element(
+               net_nfc_target_handle_h handle,
+               net_nfc_se_close_se_cb callback,
+               void *user_data)
 {
        SeFuncData *func_data;
 
@@ -536,20 +526,19 @@ net_nfc_error_e net_nfc_client_se_close_internal_secure_element(
        func_data->se_data = user_data;
 
        net_nfc_gdbus_secure_element_call_close_secure_element(
-                               se_proxy,
-                               GPOINTER_TO_UINT(handle),
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               close_secure_element,
-                               user_data);
+                       se_proxy,
+                       GPOINTER_TO_UINT(handle),
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       close_secure_element,
+                       user_data);
 
        return NET_NFC_OK;
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_se_close_internal_secure_element_sync(
-                                       net_nfc_target_handle_h handle)
+API net_nfc_error_e net_nfc_client_se_close_internal_secure_element_sync(
+               net_nfc_target_handle_h handle)
 {
        net_nfc_error_e result;
        GError *error = NULL;
@@ -572,7 +561,7 @@ net_nfc_error_e net_nfc_client_se_close_internal_secure_element_sync(
                                &error) == FALSE)
        {
                DEBUG_ERR_MSG("close internal secure element failed: %s",
-                                       error->message);
+                               error->message);
                g_error_free(error);
 
                result = NET_NFC_IPC_FAIL;
@@ -582,11 +571,10 @@ net_nfc_error_e net_nfc_client_se_close_internal_secure_element_sync(
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_se_get_atr(
-                               net_nfc_target_handle_h handle,
-                               net_nfc_se_get_atr_cb callback,
-                               void *user_data)
+API net_nfc_error_e net_nfc_client_se_get_atr(
+               net_nfc_target_handle_h handle,
+               net_nfc_se_get_atr_cb callback,
+               void *user_data)
 {
        SeFuncData *func_data;
 
@@ -607,21 +595,20 @@ net_nfc_error_e net_nfc_client_se_get_atr(
        func_data->se_data = user_data;
 
        net_nfc_gdbus_secure_element_call_get_atr(
-                                       se_proxy,
-                                       GPOINTER_TO_UINT(handle),
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       NULL,
-                                       get_atr_secure_element,
-                                       func_data);
+                       se_proxy,
+                       GPOINTER_TO_UINT(handle),
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       get_atr_secure_element,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_se_get_atr_sync(
-                               net_nfc_target_handle_h handle,
-                               data_h *atr)
+API net_nfc_error_e net_nfc_client_se_get_atr_sync(
+               net_nfc_target_handle_h handle,
+               data_h *atr)
 {
        net_nfc_error_e result;
        GVariant *out_atr;
@@ -643,13 +630,13 @@ net_nfc_error_e net_nfc_client_se_get_atr_sync(
        /* allow this function even nfc is off */
 
        if (net_nfc_gdbus_secure_element_call_get_atr_sync(
-                                       se_proxy,
-                                       GPOINTER_TO_UINT(handle),
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       &result,
-                                       &out_atr,
-                                       NULL,
-                                       &error) == true) {
+                               se_proxy,
+                               GPOINTER_TO_UINT(handle),
+                               net_nfc_client_gdbus_get_privilege(),
+                               &result,
+                               &out_atr,
+                               NULL,
+                               &error) == true) {
                *atr = net_nfc_util_gdbus_variant_to_data(out_atr);
        } else {
                DEBUG_ERR_MSG("Get attributes failed: %s", error->message);
@@ -662,12 +649,11 @@ net_nfc_error_e net_nfc_client_se_get_atr_sync(
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_se_send_apdu(
-                               net_nfc_target_handle_h handle,
-                               data_h apdu_data,
-                               net_nfc_se_send_apdu_cb callback,
-                               void *user_data)
+API net_nfc_error_e net_nfc_client_se_send_apdu(
+               net_nfc_target_handle_h handle,
+               data_h apdu_data,
+               net_nfc_se_send_apdu_cb callback,
+               void *user_data)
 {
        SeFuncData *func_data;
        GVariant *arg_data;
@@ -696,23 +682,22 @@ net_nfc_error_e net_nfc_client_se_send_apdu(
        func_data->se_data = user_data;
 
        net_nfc_gdbus_secure_element_call_send_apdu(
-                               se_proxy,
-                               GPOINTER_TO_UINT(handle),
-                               arg_data,
-                               net_nfc_client_gdbus_get_privilege(),
-                               NULL,
-                               send_apdu_secure_element,
-                               func_data);
+                       se_proxy,
+                       GPOINTER_TO_UINT(handle),
+                       arg_data,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       send_apdu_secure_element,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_se_send_apdu_sync(
-                               net_nfc_target_handle_h handle,
-                               data_h apdu_data,
-                               data_h *response)
+API net_nfc_error_e net_nfc_client_se_send_apdu_sync(
+               net_nfc_target_handle_h handle,
+               data_h apdu_data,
+               data_h *response)
 {
        net_nfc_error_e result;
        GVariant *out_data;
@@ -739,18 +724,18 @@ net_nfc_error_e net_nfc_client_se_send_apdu_sync(
                return NET_NFC_INVALID_PARAM;
 
        if (net_nfc_gdbus_secure_element_call_send_apdu_sync(
-                                       se_proxy,
-                                       GPOINTER_TO_UINT(handle),
-                                       arg_data,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       &result,
-                                       &out_data,
-                                       NULL,
-                                       &error) == true) {
+                               se_proxy,
+                               GPOINTER_TO_UINT(handle),
+                               arg_data,
+                               net_nfc_client_gdbus_get_privilege(),
+                               &result,
+                               &out_data,
+                               NULL,
+                               &error) == true) {
                *response = net_nfc_util_gdbus_variant_to_data(out_data);
        } else {
                DEBUG_ERR_MSG("Send APDU failed: %s",
-                                       error->message);
+                               error->message);
                g_error_free(error);
 
                result = NET_NFC_IPC_FAIL;
@@ -760,51 +745,45 @@ net_nfc_error_e net_nfc_client_se_send_apdu_sync(
 }
 
 
-NET_NFC_EXPORT_API
-void net_nfc_client_se_set_ese_detection_cb(
-                       net_nfc_client_se_ese_detected_event callback,
-                       void *user_data)
+API void net_nfc_client_se_set_ese_detection_cb(
+               net_nfc_client_se_ese_detected_event callback,
+               void *user_data)
 {
        se_esedetecthandler.se_ese_detected_cb = callback;
        se_esedetecthandler.se_ese_detected_data = user_data;
 }
 
 
-NET_NFC_EXPORT_API
-void net_nfc_client_se_unset_ese_detection_cb(void)
+API void net_nfc_client_se_unset_ese_detection_cb(void)
 {
        net_nfc_client_se_set_ese_detection_cb(NULL, NULL);
 }
 
 
-NET_NFC_EXPORT_API
-void net_nfc_client_se_set_transaction_event_cb(
-                       net_nfc_client_se_transaction_event callback,
-                       void *user_data)
+API void net_nfc_client_se_set_transaction_event_cb(
+               net_nfc_client_se_transaction_event callback,
+               void *user_data)
 {
        se_transeventhandler.se_transaction_event_cb = callback;
        se_transeventhandler.se_transaction_event_data = user_data;
 }
 
 
-NET_NFC_EXPORT_API
-void net_nfc_client_se_unset_transaction_event_cb(void)
+API void net_nfc_client_se_unset_transaction_event_cb(void)
 {
        net_nfc_client_se_set_transaction_event_cb(NULL, NULL);
 }
 
 
-NET_NFC_EXPORT_API
-void net_nfc_client_se_set_event_cb(net_nfc_client_se_event callback,
-                                       void *user_data)
+API void net_nfc_client_se_set_event_cb(net_nfc_client_se_event callback,
+               void *user_data)
 {
        se_eventhandler.se_event_cb = callback;
        se_eventhandler.se_event_data = user_data;
 }
 
 
-NET_NFC_EXPORT_API
-void net_nfc_client_se_unset_event_cb(void)
+API void net_nfc_client_se_unset_event_cb(void)
 {
        net_nfc_client_se_set_event_cb(NULL, NULL);
 }
@@ -822,12 +801,12 @@ net_nfc_error_e net_nfc_client_se_init(void)
        }
 
        se_proxy = net_nfc_gdbus_secure_element_proxy_new_for_bus_sync(
-                               G_BUS_TYPE_SYSTEM,
-                               G_DBUS_PROXY_FLAGS_NONE,
-                               "org.tizen.NetNfcService",
-                               "/org/tizen/NetNfcService/SecureElement",
-                               NULL,
-                               &error);
+                       G_BUS_TYPE_SYSTEM,
+                       G_DBUS_PROXY_FLAGS_NONE,
+                       "org.tizen.NetNfcService",
+                       "/org/tizen/NetNfcService/SecureElement",
+                       NULL,
+                       &error);
        if (se_proxy == NULL)
        {
                DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
@@ -838,13 +817,13 @@ net_nfc_error_e net_nfc_client_se_init(void)
        }
 
        g_signal_connect(se_proxy, "se-type-changed",
-               G_CALLBACK(se_type_changed), NULL);
+                       G_CALLBACK(se_type_changed), NULL);
 
        g_signal_connect(se_proxy, "ese-detected",
-               G_CALLBACK(se_ese_detected), NULL);
+                       G_CALLBACK(se_ese_detected), NULL);
 
        g_signal_connect(se_proxy, "transaction-event",
-               G_CALLBACK(se_transaction_event), NULL);
+                       G_CALLBACK(se_transaction_event), NULL);
 
        return NET_NFC_OK;
 }
diff --git a/client/net_nfc_client_sign_record.c b/client/net_nfc_client_sign_record.c
new file mode 100644 (file)
index 0000000..4f3fb90
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * 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_sign_record.h"
+
+API net_nfc_error_e net_nfc_sign_records(ndef_message_h msg, int begin_index, int end_index, char *cert_file, char *password)
+{
+       return net_nfc_util_sign_records((ndef_message_s *)msg, begin_index, end_index, cert_file, password);
+}
+
+API net_nfc_error_e net_nfc_sign_ndef_message(ndef_message_h msg, char *cert_file, char *password)
+{
+       return net_nfc_util_sign_ndef_message((ndef_message_s *)msg, cert_file, password);
+}
+
+API net_nfc_error_e net_nfc_verify_signature_ndef_message(ndef_message_h msg)
+{
+       return net_nfc_util_verify_signature_ndef_message((ndef_message_s *)msg);
+}
+
+API net_nfc_error_e net_nfc_verify_signature_records(ndef_record_h begin_record, ndef_record_h sign_record)
+{
+       return net_nfc_util_verify_signature_records((ndef_record_s *)begin_record, (ndef_record_s *)sign_record);
+}
similarity index 70%
rename from src/clientlib/net_nfc_client_snep.c
rename to client/net_nfc_client_snep.c
index 411890a..b920e49 100644 (file)
 #include "net_nfc_client_manager.h"
 #include "net_nfc_client_snep.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
 static NetNfcGDbusSnep *snep_proxy = NULL;
 
 /*******************************************************************/
@@ -41,8 +37,8 @@ static ndef_message_h snep_variant_to_message(GVariant *variant);
 /*********************************************************************/
 
 static void snep_send_client_request(GObject *source_object,
-       GAsyncResult *res,
-       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 /*********************************************************************/
 
@@ -52,7 +48,7 @@ static GVariant *snep_message_to_variant(ndef_message_h message)
        GVariant *variant = NULL;
 
        if (net_nfc_create_rawdata_from_ndef_message(message,
-               &data) != NET_NFC_OK)
+                               &data) != NET_NFC_OK)
        {
                DEBUG_ERR_MSG("can not convert ndef_message to rawdata");
                return NULL;
@@ -75,7 +71,7 @@ static ndef_message_h snep_variant_to_message(GVariant *variant)
        if (data.buffer && data.length > 0)
        {
                if (net_nfc_create_ndef_message_from_rawdata(&message, &data)
-                       != NET_NFC_OK)
+                               != NET_NFC_OK)
                {
                        DEBUG_ERR_MSG("memory alloc fail...");
                }
@@ -87,8 +83,8 @@ static ndef_message_h snep_variant_to_message(GVariant *variant)
 }
 
 static void snep_send_client_request(GObject *source_object,
-       GAsyncResult *res,
-       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        GVariant *parameter = (GVariant *)user_data;
        GError *error = NULL;
@@ -97,15 +93,15 @@ static void snep_send_client_request(GObject *source_object,
        GVariant *out_data;
 
        if (net_nfc_gdbus_snep_call_client_request_finish(
-               NET_NFC_GDBUS_SNEP(source_object),
-               (gint *)&out_result,
-               (guint *)&out_type,
-               &out_data,
-               res,
-               &error) == FALSE)
+                               NET_NFC_GDBUS_SNEP(source_object),
+                               (gint *)&out_result,
+                               (guint *)&out_type,
+                               &out_data,
+                               res,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("Can not finish send client request %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
 
                out_result = NET_NFC_UNKNOWN_ERROR;
@@ -118,28 +114,27 @@ static void snep_send_client_request(GObject *source_object,
                ndef_message_h message = NULL;
 
                g_variant_get(parameter, "(uuu)",
-                       (guint *)&callback,
-                       (guint *)&user_param,
-                       (guint *)&handle);
+                               (guint *)&callback,
+                               (guint *)&user_param,
+                               (guint *)&handle);
 
                if (callback != NULL) {
                        message = snep_variant_to_message(out_data);
 
                        callback(handle, out_type, out_result,
-                               message, user_param);
+                                       message, user_param);
                }
 
                g_object_unref(parameter);
        }
 }
 
-NET_NFC_EXPORT_API
-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)
+API 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_error_e result = NET_NFC_OK;
        GError *error = NULL;
@@ -158,23 +153,23 @@ net_nfc_error_e net_nfc_client_snep_start_server(
        }
 
        parameter = g_variant_new("(uu)",
-               GPOINTER_TO_UINT(callback),
-               GPOINTER_TO_UINT(user_data));
+                       GPOINTER_TO_UINT(callback),
+                       GPOINTER_TO_UINT(user_data));
 
        g_object_ref(parameter);
 
        if (net_nfc_gdbus_snep_call_server_start_sync(snep_proxy,
-               GPOINTER_TO_UINT(target),
-               sap,
-               san,
-               GPOINTER_TO_UINT(parameter),
-               net_nfc_client_gdbus_get_privilege(),
-               (gint *)&result,
-               NULL,
-               &error) == FALSE)
+                               GPOINTER_TO_UINT(target),
+                               sap,
+                               san,
+                               GPOINTER_TO_UINT(parameter),
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint *)&result,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("snep server(sync call) failed: %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
                g_object_unref(parameter);
 
@@ -184,13 +179,12 @@ net_nfc_error_e net_nfc_client_snep_start_server(
        return result;
 }
 
-NET_NFC_EXPORT_API
-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)
+API 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_error_e result = NET_NFC_OK;
        GError *error = NULL;
@@ -209,23 +203,23 @@ net_nfc_error_e net_nfc_client_snep_start_client(
        }
 
        parameter = g_variant_new("(uu)",
-               GPOINTER_TO_UINT(callback),
-               GPOINTER_TO_UINT(user_data));
+                       GPOINTER_TO_UINT(callback),
+                       GPOINTER_TO_UINT(user_data));
 
        g_object_ref(parameter);
 
        if (net_nfc_gdbus_snep_call_client_start_sync(snep_proxy,
-               GPOINTER_TO_UINT(target),
-               sap,
-               san,
-               GPOINTER_TO_UINT(parameter),
-               net_nfc_client_gdbus_get_privilege(),
-               (gint *)&result,
-               NULL,
-               &error) == FALSE)
+                               GPOINTER_TO_UINT(target),
+                               sap,
+                               san,
+                               GPOINTER_TO_UINT(parameter),
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint *)&result,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("snep client(sync call) failed: %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
                g_object_unref(parameter);
 
@@ -235,13 +229,12 @@ net_nfc_error_e net_nfc_client_snep_start_client(
        return result;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_snep_send_client_request(
-       net_nfc_snep_handle_h target,
-       net_nfc_snep_type_t snep_type,
-       ndef_message_h msg,
-       net_nfc_client_snep_event_cb callback,
-       void *user_data)
+API net_nfc_error_e net_nfc_client_snep_send_client_request(
+               net_nfc_snep_handle_h target,
+               net_nfc_snep_type_t snep_type,
+               ndef_message_h msg,
+               net_nfc_client_snep_event_cb callback,
+               void *user_data)
 {
        GVariant *ndef_msg = NULL;
        GVariant *parameter;
@@ -264,33 +257,32 @@ net_nfc_error_e net_nfc_client_snep_send_client_request(
        }
 
        parameter = g_variant_new("(uuu)",
-               GPOINTER_TO_UINT(callback),
-               GPOINTER_TO_UINT(user_data),
-               GPOINTER_TO_UINT(target));
+                       GPOINTER_TO_UINT(callback),
+                       GPOINTER_TO_UINT(user_data),
+                       GPOINTER_TO_UINT(target));
 
        g_object_ref(parameter);
 
        ndef_msg = snep_message_to_variant(msg);
 
        net_nfc_gdbus_snep_call_client_request(snep_proxy,
-               GPOINTER_TO_UINT(target),
-               snep_type,
-               ndef_msg,
-               net_nfc_client_gdbus_get_privilege(),
-               NULL,
-               snep_send_client_request,
-               parameter);
+                       GPOINTER_TO_UINT(target),
+                       snep_type,
+                       ndef_msg,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       snep_send_client_request,
+                       parameter);
 
        return NET_NFC_OK;
 }
 #if 0
-NET_NFC_EXPORT_API
-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)
+API 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)
 {
        GVariant *resp_msg = NULL;
        GVariant *arg_msg = NULL;
@@ -313,18 +305,18 @@ net_nfc_error_e net_nfc_client_snep_send_client_request_sync(
        arg_msg = snep_message_to_variant(msg);
 
        if (net_nfc_gdbus_snep_call_client_request_sync(snep_proxy,
-               GPOINTER_TO_UINT(target),
-               snep_type,
-               arg_msg,
-               net_nfc_client_gdbus_get_privilege(),
-               &result,
-               resp_type,
-               &resp_msg,
-               NULL,
-               &error) == FALSE)
+                               GPOINTER_TO_UINT(target),
+                               snep_type,
+                               arg_msg,
+                               net_nfc_client_gdbus_get_privilege(),
+                               &result,
+                               resp_type,
+                               &resp_msg,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG(" send client request (sync call) failed: %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
 
                return NET_NFC_IPC_FAIL;
@@ -341,8 +333,8 @@ net_nfc_error_e net_nfc_client_snep_send_client_request_sync(
                if (ndef_data.buffer != NULL && ndef_data.length > 0)
                {
                        result = net_nfc_create_ndef_message_from_rawdata(
-                               response,
-                               &ndef_data);
+                                       response,
+                                       &ndef_data);
 
                        net_nfc_util_free_data(&ndef_data);
                }
@@ -351,10 +343,9 @@ net_nfc_error_e net_nfc_client_snep_send_client_request_sync(
        return result;
 }
 #endif
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_snep_stop_service_sync(
-       net_nfc_target_handle_h target,
-       net_nfc_snep_handle_h service)
+API 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_error_e result = NET_NFC_OK;
        GError *error = NULL;
@@ -377,16 +368,16 @@ net_nfc_error_e net_nfc_client_snep_stop_service_sync(
        }
 
        if (net_nfc_gdbus_snep_call_stop_snep_sync(
-               snep_proxy,
-               GPOINTER_TO_UINT(target),
-               GPOINTER_TO_UINT(service),
-               net_nfc_client_gdbus_get_privilege(),
-               (gint *)&result,
-               NULL,
-               &error) == FALSE)
+                               snep_proxy,
+                               GPOINTER_TO_UINT(target),
+                               GPOINTER_TO_UINT(service),
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint *)&result,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("snep stop service(sync call) failed: %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
 
                return NET_NFC_IPC_FAIL;
@@ -396,21 +387,21 @@ net_nfc_error_e net_nfc_client_snep_stop_service_sync(
 }
 
 static void _snep_event_cb(NetNfcGDbusSnep *object,
-       guint arg_handle,
-       guint arg_event,
-       gint arg_result,
-       GVariant *arg_ndef_msg,
-       guint arg_user_data)
+               guint arg_handle,
+               guint arg_event,
+               gint arg_result,
+               GVariant *arg_ndef_msg,
+               guint arg_user_data)
 {
        GVariant *parameter = (GVariant *)GUINT_TO_POINTER(arg_user_data);
 
        INFO_MSG(">>> SIGNAL arrived");
 
        DEBUG_CLIENT_MSG("handle [%p], event [%d], result [%d], user_data [%p]",
-               GUINT_TO_POINTER(arg_handle),
-               arg_event,
-               arg_result,
-               parameter);
+                       GUINT_TO_POINTER(arg_handle),
+                       arg_event,
+                       arg_result,
+                       parameter);
 
        if (parameter != NULL)
        {
@@ -418,9 +409,9 @@ static void _snep_event_cb(NetNfcGDbusSnep *object,
                void *user_data;
 
                g_variant_get(parameter,
-                       "(uu)",
-                       &callback,
-                       &user_data);
+                               "(uu)",
+                               &callback,
+                               &user_data);
 
                if (callback != NULL)
                {
@@ -428,10 +419,10 @@ static void _snep_event_cb(NetNfcGDbusSnep *object,
                                snep_variant_to_message(arg_ndef_msg);
 
                        callback(GUINT_TO_POINTER(arg_handle),
-                               arg_event,
-                               arg_result,
-                               message,
-                               user_data);
+                                       arg_event,
+                                       arg_result,
+                                       message,
+                                       user_data);
                }
 
                if (arg_event == NET_NFC_LLCP_UNREGISTERED) {
@@ -440,11 +431,10 @@ static void _snep_event_cb(NetNfcGDbusSnep *object,
        }
 }
 
-NET_NFC_EXPORT_API
-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)
+API 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 result = NET_NFC_OK;
        GError *error = NULL;
@@ -463,20 +453,20 @@ net_nfc_error_e net_nfc_client_snep_register_server(const char *san,
        }
 
        parameter = g_variant_new("(uu)",
-               GPOINTER_TO_UINT(callback),
-               GPOINTER_TO_UINT(user_data));
+                       GPOINTER_TO_UINT(callback),
+                       GPOINTER_TO_UINT(user_data));
 
        if (net_nfc_gdbus_snep_call_server_register_sync(snep_proxy,
-               sap,
-               san,
-               GPOINTER_TO_UINT(parameter),
-               net_nfc_client_gdbus_get_privilege(),
-               (gint *)&result,
-               NULL,
-               &error) == FALSE)
+                               sap,
+                               san,
+                               GPOINTER_TO_UINT(parameter),
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint *)&result,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("snep register server(sync call) failed: %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
                g_variant_unref(parameter);
 
@@ -486,9 +476,8 @@ net_nfc_error_e net_nfc_client_snep_register_server(const char *san,
        return result;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_snep_unregister_server(const char *san,
-       sap_t sap)
+API net_nfc_error_e net_nfc_client_snep_unregister_server(const char *san,
+               sap_t sap)
 {
        net_nfc_error_e result = NET_NFC_OK;
        GError *error = NULL;
@@ -506,15 +495,15 @@ net_nfc_error_e net_nfc_client_snep_unregister_server(const char *san,
        }
 
        if (net_nfc_gdbus_snep_call_server_unregister_sync(snep_proxy,
-               sap,
-               san,
-               net_nfc_client_gdbus_get_privilege(),
-               (gint *)&result,
-               NULL,
-               &error) == FALSE)
+                               sap,
+                               san,
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint *)&result,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("snep unregister server(sync call) failed: %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
 
                result = NET_NFC_UNKNOWN_ERROR;
@@ -535,12 +524,12 @@ net_nfc_error_e net_nfc_client_snep_init(void)
        }
 
        snep_proxy = net_nfc_gdbus_snep_proxy_new_for_bus_sync(
-               G_BUS_TYPE_SYSTEM,
-               G_DBUS_PROXY_FLAGS_NONE,
-               "org.tizen.NetNfcService",
-               "/org/tizen/NetNfcService/Snep",
-               NULL,
-               &error);
+                       G_BUS_TYPE_SYSTEM,
+                       G_DBUS_PROXY_FLAGS_NONE,
+                       "org.tizen.NetNfcService",
+                       "/org/tizen/NetNfcService/Snep",
+                       NULL,
+                       &error);
        if (snep_proxy == NULL)
        {
                DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
similarity index 73%
rename from src/clientlib/net_nfc_client_system_handler.c
rename to client/net_nfc_client_system_handler.c
index 20181e9..4de1a65 100644 (file)
 #include "net_nfc_client_manager.h"
 #include "net_nfc_client_system_handler.h"
 
-
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
 typedef struct _PopupFuncData PopupFuncData;
 
 struct _PopupFuncData
@@ -41,12 +36,12 @@ static NetNfcGDbusPopup *popup_proxy = NULL;
 static int popup_state = 0;
 
 static void popup_set_active_callback(GObject *source_object,
-       GAsyncResult *res,
-       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void popup_set_active_callback(GObject *source_object,
-       GAsyncResult *res,
-       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        PopupFuncData *func_data;
 
@@ -57,15 +52,15 @@ static void popup_set_active_callback(GObject *source_object,
        gpointer data;
 
        if (net_nfc_gdbus_popup_call_set_finish(
-               NET_NFC_GDBUS_POPUP(source_object),
-               res,
-               &error) == FALSE)
+                               NET_NFC_GDBUS_POPUP(source_object),
+                               res,
+                               &error) == FALSE)
        {
 
                result = NET_NFC_UNKNOWN_ERROR;
 
                DEBUG_ERR_MSG("Can not finish popup_set_active: %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
        }
 
@@ -88,10 +83,9 @@ static void popup_set_active_callback(GObject *source_object,
        g_free(func_data);
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_sys_handler_set_state(int state,
-       net_nfc_client_popup_set_state_callback callback,
-       void *user_data)
+API net_nfc_error_e net_nfc_client_sys_handler_set_state(int state,
+               net_nfc_client_popup_set_state_callback callback,
+               void *user_data)
 {
        gboolean active = FALSE;
        PopupFuncData *func_data;
@@ -116,18 +110,17 @@ net_nfc_error_e net_nfc_client_sys_handler_set_state(int state,
                active = TRUE;
 
        net_nfc_gdbus_popup_call_set(popup_proxy,
-               active,
-               focus_state,
-               net_nfc_client_gdbus_get_privilege(),
-               NULL,
-               popup_set_active_callback,
-               func_data);
+                       active,
+                       focus_state,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       popup_set_active_callback,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_sys_handler_set_state_sync(int state)
+API net_nfc_error_e net_nfc_client_sys_handler_set_state_sync(int state)
 {
        GError *error = NULL;
        net_nfc_launch_popup_check_e focus_state = CHECK_FOREGROUND;
@@ -141,14 +134,14 @@ net_nfc_error_e net_nfc_client_sys_handler_set_state_sync(int state)
        }
 
        if (net_nfc_gdbus_popup_call_set_sync(popup_proxy,
-               (gboolean)state,
-               focus_state,
-               net_nfc_client_gdbus_get_privilege(),
-               NULL,
-               &error) == FALSE)
+                               (gboolean)state,
+                               focus_state,
+                               net_nfc_client_gdbus_get_privilege(),
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_CLIENT_MSG("can not call SetActive: %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
 
                return NET_NFC_IPC_FAIL;
@@ -157,10 +150,9 @@ net_nfc_error_e net_nfc_client_sys_handler_set_state_sync(int state)
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_sys_handler_set_state_force(int state,
-       net_nfc_client_popup_set_state_callback callback,
-       void *user_data)
+API net_nfc_error_e net_nfc_client_sys_handler_set_state_force(int state,
+               net_nfc_client_popup_set_state_callback callback,
+               void *user_data)
 {
        gboolean active = FALSE;
        PopupFuncData *func_data;
@@ -185,18 +177,17 @@ net_nfc_error_e net_nfc_client_sys_handler_set_state_force(int state,
                active = TRUE;
 
        net_nfc_gdbus_popup_call_set(popup_proxy,
-               active,
-               focus_state,
-               net_nfc_client_gdbus_get_privilege(),
-               NULL,
-               popup_set_active_callback,
-               func_data);
+                       active,
+                       focus_state,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       popup_set_active_callback,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_sys_handler_set_state_force_sync(int state)
+API net_nfc_error_e net_nfc_client_sys_handler_set_state_force_sync(int state)
 {
        GError *error = NULL;
        net_nfc_launch_popup_check_e focus_state = NO_CHECK_FOREGROUND;
@@ -210,14 +201,14 @@ net_nfc_error_e net_nfc_client_sys_handler_set_state_force_sync(int state)
        }
 
        if (net_nfc_gdbus_popup_call_set_sync(popup_proxy,
-               (gboolean)state,
-               focus_state,
-               net_nfc_client_gdbus_get_privilege(),
-               NULL,
-               &error) == FALSE)
+                               (gboolean)state,
+                               focus_state,
+                               net_nfc_client_gdbus_get_privilege(),
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_CLIENT_MSG("can not call SetActive: %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
 
                return NET_NFC_IPC_FAIL;
@@ -226,9 +217,8 @@ net_nfc_error_e net_nfc_client_sys_handler_set_state_force_sync(int state)
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_sys_handler_set_launch_popup_state(
-       int enable)
+API net_nfc_error_e net_nfc_client_sys_handler_set_launch_popup_state(
+               int enable)
 {
        net_nfc_error_e ret;
 
@@ -237,20 +227,19 @@ net_nfc_error_e net_nfc_client_sys_handler_set_launch_popup_state(
        if (enable)
        {
                ret = net_nfc_client_sys_handler_set_state_sync(
-                       NET_NFC_LAUNCH_APP_SELECT);
+                               NET_NFC_LAUNCH_APP_SELECT);
        }
        else
        {
                ret = net_nfc_client_sys_handler_set_state_sync(
-                       NET_NFC_NO_LAUNCH_APP_SELECT);
+                               NET_NFC_NO_LAUNCH_APP_SELECT);
        }
 
        return ret;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_sys_handler_set_launch_popup_state_force(
-       int enable)
+API net_nfc_error_e net_nfc_client_sys_handler_set_launch_popup_state_force(
+               int enable)
 {
        net_nfc_error_e ret;
 
@@ -259,20 +248,19 @@ net_nfc_error_e net_nfc_client_sys_handler_set_launch_popup_state_force(
        if (enable)
        {
                ret = net_nfc_client_sys_handler_set_state_force_sync(
-                       NET_NFC_LAUNCH_APP_SELECT);
+                               NET_NFC_LAUNCH_APP_SELECT);
        }
        else
        {
                ret = net_nfc_client_sys_handler_set_state_force_sync(
-                       NET_NFC_NO_LAUNCH_APP_SELECT);
+                               NET_NFC_NO_LAUNCH_APP_SELECT);
        }
 
        return ret;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_sys_handler_get_launch_popup_state(
-                       int *state)
+API net_nfc_error_e net_nfc_client_sys_handler_get_launch_popup_state(
+               int *state)
 {
        if (state == NULL)
                return NET_NFC_NULL_PARAMETER;
@@ -289,10 +277,10 @@ net_nfc_error_e net_nfc_client_sys_handler_get_launch_popup_state(
        }
 
        if (net_nfc_gdbus_popup_call_get_sync(popup_proxy,
-               net_nfc_client_gdbus_get_privilege(),
-               state,
-               NULL,
-               &error) == false) {
+                               net_nfc_client_gdbus_get_privilege(),
+                               state,
+                               NULL,
+                               &error) == false) {
                DEBUG_CLIENT_MSG("net_nfc_gdbus_popup_call_get_sync failed: %s",
                                error->message);
                g_error_free(error);
@@ -315,12 +303,12 @@ net_nfc_error_e net_nfc_client_sys_handler_init(void)
        }
 
        popup_proxy = net_nfc_gdbus_popup_proxy_new_for_bus_sync(
-                                       G_BUS_TYPE_SYSTEM,
-                                       G_DBUS_PROXY_FLAGS_NONE,
-                                       "org.tizen.NetNfcService",
-                                       "/org/tizen/NetNfcService/Popup",
-                                       NULL,
-                                       &error);
+                       G_BUS_TYPE_SYSTEM,
+                       G_DBUS_PROXY_FLAGS_NONE,
+                       "org.tizen.NetNfcService",
+                       "/org/tizen/NetNfcService/Popup",
+                       NULL,
+                       &error);
        if (popup_proxy == NULL)
        {
                DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
similarity index 76%
rename from src/clientlib/net_nfc_client_tag.c
rename to client/net_nfc_client_tag.c
index 0386018..c07e00d 100644 (file)
 #include "net_nfc_client_tag.h"
 #include "net_nfc_client_tag_internal.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
 typedef struct _TagFuncData TagFuncData;
 
 struct _TagFuncData
@@ -47,51 +43,51 @@ static net_nfc_event_filter_e client_filter = NET_NFC_ALL_ENABLE;
 static gboolean tag_check_filter(net_nfc_target_type_e type);
 
 static void tag_get_info_list(guint8 *buffer,
-                       gint number_of_keys,
-                       net_nfc_tag_info_s **list);
+               gint number_of_keys,
+               net_nfc_tag_info_s **list);
 
 static void tag_get_target_info(guint handle,
-                               guint dev_type,
-                               gboolean is_ndef_supported,
-                               guchar ndef_card_state,
-                               guint max_data_size,
-                               guint actual_data_size,
-                               guint number_of_keys,
-                               GVariant *target_info_values,
-                               GVariant *raw_data,
-                               net_nfc_target_info_s **info);
+               guint dev_type,
+               gboolean is_ndef_supported,
+               guchar ndef_card_state,
+               guint max_data_size,
+               guint actual_data_size,
+               guint number_of_keys,
+               GVariant *target_info_values,
+               GVariant *raw_data,
+               net_nfc_target_info_s **info);
 
 
 /* async callback */
 static void tag_is_tag_connected(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void tag_get_current_tag_info(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void tag_get_current_target_handle(GObject *source_object,
-                                       GAsyncResult *res,
-                                       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 /* signal callback */
 static void tag_tag_discovered(NetNfcGDbusTag *object,
-                       guint arg_handle,
-                       gint arg_dev_type,
-                       gboolean arg_is_ndef_supported,
-                       guchar arg_ndef_card_state,
-                       guint arg_max_data_size,
-                       guint arg_actual_data_size,
-                       guint arg_number_of_keys,
-                       GVariant *arg_target_info_values,
-                       GVariant *arg_raw_data,
-                       gpointer user_data);
+               guint arg_handle,
+               gint arg_dev_type,
+               gboolean arg_is_ndef_supported,
+               guchar arg_ndef_card_state,
+               guint arg_max_data_size,
+               guint arg_actual_data_size,
+               guint arg_number_of_keys,
+               GVariant *arg_target_info_values,
+               GVariant *arg_raw_data,
+               gpointer user_data);
 
 static void tag_tag_detached(NetNfcGDbusTag *object,
-                       guint arg_handle,
-                       gint arg_dev_type,
-                       gpointer user_data);
+               guint arg_handle,
+               gint arg_dev_type,
+               gpointer user_data);
 
 static gboolean tag_check_filter(net_nfc_target_type_e type)
 {
@@ -100,12 +96,12 @@ static gboolean tag_check_filter(net_nfc_target_type_e type)
        DEBUG_CLIENT_MSG("client filter =  %d", client_filter);
 
        if (type >= NET_NFC_ISO14443_A_PICC &&
-               type <= NET_NFC_MIFARE_DESFIRE_PICC)
+                       type <= NET_NFC_MIFARE_DESFIRE_PICC)
        {
                converted = NET_NFC_ISO14443A_ENABLE;
        }
        else if (type >= NET_NFC_ISO14443_B_PICC &&
-               type <= NET_NFC_ISO14443_BPRIME_PICC)
+                       type <= NET_NFC_ISO14443_BPRIME_PICC)
        {
                converted = NET_NFC_ISO14443B_ENABLE;
        }
@@ -129,8 +125,8 @@ static gboolean tag_check_filter(net_nfc_target_type_e type)
 }
 
 static void tag_get_info_list(guint8 *buffer,
-                       gint number_of_keys,
-                       net_nfc_tag_info_s **list)
+               gint number_of_keys,
+               net_nfc_tag_info_s **list)
 {
        net_nfc_tag_info_s *tmp_list = NULL;
        net_nfc_tag_info_s *current = NULL;
@@ -185,15 +181,15 @@ static void tag_get_info_list(guint8 *buffer,
 }
 
 static void tag_get_target_info(guint handle,
-                               guint dev_type,
-                               gboolean is_ndef_supported,
-                               guchar ndef_card_state,
-                               guint max_data_size,
-                               guint actual_data_size,
-                               guint number_of_keys,
-                               GVariant *target_info_values,
-                               GVariant *raw_data,
-                               net_nfc_target_info_s **info)
+               guint dev_type,
+               gboolean is_ndef_supported,
+               guchar ndef_card_state,
+               guint max_data_size,
+               guint actual_data_size,
+               guint number_of_keys,
+               GVariant *target_info_values,
+               GVariant *raw_data,
+               net_nfc_target_info_s **info)
 {
        guint8 *buffer = NULL;
        net_nfc_target_info_s *info_data = NULL;
@@ -225,8 +221,8 @@ static void tag_get_target_info(guint handle,
 }
 
 static void tag_is_tag_connected(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        TagFuncData *func_data;
 
@@ -267,15 +263,15 @@ static void tag_is_tag_connected(GObject *source_object,
                result = NET_NFC_NOT_CONNECTED;
 
        callback = (net_nfc_client_tag_is_tag_connected_completed)
-                       func_data->callback;
+               func_data->callback;
        callback(result, out_dev_type, func_data->user_data);
 
        g_free(func_data);
 }
 
 static void tag_get_current_tag_info(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        TagFuncData *func_data;
 
@@ -300,19 +296,19 @@ static void tag_get_current_tag_info(GObject *source_object,
        net_nfc_target_info_s *info_s = NULL;
 
        if (net_nfc_gdbus_tag_call_get_current_tag_info_finish (
-                                       NET_NFC_GDBUS_TAG(source_object),
-                                       &out_is_connected,
-                                       &out_handle,
-                                       (gint *)&out_dev_type,
-                                       &out_is_ndef_supported,
-                                       &out_ndef_card_state,
-                                       &out_max_data_size,
-                                       &out_actual_data_size,
-                                       &out_number_of_keys,
-                                       &out_target_info_values,
-                                       &out_raw_data,
-                                       res,
-                                       &error) == FALSE)
+                               NET_NFC_GDBUS_TAG(source_object),
+                               &out_is_connected,
+                               &out_handle,
+                               (gint *)&out_dev_type,
+                               &out_is_ndef_supported,
+                               &out_ndef_card_state,
+                               &out_max_data_size,
+                               &out_actual_data_size,
+                               &out_number_of_keys,
+                               &out_target_info_values,
+                               &out_raw_data,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_UNKNOWN_ERROR;
 
@@ -335,7 +331,7 @@ static void tag_get_current_tag_info(GObject *source_object,
                result = NET_NFC_NOT_CONNECTED;
 
        callback = (net_nfc_client_tag_get_current_tag_info_completed)
-                       func_data->callback;
+               func_data->callback;
 
        if (result != NET_NFC_OK)
        {
@@ -369,8 +365,8 @@ static void tag_get_current_tag_info(GObject *source_object,
 }
 
 static void tag_get_current_target_handle(GObject *source_object,
-                                       GAsyncResult *res,
-                                       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        TagFuncData *func_data;
 
@@ -386,12 +382,12 @@ static void tag_get_current_target_handle(GObject *source_object,
        net_nfc_client_tag_get_current_target_handle_completed callback;
 
        if (net_nfc_gdbus_tag_call_get_current_target_handle_finish(
-                                       NET_NFC_GDBUS_TAG(source_object),
-                                       &out_is_connected,
-                                       &out_handle,
-                                       (gint *)&out_dev_type,
-                                       res,
-                                       &error) == FALSE)
+                               NET_NFC_GDBUS_TAG(source_object),
+                               &out_is_connected,
+                               &out_handle,
+                               (gint *)&out_dev_type,
+                               res,
+                               &error) == FALSE)
        {
                result = NET_NFC_UNKNOWN_ERROR;
 
@@ -411,7 +407,7 @@ static void tag_get_current_target_handle(GObject *source_object,
        }
 
        callback = (net_nfc_client_tag_get_current_target_handle_completed)
-                       func_data->callback;
+               func_data->callback;
 
        if (out_is_connected == FALSE)
                result = NET_NFC_NOT_CONNECTED;
@@ -425,16 +421,16 @@ static void tag_get_current_target_handle(GObject *source_object,
 }
 
 static void tag_tag_discovered(NetNfcGDbusTag *object,
-                       guint arg_handle,
-                       gint arg_dev_type,
-                       gboolean arg_is_ndef_supported,
-                       guchar arg_ndef_card_state,
-                       guint arg_max_data_size,
-                       guint arg_actual_data_size,
-                       guint arg_number_of_keys,
-                       GVariant *arg_target_info_values,
-                       GVariant *arg_raw_data,
-                       gpointer user_data)
+               guint arg_handle,
+               gint arg_dev_type,
+               gboolean arg_is_ndef_supported,
+               guchar arg_ndef_card_state,
+               guint arg_max_data_size,
+               guint arg_actual_data_size,
+               guint arg_number_of_keys,
+               GVariant *arg_target_info_values,
+               GVariant *arg_raw_data,
+               gpointer user_data)
 {
        /*FIXME: currently SAVE_TARGET_INFO_IN_CC support only */
        net_nfc_target_info_s *info_s = NULL;
@@ -469,15 +465,15 @@ static void tag_tag_discovered(NetNfcGDbusTag *object,
        client_target_info = info_s;
 
        callback = (net_nfc_client_tag_tag_discovered)
-                       tag_discovered_func_data->callback;
+               tag_discovered_func_data->callback;
 
        callback(info_s, tag_discovered_func_data->user_data);
 }
 
 static void tag_tag_detached(NetNfcGDbusTag *object,
-                       guint arg_handle,
-                       gint arg_dev_type,
-                       gpointer user_data)
+               guint arg_handle,
+               gint arg_dev_type,
+               gpointer user_data)
 {
        net_nfc_client_tag_tag_detached callback;
 
@@ -497,7 +493,7 @@ static void tag_tag_detached(NetNfcGDbusTag *object,
        client_target_info = NULL;
 
        callback = (net_nfc_client_tag_tag_detached)
-                       tag_detached_func_data->callback;
+               tag_detached_func_data->callback;
 
        callback(tag_detached_func_data->user_data);
 }
@@ -519,11 +515,9 @@ net_nfc_target_info_s *net_nfc_client_tag_get_client_target_info(void)
        return client_target_info;
 }
 
-/* public APIs */
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_tag_is_tag_connected(
-                       net_nfc_client_tag_is_tag_connected_completed callback,
-                       void *user_data)
+API net_nfc_error_e net_nfc_client_tag_is_tag_connected(
+               net_nfc_client_tag_is_tag_connected_completed callback,
+               void *user_data)
 {
        TagFuncData *func_data;
 
@@ -543,17 +537,16 @@ net_nfc_error_e net_nfc_client_tag_is_tag_connected(
        func_data->user_data = user_data;
 
        net_nfc_gdbus_tag_call_is_tag_connected(tag_proxy,
-                                               net_nfc_client_gdbus_get_privilege(),
-                                               NULL,
-                                               tag_is_tag_connected,
-                                               func_data);
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       tag_is_tag_connected,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_tag_is_tag_connected_sync(
-                                       net_nfc_target_type_e *dev_type)
+API net_nfc_error_e net_nfc_client_tag_is_tag_connected_sync(
+               net_nfc_target_type_e *dev_type)
 {
        net_nfc_target_type_e out_dev_type;
 
@@ -567,11 +560,11 @@ net_nfc_error_e net_nfc_client_tag_is_tag_connected_sync(
        }
 
        if (net_nfc_gdbus_tag_call_is_tag_connected_sync(tag_proxy,
-                                               net_nfc_client_gdbus_get_privilege(),
-                                               &out_is_connected,
-                                               (gint *)&out_dev_type,
-                                               NULL,
-                                               &error) == FALSE)
+                               net_nfc_client_gdbus_get_privilege(),
+                               &out_is_connected,
+                               (gint *)&out_dev_type,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("Can not get is_tag_connected result: %s",
                                error->message);
@@ -588,8 +581,7 @@ net_nfc_error_e net_nfc_client_tag_is_tag_connected_sync(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_tag_get_current_tag_info(
+API 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)
 {
@@ -609,17 +601,16 @@ net_nfc_error_e net_nfc_client_tag_get_current_tag_info(
 
 
        net_nfc_gdbus_tag_call_get_current_tag_info(tag_proxy,
-                                               net_nfc_client_gdbus_get_privilege(),
-                                               NULL,
-                                               tag_get_current_tag_info,
-                                               func_data);
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       tag_get_current_tag_info,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_tag_get_current_tag_info_sync(
-                                               net_nfc_target_info_h *info)
+API net_nfc_error_e net_nfc_client_tag_get_current_tag_info_sync(
+               net_nfc_target_info_h *info)
 {
        net_nfc_target_type_e out_dev_type;
        gboolean out_is_connected = FALSE;
@@ -645,19 +636,19 @@ net_nfc_error_e net_nfc_client_tag_get_current_tag_info_sync(
        }
 
        if (net_nfc_gdbus_tag_call_get_current_tag_info_sync(tag_proxy,
-                                               net_nfc_client_gdbus_get_privilege(),
-                                               &out_is_connected,
-                                               &out_handle,
-                                               (gint *)&out_dev_type,
-                                               &out_is_ndef_supported,
-                                               &out_ndef_card_state,
-                                               &out_max_data_size,
-                                               &out_actual_data_size,
-                                               &out_number_of_keys,
-                                               &out_target_info_values,
-                                               &out_raw_data,
-                                               NULL,
-                                               &error) == FALSE)
+                               net_nfc_client_gdbus_get_privilege(),
+                               &out_is_connected,
+                               &out_handle,
+                               (gint *)&out_dev_type,
+                               &out_is_ndef_supported,
+                               &out_ndef_card_state,
+                               &out_max_data_size,
+                               &out_actual_data_size,
+                               &out_number_of_keys,
+                               &out_target_info_values,
+                               &out_raw_data,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("Can no get current_tag_info result: %s",
                                error->message);
@@ -692,10 +683,9 @@ net_nfc_error_e net_nfc_client_tag_get_current_tag_info_sync(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-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)
+API 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)
 {
        TagFuncData *func_data;
 
@@ -712,17 +702,16 @@ net_nfc_error_e net_nfc_client_tag_get_current_target_handle(
        func_data->user_data = user_data;
 
        net_nfc_gdbus_tag_call_get_current_target_handle(tag_proxy,
-                                               net_nfc_client_gdbus_get_privilege(),
-                                               NULL,
-                                               tag_get_current_target_handle,
-                                               func_data);
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       tag_get_current_target_handle,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_tag_get_current_target_handle_sync(
-                                       net_nfc_target_handle_h *handle)
+API net_nfc_error_e net_nfc_client_tag_get_current_target_handle_sync(
+               net_nfc_target_handle_h *handle)
 {
        net_nfc_target_type_e out_dev_type;
        gboolean out_is_connected = FALSE;
@@ -738,12 +727,12 @@ net_nfc_error_e net_nfc_client_tag_get_current_target_handle_sync(
        }
 
        if (net_nfc_gdbus_tag_call_get_current_target_handle_sync(tag_proxy,
-                                               net_nfc_client_gdbus_get_privilege(),
-                                               &out_is_connected,
-                                               &out_handle,
-                                               (gint *)&out_dev_type,
-                                               NULL,
-                                               &error) == FALSE)
+                               net_nfc_client_gdbus_get_privilege(),
+                               &out_is_connected,
+                               &out_handle,
+                               (gint *)&out_dev_type,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("Can no get current_target_handle result: %s",
                                error->message);
@@ -761,10 +750,9 @@ net_nfc_error_e net_nfc_client_tag_get_current_target_handle_sync(
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-void net_nfc_client_tag_set_tag_discovered(
-                       net_nfc_client_tag_tag_discovered callback,
-                       void *user_data)
+API void net_nfc_client_tag_set_tag_discovered(
+               net_nfc_client_tag_tag_discovered callback,
+               void *user_data)
 {
        if (tag_discovered_func_data == NULL)
                tag_discovered_func_data = g_new0(TagFuncData, 1);
@@ -773,8 +761,7 @@ void net_nfc_client_tag_set_tag_discovered(
        tag_discovered_func_data->user_data = user_data;
 }
 
-NET_NFC_EXPORT_API
-void net_nfc_client_tag_unset_tag_discovered(void)
+API void net_nfc_client_tag_unset_tag_discovered(void)
 {
        if (tag_discovered_func_data)
        {
@@ -784,10 +771,9 @@ void net_nfc_client_tag_unset_tag_discovered(void)
 
 }
 
-NET_NFC_EXPORT_API
-void net_nfc_client_tag_set_tag_detached(
-                       net_nfc_client_tag_tag_detached callback,
-                       void *user_data)
+API void net_nfc_client_tag_set_tag_detached(
+               net_nfc_client_tag_tag_detached callback,
+               void *user_data)
 {
        if (tag_detached_func_data == NULL)
                tag_detached_func_data = g_new0(TagFuncData, 1);
@@ -796,8 +782,7 @@ void net_nfc_client_tag_set_tag_detached(
        tag_detached_func_data->user_data = user_data;
 }
 
-NET_NFC_EXPORT_API
-void net_nfc_client_tag_unset_tag_detached(void)
+API void net_nfc_client_tag_unset_tag_detached(void)
 {
        if (tag_detached_func_data)
        {
@@ -806,14 +791,12 @@ void net_nfc_client_tag_unset_tag_detached(void)
        }
 }
 
-NET_NFC_EXPORT_API
-void net_nfc_client_tag_set_filter(net_nfc_event_filter_e filter)
+API void net_nfc_client_tag_set_filter(net_nfc_event_filter_e filter)
 {
        client_filter = filter;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_event_filter_e net_nfc_client_tag_get_filter(void)
+API net_nfc_event_filter_e net_nfc_client_tag_get_filter(void)
 {
        return client_filter;
 }
@@ -838,12 +821,12 @@ net_nfc_error_e net_nfc_client_tag_init(void)
        client_filter = NET_NFC_ALL_ENABLE;
 
        tag_proxy = net_nfc_gdbus_tag_proxy_new_for_bus_sync(
-                               G_BUS_TYPE_SYSTEM,
-                               G_DBUS_PROXY_FLAGS_NONE,
-                               "org.tizen.NetNfcService",
-                               "/org/tizen/NetNfcService/Tag",
-                               NULL,
-                               &error);
+                       G_BUS_TYPE_SYSTEM,
+                       G_DBUS_PROXY_FLAGS_NONE,
+                       "org.tizen.NetNfcService",
+                       "/org/tizen/NetNfcService/Tag",
+                       NULL,
+                       &error);
        if (tag_proxy == NULL)
        {
                DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
similarity index 82%
rename from src/clientlib/net_nfc_client_tag_felica.c
rename to client/net_nfc_client_tag_felica.c
index 38fc02d..9cb0780 100644 (file)
@@ -4,7 +4,7 @@
  * 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
 #include "net_nfc_util_internal.h"
 #include "net_nfc_target_info.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
 #define FELICA_CMD_POLL 0x00
 #define FELICA_CMD_REQ_SERVICE 0x02
 #define FELICA_CMD_REQ_RESPONSE 0x04
 #define FELICA_CMD_REQ_SYSTEM_CODE 0x0C
 #define FELICA_TAG_KEY "IDm"
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_felica_poll(net_nfc_target_handle_h handle,
-                               net_nfc_felica_poll_request_code_e req_code,
-                               uint8_t time_slote,
-                               nfc_transceive_data_callback callback,
-                               void *user_data)
+API net_nfc_error_e net_nfc_client_felica_poll(net_nfc_target_handle_h handle,
+               net_nfc_felica_poll_request_code_e req_code,
+               uint8_t time_slote,
+               nfc_transceive_data_callback callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -83,19 +78,18 @@ net_nfc_error_e net_nfc_client_felica_poll(net_nfc_target_handle_h handle,
        rawdata.length = 6;
 
        return net_nfc_client_transceive_data(handle,
-                                       (data_h)&rawdata,
-                                       callback,
-                                       user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_felica_request_service(
-                                       net_nfc_target_handle_h handle,
-                                       uint8_t number_of_area_service,
-                                       uint16_t area_service_list[],
-                                       uint8_t number_of_services,
-                                       nfc_transceive_data_callback callback,
-                                       void *user_data)
+API net_nfc_error_e net_nfc_client_felica_request_service(
+               net_nfc_target_handle_h handle,
+               uint8_t number_of_area_service,
+               uint16_t area_service_list[],
+               uint8_t number_of_services,
+               nfc_transceive_data_callback callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -176,9 +170,9 @@ net_nfc_error_e net_nfc_client_felica_request_service(
 
        net_nfc_error_e result = NET_NFC_OK;
        result = net_nfc_client_transceive_data(handle,
-                                       (data_h)&rawdata,
-                                       callback,
-                                       user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 
        if (temp != NULL)
                _net_nfc_util_free_mem(temp);
@@ -186,11 +180,10 @@ net_nfc_error_e net_nfc_client_felica_request_service(
        return result;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_felica_request_response(
-                                       net_nfc_target_handle_h handle,
-                                       nfc_transceive_data_callback callback,
-                                       void *user_data)
+API net_nfc_error_e net_nfc_client_felica_request_response(
+               net_nfc_target_handle_h handle,
+               nfc_transceive_data_callback callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -230,8 +223,8 @@ net_nfc_error_e net_nfc_client_felica_request_response(
        send_buffer[1] = FELICA_CMD_REQ_RESPONSE;
 
        memcpy(send_buffer + 2,
-               ((data_s*)IDm)->buffer,
-               ((data_s*)IDm)->length);
+                       ((data_s*)IDm)->buffer,
+                       ((data_s*)IDm)->length);
 
        DEBUG_MSG_PRINT_BUFFER(send_buffer, 10);
 
@@ -239,20 +232,19 @@ net_nfc_error_e net_nfc_client_felica_request_response(
        rawdata.length = 10;
 
        return net_nfc_client_transceive_data(handle,
-                                       (data_h)&rawdata,
-                                       callback,
-                                       user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_felica_read_without_encryption(
-                                       net_nfc_target_handle_h handle,
-                                       uint8_t number_of_services,
-                                       uint16_t service_list[],
-                                       uint8_t number_of_blocks,
-                                       uint8_t block_list[],
-                                       nfc_transceive_data_callback callback,
-                                       void *user_data)
+API net_nfc_error_e net_nfc_client_felica_read_without_encryption(
+               net_nfc_target_handle_h handle,
+               uint8_t number_of_services,
+               uint16_t service_list[],
+               uint8_t number_of_blocks,
+               uint8_t block_list[],
+               nfc_transceive_data_callback callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -296,7 +288,7 @@ net_nfc_error_e net_nfc_client_felica_read_without_encryption(
                return NET_NFC_OUT_OF_BOUND;
 
        send_buffer_length = 1 + 1 + 8 + 1 + (2 * number_of_services)
-                               + 1 + number_of_blocks;
+               + 1 + number_of_blocks;
 
        _net_nfc_util_alloc_mem(send_buffer,
                        send_buffer_length * sizeof(uint8_t));
@@ -339,9 +331,9 @@ net_nfc_error_e net_nfc_client_felica_read_without_encryption(
 
        net_nfc_error_e result = NET_NFC_OK;
        result = net_nfc_client_transceive_data(handle,
-                                               (data_h)&rawdata,
-                                               callback,
-                                               user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 
        if (temp != NULL)
                _net_nfc_util_free_mem(temp);
@@ -349,16 +341,15 @@ net_nfc_error_e net_nfc_client_felica_read_without_encryption(
        return result;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_felica_write_without_encryption(
-                                       net_nfc_target_handle_h handle,
-                                       uint8_t number_of_services,
-                                       uint16_t service_list[],
-                                       uint8_t number_of_blocks,
-                                       uint8_t block_list[],
-                                       data_h data,
-                                       nfc_transceive_data_callback callback,
-                                       void *user_data)
+API net_nfc_error_e net_nfc_client_felica_write_without_encryption(
+               net_nfc_target_handle_h handle,
+               uint8_t number_of_services,
+               uint16_t service_list[],
+               uint8_t number_of_blocks,
+               uint8_t block_list[],
+               data_h data,
+               nfc_transceive_data_callback callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -407,8 +398,8 @@ net_nfc_error_e net_nfc_client_felica_write_without_encryption(
                return NET_NFC_OUT_OF_BOUND;
 
        send_buffer_length = 1 + 1 + 8 + 1 + (2 * number_of_services)
-                               + 1 + number_of_blocks
-                               +((data_s*)data)->length;
+               + 1 + number_of_blocks
+               +((data_s*)data)->length;
 
        _net_nfc_util_alloc_mem(send_buffer,
                        send_buffer_length * sizeof(uint8_t));
@@ -454,9 +445,9 @@ net_nfc_error_e net_nfc_client_felica_write_without_encryption(
        net_nfc_error_e result = NET_NFC_OK;
 
        result = net_nfc_client_transceive_data(handle,
-                                               (data_h)&rawdata,
-                                               callback,
-                                               user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 
        if (temp != NULL)
                _net_nfc_util_free_mem(temp);
@@ -464,11 +455,10 @@ net_nfc_error_e net_nfc_client_felica_write_without_encryption(
        return result;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_felica_request_system_code(
-                                       net_nfc_target_handle_h handle,
-                                       nfc_transceive_data_callback callback,
-                                       void *user_data)
+API net_nfc_error_e net_nfc_client_felica_request_system_code(
+               net_nfc_target_handle_h handle,
+               nfc_transceive_data_callback callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -509,8 +499,8 @@ net_nfc_error_e net_nfc_client_felica_request_system_code(
        send_buffer[1] = FELICA_CMD_REQ_SYSTEM_CODE;
 
        memcpy(send_buffer + 2,
-               ((data_s *)IDm)->buffer,
-               ((data_s *)IDm)->length);
+                       ((data_s *)IDm)->buffer,
+                       ((data_s *)IDm)->length);
 
        DEBUG_MSG_PRINT_BUFFER(send_buffer, 10);
 
@@ -518,7 +508,7 @@ net_nfc_error_e net_nfc_client_felica_request_system_code(
        rawdata.length = 10;
 
        return net_nfc_client_transceive_data(handle,
-                                       (data_h)&rawdata,
-                                       callback,
-                                       user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 }
similarity index 80%
rename from src/clientlib/net_nfc_client_tag_jewel.c
rename to client/net_nfc_client_tag_jewel.c
index c044c5a..07220dc 100644 (file)
 #include "net_nfc_target_info.h"
 
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
-
 #define JEWEL_CMD_REQA 0x26
 #define JEWEL_CMD_WUPA 0x52
 #define JEWEL_CMD_RID 0x78
 #define JEWEL_CMD_WRITE_NE 0x1A
 #define JEWEL_TAG_KEY  "UID"
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_jewel_read_id(net_nfc_target_handle_h handle,
-                                       nfc_transceive_data_callback callback,
-                                       void *user_data)
+API net_nfc_error_e net_nfc_client_jewel_read_id(net_nfc_target_handle_h handle,
+               nfc_transceive_data_callback callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -77,17 +71,16 @@ net_nfc_error_e net_nfc_client_jewel_read_id(net_nfc_target_handle_h handle,
        rawdata.length = 9;
 
        return net_nfc_client_transceive_data(handle,
-                                       (data_h)&rawdata,
-                                       callback,
-                                       user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 }
 
-NET_NFC_EXPORT_API
-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)
+API 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)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -138,8 +131,8 @@ net_nfc_error_e net_nfc_client_jewel_read_byte(net_nfc_target_handle_h handle,
 
        /* UID0 ~ 3 */
        memcpy(&(send_buffer[3]),
-               ((data_s*)UID)->buffer,
-               ((data_s*)UID)->length);
+                       ((data_s*)UID)->buffer,
+                       ((data_s*)UID)->length);
 
        net_nfc_util_compute_CRC(CRC_B, send_buffer, 9);
 
@@ -149,15 +142,14 @@ net_nfc_error_e net_nfc_client_jewel_read_byte(net_nfc_target_handle_h handle,
        rawdata.length = 9;
 
        return net_nfc_client_transceive_data(handle,
-                                       (data_h)&rawdata,
-                                       callback,
-                                       user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_jewel_read_all(net_nfc_target_handle_h handle,
-                                       nfc_transceive_data_callback callback,
-                                       void *user_data)
+API net_nfc_error_e net_nfc_client_jewel_read_all(net_nfc_target_handle_h handle,
+               nfc_transceive_data_callback callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -204,8 +196,8 @@ net_nfc_error_e net_nfc_client_jewel_read_all(net_nfc_target_handle_h handle,
 
        /* UID0 ~ 3 */
        memcpy(&(send_buffer[3]),
-               ((data_s*)UID)->buffer,
-               ((data_s*)UID)->length);
+                       ((data_s*)UID)->buffer,
+                       ((data_s*)UID)->length);
 
        net_nfc_util_compute_CRC(CRC_B, send_buffer, 9);
 
@@ -215,19 +207,18 @@ net_nfc_error_e net_nfc_client_jewel_read_all(net_nfc_target_handle_h handle,
        rawdata.length = 9;
 
        return net_nfc_client_transceive_data(handle,
-                                       (data_h)&rawdata,
-                                       callback,
-                                       user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_jewel_write_with_erase(
-                                       net_nfc_target_handle_h handle,
-                                       uint8_t block,
-                                       uint8_t byte,
-                                       uint8_t data,
-                                       nfc_transceive_callback callback,
-                                       void *user_data)
+API net_nfc_error_e net_nfc_client_jewel_write_with_erase(
+               net_nfc_target_handle_h handle,
+               uint8_t block,
+               uint8_t byte,
+               uint8_t data,
+               nfc_transceive_callback callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -272,8 +263,8 @@ net_nfc_error_e net_nfc_client_jewel_write_with_erase(
 
        /* UID0 ~ 3 */
        memcpy(&(send_buffer[3]),
-               ((data_s*)UID)->buffer,
-               ((data_s*)UID)->length);
+                       ((data_s*)UID)->buffer,
+                       ((data_s*)UID)->length);
 
        net_nfc_util_compute_CRC(CRC_B, send_buffer, 9);
 
@@ -283,20 +274,19 @@ net_nfc_error_e net_nfc_client_jewel_write_with_erase(
        rawdata.length = 9;
 
        return net_nfc_client_transceive(handle,
-                                       (data_h)&rawdata,
-                                       callback,
-                                       user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_jewel_write_with_no_erase(
-                                       net_nfc_target_handle_h handle,
-                                       uint8_t block,
-                                       uint8_t byte,
-                                       uint8_t data,
-                                       nfc_transceive_callback callback,
-                                       void *user_data)
+API net_nfc_error_e net_nfc_client_jewel_write_with_no_erase(
+               net_nfc_target_handle_h handle,
+               uint8_t block,
+               uint8_t byte,
+               uint8_t data,
+               nfc_transceive_callback callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -346,8 +336,8 @@ net_nfc_error_e net_nfc_client_jewel_write_with_no_erase(
 
        /* UID0 ~ 3 */
        memcpy(&(send_buffer[3]),
-               ((data_s*)UID)->buffer,
-               ((data_s*)UID)->length);
+                       ((data_s*)UID)->buffer,
+                       ((data_s*)UID)->length);
 
        net_nfc_util_compute_CRC(CRC_B, send_buffer, 9);
 
@@ -357,7 +347,7 @@ net_nfc_error_e net_nfc_client_jewel_write_with_no_erase(
        rawdata.length = 9;
 
        return net_nfc_client_transceive(handle,
-                                       (data_h)&rawdata,
-                                       callback,
-                                       user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 }
similarity index 77%
rename from src/clientlib/net_nfc_client_tag_mifare.c
rename to client/net_nfc_client_tag_mifare.c
index b52ce92..c81ed94 100644 (file)
@@ -4,7 +4,7 @@
  * 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
 
 #include "net_nfc_client_transceive.h"
 #include "net_nfc_client_tag_internal.h"
-
-#include "net_nfc_tag_mifare.h"
-
+#include "net_nfc_client_tag_mifare.h"
 #include "net_nfc_data.h"
 #include "net_nfc_typedef_internal.h"
 #include "net_nfc_debug_internal.h"
 #include "net_nfc_target_info.h"
 #include "net_nfc_util_internal.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
 #define MIFARE_CMD_RAW                 0x00U
 #define MIFARE_CMD_AUTH_A              0x60U /**< authenticate with key A */
 #define MIFARE_CMD_AUTH_B              0x61U /**< authenticate with key B */
@@ -61,13 +55,12 @@ static uint8_t net_nfc_forum_key[6] = { 0xD3, 0xF7, 0xD3, 0xF7, 0xD3, 0xF7 };
 #define MIFARE_PAGE_SIZE 4     /* 1 page is 4 byte */
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyA(
-                                               net_nfc_target_handle_h handle,
-                                               uint8_t sector,
-                                               data_h auth_key,
-                                               void *callback,
-                                               void *user_data)
+API net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyA(
+               net_nfc_target_handle_h handle,
+               uint8_t sector,
+               data_h auth_key,
+               void *callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -108,8 +101,8 @@ net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyA(
        }
 
        if (net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
-                                       MIFARE_TAG_KEY,
-                                       &UID) != NET_NFC_OK)
+                               MIFARE_TAG_KEY,
+                               &UID) != NET_NFC_OK)
        {
                return NET_NFC_NO_DATA_FOUND;
        }
@@ -117,39 +110,33 @@ net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyA(
        switch (target_info->devType)
        {
        case NET_NFC_MIFARE_MINI_PICC :
-               {
-                       /* 0 ~ 4 : 5 sector and 4 block with 16 bytes */
-                       if (sector > MIFARE_MINI_SECTORS - 1)
-                               return NET_NFC_OUT_OF_BOUND;
+               /* 0 ~ 4 : 5 sector and 4 block with 16 bytes */
+               if (sector > MIFARE_MINI_SECTORS - 1)
+                       return NET_NFC_OUT_OF_BOUND;
 
-                       sector_to_block = sector * MIFARE_BLOCK_4 + 3;
-               }
+               sector_to_block = sector * MIFARE_BLOCK_4 + 3;
                break;
        case NET_NFC_MIFARE_1K_PICC :
-               {
-                       /* 0 ~ 15 : 16 sector and 4 block with 16 bytes */
-                       if (sector > MIFARE_1K_SECTORS)
-                               return NET_NFC_OUT_OF_BOUND;
+               /* 0 ~ 15 : 16 sector and 4 block with 16 bytes */
+               if (sector > MIFARE_1K_SECTORS)
+                       return NET_NFC_OUT_OF_BOUND;
 
-                       sector_to_block = sector * MIFARE_BLOCK_4 + 3;
-               }
+               sector_to_block = sector * MIFARE_BLOCK_4 + 3;
                break;
        case NET_NFC_MIFARE_4K_PICC :
-               {
-                       /* 0 ~ 31 : 32 sector and 4 block with 16 bytes
-                        * 32 ~ 39 : 8 sector and 16 block with 16 bytes
-                        */
-                       if (sector > MIFARE_4K_SECTORS)
-                               return NET_NFC_OUT_OF_BOUND;
+               /* 0 ~ 31 : 32 sector and 4 block with 16 bytes
+                * 32 ~ 39 : 8 sector and 16 block with 16 bytes
+                */
+               if (sector > MIFARE_4K_SECTORS)
+                       return NET_NFC_OUT_OF_BOUND;
 
-                       if (sector < 32)
-                               sector_to_block = sector * MIFARE_BLOCK_4 + 3;
-                       else
-                       {
-                               sector_to_block = (31 * MIFARE_BLOCK_4 + 3)
-                                               + (sector - 32)
-                                               * MIFARE_BLOCK_16 + 15;
-                       }
+               if (sector < 32)
+                       sector_to_block = sector * MIFARE_BLOCK_4 + 3;
+               else
+               {
+                       sector_to_block = (31 * MIFARE_BLOCK_4 + 3)
+                               + (sector - 32)
+                               * MIFARE_BLOCK_16 + 15;
                }
                break;
        default :
@@ -159,7 +146,7 @@ net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyA(
 
        /* cmd + addr + UID + AUTH_KEY + CRC_A */
        send_buffer_length = 1 + 1 + ((data_s*)UID)->length
-                       + key->length + 2;
+               + key->length + 2;
 
        _net_nfc_util_alloc_mem(send_buffer,
                        send_buffer_length * sizeof(uint8_t));
@@ -189,9 +176,9 @@ net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyA(
        rawdata.length = send_buffer_length;
 
        net_nfc_error_e result = net_nfc_client_transceive(handle,
-                                                       (data_h)&rawdata,
-                                                       callback,
-                                                       user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 
        if (send_buffer != NULL)
                _net_nfc_util_free_mem(send_buffer);
@@ -199,13 +186,12 @@ net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyA(
        return result;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyB(
-                                               net_nfc_target_handle_h handle,
-                                               uint8_t sector,
-                                               data_h auth_key,
-                                               void *callback,
-                                               void *user_data)
+API net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyB(
+               net_nfc_target_handle_h handle,
+               uint8_t sector,
+               data_h auth_key,
+               void *callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -246,8 +232,8 @@ net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyB(
        }
 
        if (net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
-                                       MIFARE_TAG_KEY,
-                                       &UID) != NET_NFC_OK)
+                               MIFARE_TAG_KEY,
+                               &UID) != NET_NFC_OK)
        {
                return NET_NFC_NO_DATA_FOUND;
        }
@@ -255,39 +241,33 @@ net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyB(
        switch (target_info->devType)
        {
        case NET_NFC_MIFARE_MINI_PICC :
-               {
-                       /* 0 ~ 4 : 5 sector and 4 block with 16 bytes */
-                       if (sector > MIFARE_MINI_SECTORS)
-                               return NET_NFC_OUT_OF_BOUND;
+               /* 0 ~ 4 : 5 sector and 4 block with 16 bytes */
+               if (sector > MIFARE_MINI_SECTORS)
+                       return NET_NFC_OUT_OF_BOUND;
 
-                       sector_to_block = sector * MIFARE_BLOCK_4 + 3;
-               }
+               sector_to_block = sector * MIFARE_BLOCK_4 + 3;
                break;
        case NET_NFC_MIFARE_1K_PICC :
-               {
-                       /* 0 ~ 15 : 16 sector and 4 block with 16 bytes */
-                       if (sector > MIFARE_1K_SECTORS)
-                               return NET_NFC_OUT_OF_BOUND;
+               /* 0 ~ 15 : 16 sector and 4 block with 16 bytes */
+               if (sector > MIFARE_1K_SECTORS)
+                       return NET_NFC_OUT_OF_BOUND;
 
-                       sector_to_block = sector * MIFARE_BLOCK_4 + 3;
-               }
+               sector_to_block = sector * MIFARE_BLOCK_4 + 3;
                break;
        case NET_NFC_MIFARE_4K_PICC :
-               {
-                       /* 0 ~ 31 : 32 sector and 4 block with 16 bytes
-                        * 32 ~ 39 : 8 sector and 16 block with 16 bytes
-                        */
-                       if (sector > MIFARE_4K_SECTORS)
-                               return NET_NFC_OUT_OF_BOUND;
+               /* 0 ~ 31 : 32 sector and 4 block with 16 bytes
+                * 32 ~ 39 : 8 sector and 16 block with 16 bytes
+                */
+               if (sector > MIFARE_4K_SECTORS)
+                       return NET_NFC_OUT_OF_BOUND;
 
-                       if (sector < 32)
-                               sector_to_block = sector * MIFARE_BLOCK_4 + 3;
-                       else
-                       {
-                               sector_to_block = (31 * MIFARE_BLOCK_4 + 3)
-                                               + (sector - 32)
-                                               * MIFARE_BLOCK_16 + 15;
-                       }
+               if (sector < 32)
+                       sector_to_block = sector * MIFARE_BLOCK_4 + 3;
+               else
+               {
+                       sector_to_block = (31 * MIFARE_BLOCK_4 + 3)
+                               + (sector - 32)
+                               * MIFARE_BLOCK_16 + 15;
                }
                break;
        default :
@@ -298,7 +278,7 @@ net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyB(
                + key->length + 2; /* cmd + addr + UID + AUTH_KEY + CRC_A */
 
        _net_nfc_util_alloc_mem(send_buffer, send_buffer_length
-                               * sizeof(uint8_t));
+                       * sizeof(uint8_t));
        if (send_buffer == NULL)
        {
                net_nfc_free_data(UID);
@@ -324,9 +304,9 @@ net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyB(
        rawdata.length = send_buffer_length;
 
        net_nfc_error_e result = net_nfc_client_transceive(handle,
-                                                       (data_h)&rawdata,
-                                                       callback,
-                                                       user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 
        if (send_buffer != NULL)
                _net_nfc_util_free_mem(send_buffer);
@@ -334,11 +314,10 @@ net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyB(
        return result;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_mifare_read(net_nfc_target_handle_h handle,
-                                       uint8_t addr,
-                                       void *callback,
-                                       void *user_data)
+API net_nfc_error_e net_nfc_client_mifare_read(net_nfc_target_handle_h handle,
+               uint8_t addr,
+               void *callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -358,10 +337,10 @@ net_nfc_error_e net_nfc_client_mifare_read(net_nfc_target_handle_h handle,
        if (target_info != NULL)
        {
                if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
-                       target_info->devType > NET_NFC_MIFARE_ULTRA_PICC)
+                               target_info->devType > NET_NFC_MIFARE_ULTRA_PICC)
                {
                        DEBUG_CLIENT_MSG("not a MIFARE TAG = [%d]",
-                                               target_info->devType);
+                                       target_info->devType);
                        return NET_NFC_NOT_SUPPORTED;
                }
 
@@ -382,18 +361,17 @@ net_nfc_error_e net_nfc_client_mifare_read(net_nfc_target_handle_h handle,
        rawdata.length = 4;
 
        return net_nfc_client_transceive_data(handle,
-                                       (data_h)&rawdata,
-                                       callback,
-                                       user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_mifare_write_block(
-                                               net_nfc_target_handle_h handle,
-                                               uint8_t addr,
-                                               data_h data,
-                                               void *callback,
-                                               void *user_data)
+API net_nfc_error_e net_nfc_client_mifare_write_block(
+               net_nfc_target_handle_h handle,
+               uint8_t addr,
+               data_h data,
+               void *callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -420,7 +398,7 @@ net_nfc_error_e net_nfc_client_mifare_write_block(
                        target_info->devType > NET_NFC_MIFARE_ULTRA_PICC)
        {
                DEBUG_CLIENT_MSG("not a MIFARE TAG = [%d] \n",
-                                       target_info->devType);
+                               target_info->devType);
                return NET_NFC_NOT_SUPPORTED;
        }
 
@@ -453,8 +431,8 @@ net_nfc_error_e net_nfc_client_mifare_write_block(
                        temp++;
 
                        memcpy(temp,
-                               ((data_s*)data)->buffer,
-                               MIFARE_PAGE_SIZE);
+                                       ((data_s*)data)->buffer,
+                                       MIFARE_PAGE_SIZE);
 
                }
                else
@@ -463,7 +441,7 @@ net_nfc_error_e net_nfc_client_mifare_write_block(
 
                        /* cmd + addr + page + CRC */
                        send_buffer_length = 1 + 1 +
-                                       ((data_s*)data)->length + 2;
+                               ((data_s*)data)->length + 2;
 
                        _net_nfc_util_alloc_mem(send_buffer,
                                        send_buffer_length * sizeof(uint8_t));
@@ -479,8 +457,8 @@ net_nfc_error_e net_nfc_client_mifare_write_block(
                        temp++;
 
                        memcpy(temp,
-                               ((data_s*)data)->buffer,
-                               ((data_s*)data)->length);
+                                       ((data_s*)data)->buffer,
+                                       ((data_s*)data)->length);
                }
 
        }
@@ -508,8 +486,8 @@ net_nfc_error_e net_nfc_client_mifare_write_block(
                        temp++;
 
                        memcpy(temp,
-                               ((data_s*)data)->buffer,
-                               MIFARE_BLOCK_SIZE);
+                                       ((data_s*)data)->buffer,
+                                       MIFARE_BLOCK_SIZE);
                }
                else
                {
@@ -517,7 +495,7 @@ net_nfc_error_e net_nfc_client_mifare_write_block(
 
                        /* cmd + addr + page + CRC */
                        send_buffer_length = 1 + 1 + ((data_s*)data)->length
-                                               + 2;
+                               + 2;
 
                        _net_nfc_util_alloc_mem(send_buffer,
                                        send_buffer_length * sizeof(uint8_t));
@@ -533,8 +511,8 @@ net_nfc_error_e net_nfc_client_mifare_write_block(
                        temp++;
 
                        memcpy(temp,
-                               ((data_s*)data)->buffer,
-                               ((data_s*)data)->length);
+                                       ((data_s*)data)->buffer,
+                                       ((data_s*)data)->length);
                }
        }
 
@@ -544,9 +522,9 @@ net_nfc_error_e net_nfc_client_mifare_write_block(
        rawdata.length = send_buffer_length;
 
        net_nfc_error_e result = net_nfc_client_transceive(handle,
-                                                       (data_h)&rawdata,
-                                                       callback,
-                                                       user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 
        if (send_buffer != NULL)
                _net_nfc_util_free_mem(send_buffer);
@@ -554,13 +532,12 @@ net_nfc_error_e net_nfc_client_mifare_write_block(
        return result;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_mifare_write_page(
-                                               net_nfc_target_handle_h handle,
-                                               uint8_t addr,
-                                               data_h data,
-                                               void *callback,
-                                               void *user_data)
+API net_nfc_error_e net_nfc_client_mifare_write_page(
+               net_nfc_target_handle_h handle,
+               uint8_t addr,
+               data_h data,
+               void *callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -616,8 +593,8 @@ net_nfc_error_e net_nfc_client_mifare_write_page(
                        temp++;
 
                        memcpy(temp,
-                               ((data_s*)data)->buffer,
-                               MIFARE_PAGE_SIZE);
+                                       ((data_s*)data)->buffer,
+                                       MIFARE_PAGE_SIZE);
                }
                else
                {
@@ -625,7 +602,7 @@ net_nfc_error_e net_nfc_client_mifare_write_page(
 
                        /* cmd + addr + page + CRC */
                        send_buffer_length = 1 + 1 + ((data_s*)data)->length
-                                               + 2;
+                               + 2;
 
                        _net_nfc_util_alloc_mem(send_buffer,
                                        send_buffer_length * sizeof(uint8_t));
@@ -641,8 +618,8 @@ net_nfc_error_e net_nfc_client_mifare_write_page(
                        temp++;
 
                        memcpy(temp,
-                               ((data_s*)data)->buffer,
-                               ((data_s*)data)->length);
+                                       ((data_s*)data)->buffer,
+                                       ((data_s*)data)->length);
                }
 
        }
@@ -669,8 +646,8 @@ net_nfc_error_e net_nfc_client_mifare_write_page(
                        temp++;
 
                        memcpy(temp,
-                               ((data_s*)data)->buffer,
-                               MIFARE_PAGE_SIZE);
+                                       ((data_s*)data)->buffer,
+                                       MIFARE_PAGE_SIZE);
 
                }
                else
@@ -679,7 +656,7 @@ net_nfc_error_e net_nfc_client_mifare_write_page(
 
                        /* cmd + addr + page + CRC */
                        send_buffer_length = 1 + 1 + ((data_s*)data)->length
-                                               + 2;
+                               + 2;
 
                        _net_nfc_util_alloc_mem(send_buffer,
                                        send_buffer_length * sizeof(uint8_t));
@@ -695,8 +672,8 @@ net_nfc_error_e net_nfc_client_mifare_write_page(
                        temp++;
 
                        memcpy(temp,
-                               ((data_s*)data)->buffer,
-                               ((data_s*)data)->length);
+                                       ((data_s*)data)->buffer,
+                                       ((data_s*)data)->length);
                }
 
        }
@@ -709,9 +686,9 @@ net_nfc_error_e net_nfc_client_mifare_write_page(
        rawdata.length = send_buffer_length;
 
        net_nfc_error_e result = net_nfc_client_transceive(handle,
-                                                       (data_h)&rawdata,
-                                                       callback,
-                                                       user_data);
+                       (data_h)&rawdata,
+                       callback,
+                       user_data);
 
        if (send_buffer != NULL)
                _net_nfc_util_free_mem(send_buffer);
@@ -719,12 +696,11 @@ net_nfc_error_e net_nfc_client_mifare_write_page(
        return result;
 }
 
-NET_NFC_EXPORT_API
-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)
+API 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)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -758,7 +734,7 @@ net_nfc_error_e net_nfc_client_mifare_increment(net_nfc_target_handle_h handle,
        send_buffer[1] = addr;
 
        /* little endian.
-          little value of byte array will be saved first in memory */
+               little value of byte array will be saved first in memory */
        send_buffer[5] = (value & 0xFF000000) >> 24;
        send_buffer[4] = (value & 0x00FF0000) >> 16;
        send_buffer[3] = (value & 0x0000FF00) >> 8;
@@ -770,15 +746,14 @@ net_nfc_error_e net_nfc_client_mifare_increment(net_nfc_target_handle_h handle,
        rawdata.length = 8;
 
        return net_nfc_client_transceive(handle, (data_h)&rawdata, callback,
-                                       user_data);
+                       user_data);
 }
 
-NET_NFC_EXPORT_API
-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)
+API 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)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -810,7 +785,7 @@ net_nfc_error_e net_nfc_client_mifare_decrement(net_nfc_target_handle_h handle,
        send_buffer[1] = addr;
 
        /* little endian.
-          little value of byte array will be saved first in memory */
+               little value of byte array will be saved first in memory */
        send_buffer[5] = (value & 0xFF000000) >> 24;
        send_buffer[4] = (value & 0x00FF0000) >> 16;
        send_buffer[3] = (value & 0x0000FF00) >> 8;
@@ -824,14 +799,13 @@ net_nfc_error_e net_nfc_client_mifare_decrement(net_nfc_target_handle_h handle,
        rawdata.length = 8;
 
        return net_nfc_client_transceive(handle, (data_h)&rawdata, callback,
-                                       user_data);
+                       user_data);
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_mifare_transfer(net_nfc_target_handle_h handle,
-                                       uint8_t addr,
-                                       void *callback,
-                                       void *user_data)
+API net_nfc_error_e net_nfc_client_mifare_transfer(net_nfc_target_handle_h handle,
+               uint8_t addr,
+               void *callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -867,14 +841,13 @@ net_nfc_error_e net_nfc_client_mifare_transfer(net_nfc_target_handle_h handle,
        rawdata.length = 4;
 
        return net_nfc_client_transceive(handle, (data_h)&rawdata, callback,
-                                       user_data);
+                       user_data);
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_mifare_restore(net_nfc_target_handle_h handle,
-                                       uint8_t addr,
-                                       void *callback,
-                                       void *user_data)
+API net_nfc_error_e net_nfc_client_mifare_restore(net_nfc_target_handle_h handle,
+               uint8_t addr,
+               void *callback,
+               void *user_data)
 {
        net_nfc_target_info_s* target_info = NULL;
 
@@ -910,11 +883,10 @@ net_nfc_error_e net_nfc_client_mifare_restore(net_nfc_target_handle_h handle,
        rawdata.length = 4;
 
        return net_nfc_client_transceive(handle, (data_h)&rawdata, callback,
-                                       user_data);
+                       user_data);
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_mifare_create_default_key(data_h* key)
+API net_nfc_error_e net_nfc_client_mifare_create_default_key(data_h* key)
 {
        if (key == NULL)
                return NET_NFC_NULL_PARAMETER;
@@ -922,9 +894,8 @@ net_nfc_error_e net_nfc_client_mifare_create_default_key(data_h* key)
        return net_nfc_create_data(key, default_key, 6);
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_mifare_create_application_directory_key(
-                                                               data_h* key)
+API net_nfc_error_e net_nfc_client_mifare_create_application_directory_key(
+               data_h* key)
 {
        if (key == NULL)
                return NET_NFC_NULL_PARAMETER;
@@ -932,8 +903,7 @@ net_nfc_error_e net_nfc_client_mifare_create_application_directory_key(
        return net_nfc_create_data(key, mad_key, 6);
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_mifare_create_net_nfc_forum_key(data_h* key)
+API net_nfc_error_e net_nfc_client_mifare_create_net_nfc_forum_key(data_h* key)
 {
        if (key == NULL)
                return NET_NFC_NULL_PARAMETER;
similarity index 83%
rename from src/clientlib/net_nfc_client_target_info.c
rename to client/net_nfc_client_target_info.c
index d1f5064..1884af2 100644 (file)
 #include "net_nfc_target_info.h"
 #include "net_nfc_util_internal.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_tag_type(net_nfc_target_info_h target_info, net_nfc_target_type_e * type)
+API net_nfc_error_e net_nfc_get_tag_type(net_nfc_target_info_h target_info, net_nfc_target_type_e * type)
 {
        if (target_info == NULL || type == NULL)
        {
@@ -38,7 +34,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_tag_type(net_nfc_target_info_h ta
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_tag_handle(net_nfc_target_info_h target_info, net_nfc_target_handle_h * handle)
+API net_nfc_error_e net_nfc_get_tag_handle(net_nfc_target_info_h target_info, net_nfc_target_handle_h * handle)
 {
        if (target_info == NULL || handle == NULL)
        {
@@ -50,7 +46,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_tag_handle(net_nfc_target_info_h
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_tag_ndef_support(net_nfc_target_info_h target_info, bool * is_support)
+API net_nfc_error_e net_nfc_get_tag_ndef_support(net_nfc_target_info_h target_info, bool * is_support)
 {
        if (target_info == NULL || is_support == NULL)
        {
@@ -62,7 +58,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_tag_ndef_support(net_nfc_target_i
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_tag_max_data_size(net_nfc_target_info_h target_info, uint32_t * max_size)
+API net_nfc_error_e net_nfc_get_tag_max_data_size(net_nfc_target_info_h target_info, uint32_t * max_size)
 {
        if (target_info == NULL || max_size == NULL)
        {
@@ -74,7 +70,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_tag_max_data_size(net_nfc_target_
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_tag_actual_data_size(net_nfc_target_info_h target_info, uint32_t * actual_data)
+API net_nfc_error_e net_nfc_get_tag_actual_data_size(net_nfc_target_info_h target_info, uint32_t * actual_data)
 {
        if (target_info == NULL || actual_data == NULL)
        {
@@ -86,7 +82,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_tag_actual_data_size(net_nfc_targ
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_tag_info_keys(net_nfc_target_info_h target_info, char ***keys, int* number_of_keys)
+API net_nfc_error_e net_nfc_get_tag_info_keys(net_nfc_target_info_h target_info, char ***keys, int* number_of_keys)
 {
        if (keys == NULL || number_of_keys == NULL || target_info == NULL)
        {
@@ -133,7 +129,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_tag_info_keys(net_nfc_target_info
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_tag_info_value(net_nfc_target_info_h target_info, const char* key, data_h* value)
+API net_nfc_error_e net_nfc_get_tag_info_value(net_nfc_target_info_h target_info, const char* key, data_h* value)
 {
        if (target_info == NULL || key == NULL || value == NULL)
        {
@@ -173,7 +169,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_tag_info_value(net_nfc_target_inf
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_duplicate_target_info(net_nfc_target_info_h origin, net_nfc_target_info_h *result)
+API net_nfc_error_e net_nfc_duplicate_target_info(net_nfc_target_info_h origin, net_nfc_target_info_h *result)
 {
        net_nfc_target_info_s *handle = (net_nfc_target_info_s *)origin;
        net_nfc_target_info_s *temp = NULL;
@@ -267,7 +263,7 @@ static net_nfc_error_e net_nfc_util_release_tag_info(net_nfc_target_info_s *info
        return result;
 }
 
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_release_tag_info(net_nfc_target_info_h target_info)
+API net_nfc_error_e net_nfc_release_tag_info(net_nfc_target_info_h target_info)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_target_info_s *info = (net_nfc_target_info_s *)target_info;
similarity index 76%
rename from src/clientlib/net_nfc_client_test.c
rename to client/net_nfc_client_test.c
index 2cd9377..d4eb0f4 100644 (file)
 #include "net_nfc_client_manager.h"
 #include "net_nfc_client_test.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
 typedef struct _TestFuncData TestFuncData;
 
 struct _TestFuncData
@@ -34,27 +30,27 @@ struct _TestFuncData
 };
 
 static void test_call_sim_test_callback(GObject *source_object,
-                                       GAsyncResult *res,
-                                       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void test_call_prbs_test_callback(GObject *source_object,
-                                       GAsyncResult *res,
-                                       gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void test_call_get_firmware_version_callback(GObject *source_object,
-                                               GAsyncResult *res,
-                                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void test_call_set_ee_data_callback(GObject *source_object,
-                                       GAsyncResult *res,
-                                       gpointer user_data);
+               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)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        TestFuncData *func_data;
 
@@ -74,7 +70,7 @@ static void test_call_sim_test_callback(GObject *source_object,
                out_result = NET_NFC_UNKNOWN_ERROR;
 
                DEBUG_ERR_MSG("Can not finish sim_test: %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
        }
 
@@ -97,8 +93,8 @@ static void test_call_sim_test_callback(GObject *source_object,
 }
 
 static void test_call_prbs_test_callback(GObject *source_object,
-                                       GAsyncResult *res,
-                                       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        TestFuncData *func_data;
 
@@ -118,7 +114,7 @@ static void test_call_prbs_test_callback(GObject *source_object,
                out_result = NET_NFC_UNKNOWN_ERROR;
 
                DEBUG_ERR_MSG("Can not finish prbs test: %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
        }
 
@@ -133,7 +129,7 @@ static void test_call_prbs_test_callback(GObject *source_object,
        }
 
        callback = (net_nfc_client_test_prbs_test_completed)
-                       func_data->callback;
+               func_data->callback;
        data = func_data->user_data;
 
        callback(out_result, data);
@@ -142,8 +138,8 @@ static void test_call_prbs_test_callback(GObject *source_object,
 }
 
 static void test_call_get_firmware_version_callback(GObject *source_object,
-                                               GAsyncResult *res,
-                                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        TestFuncData *func_data;
 
@@ -165,7 +161,7 @@ static void test_call_get_firmware_version_callback(GObject *source_object,
                out_result = NET_NFC_UNKNOWN_ERROR;
 
                DEBUG_ERR_MSG("Can not finish get_firmware_version: %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
        }
 
@@ -181,7 +177,7 @@ static void test_call_get_firmware_version_callback(GObject *source_object,
        }
 
        callback = (net_nfc_client_test_get_firmware_version_completed)
-                       func_data->callback;
+               func_data->callback;
        data = func_data->user_data;
 
        callback(out_result, out_version, data);
@@ -191,8 +187,8 @@ static void test_call_get_firmware_version_callback(GObject *source_object,
 }
 
 static void test_call_set_ee_data_callback(GObject *source_object,
-                                       GAsyncResult *res,
-                                       gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        TestFuncData *func_data;
 
@@ -211,7 +207,7 @@ static void test_call_set_ee_data_callback(GObject *source_object,
                out_result = NET_NFC_UNKNOWN_ERROR;
 
                DEBUG_ERR_MSG("Can not finish set_ee_data: %s\n",
-                       error->message);
+                               error->message);
                g_error_free(error);
        }
 
@@ -224,7 +220,7 @@ static void test_call_set_ee_data_callback(GObject *source_object,
        }
 
        callback = (net_nfc_client_test_set_ee_data_completed)
-                       func_data->callback;
+               func_data->callback;
 
        callback(out_result, func_data->user_data);
 
@@ -232,10 +228,9 @@ static void test_call_set_ee_data_callback(GObject *source_object,
 }
 
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_test_sim_test(
-                       net_nfc_client_test_sim_test_completed callback,
-                       void *user_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;
 
@@ -255,16 +250,15 @@ net_nfc_error_e net_nfc_client_test_sim_test(
        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);
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       test_call_sim_test_callback,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_test_sim_test_sync(void)
+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;
@@ -278,10 +272,10 @@ net_nfc_error_e net_nfc_client_test_sim_test_sync(void)
        }
 
        if (net_nfc_gdbus_test_call_sim_test_sync(test_proxy,
-                                               net_nfc_client_gdbus_get_privilege(),
-                                               (gint *)&out_result,
-                                               NULL,
-                                               &error) == FALSE)
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint *)&out_result,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_CLIENT_MSG("can not call SimTest: %s",
                                error->message);
@@ -292,11 +286,10 @@ net_nfc_error_e net_nfc_client_test_sim_test_sync(void)
        return out_result;
 }
 
-NET_NFC_EXPORT_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)
+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;
 
@@ -316,19 +309,18 @@ net_nfc_error_e net_nfc_client_test_prbs_test(uint32_t tech,
        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);
+                       tech,
+                       rate,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       test_call_prbs_test_callback,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_test_prbs_test_sync(uint32_t tech,
-                                               uint32_t rate)
+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;
@@ -342,12 +334,12 @@ net_nfc_error_e net_nfc_client_test_prbs_test_sync(uint32_t tech,
        }
 
        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)
+                               tech,
+                               rate,
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint *)&out_result,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_CLIENT_MSG("can not call PrbsTest: %s",
                                error->message);
@@ -358,8 +350,7 @@ net_nfc_error_e net_nfc_client_test_prbs_test_sync(uint32_t tech,
        return out_result;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_test_get_firmware_version(
+API net_nfc_error_e net_nfc_client_test_get_firmware_version(
                net_nfc_client_test_get_firmware_version_completed callback,
                void *user_data)
 {
@@ -381,16 +372,15 @@ net_nfc_error_e net_nfc_client_test_get_firmware_version(
        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);
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       test_call_get_firmware_version_callback,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_test_get_firmware_version_sync(char **version)
+API net_nfc_error_e net_nfc_client_test_get_firmware_version_sync(char **version)
 {
        gchar *out_version = NULL;
        GError *error = NULL;
@@ -406,11 +396,11 @@ net_nfc_error_e net_nfc_client_test_get_firmware_version_sync(char **version)
        }
 
        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)
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint *)out_result,
+                               &out_version,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_CLIENT_MSG("can not call PrbsTest: %s",
                                error->message);
@@ -424,12 +414,11 @@ net_nfc_error_e net_nfc_client_test_get_firmware_version_sync(char **version)
        return out_result;
 }
 
-NET_NFC_EXPORT_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)
+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;
@@ -449,21 +438,20 @@ net_nfc_error_e net_nfc_client_test_set_ee_data(int mode,
        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);
+                       mode,
+                       reg_id,
+                       variant,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       test_call_set_ee_data_callback,
+                       func_data);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_test_set_ee_data_sync(int mode,
-                                               int reg_id,
-                                               data_h data)
+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;
@@ -481,13 +469,13 @@ net_nfc_error_e net_nfc_client_test_set_ee_data_sync(int mode,
        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)
+                               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);
@@ -510,12 +498,12 @@ net_nfc_error_e net_nfc_client_test_init(void)
        }
 
        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);
+                       G_BUS_TYPE_SYSTEM,
+                       G_DBUS_PROXY_FLAGS_NONE,
+                       "org.tizen.NetNfcService",
+                       "/org/tizen/NetNfcService/Test",
+                       NULL,
+                       &error);
 
        if (test_proxy == NULL)
        {
similarity index 76%
rename from src/clientlib/net_nfc_client_transceive.c
rename to client/net_nfc_client_transceive.c
index 2213a8c..71579e3 100644 (file)
 #include "net_nfc_client_tag_internal.h"
 #include "net_nfc_client_transceive.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
 static NetNfcGDbusTransceive *transceive_proxy = NULL;
 
 static GVariant *transceive_data_to_transceive_variant(
-                                               net_nfc_target_type_e dev_type,
-                                               data_s *data);
+               net_nfc_target_type_e dev_type,
+               data_s *data);
 
 static void transceive_call(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 static void transceive_data_call(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data);
+               GAsyncResult *res,
+               gpointer user_data);
 
 typedef struct _TransceiveFuncData TransceiveFuncData;
 
@@ -53,8 +49,8 @@ struct _TransceiveFuncData
 };
 
 static GVariant *transceive_data_to_transceive_variant(
-                                               net_nfc_target_type_e devType,
-                                               data_s *data)
+               net_nfc_target_type_e devType,
+               data_s *data)
 {
        GVariant *variant = NULL;
        data_s transceive_info = {NULL,};
@@ -71,51 +67,45 @@ static GVariant *transceive_data_to_transceive_variant(
        case NET_NFC_MIFARE_1K_PICC :
        case NET_NFC_MIFARE_4K_PICC :
        case NET_NFC_MIFARE_ULTRA_PICC :
+               if(net_nfc_util_alloc_data(&transceive_info,
+                                       data->length + 2) == true)
                {
-                       if(net_nfc_util_alloc_data(&transceive_info,
-                               data->length + 2) == true)
-                       {
-                               memcpy(transceive_info.buffer,
+                       memcpy(transceive_info.buffer,
                                        data->buffer,
                                        data->length);
 
-                               net_nfc_util_compute_CRC(CRC_A,
-                                                       transceive_info.buffer,
-                                                       transceive_info.length);
-                       }
+                       net_nfc_util_compute_CRC(CRC_A,
+                                       transceive_info.buffer,
+                                       transceive_info.length);
                }
                break;
 
        case NET_NFC_JEWEL_PICC :
+               if (data->length > 9)
+               {
+                       DEBUG_ERR_MSG("data length is larger than 9");
+                       return NULL;
+               }
+
+               if(net_nfc_util_alloc_data(&transceive_info, 9) == true)
                {
-                       if (data->length > 9)
-                       {
-                               DEBUG_ERR_MSG("data length is larger than 9");
-                               return NULL;
-                       }
-
-                       if(net_nfc_util_alloc_data(&transceive_info, 9) == true)
-                       {
-                               memcpy(transceive_info.buffer,
+                       memcpy(transceive_info.buffer,
                                        data->buffer,
                                        data->length);
-                               net_nfc_util_compute_CRC(CRC_B,
-                                               transceive_info.buffer,
-                                               transceive_info.length);
-                       }
-
+                       net_nfc_util_compute_CRC(CRC_B,
+                                       transceive_info.buffer,
+                                       transceive_info.length);
                }
+
                break;
 
        default :
+               if(net_nfc_util_alloc_data(&transceive_info,
+                                       data->length) == true)
                {
-                       if(net_nfc_util_alloc_data(&transceive_info,
-                               data->length) == true)
-                       {
-                               memcpy(transceive_info.buffer,
+                       memcpy(transceive_info.buffer,
                                        data->buffer,
                                        data->length);
-                       }
                }
                break;
        }
@@ -128,8 +118,8 @@ static GVariant *transceive_data_to_transceive_variant(
 }
 
 static void transceive_data_call(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        TransceiveFuncData *func_data;
 
@@ -170,9 +160,9 @@ static void transceive_data_call(GObject *source_object,
        net_nfc_util_gdbus_variant_to_data_s(out_data, &resp);
 
        ((nfc_transceive_data_callback)func_data->transceive_send_callback)(
-                               out_result,
-                               &resp,
-                               func_data->transceive_send_data);
+               out_result,
+               &resp,
+               func_data->transceive_send_data);
 
        net_nfc_util_free_data(&resp);
 
@@ -180,8 +170,8 @@ static void transceive_data_call(GObject *source_object,
 }
 
 static void transceive_call(GObject *source_object,
-                               GAsyncResult *res,
-                               gpointer user_data)
+               GAsyncResult *res,
+               gpointer user_data)
 {
        TransceiveFuncData *func_data;
 
@@ -215,17 +205,16 @@ static void transceive_call(GObject *source_object,
        }
 
        ((nfc_transceive_callback)func_data->transceive_send_callback)(
-                               out_result,
-                               func_data->transceive_send_data);
+               out_result,
+               func_data->transceive_send_data);
 
        g_free(func_data);
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_transceive(net_nfc_target_handle_h handle,
-                                       data_h rawdata,
-                                       nfc_transceive_callback callback,
-                                       void *user_data)
+API net_nfc_error_e net_nfc_client_transceive(net_nfc_target_handle_h handle,
+               data_h rawdata,
+               nfc_transceive_callback callback,
+               void *user_data)
 {
        net_nfc_target_info_s *target_info = NULL;
        data_s *data = (data_s *)rawdata;
@@ -259,7 +248,7 @@ net_nfc_error_e net_nfc_client_transceive(net_nfc_target_handle_h handle,
                return NET_NFC_OPERATION_FAIL;
 
        arg_data = transceive_data_to_transceive_variant(target_info->devType,
-                                                       data);
+                       data);
        if (arg_data == NULL)
                return NET_NFC_OPERATION_FAIL;
 
@@ -269,22 +258,21 @@ net_nfc_error_e net_nfc_client_transceive(net_nfc_target_handle_h handle,
        funcdata->transceive_send_data = user_data;
 
        net_nfc_gdbus_transceive_call_transceive(transceive_proxy,
-                                               GPOINTER_TO_UINT(handle),
-                                               target_info->devType,
-                                               arg_data,
-                                               net_nfc_client_gdbus_get_privilege(),
-                                               NULL,
-                                               transceive_call,
-                                               funcdata);
+                       GPOINTER_TO_UINT(handle),
+                       target_info->devType,
+                       arg_data,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       transceive_call,
+                       funcdata);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-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)
+API 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)
 {
        net_nfc_target_info_s *target_info = NULL;
        data_s *data = (data_s *)rawdata;
@@ -318,7 +306,7 @@ net_nfc_error_e net_nfc_client_transceive_data(net_nfc_target_handle_h handle,
                return NET_NFC_OPERATION_FAIL;
 
        arg_data = transceive_data_to_transceive_variant(target_info->devType,
-                                                       data);
+                       data);
        if (arg_data == NULL)
                return NET_NFC_OPERATION_FAIL;
 
@@ -328,20 +316,19 @@ net_nfc_error_e net_nfc_client_transceive_data(net_nfc_target_handle_h handle,
        funcdata->transceive_send_data = user_data;
 
        net_nfc_gdbus_transceive_call_transceive_data(transceive_proxy,
-                                               GPOINTER_TO_UINT(handle),
-                                               target_info->devType,
-                                               arg_data,
-                                               net_nfc_client_gdbus_get_privilege(),
-                                               NULL,
-                                               transceive_data_call,
-                                               funcdata);
+                       GPOINTER_TO_UINT(handle),
+                       target_info->devType,
+                       arg_data,
+                       net_nfc_client_gdbus_get_privilege(),
+                       NULL,
+                       transceive_data_call,
+                       funcdata);
 
        return NET_NFC_OK;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_transceive_sync(net_nfc_target_handle_h handle,
-                                       data_h rawdata)
+API net_nfc_error_e net_nfc_client_transceive_sync(net_nfc_target_handle_h handle,
+               data_h rawdata)
 {
        net_nfc_target_info_s *target_info = NULL;
        data_s *data = (data_s *)rawdata;
@@ -377,21 +364,21 @@ net_nfc_error_e net_nfc_client_transceive_sync(net_nfc_target_handle_h handle,
                return NET_NFC_OPERATION_FAIL;
 
        arg_data = transceive_data_to_transceive_variant(target_info->devType,
-                                                       data);
+                       data);
        if (arg_data == NULL)
                return NET_NFC_OPERATION_FAIL;
 
        if(net_nfc_gdbus_transceive_call_transceive_sync(transceive_proxy,
-                                               GPOINTER_TO_UINT(handle),
-                                               target_info->devType,
-                                               arg_data,
-                                               net_nfc_client_gdbus_get_privilege(),
-                                               (gint *)&out_result,
-                                               NULL,
-                                               &error) == FALSE)
+                               GPOINTER_TO_UINT(handle),
+                               target_info->devType,
+                               arg_data,
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint *)&out_result,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("Transceive (sync call) failed: %s",
-                       error->message);
+                               error->message);
 
                g_error_free(error);
                return NET_NFC_UNKNOWN_ERROR;
@@ -400,11 +387,10 @@ net_nfc_error_e net_nfc_client_transceive_sync(net_nfc_target_handle_h handle,
        return out_result;
 }
 
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_transceive_data_sync(
-                                               net_nfc_target_handle_h handle,
-                                               data_h rawdata,
-                                               data_h *response)
+API 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_info_s *target_info = NULL;
        data_s *data = (data_s *)rawdata;
@@ -441,23 +427,23 @@ net_nfc_error_e net_nfc_client_transceive_data_sync(
                return NET_NFC_OPERATION_FAIL;
 
        arg_data = transceive_data_to_transceive_variant(target_info->devType,
-                                                       data);
+                       data);
        if (arg_data == NULL)
                return NET_NFC_OPERATION_FAIL;
 
        if (net_nfc_gdbus_transceive_call_transceive_data_sync(
-                                               transceive_proxy,
-                                               GPOINTER_TO_UINT(handle),
-                                               target_info->devType,
-                                               arg_data,
-                                               net_nfc_client_gdbus_get_privilege(),
-                                               (gint *)&out_result,
-                                               &out_data,
-                                               NULL,
-                                               &error) == FALSE)
+                               transceive_proxy,
+                               GPOINTER_TO_UINT(handle),
+                               target_info->devType,
+                               arg_data,
+                               net_nfc_client_gdbus_get_privilege(),
+                               (gint *)&out_result,
+                               &out_data,
+                               NULL,
+                               &error) == FALSE)
        {
                DEBUG_ERR_MSG("Transceive (sync call) failed: %s",
-                       error->message);
+                               error->message);
                g_error_free(error);
                return NET_NFC_UNKNOWN_ERROR;
        }
@@ -483,12 +469,12 @@ net_nfc_error_e net_nfc_client_transceive_init(void)
        }
 
        transceive_proxy = net_nfc_gdbus_transceive_proxy_new_for_bus_sync(
-                                       G_BUS_TYPE_SYSTEM,
-                                       G_DBUS_PROXY_FLAGS_NONE,
-                                       "org.tizen.NetNfcService",
-                                       "/org/tizen/NetNfcService/Transceive",
-                                       NULL,
-                                       &error);
+                       G_BUS_TYPE_SYSTEM,
+                       G_DBUS_PROXY_FLAGS_NONE,
+                       "org.tizen.NetNfcService",
+                       "/org/tizen/NetNfcService/Transceive",
+                       NULL,
+                       &error);
        if (transceive_proxy == NULL)
        {
                DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
diff --git a/client/nfc.pc.in b/client/nfc.pc.in
new file mode 100644 (file)
index 0000000..9f70c68
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@PREFIX@
+exec_prefix=${prefix}/bin
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@/@NFC_CLIENT@
+
+Name: @NFC_CLIENT@
+Description: NFC
+Version: @FULLVER@
+Requires: glib-2.0
+Libs: -L${libdir} -l@NFC_CLIENT@
+Cflags: -I${includedir}
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a55df66
--- /dev/null
@@ -0,0 +1,39 @@
+INCLUDE_DIRECTORIES(include)
+
+SET(NFC_COMMON "nfc-common")
+
+FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen)
+EXEC_PROGRAM(${GDBUS_CODEGEN} ARGS
+       " --generate-c-code ${CMAKE_CURRENT_SOURCE_DIR}/net_nfc_gdbus"
+       " --c-namespace NetNfcGDbus"
+       " --interface-prefix org.tizen.NetNfcService."
+       " ${CMAKE_CURRENT_SOURCE_DIR}/net_nfc.xml"
+)
+
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} COMMON_SRCS)
+
+pkg_check_modules(common_pkgs REQUIRED glib-2.0 gio-2.0 gio-unix-2.0 dlog bluetooth-api
+       libssl)
+
+SET(EXTRA_CFLAGS "-fPIC -Wall -Werror-implicit-function-declaration")
+
+FOREACH(flag ${common_pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+ADD_LIBRARY(${NFC_COMMON} SHARED ${COMMON_SRCS})
+SET_TARGET_PROPERTIES(${NFC_COMMON} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER})
+TARGET_LINK_LIBRARIES(${NFC_COMMON} ${common_pkgs_LDFLAGS})
+
+FILE(GLOB COMMON_HEADER include/*.h)
+
+CONFIGURE_FILE(${NFC_COMMON}.pc.in ${NFC_COMMON}.pc @ONLY)
+INSTALL(FILES ${NFC_COMMON}.pc DESTINATION lib/pkgconfig)
+
+INSTALL(TARGETS ${NFC_COMMON} DESTINATION lib)
+
+FOREACH(hfile ${COMMON_HEADER})
+        INSTALL(FILES ${hfile} DESTINATION include/${NFC_COMMON})
+ENDFOREACH(hfile)
+
similarity index 99%
rename from src/commonlib/include/net_nfc_typedef.h
rename to common/include/net_nfc_typedef.h
index 407ca3b..8ab97f6 100644 (file)
 #ifndef __NET_NFC_TYPEDEF_H__
 #define __NET_NFC_TYPEDEF_H__
 
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 /**
  NFC Manager
  NFC Manager controls the nfc device with high level APIs such as SmartPoster and Connection handover.
  This documents provide the NFC defines
 
  */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <stdbool.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
 
 /**
  net_nfc_error_e is enum type that returned from each functions
similarity index 100%
rename from src/commonlib/net_nfc.xml
rename to common/net_nfc.xml
similarity index 98%
rename from src/commonlib/include/net_nfc_debug_internal.h
rename to common/net_nfc_debug_internal.h
index 3bf40c6..27ad787 100644 (file)
 #define LOG_COLOR_LIGHTBLUE    "\033[0;37m"
 #define LOG_COLOR_END          "\033[0;m"
 
+#ifndef API
+#define API __attribute__((visibility("default")))
+#endif
+
+
 /* nfc_log_to_file */
 extern FILE *nfc_log_file;
 #define NFC_DLOG_FILE "/opt/usr/share/nfc_debug/nfc_mgr_dlog.txt"
similarity index 85%
rename from src/commonlib/net_nfc_util.c
rename to common/net_nfc_util.c
index 7569c17..e317d1e 100644 (file)
@@ -1,18 +1,18 @@
 /*
 * 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.
 */
+ * 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.
+ */
 
 // libc header
 #include <stdlib.h>
 #include "net_nfc_oem_controller.h"
 #include "net_nfc_util_defines.h"
 
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
 static const char *schema[] =
 {
        "",
@@ -74,8 +70,6 @@ static const char *schema[] =
        "urn:epc:nfc:",
 };
 
-// defines for bluetooth api
-#define USE_BLUETOOTH_API
 static uint8_t *bt_addr = NULL;
 
 /* for log tag */
@@ -138,7 +132,7 @@ void net_nfc_manager_fini_log()
        }
 }
 
-NET_NFC_EXPORT_API void __net_nfc_util_free_mem(void **mem, char *filename, unsigned int line)
+API void __net_nfc_util_free_mem(void **mem, char *filename, unsigned int line)
 {
        if (mem == NULL)
        {
@@ -156,7 +150,7 @@ NET_NFC_EXPORT_API void __net_nfc_util_free_mem(void **mem, char *filename, unsi
        *mem = NULL;
 }
 
-NET_NFC_EXPORT_API void __net_nfc_util_alloc_mem(void **mem, int size, char *filename, unsigned int line)
+API void __net_nfc_util_alloc_mem(void **mem, int size, char *filename, unsigned int line)
 {
        if (mem == NULL || size <= 0)
        {
@@ -177,7 +171,7 @@ NET_NFC_EXPORT_API void __net_nfc_util_alloc_mem(void **mem, int size, char *fil
        }
 }
 
-NET_NFC_EXPORT_API void __net_nfc_util_strdup(char **output, const char *origin, char *filename, unsigned int line)
+API void __net_nfc_util_strdup(char **output, const char *origin, char *filename, unsigned int line)
 {
        if (output == NULL || origin == NULL)
        {
@@ -198,7 +192,7 @@ NET_NFC_EXPORT_API void __net_nfc_util_strdup(char **output, const char *origin,
        }
 }
 
-NET_NFC_EXPORT_API bool net_nfc_util_alloc_data(data_s *data, uint32_t length)
+API bool net_nfc_util_alloc_data(data_s *data, uint32_t length)
 {
        if (data == NULL || length == 0)
                return false;
@@ -212,7 +206,7 @@ NET_NFC_EXPORT_API bool net_nfc_util_alloc_data(data_s *data, uint32_t length)
        return true;
 }
 
-NET_NFC_EXPORT_API bool net_nfc_util_duplicate_data(data_s *dest, net_nfc_data_s *src)
+API bool net_nfc_util_duplicate_data(data_s *dest, net_nfc_data_s *src)
 {
        if (dest == NULL || src == NULL || src->length == 0)
                return false;
@@ -225,7 +219,7 @@ NET_NFC_EXPORT_API bool net_nfc_util_duplicate_data(data_s *dest, net_nfc_data_s
        return true;
 }
 
-NET_NFC_EXPORT_API void net_nfc_util_free_data(data_s *data)
+API void net_nfc_util_free_data(data_s *data)
 {
        if (data == NULL || data->buffer == NULL)
                return;
similarity index 79%
rename from src/commonlib/net_nfc_util_gdbus.c
rename to common/net_nfc_util_gdbus.c
index c9b091f..41b1d1a 100644 (file)
@@ -1,18 +1,18 @@
 /*
 * 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.
 */
+ * 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.
+ */
 
 // libc header
 
@@ -24,7 +24,7 @@
 #include "net_nfc_util_gdbus_internal.h"
 
 void net_nfc_util_gdbus_variant_to_buffer(GVariant *variant, uint8_t **buffer,
-       size_t *length)
+               size_t *length)
 {
        GVariantIter *iter;
        guint8 *buf = NULL;
@@ -146,7 +146,7 @@ void net_nfc_util_gdbus_variant_to_data_s(GVariant *variant, data_s *data)
 }
 
 GVariant *net_nfc_util_gdbus_buffer_to_variant(const uint8_t *buffer,
-       size_t length)
+               size_t length)
 {
        GVariantBuilder builder;
 
@@ -168,7 +168,7 @@ GVariant *net_nfc_util_gdbus_data_to_variant(const data_s *data)
        if (data != NULL)
        {
                return net_nfc_util_gdbus_buffer_to_variant(data->buffer,
-                       data->length);
+                               data->length);
        }
        else
        {
similarity index 97%
rename from src/commonlib/net_nfc_util_handover.c
rename to common/net_nfc_util_handover.c
index de399ab..df44989 100644 (file)
@@ -1,18 +1,18 @@
 /*
 * 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.
 */
+ * 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 <glib.h>
@@ -909,9 +909,7 @@ net_nfc_error_e net_nfc_util_create_handover_error_record(ndef_record_s **record
        return NET_NFC_OK;
 }
 
-/*
- inner_msg should be freed after using
- */
+/*     inner_msg should be freed after using   */
 
 static net_nfc_error_e __net_nfc_get_inner_message(ndef_message_s *message, ndef_message_s *inner_msg)
 {
@@ -931,7 +929,7 @@ static net_nfc_error_e __net_nfc_get_inner_message(ndef_message_s *message, ndef
        }
 
        if (strncmp((char*)(inner_record->type_s.buffer), CH_REQ_RECORD_TYPE, (size_t)(inner_record->type_s.length)) != 0
-               && strncmp((char*)(inner_record->type_s.buffer), CH_SEL_RECORD_TYPE, (size_t)(inner_record->type_s.length)) != 0)
+                       && strncmp((char*)(inner_record->type_s.buffer), CH_SEL_RECORD_TYPE, (size_t)(inner_record->type_s.length)) != 0)
        {
                // This message is not connection handover message
                return NET_NFC_INVALID_FORMAT;
@@ -973,7 +971,7 @@ static net_nfc_error_e __net_nfc_replace_inner_message(ndef_message_s *message,
        }
 
        if (strncmp((char *)(inner_record->type_s.buffer), CH_REQ_RECORD_TYPE, (size_t)(inner_record->type_s.length)) != 0
-               && strncmp((char *)(inner_record->type_s.buffer), CH_SEL_RECORD_TYPE, (size_t)(inner_record->type_s.length)) != 0)
+                       && strncmp((char *)(inner_record->type_s.buffer), CH_SEL_RECORD_TYPE, (size_t)(inner_record->type_s.length)) != 0)
        {
                // This message is not connection handover message
                DEBUG_ERR_MSG("unknown type [%s]", inner_record->type_s.buffer);
@@ -1072,7 +1070,7 @@ net_nfc_error_e net_nfc_util_append_carrier_config_record(ndef_message_s *messag
        {
                /* selector record type can include empty inner message. so that case, we will continue */
                if (message->records != NULL &&
-                       memcmp((char *)message->records->type_s.buffer, CH_SEL_RECORD_TYPE, (size_t)message->records->type_s.length) != 0)
+                               memcmp((char *)message->records->type_s.buffer, CH_SEL_RECORD_TYPE, (size_t)message->records->type_s.length) != 0)
                {
                        DEBUG_ERR_MSG("ERROR [%d]", error);
 
@@ -1087,7 +1085,7 @@ net_nfc_error_e net_nfc_util_append_carrier_config_record(ndef_message_s *messag
 
        config_ref_count++;
        offset = 0;
-//     id = '0' + config_ref_count;
+       //      id = '0' + config_ref_count;
        id = 'b';
 
        /* carrier flag */
@@ -1212,7 +1210,7 @@ net_nfc_error_e net_nfc_util_remove_carrier_config_record(ndef_message_s *messag
                        if (strncmp((char *)current->type_s.buffer, ALTERNATIVE_RECORD_TYPE, (size_t)current->type_s.length) == 0)
                        {
                                if ((uint32_t)(current->payload_s.buffer[1]) == record_priv->id_s.length &&
-                                       strncmp((char *)(current->payload_s.buffer + 2), (char*)(record_priv->id_s.buffer), (size_t)current->payload_s.buffer[1]) == 0)
+                                               strncmp((char *)(current->payload_s.buffer + 2), (char*)(record_priv->id_s.buffer), (size_t)current->payload_s.buffer[1]) == 0)
                                {
                                        // comparing the instance
                                        break;
@@ -1318,7 +1316,7 @@ net_nfc_error_e net_nfc_util_get_handover_random_number(ndef_message_s *message,
        {
                cr_record = inner_msg->records;
                if (strncmp((char*)cr_record->type_s.buffer, COLLISION_DETECT_RECORD_TYPE, (size_t)cr_record->type_s.length) != 0
-                       || cr_record->payload_s.length < 2)
+                               || cr_record->payload_s.length < 2)
                {
                        DEBUG_MSG("There is no Collision resolution record");
 
similarity index 94%
rename from src/commonlib/include/net_nfc_util_internal.h
rename to common/net_nfc_util_internal.h
index f607c75..16d3a8b 100644 (file)
 
 #include "net_nfc_typedef_internal.h"
 
+#define NET_NFC_MANAGER_DATA_PATH              "/opt/data/nfc-manager-daemon"
+#define NET_NFC_MANAGER_DATA_PATH_MESSAGE      "message"
+#define NET_NFC_MANAGER_NDEF_FILE_NAME         "ndef-message.txt"
+
 #define NET_NFC_REVERSE_ORDER_6_BYTES(__array) \
        do \
        { \
similarity index 94%
rename from src/commonlib/net_nfc_util_ndef_message.c
rename to common/net_nfc_util_ndef_message.c
index 9a96e0c..ab6142e 100644 (file)
@@ -1,18 +1,18 @@
 /*
 * 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.
 */
+ * 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"
@@ -456,9 +456,9 @@ void net_nfc_util_print_ndef_message(ndef_message_s *msg)
                }
                DEBUG_MSG("---------- Record -----------------------------------------\n");
                DEBUG_MSG("MB:%d ME:%d CF:%d SR:%d IL:%d TNF:0x%02X\n",
-                       current->MB, current->ME, current->CF, current->SR, current->IL, current->TNF);
+                               current->MB, current->ME, current->CF, current->SR, current->IL, current->TNF);
                DEBUG_MSG("TypeLength:%d  PayloadLength:%d  IDLength:%d\n",
-                       current->type_s.length, current->payload_s.length, current->id_s.length);
+                               current->type_s.length, current->payload_s.length, current->id_s.length);
                if (current->type_s.buffer != NULL)
                {
                        memcpy(buffer, current->type_s.buffer, current->type_s.length);
@@ -666,7 +666,7 @@ net_nfc_error_e net_nfc_util_search_record_by_type(ndef_message_s *ndef_message,
        if (type_length > 12)
        {
                if (memcmp(buf, "urn:nfc:ext:", 12) == 0 ||
-                       memcmp(buf, "urn:nfc:wkt:", 12) == 0)
+                               memcmp(buf, "urn:nfc:wkt:", 12) == 0)
                {
                        buf += 12;
                        type_length -= 12;
@@ -685,8 +685,8 @@ net_nfc_error_e net_nfc_util_search_record_by_type(ndef_message_s *ndef_message,
                }
 
                if (tmp_record->TNF == tnf &&
-                       type_length == tmp_record->type_s.length &&
-                       memcmp(buf, tmp_record->type_s.buffer, type_length) == 0)
+                               type_length == tmp_record->type_s.length &&
+                               memcmp(buf, tmp_record->type_s.buffer, type_length) == 0)
                {
                        *record = tmp_record;
 
@@ -725,7 +725,7 @@ net_nfc_error_e net_nfc_util_search_record_by_id(ndef_message_s *ndef_message, d
                        return NET_NFC_INVALID_FORMAT;
                }
                if (id_length == record_in_msg->id_s.length &&
-                       memcmp(buf, record_in_msg->id_s.buffer, id_length) == 0)
+                               memcmp(buf, record_in_msg->id_s.buffer, id_length) == 0)
                {
                        *record = record_in_msg;
 
similarity index 90%
rename from src/commonlib/net_nfc_util_ndef_record.c
rename to common/net_nfc_util_ndef_record.c
index aa55d53..9fe253e 100644 (file)
@@ -1,18 +1,18 @@
 /*
 * 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.
 */
+ * 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_defines.h"
@@ -273,17 +273,17 @@ uint32_t net_nfc_util_get_record_length(ndef_record_s *Record)
                return 0;
 
        /* Type length is present only for following TNF
-        NET_NFC_TNF_NFCWELLKNOWN
-        NET_NFC_TNF_MEDIATYPE
-        SLP_FRINET_NFC_NDEFRECORD_TNF_ABSURI
-        SLP_FRINET_NFC_NDEFRECORD_TNF_NFCEXT
-        */
+               NET_NFC_TNF_NFCWELLKNOWN
+               NET_NFC_TNF_MEDIATYPE
+               SLP_FRINET_NFC_NDEFRECORD_TNF_ABSURI
+               SLP_FRINET_NFC_NDEFRECORD_TNF_NFCEXT
+               */
 
        /* ++ is for the Type Length Byte */
        RecordLength++;
        if (Record->TNF != NET_NFC_NDEF_TNF_EMPTY &&
-               Record->TNF != NET_NFC_NDEF_TNF_UNKNOWN &&
-               Record->TNF != NET_NFC_NDEF_TNF_UNCHANGED)
+                       Record->TNF != NET_NFC_NDEF_TNF_UNKNOWN &&
+                       Record->TNF != NET_NFC_NDEF_TNF_UNCHANGED)
        {
                RecordLength += Record->type_s.length;
        }
@@ -329,7 +329,7 @@ net_nfc_error_e net_nfc_util_create_uri_string_from_uri_record(ndef_record_s *re
        *uri = NULL;
 
        if (record->TNF == NET_NFC_RECORD_WELL_KNOWN_TYPE &&
-               (record->type_s.length == 1 && record->type_s.buffer[0] == 'U'))
+                       (record->type_s.length == 1 && record->type_s.buffer[0] == 'U'))
        {
                data_s *payload = &record->payload_s;
 
similarity index 96%
rename from src/commonlib/net_nfc_util_openssl.c
rename to common/net_nfc_util_openssl.c
index f51b589..4a9810a 100644 (file)
@@ -1,18 +1,18 @@
 /*
 * 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.
 */
+ * 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 <openssl/evp.h>
@@ -467,7 +467,7 @@ int net_nfc_util_openssl_sign_buffer(uint32_t type, uint8_t *buffer, uint32_t le
 
                /* RSASSA-PSS, RSASSA-PKCS1-v1_5 */
        case 1 :
-               case 2 :
+       case 2 :
                /* md */
                md = EVP_get_digestbyname("sha1");
 
similarity index 95%
rename from src/commonlib/net_nfc_util_sign_record.c
rename to common/net_nfc_util_sign_record.c
index e64c179..1815d9e 100644 (file)
@@ -27,8 +27,8 @@
 
 #define IS_SIGN_RECORD(__x) \
        (((__x)->TNF == NET_NFC_RECORD_WELL_KNOWN_TYPE) && \
-       ((__x)->type_s.length == 3) && \
-       (memcmp((__x)->type_s.buffer, "Sig", 3) == 0))
+        ((__x)->type_s.length == 3) && \
+        (memcmp((__x)->type_s.buffer, "Sig", 3) == 0))
 
 #define IS_EMPTY_RECORD(__x) \
        ((__x->TNF == NET_NFC_RECORD_EMPTY))
@@ -169,7 +169,7 @@ net_nfc_error_e net_nfc_util_verify_signature_records(ndef_record_s *begin_recor
                        data_info = (net_nfc_sub_field_s *)chain_info->cert_store;
                        DEBUG_MSG("certficate length : %d", data_info->length);
 
-       //              DEBUG_MSG_PRINT_BUFFER(data_info->value, data_info->length);
+                       //              DEBUG_MSG_PRINT_BUFFER(data_info->value, data_info->length);
 
                        /* the first certificate is signer's one
                         * verify signature of content */
@@ -188,11 +188,11 @@ net_nfc_error_e net_nfc_util_verify_signature_records(ndef_record_s *begin_recor
 
                                        /* verify certificate using certificate chain */
                                        for (i = 1, data_info = (net_nfc_sub_field_s *)__NEXT_SUB_FIELD(data_info);
-                                               i < chain_info->num_of_certs;
-                                               i++, data_info = (net_nfc_sub_field_s *)__NEXT_SUB_FIELD(data_info))
+                                                       i < chain_info->num_of_certs;
+                                                       i++, data_info = (net_nfc_sub_field_s *)__NEXT_SUB_FIELD(data_info))
                                        {
                                                DEBUG_MSG("certficate length : %d", data_info->length);
-//                                             DEBUG_MSG_PRINT_BUFFER(data_info->value, data_info->length);
+                                               //DEBUG_MSG_PRINT_BUFFER(data_info->value, data_info->length);
 
                                                net_nfc_util_openssl_add_certificate_of_ca(context, data_info->value, data_info->length);
                                        }
@@ -206,8 +206,8 @@ net_nfc_error_e net_nfc_util_verify_signature_records(ndef_record_s *begin_recor
                                                _net_nfc_util_free_mem(buffer);
                                                return result;
 
-//                                             DEBUG_MSG("certficate length : %d", data_info->length);
-//                                             DEBUG_MSG_PRINT_BUFFER(data_info->value, data_info->length);
+                                               //DEBUG_MSG("certficate length : %d", data_info->length);
+                                               //DEBUG_MSG_PRINT_BUFFER(data_info->value, data_info->length);
                                        }
 
                                        /* verify buffer with cert chain and signature bytes */
diff --git a/common/nfc-common.pc.in b/common/nfc-common.pc.in
new file mode 100644 (file)
index 0000000..a1a676e
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@PREFIX@
+exec_prefix=${prefix}/bin
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@/@NFC_COMMON@
+
+Name: @NFC_COMMON@
+Description: NFC Common Library
+Version: @FULLVER@
+Requires:
+Libs: -L${libdir} -l@NFC_COMMON@
+Cflags: -I${includedir}
diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c6ccc22
--- /dev/null
@@ -0,0 +1,25 @@
+LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/include)
+
+SET(NFC_DAEMON "nfc-manager-daemon")
+
+FILE(GLOB DAEMON_SRCS *.c)
+
+pkg_check_modules(daemon_pkgs REQUIRED aul glib-2.0 gio-unix-2.0 security-server
+       vconf dlog tapi appsvc libcurl bluetooth-api libssl svi capi-media-wav-player
+       pkgmgr pkgmgr-info capi-network-wifi ecore-x pmapi)
+
+FOREACH(flag ${daemon_pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+ADD_EXECUTABLE(${NFC_DAEMON} ${DAEMON_SRCS})
+TARGET_LINK_LIBRARIES(${NFC_DAEMON} ${daemon_pkgs_LDFLAGS} pthread dl rt nfc-common)
+
+INSTALL(TARGETS ${NFC_DAEMON} DESTINATION bin)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.tizen.NetNfcService.service DESTINATION share/dbus-1/services)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/nfc-manager.xml DESTINATION share/packages)
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/sounds DESTINATION share/nfc-manager-daemon)
similarity index 54%
rename from src/manager/net_nfc_server.c
rename to daemon/net_nfc_server.c
index f2d8d22..4d9e456 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
+#include <glib.h>
 #include <gio/gio.h>
+#include <vconf.h>
 
 #include "net_nfc_debug_internal.h"
+#include "net_nfc_util_internal.h"
 #include "net_nfc_gdbus.h"
-#include "net_nfc_server_common.h"
 #include "net_nfc_server.h"
+#include "net_nfc_server_common.h"
+#include "net_nfc_server_vconf.h"
 #include "net_nfc_server_manager.h"
+#include "net_nfc_server_util.h"
+#include "net_nfc_server_controller.h"
 #include "net_nfc_server_tag.h"
 #include "net_nfc_server_ndef.h"
 #include "net_nfc_server_llcp.h"
 #include "net_nfc_server_se.h"
 #include "net_nfc_server_snep.h"
 #include "net_nfc_server_system_handler.h"
-#include "net_nfc_server_context_internal.h"
+#include "net_nfc_server_context.h"
+
+static gboolean use_daemon = FALSE;
+static GMainLoop *loop = NULL;
 
 static GDBusConnection *connection = NULL;
 static guint subscribe_id;
 
+GOptionEntry option_entries[] = {
+       { "daemon", 'd', 0, G_OPTION_ARG_NONE, &use_daemon,
+               "Use Daemon mode", NULL },
+       { NULL }
+};
+
 pid_t net_nfc_server_gdbus_get_pid(const char *name)
 {
        guint pid = 0;
@@ -43,16 +57,16 @@ pid_t net_nfc_server_gdbus_get_pid(const char *name)
        GVariant *_ret;
 
        _ret = g_dbus_connection_call_sync(connection,
-               "org.freedesktop.DBus",
-               "/org/freedesktop/DBus",
-               "org.freedesktop.DBus",
-               "GetConnectionUnixProcessID",
-               g_variant_new("(s)", name),
-               NULL,
-               G_DBUS_CALL_FLAGS_NONE,
-               -1,
-               NULL,
-               &error);
+                       "org.freedesktop.DBus",
+                       "/org/freedesktop/DBus",
+                       "org.freedesktop.DBus",
+                       "GetConnectionUnixProcessID",
+                       g_variant_new("(s)", name),
+                       NULL,
+                       G_DBUS_CALL_FLAGS_NONE,
+                       -1,
+                       NULL,
+                       &error);
        if (_ret != NULL) {
                g_variant_get(_ret, "(u)", &pid);
                g_variant_unref(_ret);
@@ -62,8 +76,8 @@ pid_t net_nfc_server_gdbus_get_pid(const char *name)
 }
 
 static void _name_owner_changed(GDBusProxy *proxy,
-       const gchar *name, const gchar *old_owner,
-       const gchar *new_owner, void *user_data)
+               const gchar *name, const gchar *old_owner,
+               const gchar *new_owner, void *user_data)
 {
        if (name == NULL || old_owner == NULL || new_owner == NULL) {
                DEBUG_ERR_MSG("invalid parameter");
@@ -83,22 +97,22 @@ static void _name_owner_changed(GDBusProxy *proxy,
 }
 
 static void _on_name_owner_changed(GDBusConnection *connection,
-       const gchar *sender_name, const gchar *object_path,
-       const gchar *interface_name, const gchar *signal_name,
-       GVariant *parameters, gpointer user_data)
+               const gchar *sender_name, const gchar *object_path,
+               const gchar *interface_name, const gchar *signal_name,
+               GVariant *parameters, gpointer user_data)
 {
        gchar *name;
        gchar *old_owner;
        gchar *new_owner;
 
        g_variant_get(parameters,
-               "(sss)",
-               &name,
-               &old_owner,
-               &new_owner);
+                       "(sss)",
+                       &name,
+                       &old_owner,
+                       &new_owner);
 
        _name_owner_changed((GDBusProxy *)connection,
-               name, old_owner, new_owner, user_data);
+                       name, old_owner, new_owner, user_data);
 }
 
 static void _subscribe_name_owner_changed_event()
@@ -108,14 +122,14 @@ static void _subscribe_name_owner_changed_event()
 
        /* subscribe signal */
        subscribe_id = g_dbus_connection_signal_subscribe(connection,
-               "org.freedesktop.DBus", /* bus name */
-               "org.freedesktop.DBus", /* interface */
-               "NameOwnerChanged", /* member */
-               "/org/freedesktop/DBus", /* path */
-               NULL, /* arg0 */
-               G_DBUS_SIGNAL_FLAGS_NONE,
-               _on_name_owner_changed,
-               NULL, NULL);
+                       "org.freedesktop.DBus", /* bus name */
+                       "org.freedesktop.DBus", /* interface */
+                       "NameOwnerChanged", /* member */
+                       "/org/freedesktop/DBus", /* path */
+                       NULL, /* arg0 */
+                       G_DBUS_SIGNAL_FLAGS_NONE,
+                       _on_name_owner_changed,
+                       NULL, NULL);
 }
 
 static void _unsubscribe_name_owner_changed_event()
@@ -129,7 +143,7 @@ static void _unsubscribe_name_owner_changed_event()
        }
 }
 
-void net_nfc_server_gdbus_init(void)
+static void net_nfc_server_gdbus_init(void)
 {
        GError *error = NULL;
 
@@ -221,7 +235,7 @@ void net_nfc_server_gdbus_init(void)
        _subscribe_name_owner_changed_event();
 }
 
-void net_nfc_server_gdbus_deinit(void)
+static void net_nfc_server_gdbus_deinit(void)
 {
        _unsubscribe_name_owner_changed_event();
 
@@ -246,3 +260,129 @@ void net_nfc_server_gdbus_deinit(void)
                connection = NULL;
        }
 }
+
+void net_nfc_manager_quit()
+{
+       DEBUG_MSG("net_nfc_manager_quit kill the nfc-manager daemon!!");
+
+       if (loop != NULL)
+               g_main_loop_quit(loop);
+}
+
+static void on_bus_acquired(GDBusConnection *connection, const gchar *path,
+               gpointer user_data)
+{
+       gint state;
+
+       DEBUG_MSG("bus path : %s", path);
+
+       net_nfc_server_gdbus_init();
+
+       net_nfc_server_controller_init();
+
+       if (vconf_get_bool(VCONFKEY_NFC_STATE, &state) != 0)
+       {
+               DEBUG_MSG("VCONFKEY_NFC_STATE is not exist");
+               net_nfc_manager_quit();
+
+               return;
+       }
+
+       net_nfc_server_vconf_init();
+
+       if (state == 1)
+               net_nfc_server_manager_set_active(TRUE);
+#ifndef ESE_ALWAYS_ON
+       else if (use_daemon == TRUE)
+               net_nfc_server_controller_deinit();
+#endif
+}
+
+static void on_name_acquired(GDBusConnection *connection, const gchar *name,
+               gpointer user_data)
+{
+       DEBUG_SERVER_MSG("name : %s", name);
+}
+
+static void on_name_lost(GDBusConnection *connnection, const gchar *name,
+               gpointer user_data)
+{
+       DEBUG_SERVER_MSG("name : %s", name);
+
+       net_nfc_manager_quit();
+}
+
+
+int main(int argc, char *argv[])
+{
+
+       void *handle = NULL;
+       guint id = 0;
+       gboolean use_daemon = FALSE;
+       GOptionContext *option_context;
+       GError *error = NULL;
+
+       option_context = g_option_context_new("Nfc manager");
+       g_option_context_add_main_entries(option_context, option_entries, NULL);
+
+       if (g_option_context_parse(option_context, &argc, &argv, &error) == FALSE)
+       {
+               DEBUG_ERR_MSG("can not parse option: %s", error->message);
+               g_error_free(error);
+
+               g_option_context_free(option_context);
+               return 0;
+       }
+
+       DEBUG_SERVER_MSG("start nfc manager");
+       DEBUG_SERVER_MSG("use_daemon : %d", use_daemon);
+
+       net_nfc_manager_init_log();
+
+       net_nfc_app_util_clean_storage(MESSAGE_STORAGE);
+
+       handle = net_nfc_controller_onload();
+       if (handle == NULL)
+       {
+               DEBUG_ERR_MSG("load plugin library is failed");
+
+               if (vconf_set_bool(VCONFKEY_NFC_FEATURE, VCONFKEY_NFC_FEATURE_OFF) != 0)
+                       DEBUG_ERR_MSG("VCONFKEY_NFC_FEATURE set to %d failed", VCONFKEY_NFC_FEATURE_OFF);
+
+               if (vconf_set_bool(VCONFKEY_NFC_STATE, 0) != 0)
+                       DEBUG_ERR_MSG("VCONFKEY_NFC_STATE set to %d failed", 0);
+
+               goto EXIT;
+       }
+
+       if (vconf_set_bool(VCONFKEY_NFC_FEATURE, VCONFKEY_NFC_FEATURE_ON) != 0)
+               DEBUG_ERR_MSG("VCONFKEY_NFC_FEATURE set to %d failed", VCONFKEY_NFC_FEATURE_ON);
+
+       id = g_bus_own_name(G_BUS_TYPE_SYSTEM,
+                       "org.tizen.NetNfcService",
+                       G_BUS_NAME_OWNER_FLAGS_NONE,
+                       on_bus_acquired,
+                       on_name_acquired,
+                       on_name_lost,
+                       NULL,
+                       NULL);
+
+       loop = g_main_loop_new(NULL, FALSE);
+       g_main_loop_run(loop);
+
+EXIT :
+       net_nfc_server_vconf_deinit();
+       net_nfc_server_controller_deinit();
+       net_nfc_server_gdbus_deinit();
+
+       if (id)
+               g_bus_unown_name(id);
+
+       net_nfc_controller_unload(handle);
+
+       net_nfc_manager_fini_log();
+
+       g_option_context_free(option_context);
+
+       return 0;
+}
\ No newline at end of file
similarity index 90%
rename from src/manager/include/net_nfc_server.h
rename to daemon/net_nfc_server.h
index 98de4a5..972fc84 100644 (file)
 #ifndef __NET_NFC_SERVER_H__
 #define __NET_NFC_SERVER_H__
 
-void net_nfc_server_gdbus_init(void);
+pid_t net_nfc_server_gdbus_get_pid(const char *name);
 
-void net_nfc_server_gdbus_deinit(void);
+void net_nfc_manager_quit();
 
-pid_t net_nfc_server_gdbus_get_pid(const char *name);
 
 #endif //__NET_NFC_SERVER_H__
similarity index 90%
rename from src/manager/net_nfc_server_common.c
rename to daemon/net_nfc_server_common.c
index 35e52aa..051a287 100644 (file)
@@ -18,9 +18,9 @@
 
 #include "net_nfc_debug_internal.h"
 #include "net_nfc_util_internal.h"
-#include "net_nfc_manager.h"
-#include "net_nfc_manager_util_internal.h"
-#include "net_nfc_controller_internal.h"
+#include "net_nfc_server.h"
+#include "net_nfc_server_util.h"
+#include "net_nfc_server_controller.h"
 #include "net_nfc_server_common.h"
 #include "net_nfc_server_tag.h"
 #include "net_nfc_server_llcp.h"
@@ -42,13 +42,13 @@ static void controller_async_queue_free_func(gpointer user_data);
 static void controller_thread_deinit_thread_func(gpointer user_data);
 
 static void controller_target_detected_cb(void *info,
-                               void *user_context);
+               void *user_context);
 
 static void controller_se_transaction_cb(void *info,
-                               void *user_context);
+               void *user_context);
 
 static void controller_llcp_event_cb(void *info,
-                               void *user_context);
+               void *user_context);
 
 static void controller_init_thread_func(gpointer user_data);
 
@@ -103,7 +103,7 @@ static void controller_thread_deinit_thread_func(gpointer user_data)
 
 /* FIXME: it works as broadcast only now */
 static void controller_target_detected_cb(void *info,
-                               void *user_context)
+               void *user_context)
 {
        net_nfc_request_target_detected_t *req =
                (net_nfc_request_target_detected_t *)info;
@@ -120,7 +120,7 @@ static void controller_target_detected_cb(void *info,
 
                if (req->devType != NET_NFC_UNKNOWN_TARGET) {
                        if (req->devType == NET_NFC_NFCIP1_TARGET ||
-                               req->devType == NET_NFC_NFCIP1_INITIATOR) {
+                                       req->devType == NET_NFC_NFCIP1_INITIATOR) {
                                /* llcp target detected */
                                net_nfc_server_llcp_target_detected(info);
                        } else {
@@ -139,7 +139,7 @@ static void controller_target_detected_cb(void *info,
 
 /* FIXME : net_nfc_dispatcher_queue_push() need to be removed */
 static void controller_se_transaction_cb(void *info,
-                               void *user_context)
+               void *user_context)
 {
        net_nfc_request_se_event_t *req = (net_nfc_request_se_event_t *)info;
 
@@ -164,7 +164,7 @@ static void controller_se_transaction_cb(void *info,
 
 /* FIXME : net_nfc_dispatcher_queue_push() need to be removed */
 static void controller_llcp_event_cb(void *info,
-                               void *user_context)
+               void *user_context)
 {
        net_nfc_request_llcp_msg_t *req_llcp_msg;
        net_nfc_request_msg_t *req_msg;
@@ -235,9 +235,9 @@ static void controller_init_thread_func(gpointer user_data)
                        result);
 
        if (net_nfc_controller_register_listener(controller_target_detected_cb,
-                                               controller_se_transaction_cb,
-                                               controller_llcp_event_cb,
-                                               &result) == false)
+                               controller_se_transaction_cb,
+                               controller_llcp_event_cb,
+                               &result) == false)
        {
                DEBUG_ERR_MSG("%s failed [%d]",
                                "net_nfc_contorller_register_listener",
@@ -261,8 +261,8 @@ static void controller_deinit_thread_func(gpointer user_data)
        net_nfc_error_e result;
 
        net_nfc_controller_configure_discovery(NET_NFC_DISCOVERY_MODE_CONFIG,
-                                       NET_NFC_ALL_DISABLE,
-                                       &result);
+                       NET_NFC_ALL_DISABLE,
+                       &result);
 
        net_nfc_server_free_target_info();
 
@@ -306,9 +306,9 @@ static void restart_polling_loop_thread_func(gpointer user_data)
        if (pm_state == VCONFKEY_PM_STATE_NORMAL)
        {
                if (net_nfc_controller_configure_discovery(
-                                               NET_NFC_DISCOVERY_MODE_CONFIG,
-                                               NET_NFC_ALL_ENABLE,
-                                               &result) == true)
+                                       NET_NFC_DISCOVERY_MODE_CONFIG,
+                                       NET_NFC_ALL_ENABLE,
+                                       &result) == true)
                {
                        DEBUG_SERVER_MSG("polling enable");
                }
@@ -319,9 +319,9 @@ static void restart_polling_loop_thread_func(gpointer user_data)
        if (pm_state == VCONFKEY_PM_STATE_LCDOFF)
        {
                if (net_nfc_controller_configure_discovery(
-                                               NET_NFC_DISCOVERY_MODE_CONFIG,
-                                               NET_NFC_ALL_DISABLE,
-                                               &result) == true)
+                                       NET_NFC_DISCOVERY_MODE_CONFIG,
+                                       NET_NFC_ALL_DISABLE,
+                                       &result) == true)
                {
                        DEBUG_SERVER_MSG("polling disabled");
                }
@@ -335,12 +335,12 @@ gboolean net_nfc_server_controller_thread_init(void)
        GError *error = NULL;
 
        controller_async_queue = g_async_queue_new_full(
-                                       controller_async_queue_free_func);
+                       controller_async_queue_free_func);
 
        controller_thread = g_thread_try_new("controller_thread",
-                                       controller_thread_func,
-                                       NULL,
-                                       &error);
+                       controller_thread_func,
+                       NULL,
+                       &error);
 
        if (controller_thread == NULL)
        {
@@ -356,8 +356,8 @@ gboolean net_nfc_server_controller_thread_init(void)
 void net_nfc_server_controller_thread_deinit(void)
 {
        if(net_nfc_server_controller_async_queue_push(
-                                       controller_thread_deinit_thread_func,
-                                       NULL)==FALSE)
+                               controller_thread_deinit_thread_func,
+                               NULL)==FALSE)
        {
                DEBUG_ERR_MSG("Failed to push onto the queue");
        }
@@ -372,8 +372,8 @@ void net_nfc_server_controller_thread_deinit(void)
 void net_nfc_server_controller_init(void)
 {
        if(net_nfc_server_controller_async_queue_push(
-                                       controller_init_thread_func,
-                                       NULL)==FALSE)
+                               controller_init_thread_func,
+                               NULL)==FALSE)
        {
                DEBUG_ERR_MSG("Failed to push onto the queue");
        }
@@ -383,14 +383,14 @@ void net_nfc_server_controller_init(void)
 void net_nfc_server_controller_deinit(void)
 {
        net_nfc_server_controller_async_queue_push(
-                                       controller_deinit_thread_func,
-                                       NULL);
+                       controller_deinit_thread_func,
+                       NULL);
 }
 #endif
 
 gboolean net_nfc_server_controller_async_queue_push(
-                                       net_nfc_server_controller_func func,
-                                       gpointer user_data)
+               net_nfc_server_controller_func func,
+               gpointer user_data)
 {
        ControllerFuncData *func_data;
 
@@ -412,8 +412,8 @@ gboolean net_nfc_server_controller_async_queue_push(
 void net_nfc_server_restart_polling_loop(void)
 {
        if(net_nfc_server_controller_async_queue_push(
-                                       restart_polling_loop_thread_func,
-                                       NULL) == FALSE)
+                               restart_polling_loop_thread_func,
+                               NULL) == FALSE)
        {
                DEBUG_ERR_MSG("Failed to push onto the queue");
        }
similarity index 90%
rename from src/manager/net_nfc_server_context.c
rename to daemon/net_nfc_server_context.c
index 2576db7..b13941b 100644 (file)
 #include "security-server.h"
 #endif
 
-#include "net_nfc_manager.h"
+#include "net_nfc_server.h"
 #include "net_nfc_debug_internal.h"
 #include "net_nfc_util_internal.h"
 #include "net_nfc_util_defines.h"
 #include "net_nfc_util_gdbus_internal.h"
 #include "net_nfc_server.h"
-#include "net_nfc_server_context_internal.h"
+#include "net_nfc_server_context.h"
 
 
 static GHashTable *client_contexts;
@@ -69,9 +69,9 @@ void net_nfc_server_gdbus_deinit_client_context()
 
 /* TODO */
 bool net_nfc_server_gdbus_check_privilege(GDBusMethodInvocation *invocation,
-       GVariant *privilege,
-       const char *object,
-       const char *right)
+               GVariant *privilege,
+               const char *object,
+               const char *right)
 {
 #ifdef SECURITY_SERVER
        data_s priv = { NULL, 0 };
@@ -91,8 +91,8 @@ bool net_nfc_server_gdbus_check_privilege(GDBusMethodInvocation *invocation,
        if (result < 0) {
                DEBUG_ERR_MSG("permission denied : \"%s\", \"%s\"", object, right);
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.Privilege",
-                       "Permission denied");
+                               "org.tizen.NetNfcService.Privilege",
+                               "Permission denied");
 
                return false;
        }
@@ -124,7 +124,7 @@ size_t net_nfc_server_gdbus_get_client_count()
 }
 
 net_nfc_client_context_info_t *net_nfc_server_gdbus_get_client_context_no_lock(
-       const char *id)
+               const char *id)
 {
        net_nfc_client_context_info_t *result;
 
@@ -134,7 +134,7 @@ net_nfc_client_context_info_t *net_nfc_server_gdbus_get_client_context_no_lock(
 }
 
 net_nfc_client_context_info_t *net_nfc_server_gdbus_get_client_context(
-       const char *id)
+               const char *id)
 {
        net_nfc_client_context_info_t *result;
 
@@ -148,7 +148,7 @@ net_nfc_client_context_info_t *net_nfc_server_gdbus_get_client_context(
 }
 
 void net_nfc_server_gdbus_add_client_context(const char *id,
-       client_state_e state)
+               client_state_e state)
 {
        pthread_mutex_lock(&context_lock);
 
@@ -172,11 +172,11 @@ void net_nfc_server_gdbus_add_client_context(const char *id,
                        info->launch_popup_state_no_check = NET_NFC_LAUNCH_APP_SELECT;
 
                        g_hash_table_insert(client_contexts,
-                               (gpointer)info->id,
-                               (gpointer)info);
+                                       (gpointer)info->id,
+                                       (gpointer)info);
 
                        DEBUG_SERVER_MSG("current client count = [%d]",
-                               net_nfc_server_gdbus_get_client_count_no_lock());
+                                       net_nfc_server_gdbus_get_client_count_no_lock());
                }
                else
                {
@@ -197,29 +197,29 @@ void net_nfc_server_gdbus_cleanup_client_context(const char *id)
        if (info != NULL)
        {
                DEBUG_SERVER_MSG("clean up client context, [%s, %d]", info->id,
-                       info->pid);
+                               info->pid);
 
                g_hash_table_remove(client_contexts, id);
 
                _cleanup_client_context(info);
 
                DEBUG_SERVER_MSG("current client count = [%d]",
-                       net_nfc_server_gdbus_get_client_count_no_lock());
-
-//             /* TODO : exit when no client */
-//             if (net_nfc_server_gdbus_get_client_count_no_lock() == 0)
-//             {
-//                     /* terminate service */
-//                     net_nfc_manager_quit();
-//             }
+                               net_nfc_server_gdbus_get_client_count_no_lock());
+
+               ///* TODO : exit when no client */
+               //if (net_nfc_server_gdbus_get_client_count_no_lock() == 0)
+               //{
+               //      /* terminate service */
+               //      net_nfc_manager_quit();
+               //}
        }
 
        pthread_mutex_unlock(&context_lock);
 }
 
 void net_nfc_server_gdbus_for_each_client_context(
-       net_nfc_server_gdbus_for_each_client_cb cb,
-       void *user_param)
+               net_nfc_server_gdbus_for_each_client_cb cb,
+               void *user_param)
 {
        GHashTableIter iter;
        char *id;
@@ -232,7 +232,7 @@ void net_nfc_server_gdbus_for_each_client_context(
 
        g_hash_table_iter_init(&iter, client_contexts);
        while (g_hash_table_iter_next(&iter, (gpointer *)&id,
-               (gpointer *)&info) == true) {
+                               (gpointer *)&info) == true) {
                cb(info, user_param);
        }
 
@@ -276,8 +276,8 @@ void net_nfc_server_gdbus_set_client_state(const char *id, client_state_e state)
 }
 
 void net_nfc_server_gdbus_set_launch_state(const char *id,
-       net_nfc_launch_popup_state_e popup_state,
-       net_nfc_launch_popup_check_e check_foreground)
+               net_nfc_launch_popup_state_e popup_state,
+               net_nfc_launch_popup_check_e check_foreground)
 {
        net_nfc_client_context_info_t *info;
 
@@ -296,7 +296,7 @@ void net_nfc_server_gdbus_set_launch_state(const char *id,
 }
 
 net_nfc_launch_popup_state_e net_nfc_server_gdbus_get_launch_state(
-       const char *id)
+               const char *id)
 {
        net_nfc_client_context_info_t *info;
        net_nfc_launch_popup_state_e result = NET_NFC_LAUNCH_APP_SELECT;
@@ -306,7 +306,7 @@ net_nfc_launch_popup_state_e net_nfc_server_gdbus_get_launch_state(
        info = net_nfc_server_gdbus_get_client_context_no_lock(id);
        if (info != NULL) {
                if (info->launch_popup_state_no_check  ==
-                       NET_NFC_NO_LAUNCH_APP_SELECT) {
+                               NET_NFC_NO_LAUNCH_APP_SELECT) {
                        result = NET_NFC_NO_LAUNCH_APP_SELECT;
                } else {
                        result = info->launch_popup_state;
@@ -319,7 +319,7 @@ net_nfc_launch_popup_state_e net_nfc_server_gdbus_get_launch_state(
 }
 
 net_nfc_launch_popup_state_e net_nfc_server_gdbus_get_client_popup_state(
-       pid_t pid)
+               pid_t pid)
 {
        GHashTableIter iter;
        char *id;
@@ -330,9 +330,9 @@ net_nfc_launch_popup_state_e net_nfc_server_gdbus_get_client_popup_state(
 
        g_hash_table_iter_init(&iter, client_contexts);
        while (g_hash_table_iter_next(&iter, (gpointer *)&id,
-               (gpointer *)&temp) == true) {
+                               (gpointer *)&temp) == true) {
                if (temp->launch_popup_state_no_check ==
-                       NET_NFC_NO_LAUNCH_APP_SELECT) {
+                               NET_NFC_NO_LAUNCH_APP_SELECT) {
                        state = NET_NFC_NO_LAUNCH_APP_SELECT;
                        break;
                }
@@ -393,7 +393,7 @@ bool net_nfc_server_gdbus_is_server_busy()
 
                g_hash_table_iter_init(&iter, client_contexts);
                while (g_hash_table_iter_next(&iter, (gpointer *)&id,
-                       (gpointer *)&info) == true) {
+                                       (gpointer *)&info) == true) {
                        if (info->ref_se > 0) {
                                result = true;
                                break;
similarity index 94%
rename from src/manager/include/net_nfc_server_context_internal.h
rename to daemon/net_nfc_server_context.h
index dbe3b91..12b5473 100644 (file)
@@ -13,8 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __NET_NFC_SERVER_CONTEXT_INTERNAL_H__
-#define __NET_NFC_SERVER_CONTEXT_INTERNAL_H__
+#ifndef __NET_NFC_SERVER_CONTEXT_H__
+#define __NET_NFC_SERVER_CONTEXT_H__
 
 #include <unistd.h>
 #include <glib.h>
@@ -86,4 +86,4 @@ void net_nfc_server_gdbus_decrease_se_count(const char *id);
 
 bool net_nfc_server_gdbus_is_server_busy();
 
-#endif //__NET_NFC_SERVER_CONTEXT_INTERNAL_H__
+#endif //__NET_NFC_SERVER_CONTEXT_H__
\ No newline at end of file
similarity index 90%
rename from src/manager/net_nfc_controller.c
rename to daemon/net_nfc_server_controller.c
index 8c26233..c2686a2 100644 (file)
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#define _GNU_SOURCE
 #include <linux/limits.h>
 #include <stdio.h>
 #include <dlfcn.h>
@@ -26,7 +27,7 @@
 #include <pmapi.h>/*for pm lock*/
 
 #include "net_nfc_oem_controller.h"
-#include "net_nfc_controller_internal.h"
+#include "net_nfc_server_controller.h"
 #include "net_nfc_util_internal.h"
 #include "net_nfc_debug_internal.h"
 #include "net_nfc_server_tag.h"
@@ -38,7 +39,7 @@
 static net_nfc_oem_interface_s g_interface;
 
 static void *net_nfc_controller_load_file(const char *dir_path,
-                                       const char *filename)
+               const char *filename)
 {
        void *handle = NULL;
        char path[PATH_MAX] = { '\0' };
@@ -65,7 +66,7 @@ static void *net_nfc_controller_load_file(const char *dir_path,
        if (handle == NULL) {
                char buffer[1024];
                DEBUG_ERR_MSG("dlopen failed, [%d] : %s",
-                       errno, strerror_r(errno, buffer, sizeof(buffer)));
+                               errno, strerror_r(errno, buffer, sizeof(buffer)));
                goto ERROR;
        }
 
@@ -73,7 +74,7 @@ static void *net_nfc_controller_load_file(const char *dir_path,
        if (onload == NULL) {
                char buffer[1024];
                DEBUG_ERR_MSG("dlsym failed, [%d] : %s",
-                       errno, strerror_r(errno, buffer, sizeof(buffer)));
+                               errno, strerror_r(errno, buffer, sizeof(buffer)));
                goto ERROR;
        }
 
@@ -85,7 +86,7 @@ static void *net_nfc_controller_load_file(const char *dir_path,
 
        if (net_nfc_controller_support_nfc(&result) == false) {
                DEBUG_ERR_MSG("net_nfc_controller_support_nfc failed, [%d]",
-                       result);
+                               result);
                goto ERROR;
        }
 
@@ -132,7 +133,7 @@ void *net_nfc_controller_onload()
                        continue;
 
                handle = net_nfc_controller_load_file(NFC_MANAGER_MODULEDIR,
-                                               dir->d_name);
+                               dir->d_name);
                if (handle)
                {
                        SECURE_LOGD("Successfully loaded : %s",
@@ -146,7 +147,7 @@ void *net_nfc_controller_onload()
 
        /* load default plugin */
        handle = net_nfc_controller_load_file(NFC_MANAGER_MODULEDIR,
-                                       NET_NFC_DEFAULT_PLUGIN);
+                       NET_NFC_DEFAULT_PLUGIN);
 
        if (handle)
        {
@@ -202,7 +203,7 @@ bool net_nfc_controller_deinit(void)
 }
 
 bool net_nfc_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)
+               se_transaction_listener_cb se_transaction_listener, llcp_event_listener_cb llcp_event_listener, net_nfc_error_e *result)
 {
        if (g_interface.register_listener != NULL)
        {
@@ -333,6 +334,8 @@ bool net_nfc_controller_secure_element_open(net_nfc_secure_element_type_e elemen
 
        ret_val = pm_lock_state(LCD_NORMAL, GOTO_STATE_NOW, 0);
 
+       DEBUG_SERVER_MSG("pm_lock_state [%d]!!", ret_val);
+
        if (g_interface.secure_element_open != NULL)
        {
                return g_interface.secure_element_open(element_type, handle, result);
@@ -378,6 +381,7 @@ bool net_nfc_controller_secure_element_close(net_nfc_target_handle_s *handle, ne
        int ret_val = 0;
 
        ret_val = pm_unlock_state(LCD_NORMAL, PM_RESET_TIMER);
+       DEBUG_SERVER_MSG("pm_unlock_state [%d]!!", ret_val);
 
        if (g_interface.secure_element_close != NULL)
        {
@@ -475,7 +479,8 @@ bool net_nfc_controller_read_ndef(net_nfc_target_handle_s *handle, data_s **data
        }
 }
 
-bool net_nfc_controller_write_ndef(net_nfc_target_handle_s *handle, data_s *data, net_nfc_error_e *result)
+bool net_nfc_controller_write_ndef(net_nfc_target_handle_s *handle, data_s *data,
+       net_nfc_error_e *result)
 {
        if (g_interface.write_ndef != NULL)
        {
@@ -489,7 +494,8 @@ bool net_nfc_controller_write_ndef(net_nfc_target_handle_s *handle, data_s *data
        }
 }
 
-bool net_nfc_controller_make_read_only_ndef(net_nfc_target_handle_s *handle, net_nfc_error_e *result)
+bool net_nfc_controller_make_read_only_ndef(net_nfc_target_handle_s *handle,
+       net_nfc_error_e *result)
 {
        if (g_interface.make_read_only_ndef != NULL)
        {
@@ -503,7 +509,8 @@ bool net_nfc_controller_make_read_only_ndef(net_nfc_target_handle_s *handle, net
        }
 }
 
-bool net_nfc_controller_format_ndef(net_nfc_target_handle_s *handle, data_s *secure_key, net_nfc_error_e *result)
+bool net_nfc_controller_format_ndef(net_nfc_target_handle_s *handle,
+       data_s *secure_key, net_nfc_error_e *result)
 {
        if (g_interface.format_ndef != NULL)
        {
@@ -517,7 +524,8 @@ bool net_nfc_controller_format_ndef(net_nfc_target_handle_s *handle, data_s *sec
        }
 }
 
-bool net_nfc_controller_transceive(net_nfc_target_handle_s *handle, net_nfc_transceive_info_s *info, data_s **data, net_nfc_error_e *result)
+bool net_nfc_controller_transceive(net_nfc_target_handle_s *handle,
+       net_nfc_transceive_info_s *info, data_s **data, net_nfc_error_e *result)
 {
        if (g_interface.transceive != NULL)
        {
@@ -558,7 +566,8 @@ bool net_nfc_controller_is_ready(net_nfc_error_e *result)
        }
 }
 
-bool net_nfc_controller_llcp_config(net_nfc_llcp_config_info_s *config, net_nfc_error_e *result)
+bool net_nfc_controller_llcp_config(net_nfc_llcp_config_info_s *config,
+       net_nfc_error_e *result)
 {
        if (g_interface.config_llcp != NULL)
        {
@@ -571,7 +580,8 @@ bool net_nfc_controller_llcp_config(net_nfc_llcp_config_info_s *config, net_nfc_
                return false;
        }
 }
-bool net_nfc_controller_llcp_check_llcp(net_nfc_target_handle_s *handle, net_nfc_error_e *result)
+bool net_nfc_controller_llcp_check_llcp(net_nfc_target_handle_s *handle,
+       net_nfc_error_e *result)
 {
        if (g_interface.check_llcp_status != NULL)
        {
@@ -584,7 +594,8 @@ bool net_nfc_controller_llcp_check_llcp(net_nfc_target_handle_s *handle, net_nfc
                return false;
        }
 }
-bool net_nfc_controller_llcp_activate_llcp(net_nfc_target_handle_s *handle, net_nfc_error_e *result)
+bool net_nfc_controller_llcp_activate_llcp(net_nfc_target_handle_s *handle,
+       net_nfc_error_e *result)
 {
        if (g_interface.activate_llcp != NULL)
        {
@@ -619,7 +630,7 @@ socket_info_t *_get_socket_info(net_nfc_llcp_socket_t socket)
        GSList *item;
 
        item = g_slist_find_custom(llcp_sockets, GUINT_TO_POINTER(socket),
-               _compare_socket_info);
+                       _compare_socket_info);
        if (item != NULL) {
                result = (socket_info_t *)item->data;
        } else {
@@ -648,26 +659,15 @@ static void _remove_socket_info(net_nfc_llcp_socket_t socket)
        GSList *item;
 
        item = g_slist_find_custom(llcp_sockets, GUINT_TO_POINTER(socket),
-               _compare_socket_info);
+                       _compare_socket_info);
        if (item != NULL) {
                llcp_sockets = g_slist_remove_link(llcp_sockets, item);
                free(item->data);
        }
 }
 
-static void _destroy_function(gpointer data)
-{
-       free(data);
-}
-
-static void _clear_socket_info()
-{
-       g_slist_free_full(llcp_sockets, _destroy_function);
-       llcp_sockets = NULL;
-}
-
 void net_nfc_controller_llcp_socket_error_cb(net_nfc_llcp_socket_t socket,
-       net_nfc_error_e result, void *data, void *user_param)
+               net_nfc_error_e result, void *data, void *user_param)
 {
        socket_info_t *info;
 
@@ -681,7 +681,9 @@ void net_nfc_controller_llcp_socket_error_cb(net_nfc_llcp_socket_t socket,
        }
 }
 
-bool net_nfc_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, net_nfc_service_llcp_cb cb, void *user_param)
+bool net_nfc_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,
+               net_nfc_service_llcp_cb cb, void *user_param)
 {
        if (g_interface.create_llcp_socket != NULL)
        {
@@ -714,7 +716,8 @@ bool net_nfc_controller_llcp_create_socket(net_nfc_llcp_socket_t *socket, net_nf
        }
 }
 
-bool net_nfc_controller_llcp_bind(net_nfc_llcp_socket_t socket, uint8_t service_access_point, net_nfc_error_e *result)
+bool net_nfc_controller_llcp_bind(net_nfc_llcp_socket_t socket,
+               uint8_t service_access_point, net_nfc_error_e *result)
 {
        if (g_interface.bind_llcp_socket != NULL)
        {
@@ -729,7 +732,7 @@ bool net_nfc_controller_llcp_bind(net_nfc_llcp_socket_t socket, uint8_t service_
 }
 
 void net_nfc_controller_llcp_incoming_cb(net_nfc_llcp_socket_t socket,
-       net_nfc_error_e result, void *data, void *user_param)
+               net_nfc_error_e result, void *data, void *user_param)
 {
        socket_info_t *info = (socket_info_t *)user_param;
 
@@ -738,7 +741,7 @@ void net_nfc_controller_llcp_incoming_cb(net_nfc_llcp_socket_t socket,
                if (_add_socket_info(socket) != NULL) {
                        if (info->work_cb != NULL) {
                                info->work_cb(socket, result, NULL, NULL,
-                                       info->work_param);
+                                               info->work_param);
                        }
                } else {
                        DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
@@ -746,7 +749,9 @@ void net_nfc_controller_llcp_incoming_cb(net_nfc_llcp_socket_t socket,
        }
 }
 
-bool net_nfc_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, net_nfc_service_llcp_cb cb, void *user_param)
+bool net_nfc_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,
+               net_nfc_service_llcp_cb cb, void *user_param)
 {
        if (g_interface.listen_llcp_socket != NULL)
        {
@@ -772,7 +777,8 @@ bool net_nfc_controller_llcp_listen(net_nfc_target_handle_s* handle, uint8_t *se
        }
 }
 
-bool net_nfc_controller_llcp_accept(net_nfc_llcp_socket_t socket, net_nfc_error_e *result, net_nfc_service_llcp_cb cb, void *user_param)
+bool net_nfc_controller_llcp_accept(net_nfc_llcp_socket_t socket,
+               net_nfc_error_e *result, net_nfc_service_llcp_cb cb, void *user_param)
 {
        if (g_interface.accept_llcp_socket != NULL)
        {
@@ -798,7 +804,8 @@ bool net_nfc_controller_llcp_accept(net_nfc_llcp_socket_t socket, net_nfc_error_
        }
 }
 
-bool net_nfc_controller_llcp_reject(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, net_nfc_error_e *result)
+bool net_nfc_controller_llcp_reject(net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket, net_nfc_error_e *result)
 {
        if (g_interface.reject_llcp != NULL)
        {
@@ -820,7 +827,7 @@ bool net_nfc_controller_llcp_reject(net_nfc_target_handle_s *handle, net_nfc_llc
 }
 
 void net_nfc_controller_llcp_connected_cb(net_nfc_llcp_socket_t socket,
-       net_nfc_error_e result, void *data, void *user_param)
+               net_nfc_error_e result, void *data, void *user_param)
 {
        net_nfc_llcp_param_t *param = (net_nfc_llcp_param_t *)user_param;
 
@@ -834,7 +841,9 @@ void net_nfc_controller_llcp_connected_cb(net_nfc_llcp_socket_t socket,
        _net_nfc_util_free_mem(param);
 }
 
-bool net_nfc_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, net_nfc_service_llcp_cb cb, void *user_param)
+bool net_nfc_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,
+               net_nfc_service_llcp_cb cb, void *user_param)
 {
        int ret_val = 0;
 
@@ -867,7 +876,9 @@ bool net_nfc_controller_llcp_connect_by_url(net_nfc_target_handle_s *handle, net
        }
 }
 
-bool net_nfc_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, net_nfc_service_llcp_cb cb, void *user_param)
+bool net_nfc_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,
+               net_nfc_service_llcp_cb cb, void *user_param)
 {
        int ret_val = 0;
 
@@ -901,7 +912,7 @@ bool net_nfc_controller_llcp_connect(net_nfc_target_handle_s *handle, net_nfc_ll
 }
 
 void net_nfc_controller_llcp_disconnected_cb(net_nfc_llcp_socket_t socket,
-       net_nfc_error_e result, void *data, void *user_param)
+               net_nfc_error_e result, void *data, void *user_param)
 {
        net_nfc_llcp_param_t *param = (net_nfc_llcp_param_t *)user_param;
 
@@ -915,7 +926,9 @@ void net_nfc_controller_llcp_disconnected_cb(net_nfc_llcp_socket_t socket,
        _net_nfc_util_free_mem(param);
 }
 
-bool net_nfc_controller_llcp_disconnect(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, net_nfc_error_e *result, net_nfc_service_llcp_cb cb, void *user_param)
+bool net_nfc_controller_llcp_disconnect(net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket, net_nfc_error_e *result, net_nfc_service_llcp_cb cb,
+               void *user_param)
 {
        int ret_val = 0;
 
@@ -948,7 +961,8 @@ bool net_nfc_controller_llcp_disconnect(net_nfc_target_handle_s *handle, net_nfc
        }
 }
 
-bool net_nfc_controller_llcp_socket_close(net_nfc_llcp_socket_t socket, net_nfc_error_e *result)
+bool net_nfc_controller_llcp_socket_close(net_nfc_llcp_socket_t socket,
+               net_nfc_error_e *result)
 {
        if (g_interface.close_llcp_socket != NULL)
        {
@@ -963,7 +977,7 @@ bool net_nfc_controller_llcp_socket_close(net_nfc_llcp_socket_t socket, net_nfc_
 }
 
 void net_nfc_controller_llcp_received_cb(net_nfc_llcp_socket_t socket,
-       net_nfc_error_e result, void *data, void *user_param)
+               net_nfc_error_e result, void *data, void *user_param)
 {
        net_nfc_llcp_param_t *param = (net_nfc_llcp_param_t *)user_param;
 
@@ -980,7 +994,9 @@ void net_nfc_controller_llcp_received_cb(net_nfc_llcp_socket_t socket,
        _net_nfc_util_free_mem(param);
 }
 
-bool net_nfc_controller_llcp_recv(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, uint32_t max_len, net_nfc_error_e *result, net_nfc_service_llcp_cb cb, void *user_param)
+bool net_nfc_controller_llcp_recv(net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket, uint32_t max_len, net_nfc_error_e *result,
+               net_nfc_service_llcp_cb cb, void *user_param)
 {
        if (g_interface.recv_llcp != NULL)
        {
@@ -1018,7 +1034,7 @@ bool net_nfc_controller_llcp_recv(net_nfc_target_handle_s *handle, net_nfc_llcp_
 }
 
 void net_nfc_controller_llcp_sent_cb(net_nfc_llcp_socket_t socket,
-       net_nfc_error_e result, void *data, void *user_param)
+               net_nfc_error_e result, void *data, void *user_param)
 {
        net_nfc_llcp_param_t *param = (net_nfc_llcp_param_t *)user_param;
 
@@ -1032,7 +1048,9 @@ void net_nfc_controller_llcp_sent_cb(net_nfc_llcp_socket_t socket,
        _net_nfc_util_free_mem(param);
 }
 
-bool net_nfc_controller_llcp_send(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, data_s *data, net_nfc_error_e *result, net_nfc_service_llcp_cb cb, void *user_param)
+bool net_nfc_controller_llcp_send(net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket, data_s *data, net_nfc_error_e *result,
+               net_nfc_service_llcp_cb cb, void *user_param)
 {
        if (g_interface.send_llcp != NULL)
        {
@@ -1058,7 +1076,9 @@ bool net_nfc_controller_llcp_send(net_nfc_target_handle_s *handle, net_nfc_llcp_
                return false;
        }
 }
-bool net_nfc_controller_llcp_recv_from(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, uint32_t max_len, net_nfc_error_e *result, net_nfc_service_llcp_cb cb, void *user_param)
+bool net_nfc_controller_llcp_recv_from(net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket, uint32_t max_len, net_nfc_error_e *result,
+               net_nfc_service_llcp_cb cb, void *user_param)
 {
        if (g_interface.recv_from_llcp != NULL)
        {
@@ -1094,7 +1114,9 @@ bool net_nfc_controller_llcp_recv_from(net_nfc_target_handle_s *handle, net_nfc_
                return false;
        }
 }
-bool net_nfc_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, net_nfc_service_llcp_cb cb, void *user_param)
+bool net_nfc_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, net_nfc_service_llcp_cb cb, void *user_param)
 {
        if (g_interface.send_to_llcp != NULL)
        {
@@ -1121,7 +1143,8 @@ bool net_nfc_controller_llcp_send_to(net_nfc_target_handle_s *handle, net_nfc_ll
        }
 }
 
-bool net_nfc_controller_llcp_get_remote_config(net_nfc_target_handle_s *handle, net_nfc_llcp_config_info_s *config, net_nfc_error_e *result)
+bool net_nfc_controller_llcp_get_remote_config(net_nfc_target_handle_s *handle,
+               net_nfc_llcp_config_info_s *config, net_nfc_error_e *result)
 {
        if (g_interface.get_remote_config != NULL)
        {
@@ -1134,7 +1157,8 @@ bool net_nfc_controller_llcp_get_remote_config(net_nfc_target_handle_s *handle,
                return false;
        }
 }
-bool net_nfc_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)
+bool net_nfc_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)
 {
        if (g_interface.get_remote_socket_info != NULL)
        {
@@ -1219,7 +1243,8 @@ bool net_nfc_controller_support_nfc(net_nfc_error_e *result)
        }
 }
 
-bool net_nfc_controller_eedata_register_set(net_nfc_error_e *result, uint32_t mode, uint32_t reg_id, data_s *data)
+bool net_nfc_controller_eedata_register_set(net_nfc_error_e *result,
+               uint32_t mode, uint32_t reg_id, data_s *data)
 {
        if (g_interface.eedata_register_set != NULL)
        {
similarity index 98%
rename from src/manager/include/net_nfc_controller_internal.h
rename to daemon/net_nfc_server_controller.h
index 4b59e2b..5de272b 100644 (file)
@@ -13,8 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __NET_NFC_CONTROLLER_INTERNAL_H__
-#define __NET_NFC_CONTROLLER_INTERNAL_H__
+#ifndef __NET_NFC_SERVER_CONTROLLER_H__
+#define __NET_NFC_SERVER_CONTROLLER_H__
 
 #include "net_nfc_typedef_internal.h"
 
@@ -105,4 +105,4 @@ bool net_nfc_controller_eedata_register_set(net_nfc_error_e *result , uint32_t m
 socket_info_t *_get_socket_info(net_nfc_llcp_socket_t socket);
 socket_info_t *_add_socket_info(net_nfc_llcp_socket_t socket);
 
-#endif //__NET_NFC_CONTROLLER_INTERNAL_H__
+#endif //__NET_NFC_SERVER_CONTROLLER_H__
\ No newline at end of file
similarity index 80%
rename from src/manager/net_nfc_server_handover.c
rename to daemon/net_nfc_server_handover.c
index 0466e20..ea08f21 100644 (file)
 #include "net_nfc_server_process_handover.h"
 #include "net_nfc_server_handover.h"
 #include "net_nfc_debug_internal.h"
-#include "net_nfc_controller_internal.h"
+#include "net_nfc_server_controller.h"
 #include "net_nfc_util_gdbus_internal.h"
-#include "net_nfc_server_context_internal.h"
+#include "net_nfc_server_context.h"
 
 static NetNfcGDbusHandover *handover_skeleton = NULL;
 
 static void handover_request_thread_func(gpointer user_data);
 
 static gboolean handover_handle_request(NetNfcGDbusHandover *hdover,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               gint32 arg_type,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               gint32 arg_type,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static void handover_request_thread_func(gpointer user_data)
 {
@@ -56,9 +56,9 @@ static void handover_request_thread_func(gpointer user_data)
                if (handover_data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               handover_data->invocation,
-                               "org.tizen.NetNfcService.Handover.DataError",
-                               "Handover invocation is NULL");
+                                       handover_data->invocation,
+                                       "org.tizen.NetNfcService.Handover.DataError",
+                                       "Handover invocation is NULL");
 
                        g_object_unref(handover_data->invocation);
                }
@@ -71,15 +71,15 @@ static void handover_request_thread_func(gpointer user_data)
        handle = GUINT_TO_POINTER(handover_data->handle);
 
        if ((error = net_nfc_server_handover_default_client_start(
-                               handle,
-                               (void *)handover_data)) != NET_NFC_OK)
+                                       handle,
+                                       (void *)handover_data)) != NET_NFC_OK)
        {
                if (handover_data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               handover_data->invocation,
-                               "org.tizen.NetNfcService.Handover.SendError",
-                               "handover operation unsuccessfull");
+                                       handover_data->invocation,
+                                       "org.tizen.NetNfcService.Handover.SendError",
+                                       "handover operation unsuccessfull");
 
                        g_object_unref(handover_data->invocation);
                }
@@ -90,22 +90,22 @@ static void handover_request_thread_func(gpointer user_data)
 }
 
 static gboolean handover_handle_request(NetNfcGDbusHandover *hdover,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               gint32 arg_type,
-                               GVariant *smack_privilege,
-                               gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               gint32 arg_type,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        HandoverRequestData *data;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+                               smack_privilege,
+                               "nfc-manager::p2p",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return TRUE;
@@ -116,8 +116,8 @@ static gboolean handover_handle_request(NetNfcGDbusHandover *hdover,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-               "org.tizen.NetNfcService.AllocationError",
-               "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return FALSE;
        }
 
@@ -127,7 +127,7 @@ static gboolean handover_handle_request(NetNfcGDbusHandover *hdover,
        data->invocation = g_object_ref(invocation);
 
        if (net_nfc_server_controller_async_queue_push(
-               handover_request_thread_func, data) == FALSE)
+                               handover_request_thread_func, data) == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.Handover.ThreadError",
similarity index 98%
rename from src/manager/net_nfc_server_handover_bss.c
rename to daemon/net_nfc_server_handover_bss.c
index 835bda1..3f12982 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#include <glib.h>
 
+#include "net_nfc_debug_internal.h"
+#include "net_nfc_util_internal.h"
 #include "net_nfc_util_handover.h"
+#include "net_nfc_util_ndef_message.h"
+#include "net_nfc_util_ndef_record.h"
+#include "net_nfc_server_llcp.h"
 #include "net_nfc_server_handover_bss.h"
 
 static int _net_nfc_handover_bss_process_carrier_record(
similarity index 81%
rename from src/manager/include/net_nfc_server_handover_bss.h
rename to daemon/net_nfc_server_handover_bss.h
index 947a8bd..c1993dd 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 #ifndef __NET_NFC_SERVER_HANDOVER_BSS_H__
 #define __NET_NFC_SERVER_HANDOVER_BSS_H__
-#include <gio/gio.h>
+
 #include <wifi.h>
-#include "net_nfc_debug_internal.h"
-#include "net_nfc_util_internal.h"
-#include "net_nfc_util_ndef_message.h"
-#include "net_nfc_util_ndef_record.h"
-#include "net_nfc_util_handover.h"
-#include "net_nfc_server_handover_internal.h"
-#include "net_nfc_server_llcp.h"
+
+#include "net_nfc_typedef_internal.h"
+#include "net_nfc_server_handover_bt.h"
 
 typedef struct _net_nfc_handover_bss_process_context_t
 {
@@ -44,4 +38,5 @@ net_nfc_error_e net_nfc_server_handover_bss_process_carrier_record(
        ndef_record_s *record,
        net_nfc_server_handover_process_carrier_record_cb cb,
        void *user_param);
+
 #endif //__NET_NFC_SERVER_HANDOVER_BSS_H__
similarity index 81%
rename from src/manager/net_nfc_server_handover_bt.c
rename to daemon/net_nfc_server_handover_bt.c
index 451a9cc..44d79f7 100644 (file)
@@ -20,7 +20,7 @@
 #include "net_nfc_util_ndef_message.h"
 #include "net_nfc_util_ndef_record.h"
 #include "net_nfc_util_handover.h"
-#include "net_nfc_server_handover_internal.h"
+#include "net_nfc_server_handover_bt.h"
 #include "net_nfc_server_llcp.h"
 
 
@@ -51,14 +51,14 @@ net_nfc_handover_bt_process_context_t;
 
 
 static int _net_nfc_handover_bt_get_carrier_record(
-                       net_nfc_handover_bt_get_context_t *context);
+               net_nfc_handover_bt_get_context_t *context);
 static int _net_nfc_handover_bt_process_carrier_record(
-                       net_nfc_handover_bt_process_context_t *context);
+               net_nfc_handover_bt_process_context_t *context);
 
 
 static net_nfc_error_e _net_nfc_handover_bt_get_oob_data(
-                       net_nfc_carrier_config_s *config,
-                       bt_oob_data_t *oob)
+               net_nfc_carrier_config_s *config,
+               bt_oob_data_t *oob)
 {
        net_nfc_error_e result = NET_NFC_UNKNOWN_ERROR;
        data_s hash = { NULL, 0 };
@@ -112,7 +112,7 @@ static net_nfc_error_e _net_nfc_handover_bt_get_oob_data(
                else
                {
                        DEBUG_ERR_MSG("randomizer.length error :"
-                               " [%d] bytes", randomizer.length);
+                                       " [%d] bytes", randomizer.length);
                }
        }
 
@@ -122,9 +122,9 @@ static net_nfc_error_e _net_nfc_handover_bt_get_oob_data(
 }
 
 static void _net_nfc_handover_bt_get_carrier_config_cb(
-                       int event,
-                       bluetooth_event_param_t *param,
-                       void *user_data)
+               int event,
+               bluetooth_event_param_t *param,
+               void *user_data)
 {
        net_nfc_handover_bt_get_context_t *context =
                (net_nfc_handover_bt_get_context_t *)user_data;
@@ -158,7 +158,7 @@ static void _net_nfc_handover_bt_get_carrier_config_cb(
 
        default :
                DEBUG_SERVER_MSG("unhandled bt event [%d],"
-                       "[0x%04x]", event, param->result);
+                               "[0x%04x]", event, param->result);
                break;
        }
 
@@ -166,7 +166,7 @@ static void _net_nfc_handover_bt_get_carrier_config_cb(
 }
 
 static net_nfc_error_e _net_nfc_handover_bt_create_config_record(
-                       ndef_record_s **record)
+               ndef_record_s **record)
 {
        bluetooth_device_address_t bt_addr = { { 0, } };
        net_nfc_carrier_config_s *config = NULL;
@@ -177,21 +177,21 @@ static net_nfc_error_e _net_nfc_handover_bt_create_config_record(
                        == BLUETOOTH_ERROR_NONE)
        {
                if ((result = net_nfc_util_create_carrier_config(
-                               &config,
-                               NET_NFC_CONN_HANDOVER_CARRIER_BT)) == NET_NFC_OK)
+                                               &config,
+                                               NET_NFC_CONN_HANDOVER_CARRIER_BT)) == NET_NFC_OK)
                {
                        bt_oob_data_t oob = { { 0 }, };
 
                        NET_NFC_REVERSE_ORDER_6_BYTES(bt_addr.addr);
 
                        if ((result = net_nfc_util_add_carrier_config_property(
-                                       config,
-                                       NET_NFC_BT_ATTRIBUTE_ADDRESS,
-                                       sizeof(bt_addr.addr), bt_addr.addr)) != NET_NFC_OK)
+                                                       config,
+                                                       NET_NFC_BT_ATTRIBUTE_ADDRESS,
+                                                       sizeof(bt_addr.addr), bt_addr.addr)) != NET_NFC_OK)
                        {
                                DEBUG_ERR_MSG("net_nfc_util_add_carrier"
-                                       "_config_property failed"
-                                       "[%d]", result);
+                                               "_config_property failed"
+                                               "[%d]", result);
                        }
 
                        /* get oob data */
@@ -200,34 +200,34 @@ static net_nfc_error_e _net_nfc_handover_bt_create_config_record(
                                if (oob.hash_len == 16 && oob.randomizer_len == 16)
                                {
                                        DEBUG_SERVER_MSG("oob.hash_len "
-                                               "[%d]", oob.hash_len);
+                                                       "[%d]", oob.hash_len);
                                        DEBUG_SERVER_MSG("oob.randomizer_len"
-                                               " [%d]", oob.randomizer_len);
+                                                       " [%d]", oob.randomizer_len);
 
                                        NET_NFC_REVERSE_ORDER_16_BYTES(oob.hash);
 
                                        if ((result =
-                                               net_nfc_util_add_carrier_config_property(
-                                                       config,
-                                                       NET_NFC_BT_ATTRIBUTE_OOB_HASH_C,
-                                                       oob.hash_len, oob.hash)) != NET_NFC_OK)
+                                                               net_nfc_util_add_carrier_config_property(
+                                                                       config,
+                                                                       NET_NFC_BT_ATTRIBUTE_OOB_HASH_C,
+                                                                       oob.hash_len, oob.hash)) != NET_NFC_OK)
                                        {
                                                DEBUG_ERR_MSG("net_nfc_util_add_carrier"
-                                                       "_config_property failed"
-                                                       " [%d]",result);
+                                                               "_config_property failed"
+                                                               " [%d]",result);
                                        }
 
                                        NET_NFC_REVERSE_ORDER_16_BYTES(oob.randomizer);
 
                                        if ((result = net_nfc_util_add_carrier_config_property(
-                                                       config,
-                                                       NET_NFC_BT_ATTRIBUTE_OOB_HASH_R,
-                                                       oob.randomizer_len,
-                                                       oob.randomizer)) != NET_NFC_OK)
+                                                                       config,
+                                                                       NET_NFC_BT_ATTRIBUTE_OOB_HASH_R,
+                                                                       oob.randomizer_len,
+                                                                       oob.randomizer)) != NET_NFC_OK)
                                        {
                                                DEBUG_ERR_MSG("net_nfc_util_add_carrier"
-                                                       "_config_property failed"
-                                                       " [%d]",result);
+                                                               "_config_property failed"
+                                                               " [%d]",result);
                                        }
                                }
                                else
@@ -237,12 +237,12 @@ static net_nfc_error_e _net_nfc_handover_bt_create_config_record(
                        }
 
                        if ((result = net_nfc_util_create_ndef_record_with_carrier_config(
-                                       record,
-                                       config)) != NET_NFC_OK)
+                                                       record,
+                                                       config)) != NET_NFC_OK)
                        {
                                DEBUG_ERR_MSG("net_nfc_util_create_ndef_record"
-                                       "_with_carrier_config failed"
-                                       "[%d]",result);
+                                               "_with_carrier_config failed"
+                                               "[%d]",result);
                        }
 
                        net_nfc_util_free_carrier_config(config);
@@ -250,13 +250,13 @@ static net_nfc_error_e _net_nfc_handover_bt_create_config_record(
                else
                {
                        DEBUG_ERR_MSG("net_nfc_util_create_carrier_config failed "
-                               "[%d]", result);
+                                       "[%d]", result);
                }
        }
        else
        {
                DEBUG_ERR_MSG("bluetooth_get_local_address failed"
-                       " [%d]", result);
+                               " [%d]", result);
                result = NET_NFC_OPERATION_FAIL;
        }
 
@@ -264,14 +264,14 @@ static net_nfc_error_e _net_nfc_handover_bt_create_config_record(
 }
 
 static int _net_nfc_handover_bt_get_carrier_record(
-                       net_nfc_handover_bt_get_context_t *context)
+               net_nfc_handover_bt_get_context_t *context)
 {
        LOGD("[%s:%d] START", __func__, __LINE__);
 
        if (context->result != NET_NFC_OK && context->result != NET_NFC_BUSY)
        {
                DEBUG_ERR_MSG("context->result is error"
-                       " [%d]", context->result);
+                               " [%d]", context->result);
 
                context->step = NET_NFC_LLCP_STEP_RETURN;
        }
@@ -282,8 +282,8 @@ static int _net_nfc_handover_bt_get_carrier_record(
                DEBUG_MSG("STEP [1]");
 
                if (bluetooth_register_callback(
-                       _net_nfc_handover_bt_get_carrier_config_cb,
-                       context) >= BLUETOOTH_ERROR_NONE)
+                                       _net_nfc_handover_bt_get_carrier_config_cb,
+                                       context) >= BLUETOOTH_ERROR_NONE)
                {
                        context->step = NET_NFC_LLCP_STEP_02;
                        context->result = NET_NFC_OK;
@@ -298,8 +298,8 @@ static int _net_nfc_handover_bt_get_carrier_record(
 
                                /* do next step */
                                g_idle_add((GSourceFunc)
-                                       _net_nfc_handover_bt_get_carrier_record,
-                                       (gpointer)context);
+                                               _net_nfc_handover_bt_get_carrier_record,
+                                               (gpointer)context);
                        }
                }
                else
@@ -310,8 +310,8 @@ static int _net_nfc_handover_bt_get_carrier_record(
                        context->result = NET_NFC_OPERATION_FAIL;
 
                        g_idle_add((GSourceFunc)
-                               _net_nfc_handover_bt_get_carrier_record,
-                               (gpointer)context);
+                                       _net_nfc_handover_bt_get_carrier_record,
+                                       (gpointer)context);
                }
                break;
 
@@ -322,17 +322,17 @@ static int _net_nfc_handover_bt_get_carrier_record(
 
                /* append config to ndef message */
                if ((context->result =
-                       _net_nfc_handover_bt_create_config_record(
-                               &context->carrier)) != NET_NFC_OK)
+                                       _net_nfc_handover_bt_create_config_record(
+                                               &context->carrier)) != NET_NFC_OK)
                {
                        DEBUG_ERR_MSG("_ch_create_bt_config_record failed"
-                               "[%d]", context->result);
+                                       "[%d]", context->result);
                }
 
                /* complete and return to upper step */
                g_idle_add((GSourceFunc)
-                       _net_nfc_handover_bt_get_carrier_record,
-                       (gpointer)context);
+                               _net_nfc_handover_bt_get_carrier_record,
+                               (gpointer)context);
                break;
 
        case NET_NFC_LLCP_STEP_RETURN :
@@ -343,11 +343,11 @@ static int _net_nfc_handover_bt_get_carrier_record(
 
                /* complete and return to upper step */
                context->cb(context->result,
-                       context->cps,
-                       context->carrier,
-                       context->aux_data_count,
-                       context->aux_data,
-                       context->user_param);
+                               context->cps,
+                               context->carrier,
+                               context->aux_data_count,
+                               context->aux_data,
+                               context->user_param);
                break;
 
        default :
@@ -376,7 +376,7 @@ net_nfc_error_e net_nfc_server_handover_bt_get_carrier_record(
                context->cps = NET_NFC_CONN_HANDOVER_CARRIER_ACTIVATE;
 
                g_idle_add((GSourceFunc)_net_nfc_handover_bt_get_carrier_record,
-                       (gpointer)context);
+                               (gpointer)context);
        }
        else
        {
@@ -405,7 +405,7 @@ static bool _net_nfc_handover_bt_check_bond_device(
                bluetooth_device_info_t *ptr;
 
                DEBUG_SERVER_MSG("g pointer array count :"
-                       " [%d]", devinfo->len);
+                               " [%d]", devinfo->len);
 
                for (i = 0; i < devinfo->len; i++)
                {
@@ -414,23 +414,23 @@ static bool _net_nfc_handover_bt_check_bond_device(
                        {
                                SECURE_LOGD("Name [%s]", ptr->device_name.name);
                                DEBUG_SERVER_MSG("Major Class [%d]",
-                                       ptr->device_class.major_class);
+                                               ptr->device_class.major_class);
                                DEBUG_SERVER_MSG("Minor Class [%d]",
-                                       ptr->device_class.minor_class);
+                                               ptr->device_class.minor_class);
                                DEBUG_SERVER_MSG("Service Class [%d]",
-                                       ptr->device_class.service_class);
+                                               ptr->device_class.service_class);
                                DEBUG_SERVER_MSG("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
-                                       ptr->device_address.addr[0],
-                                       ptr->device_address.addr[1],
-                                       ptr->device_address.addr[2],
-                                       ptr->device_address.addr[3],
-                                       ptr->device_address.addr[4],
-                                       ptr->device_address.addr[5]);
+                                               ptr->device_address.addr[0],
+                                               ptr->device_address.addr[1],
+                                               ptr->device_address.addr[2],
+                                               ptr->device_address.addr[3],
+                                               ptr->device_address.addr[4],
+                                               ptr->device_address.addr[5]);
 
                                /* compare selector address */
                                if (memcmp(&(ptr->device_address),
-                                       address,
-                                       sizeof(ptr->device_address)) == 0)
+                                                       address,
+                                                       sizeof(ptr->device_address)) == 0)
                                {
                                        DEBUG_SERVER_MSG("Found!!!");
                                        result = true;
@@ -442,7 +442,7 @@ static bool _net_nfc_handover_bt_check_bond_device(
        else
        {
                DEBUG_ERR_MSG("bluetooth_get_bonded_device_list failed with"
-                       " [%d]", ret);
+                               " [%d]", ret);
        }
 
        /* free g_pointer_array */
@@ -524,7 +524,7 @@ static int _net_nfc_handover_bt_process_carrier_record(
        if (context->result != NET_NFC_OK && context->result != NET_NFC_BUSY)
        {
                DEBUG_ERR_MSG("context->result is error"
-                       " [%d]", context->result);
+                               " [%d]", context->result);
                context->step = NET_NFC_LLCP_STEP_RETURN;
        }
 
@@ -534,8 +534,8 @@ static int _net_nfc_handover_bt_process_carrier_record(
                DEBUG_MSG("STEP [1]");
 
                if (bluetooth_register_callback(
-                               _net_nfc_handover_bt_process_carrier_record_cb,
-                               context) >= BLUETOOTH_ERROR_NONE)
+                                       _net_nfc_handover_bt_process_carrier_record_cb,
+                                       context) >= BLUETOOTH_ERROR_NONE)
                {
                        /* next step */
                        context->step = NET_NFC_LLCP_STEP_02;
@@ -552,8 +552,8 @@ static int _net_nfc_handover_bt_process_carrier_record(
                                context->result = NET_NFC_OK;
 
                                g_idle_add((GSourceFunc)
-                                       _net_nfc_handover_bt_process_carrier_record,
-                                       (gpointer)context);
+                                               _net_nfc_handover_bt_process_carrier_record,
+                                               (gpointer)context);
                        }
                }
                else
@@ -562,8 +562,8 @@ static int _net_nfc_handover_bt_process_carrier_record(
                        context->result = NET_NFC_OPERATION_FAIL;
 
                        g_idle_add(
-                               (GSourceFunc)_net_nfc_handover_bt_process_carrier_record,
-                               (gpointer)context);
+                                       (GSourceFunc)_net_nfc_handover_bt_process_carrier_record,
+                                       (gpointer)context);
                }
                break;
 
@@ -579,8 +579,8 @@ static int _net_nfc_handover_bt_process_carrier_record(
                                        context->carrier);
 
                        net_nfc_util_get_carrier_config_property(config,
-                               NET_NFC_BT_ATTRIBUTE_ADDRESS,
-                               (uint16_t *)&temp.length, &temp.buffer);
+                                       NET_NFC_BT_ATTRIBUTE_ADDRESS,
+                                       (uint16_t *)&temp.length, &temp.buffer);
 
                        if (temp.length == 6)
                        {
@@ -589,19 +589,19 @@ static int _net_nfc_handover_bt_process_carrier_record(
                                memcpy(context->addr.addr,
                                                temp.buffer,
                                                MIN(sizeof(context->addr.addr),
-                                               temp.length));
+                                                       temp.length));
 
                                if (_net_nfc_handover_bt_check_bond_device
-                                                       (&context->addr) == true)
+                                               (&context->addr) == true)
                                {
                                        DEBUG_SERVER_MSG("already paired with"
-                                               " [%02x:%02x:%02x:%02x:%02x:%02x]",
-                                               context->addr.addr[0],
-                                               context->addr.addr[1],
-                                               context->addr.addr[2],
-                                               context->addr.addr[3],
-                                               context->addr.addr[4],
-                                               context->addr.addr[5]);
+                                                       " [%02x:%02x:%02x:%02x:%02x:%02x]",
+                                                       context->addr.addr[0],
+                                                       context->addr.addr[1],
+                                                       context->addr.addr[2],
+                                                       context->addr.addr[3],
+                                                       context->addr.addr[4],
+                                                       context->addr.addr[5]);
 
                                        /* return */
                                        context->step = NET_NFC_LLCP_STEP_RETURN;
@@ -612,8 +612,8 @@ static int _net_nfc_handover_bt_process_carrier_record(
                                        bt_oob_data_t oob = { { 0 } , };
 
                                        if (_net_nfc_handover_bt_get_oob_data(
-                                                       config,
-                                                       &oob) == NET_NFC_OK)
+                                                               config,
+                                                               &oob) == NET_NFC_OK)
                                        {
                                                /* set oob data */
                                                bluetooth_oob_add_remote_data(
@@ -629,7 +629,7 @@ static int _net_nfc_handover_bt_process_carrier_record(
                        else
                        {
                                DEBUG_ERR_MSG("bluetooth address is invalid."
-                                       " [%d] bytes", temp.length);
+                                               " [%d] bytes", temp.length);
 
                                context->step = NET_NFC_LLCP_STEP_RETURN;
                                context->result = NET_NFC_OPERATION_FAIL;
@@ -638,8 +638,8 @@ static int _net_nfc_handover_bt_process_carrier_record(
                        net_nfc_util_free_carrier_config(config);
 
                        g_idle_add(
-                               (GSourceFunc)_net_nfc_handover_bt_process_carrier_record,
-                               (gpointer)context);
+                                       (GSourceFunc)_net_nfc_handover_bt_process_carrier_record,
+                                       (gpointer)context);
                }
                break;
 
@@ -653,9 +653,9 @@ static int _net_nfc_handover_bt_process_carrier_record(
                        bluetooth_unregister_callback();
 
                        context->cb(context->result,
-                               NET_NFC_CONN_HANDOVER_CARRIER_BT,
-                               &data,
-                               context->user_param);
+                                       NET_NFC_CONN_HANDOVER_CARRIER_BT,
+                                       &data,
+                                       context->user_param);
                }
                break;
 
@@ -669,9 +669,9 @@ static int _net_nfc_handover_bt_process_carrier_record(
 }
 
 net_nfc_error_e net_nfc_server_handover_bt_process_carrier_record(
-       ndef_record_s *record,
-       net_nfc_server_handover_process_carrier_record_cb cb,
-       void *user_param)
+               ndef_record_s *record,
+               net_nfc_server_handover_process_carrier_record_cb cb,
+               void *user_param)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_handover_bt_process_context_t *context = NULL;
@@ -683,11 +683,11 @@ net_nfc_error_e net_nfc_server_handover_bt_process_carrier_record(
                context->user_param = user_param;
                context->step = NET_NFC_LLCP_STEP_01;
                net_nfc_util_create_record(record->TNF, &record->type_s,
-                       &record->id_s, &record->payload_s, &context->carrier);
+                               &record->id_s, &record->payload_s, &context->carrier);
 
                g_idle_add(
-                       (GSourceFunc)_net_nfc_handover_bt_process_carrier_record,
-                       (gpointer)context);
+                               (GSourceFunc)_net_nfc_handover_bt_process_carrier_record,
+                               (gpointer)context);
        }
        else
        {
@@ -698,7 +698,7 @@ net_nfc_error_e net_nfc_server_handover_bt_process_carrier_record(
 }
 
 static void _net_nfc_handover_bt_post_process_cb(int event,
-       bluetooth_event_param_t *param, void *user_data)
+               bluetooth_event_param_t *param, void *user_data)
 {
        net_nfc_handover_bt_process_context_t *context =
                (net_nfc_handover_bt_process_context_t *)user_data;
@@ -724,7 +724,7 @@ static void _net_nfc_handover_bt_post_process_cb(int event,
 
        case BLUETOOTH_EVENT_BONDING_FINISHED :
                DEBUG_SERVER_MSG("BLUETOOTH_EVENT_BONDING_FINISHED,"
-                       " result [0x%04x]",param->result);
+                               " result [0x%04x]",param->result);
 
                if (param->result < BLUETOOTH_ERROR_NONE)
                {
@@ -737,14 +737,14 @@ static void _net_nfc_handover_bt_post_process_cb(int event,
                }
 
                context->cb(context->result,
-                       NET_NFC_CONN_HANDOVER_CARRIER_BT,
-                       NULL,
-                       context->user_param);
+                               NET_NFC_CONN_HANDOVER_CARRIER_BT,
+                               NULL,
+                               context->user_param);
                break;
 
        default :
                DEBUG_SERVER_MSG("unhandled bt event"
-                       " [%d], [0x%04x]", event, param->result);
+                               " [%d], [0x%04x]", event, param->result);
                break;
        }
 
@@ -752,9 +752,9 @@ static void _net_nfc_handover_bt_post_process_cb(int event,
 }
 
 net_nfc_error_e net_nfc_server_handover_bt_post_process(
-       data_s *data,
-       net_nfc_server_handover_process_carrier_record_cb cb,
-       void *user_param)
+               data_s *data,
+               net_nfc_server_handover_process_carrier_record_cb cb,
+               void *user_param)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_handover_bt_process_context_t *context = NULL;
@@ -770,8 +770,8 @@ net_nfc_error_e net_nfc_server_handover_bt_post_process(
                memcpy(&bt_addr.addr, data->buffer, sizeof(bt_addr.addr));
 
                if (bluetooth_register_callback(
-                       _net_nfc_handover_bt_post_process_cb,
-                       context) >= BLUETOOTH_ERROR_NONE)
+                                       _net_nfc_handover_bt_post_process_cb,
+                                       context) >= BLUETOOTH_ERROR_NONE)
                {
                        bluetooth_bond_device(&bt_addr);
                }
similarity index 73%
rename from src/manager/include/net_nfc_server_handover_internal.h
rename to daemon/net_nfc_server_handover_bt.h
index b7e90af..1b0909f 100644 (file)
@@ -13,8 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __NET_NFC_SERVER_HANDOVER_INTERNAL_H__
-#define __NET_NFC_SERVER_HANDOVER_INTERNAL_H__
+#ifndef __NET_NFC_SERVER_HANDOVER_BT_H__
+#define __NET_NFC_SERVER_HANDOVER_BT_H__
 
 #include "net_nfc_typedef_internal.h"
 
@@ -32,7 +32,6 @@ typedef void (*net_nfc_server_handover_process_carrier_record_cb)(
                        data_s *data,
                        void *user_param);
 
-
 /* alternative carrier functions */
 net_nfc_error_e net_nfc_server_handover_bt_get_carrier_record(
        net_nfc_server_handover_get_carrier_record_cb cb, void *user_param);
@@ -41,18 +40,8 @@ net_nfc_error_e net_nfc_server_handover_bt_process_carrier_record(
        ndef_record_s *record, net_nfc_server_handover_process_carrier_record_cb cb,
        void *user_param);
 
-net_nfc_error_e net_nfc_server_handover_bt_post_process(
-       data_s *data, net_nfc_server_handover_process_carrier_record_cb cb,
+net_nfc_error_e net_nfc_server_handover_bt_post_process(data_s *data,
+       net_nfc_server_handover_process_carrier_record_cb cb,
        void *user_param);
 
-
-
-/* handover server/client functions */
-net_nfc_error_e net_nfc_server_handover_default_server_start(
-       net_nfc_target_handle_s *handle);
-
-net_nfc_error_e net_nfc_server_handover_default_client_start(
-       net_nfc_target_handle_s *handle,
-       void *user_data);
-
-#endif //__NET_NFC_SERVER_HANDOVER_INTERNAL_H__
+#endif //__NET_NFC_SERVER_HANDOVER_BT_H__
similarity index 76%
rename from src/manager/net_nfc_server_llcp.c
rename to daemon/net_nfc_server_llcp.c
index 6ebcb42..094ab65 100644 (file)
@@ -26,9 +26,9 @@
 #include "net_nfc_server_tag.h"
 
 #include "net_nfc_debug_internal.h"
-#include "net_nfc_controller_internal.h"
+#include "net_nfc_server_controller.h"
 #include "net_nfc_util_gdbus_internal.h"
-#include "net_nfc_server_context_internal.h"
+#include "net_nfc_server_context.h"
 
 /* default llcp configurations */
 #define NET_NFC_LLCP_MIU       128
@@ -205,55 +205,55 @@ struct _LlcpSimpleData
 
 
 static void llcp_add_async_queue(net_nfc_request_msg_t *req_msg,
-                               net_nfc_server_controller_func func);
+               net_nfc_server_controller_func func);
 
 static void llcp_socket_error_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param);
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param);
 
 static void llcp_listen_cb(net_nfc_llcp_socket_t socket,
-                       net_nfc_error_e result,
-                       data_s *data,
-                       void *extra,
-                       void *user_param);
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param);
 
 static void llcp_connect_by_url_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param);
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param);
 
 static void llcp_connect_cb(net_nfc_llcp_socket_t socket,
-                       net_nfc_error_e result,
-                       data_s *data,
-                       void *extra,
-                       void *user_param);
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param);
 
 static void llcp_send_cb(net_nfc_llcp_socket_t socket,
-                       net_nfc_error_e result,
-                       data_s *data,
-                       void *extra,
-                       void *user_param);
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param);
 
 static void llcp_receive_cb(net_nfc_llcp_socket_t socket,
-                       net_nfc_error_e result,
-                       data_s *data,
-                       void *extra,
-                       void *user_param);
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param);
 
 static void llcp_receive_from_cb(net_nfc_llcp_socket_t socket,
-                       net_nfc_error_e result,
-                       data_s *data,
-                       void *extra,
-                       void *user_param);
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param);
 
 static void llcp_disconnect_cb(net_nfc_llcp_socket_t socket,
-                       net_nfc_error_e result,
-                       data_s *data,
-                       void *extra,
-                       void *user_param);
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param);
 
 /* client method */
 static void llcp_handle_config_thread_func(gpointer user_data);
@@ -278,100 +278,100 @@ static void llcp_handle_disconnect_thread_func(gpointer user_data);
 
 /* methods */
 static gboolean llcp_handle_config(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               GVariant *arg_config,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               GVariant *arg_config,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean llcp_handle_listen(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               guint16 arg_miu,
-                               guint8 arg_rw,
-                               gint32 arg_type,
-                               guint8 arg_sap,
-                               const gchar *arg_service_name,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               guint16 arg_miu,
+               guint8 arg_rw,
+               gint32 arg_type,
+               guint8 arg_sap,
+               const gchar *arg_service_name,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean llcp_handle_connect(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               guint16 arg_miu,
-                               guint8 arg_rw,
-                               gint32 arg_type,
-                               const gchar *arg_service_name,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               guint16 arg_miu,
+               guint8 arg_rw,
+               gint32 arg_type,
+               const gchar *arg_service_name,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean llcp_handle_connect_sap(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               guint16 arg_miu,
-                               guint8 arg_rw,
-                               gint32 arg_type,
-                               guint8 arg_sap,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               guint16 arg_miu,
+               guint8 arg_rw,
+               gint32 arg_type,
+               guint8 arg_sap,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean llcp_handle_send(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               GVariant *arg_data,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               GVariant *arg_data,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean llcp_handle_send_to(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               guint8 arg_sap,
-                               GVariant *arg_data,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               guint8 arg_sap,
+               GVariant *arg_data,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean llcp_handle_receive(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               guint32 arg_req_length,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               guint32 arg_req_length,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean llcp_handle_receive_from(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               guint32 arg_req_length,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               guint32 arg_req_length,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean llcp_handle_close(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean llcp_handle_disconnect(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 
 /* server side */
@@ -393,44 +393,44 @@ static void llcp_disconnect_thread_func(gpointer user_data);
 
 /* simple */
 static void llcp_simple_socket_error_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param);
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param);
 
 static void llcp_simple_listen_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param);
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param);
 
 static void llcp_simple_connect_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param);
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param);
 
 static void llcp_simple_server_error_cb(net_nfc_llcp_socket_t socket,
-                                       net_nfc_error_e result,
-                                       data_s *data,
-                                       void *extra,
-                                       void *user_param);
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param);
 
 static void llcp_simple_send_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param);
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param);
 
 static void llcp_simple_receive_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param);
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param);
 
 
 static void llcp_add_async_queue(net_nfc_request_msg_t *req_msg,
-                               net_nfc_server_controller_func func)
+               net_nfc_server_controller_func func)
 {
        ServerLlcpData *data = NULL;
 
@@ -469,10 +469,10 @@ static void llcp_add_async_queue(net_nfc_request_msg_t *req_msg,
 }
 
 static void llcp_socket_error_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param)
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        LlcpData *llcp_data;
 
@@ -495,10 +495,10 @@ static void llcp_socket_error_cb(net_nfc_llcp_socket_t socket,
 }
 
 static void llcp_listen_cb(net_nfc_llcp_socket_t socket,
-                       net_nfc_error_e result,
-                       data_s *data,
-                       void *extra,
-                       void *user_param)
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        LlcpListenData *llcp_data;
 
@@ -513,9 +513,9 @@ static void llcp_listen_cb(net_nfc_llcp_socket_t socket,
                if (llcp_data->invocation)
                {
                        net_nfc_gdbus_llcp_complete_listen(llcp_data->llcp,
-                                               llcp_data->invocation,
-                                               llcp_data->client_socket,
-                                               socket);
+                                       llcp_data->invocation,
+                                       llcp_data->client_socket,
+                                       socket);
                        g_object_unref(llcp_data->invocation);
                }
 
@@ -527,10 +527,10 @@ static void llcp_listen_cb(net_nfc_llcp_socket_t socket,
 }
 
 static void llcp_connect_by_url_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param)
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        LlcpConnectData *llcp_data;
 
@@ -545,9 +545,9 @@ static void llcp_connect_by_url_cb(net_nfc_llcp_socket_t socket,
                if (llcp_data->invocation)
                {
                        net_nfc_gdbus_llcp_complete_connect(llcp_data->llcp,
-                                               llcp_data->invocation,
-                                               llcp_data->client_socket,
-                                               socket);
+                                       llcp_data->invocation,
+                                       llcp_data->client_socket,
+                                       socket);
                        g_object_unref(llcp_data->invocation);
                }
 
@@ -559,10 +559,10 @@ static void llcp_connect_by_url_cb(net_nfc_llcp_socket_t socket,
 }
 
 static void llcp_connect_cb(net_nfc_llcp_socket_t socket,
-                       net_nfc_error_e result,
-                       data_s *data,
-                       void *extra,
-                       void *user_param)
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        LlcpConnectSapData *llcp_data;
 
@@ -577,10 +577,10 @@ static void llcp_connect_cb(net_nfc_llcp_socket_t socket,
                if (llcp_data->invocation)
                {
                        net_nfc_gdbus_llcp_complete_connect_sap(
-                                               llcp_data->llcp,
-                                               llcp_data->invocation,
-                                               llcp_data->client_socket,
-                                               socket);
+                                       llcp_data->llcp,
+                                       llcp_data->invocation,
+                                       llcp_data->client_socket,
+                                       socket);
                        g_object_unref(llcp_data->invocation);
                }
 
@@ -591,10 +591,10 @@ static void llcp_connect_cb(net_nfc_llcp_socket_t socket,
 }
 
 static void llcp_send_cb(net_nfc_llcp_socket_t socket,
-                       net_nfc_error_e result,
-                       data_s *data,
-                       void *extra,
-                       void *user_param)
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        LlcpData *llcp_data;
 
@@ -609,9 +609,9 @@ static void llcp_send_cb(net_nfc_llcp_socket_t socket,
                if (llcp_data->invocation)
                {
                        net_nfc_gdbus_llcp_complete_send(
-                                                       llcp_data->llcp,
-                                                       llcp_data->invocation,
-                                                       socket);
+                                       llcp_data->llcp,
+                                       llcp_data->invocation,
+                                       socket);
                        g_object_unref(llcp_data->invocation);
                }
 
@@ -622,10 +622,10 @@ static void llcp_send_cb(net_nfc_llcp_socket_t socket,
 }
 
 static void llcp_receive_cb(net_nfc_llcp_socket_t socket,
-                       net_nfc_error_e result,
-                       data_s *data,
-                       void *extra,
-                       void *user_param)
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        LlcpData *llcp_data;
 
@@ -642,9 +642,9 @@ static void llcp_receive_cb(net_nfc_llcp_socket_t socket,
 
                        variant = net_nfc_util_gdbus_data_to_variant(data);
                        net_nfc_gdbus_llcp_complete_receive(
-                                                       llcp_data->llcp,
-                                                       llcp_data->invocation,
-                                                       variant);
+                                       llcp_data->llcp,
+                                       llcp_data->invocation,
+                                       variant);
 
                        g_object_unref(llcp_data->invocation);
                }
@@ -656,10 +656,10 @@ static void llcp_receive_cb(net_nfc_llcp_socket_t socket,
 }
 
 static void llcp_receive_from_cb(net_nfc_llcp_socket_t socket,
-                       net_nfc_error_e result,
-                       data_s *data,
-                       void *extra,
-                       void *user_param)
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        LlcpData *llcp_data;
 
@@ -677,10 +677,10 @@ static void llcp_receive_from_cb(net_nfc_llcp_socket_t socket,
 
                        variant = net_nfc_util_gdbus_data_to_variant(data);
                        net_nfc_gdbus_llcp_complete_receive_from(
-                                                       llcp_data->llcp,
-                                                       llcp_data->invocation,
-                                                       (guint8) (int)extra,
-                                                       variant);
+                                       llcp_data->llcp,
+                                       llcp_data->invocation,
+                                       (guint8) (int)extra,
+                                       variant);
 
                        g_object_unref(llcp_data->invocation);
                }
@@ -693,10 +693,10 @@ static void llcp_receive_from_cb(net_nfc_llcp_socket_t socket,
 
 
 static void llcp_disconnect_cb(net_nfc_llcp_socket_t socket,
-                       net_nfc_error_e result,
-                       data_s *data,
-                       void *extra,
-                       void *user_param)
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        LlcpData *llcp_data;
 
@@ -711,9 +711,9 @@ static void llcp_disconnect_cb(net_nfc_llcp_socket_t socket,
                if (llcp_data->invocation)
                {
                        net_nfc_gdbus_llcp_complete_disconnect(
-                                                       llcp_data->llcp,
-                                                       llcp_data->invocation,
-                                                       socket);
+                                       llcp_data->llcp,
+                                       llcp_data->invocation,
+                                       socket);
 
                        g_object_unref(llcp_data->invocation);
                }
@@ -745,9 +745,9 @@ static void llcp_handle_config_thread_func(gpointer user_data)
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ConfigError",
-                               "can not get llcp");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ConfigError",
+                                       "can not get llcp");
 
                        g_object_unref(data->invocation);
                }
@@ -766,9 +766,9 @@ static void llcp_handle_config_thread_func(gpointer user_data)
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ConfigError",
-                               "can not get llcp");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ConfigError",
+                                       "can not get llcp");
 
                        g_object_unref(data->invocation);
                }
@@ -781,7 +781,7 @@ static void llcp_handle_config_thread_func(gpointer user_data)
        if (data->invocation)
        {
                net_nfc_gdbus_llcp_complete_config(data->llcp,
-                                               data->invocation);
+                               data->invocation);
 
                g_object_unref(data->invocation);
        }
@@ -814,9 +814,9 @@ static void llcp_handle_listen_thread_func(gpointer user_data)
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ListenError",
-                               "can not get llcp");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ListenError",
+                                       "can not get llcp");
 
                        g_object_unref(data->invocation);
                }
@@ -832,30 +832,30 @@ static void llcp_handle_listen_thread_func(gpointer user_data)
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(data->invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return;
        }
        error_data->llcp = g_object_ref(data->llcp);
        error_data->invocation = g_object_ref(data->invocation);
 
        if (net_nfc_controller_llcp_create_socket(&socket,
-                                               data->type,
-                                               data->miu,
-                                               data->rw,
-                                               &result,
-                                               llcp_socket_error_cb,
-                                               error_data) == false)
+                               data->type,
+                               data->miu,
+                               data->rw,
+                               &result,
+                               llcp_socket_error_cb,
+                               error_data) == false)
        {
                DEBUG_ERR_MSG("%s fiailed [%d]",
-                       "net_nfc_controller_llcp_create_socket" ,result);
+                               "net_nfc_controller_llcp_create_socket" ,result);
 
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ListenError",
-                               "can not create socket");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ListenError",
+                                       "can not create socket");
 
                        g_object_unref(data->invocation);
                }
@@ -871,18 +871,18 @@ static void llcp_handle_listen_thread_func(gpointer user_data)
        }
 
        if (net_nfc_controller_llcp_bind(socket,
-                                       data->sap,
-                                       &result) == false)
+                               data->sap,
+                               &result) == false)
        {
                DEBUG_ERR_MSG("%s fiailed [%d]",
-                       "net_nfc_controller_llcp_create_socket" ,result);
+                               "net_nfc_controller_llcp_create_socket" ,result);
 
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ListenError",
-                               "can not bind socket");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ListenError",
+                                       "can not bind socket");
 
                        g_object_unref(data->invocation);
                }
@@ -903,11 +903,11 @@ static void llcp_handle_listen_thread_func(gpointer user_data)
        DEBUG_SERVER_MSG("OAL socket in Listen : %d\n", socket);
 
        if (net_nfc_controller_llcp_listen(GUINT_TO_POINTER(data->handle),
-                                       (uint8_t *)data->service_name,
-                                       socket,
-                                       &result,
-                                       llcp_listen_cb,
-                                       data) == false)
+                               (uint8_t *)data->service_name,
+                               socket,
+                               &result,
+                               llcp_listen_cb,
+                               data) == false)
        {
                DEBUG_ERR_MSG("%s failed [%d]",
                                "net_nfc_controller_llcp_listen",
@@ -916,9 +916,9 @@ static void llcp_handle_listen_thread_func(gpointer user_data)
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ListenError",
-                               "can not listen socket");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ListenError",
+                                       "can not listen socket");
 
                        g_object_unref(data->invocation);
                }
@@ -957,9 +957,9 @@ static void llcp_handle_connect_thread_func(gpointer user_data)
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ConnectError",
-                               "can not get llcp");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ConnectError",
+                                       "can not get llcp");
 
                        g_object_unref(data->invocation);
                }
@@ -975,30 +975,30 @@ static void llcp_handle_connect_thread_func(gpointer user_data)
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(data->invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return;
        }
        error_data->llcp = g_object_ref(data->llcp);
        error_data->invocation = g_object_ref(data->invocation);
 
        if (net_nfc_controller_llcp_create_socket(&socket,
-                                               data->type,
-                                               data->miu,
-                                               data->rw,
-                                               &result,
-                                               llcp_socket_error_cb,
-                                               error_data) == false)
+                               data->type,
+                               data->miu,
+                               data->rw,
+                               &result,
+                               llcp_socket_error_cb,
+                               error_data) == false)
        {
                DEBUG_ERR_MSG("%s fiailed [%d]",
-                       "net_nfc_controller_llcp_create_socket" ,result);
+                               "net_nfc_controller_llcp_create_socket" ,result);
 
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ConnectError",
-                               "can not create socket");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ConnectError",
+                                       "can not create socket");
 
                        g_object_unref(data->invocation);
                }
@@ -1016,23 +1016,23 @@ static void llcp_handle_connect_thread_func(gpointer user_data)
        DEBUG_SERVER_MSG("OAL socket in Listen :%d", socket);
 
        if (net_nfc_controller_llcp_connect_by_url(
-                                               GUINT_TO_POINTER(data->handle),
-                                               socket,
-                                               (uint8_t *)data->service_name,
-                                               &result,
-                                               llcp_connect_by_url_cb,
-                                               data) == false)
+                               GUINT_TO_POINTER(data->handle),
+                               socket,
+                               (uint8_t *)data->service_name,
+                               &result,
+                               llcp_connect_by_url_cb,
+                               data) == false)
        {
                DEBUG_ERR_MSG("%s failed, [%d]",
-                       "net_nfc_controller_llcp_connect_by_url",
-                       result);
+                               "net_nfc_controller_llcp_connect_by_url",
+                               result);
 
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ConnectError",
-                               "can not listen socket");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ConnectError",
+                                       "can not listen socket");
 
                        g_object_unref(data->invocation);
                }
@@ -1071,9 +1071,9 @@ static void llcp_handle_connect_sap_thread_func(gpointer user_data)
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ConnectSapError",
-                               "can not get llcp");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ConnectSapError",
+                                       "can not get llcp");
 
                        g_object_unref(data->invocation);
                }
@@ -1088,30 +1088,30 @@ static void llcp_handle_connect_sap_thread_func(gpointer user_data)
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(data->invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return;
        }
        error_data->llcp = g_object_ref(data->llcp);
        error_data->invocation = g_object_ref(data->invocation);
 
        if (net_nfc_controller_llcp_create_socket(&socket,
-                                               data->type,
-                                               data->miu,
-                                               data->rw,
-                                               &result,
-                                               llcp_socket_error_cb,
-                                               error_data) == false)
+                               data->type,
+                               data->miu,
+                               data->rw,
+                               &result,
+                               llcp_socket_error_cb,
+                               error_data) == false)
        {
                DEBUG_ERR_MSG("%s fiailed [%d]",
-                       "net_nfc_controller_llcp_create_socket" ,result);
+                               "net_nfc_controller_llcp_create_socket" ,result);
 
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ConnectSapError",
-                               "can not create socket");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ConnectSapError",
+                                       "can not create socket");
 
                        g_object_unref(data->invocation);
                }
@@ -1128,22 +1128,22 @@ static void llcp_handle_connect_sap_thread_func(gpointer user_data)
        DEBUG_SERVER_MSG("OAL socket in Listen :%d", socket);
 
        if (net_nfc_controller_llcp_connect(GUINT_TO_POINTER(data->handle),
-                                       socket,
-                                       data->sap,
-                                       &result,
-                                       llcp_connect_cb,
-                                       data) == false)
+                               socket,
+                               data->sap,
+                               &result,
+                               llcp_connect_cb,
+                               data) == false)
        {
                DEBUG_ERR_MSG("%s failed, [%d]",
-                       "net_nfc_controller_llcp_connect",
-                       result);
+                               "net_nfc_controller_llcp_connect",
+                               result);
 
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ConnectSapError",
-                               "can not connect socket");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ConnectSapError",
+                                       "can not connect socket");
 
                        g_object_unref(data->invocation);
                }
@@ -1181,9 +1181,9 @@ static void llcp_handle_send_thread_func(gpointer user_data)
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.SendError",
-                               "can not get llcp");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.SendError",
+                                       "can not get llcp");
 
                        g_object_unref(data->invocation);
                }
@@ -1204,30 +1204,30 @@ static void llcp_handle_send_thread_func(gpointer user_data)
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(data->invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return;
        }
        llcp_data->llcp = g_object_ref(data->llcp);
        llcp_data->invocation = g_object_ref(data->invocation);
 
        if (net_nfc_controller_llcp_send(GUINT_TO_POINTER(data->handle),
-                                       data->oal_socket,
-                                       data->data,
-                                       &result,
-                                       llcp_send_cb,
-                                       llcp_data) == false)
+                               data->oal_socket,
+                               data->data,
+                               &result,
+                               llcp_send_cb,
+                               llcp_data) == false)
        {
                DEBUG_ERR_MSG("%s failed, [%d]",
-                       "net_nfc_controller_llcp_send",
-                       result);
+                               "net_nfc_controller_llcp_send",
+                               result);
 
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.SendError",
-                               "can not send socket");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.SendError",
+                                       "can not send socket");
 
                        g_object_unref(data->invocation);
                }
@@ -1282,9 +1282,9 @@ static void llcp_handle_send_to_thread_func(gpointer user_data)
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.SendToError",
-                               "can not get llcp");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.SendToError",
+                                       "can not get llcp");
 
                        g_object_unref(data->invocation);
                }
@@ -1305,31 +1305,31 @@ static void llcp_handle_send_to_thread_func(gpointer user_data)
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(data->invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return;
        }
        llcp_data->llcp = g_object_ref(data->llcp);
        llcp_data->invocation = g_object_ref(data->invocation);
 
        if (net_nfc_controller_llcp_send_to(GUINT_TO_POINTER(data->handle),
-                                       data->oal_socket,
-                                       data->data,
-                                       data->sap,
-                                       &result,
-                                       llcp_send_cb,
-                                       llcp_data) == false)
+                               data->oal_socket,
+                               data->data,
+                               data->sap,
+                               &result,
+                               llcp_send_cb,
+                               llcp_data) == false)
        {
                DEBUG_ERR_MSG("%s failed, [%d]",
-                       "net_nfc_controller_llcp_send_to",
-                       result);
+                               "net_nfc_controller_llcp_send_to",
+                               result);
 
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.SendToError",
-                               "can not send socket");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.SendToError",
+                                       "can not send socket");
 
                        g_object_unref(data->invocation);
                }
@@ -1384,9 +1384,9 @@ static void llcp_handle_receive_thread_func(gpointer user_data)
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ReceiveError",
-                               "can not get llcp");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ReceiveError",
+                                       "can not get llcp");
 
                        g_object_unref(data->invocation);
                }
@@ -1401,30 +1401,30 @@ static void llcp_handle_receive_thread_func(gpointer user_data)
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(data->invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return;
        }
        llcp_data->llcp = g_object_ref(data->llcp);
        llcp_data->invocation = g_object_ref(data->invocation);
 
        if (net_nfc_controller_llcp_recv(GUINT_TO_POINTER(data->handle),
-                                       data->oal_socket,
-                                       data->req_length,
-                                       &result,
-                                       llcp_receive_cb,
-                                       llcp_data) == false)
+                               data->oal_socket,
+                               data->req_length,
+                               &result,
+                               llcp_receive_cb,
+                               llcp_data) == false)
        {
                DEBUG_ERR_MSG("%s failed, [%d]",
-                       "net_nfc_controller_llcp_receive",
-                       result);
+                               "net_nfc_controller_llcp_receive",
+                               result);
 
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ReceiveError",
-                               "can not receive");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ReceiveError",
+                                       "can not receive");
 
                        g_object_unref(data->invocation);
                }
@@ -1466,9 +1466,9 @@ static void llcp_handle_receive_from_thread_func(gpointer user_data)
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ReceiveFromError",
-                               "can not get llcp");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ReceiveFromError",
+                                       "can not get llcp");
 
                        g_object_unref(data->invocation);
                }
@@ -1483,30 +1483,30 @@ static void llcp_handle_receive_from_thread_func(gpointer user_data)
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(data->invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return;
        }
        llcp_data->llcp = g_object_ref(data->llcp);
        llcp_data->invocation = g_object_ref(data->invocation);
 
        if (net_nfc_controller_llcp_recv_from(GUINT_TO_POINTER(data->handle),
-                                       data->oal_socket,
-                                       data->req_length,
-                                       &result,
-                                       llcp_receive_from_cb,
-                                       llcp_data) == false)
+                               data->oal_socket,
+                               data->req_length,
+                               &result,
+                               llcp_receive_from_cb,
+                               llcp_data) == false)
        {
                DEBUG_ERR_MSG("%s failed, [%d]",
-                       "net_nfc_controller_llcp_receive",
-                       result);
+                               "net_nfc_controller_llcp_receive",
+                               result);
 
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.ReceiveFromError",
-                               "can not receive");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.ReceiveFromError",
+                                       "can not receive");
 
                        g_object_unref(data->invocation);
                }
@@ -1547,9 +1547,9 @@ static void llcp_handle_close_thread_func(gpointer user_data)
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.CloseError",
-                               "can not get llcp");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.CloseError",
+                                       "can not get llcp");
 
                        g_object_unref(data->invocation);
                }
@@ -1560,11 +1560,11 @@ static void llcp_handle_close_thread_func(gpointer user_data)
        }
 
        net_nfc_controller_llcp_socket_close(data->oal_socket,
-                                       &result);
+                       &result);
 
        net_nfc_gdbus_llcp_complete_close(data->llcp,
-                                       data->invocation,
-                                       data->client_socket);
+                       data->invocation,
+                       data->client_socket);
 }
 
 static void llcp_handle_disconnect_thread_func(gpointer user_data)
@@ -1589,9 +1589,9 @@ static void llcp_handle_disconnect_thread_func(gpointer user_data)
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.DisconnectError",
-                               "can not get llcp");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.DisconnectError",
+                                       "can not get llcp");
 
                        g_object_unref(data->invocation);
                }
@@ -1606,7 +1606,7 @@ static void llcp_handle_disconnect_thread_func(gpointer user_data)
                net_nfc_server_free_target_info();
                ret_val = pm_unlock_state(LCD_NORMAL, PM_RESET_TIMER);
                DEBUG_SERVER_MSG("net_nfc_controller_disconnect pm_unlock_state"
-                                               "[%d]!!", ret_val);
+                               "[%d]!!", ret_val);
        }
 
        llcp_data = g_new0(LlcpData, 1);
@@ -1619,21 +1619,21 @@ static void llcp_handle_disconnect_thread_func(gpointer user_data)
        llcp_data->invocation = g_object_ref(data->invocation);
 
        if (net_nfc_controller_llcp_disconnect(GUINT_TO_POINTER(data->handle),
-                                       data->oal_socket,
-                                       &result,
-                                       llcp_disconnect_cb,
-                                       llcp_data) == false)
+                               data->oal_socket,
+                               &result,
+                               llcp_disconnect_cb,
+                               llcp_data) == false)
        {
                DEBUG_ERR_MSG("%s failed, [%d]",
-                       "net_nfc_controller_llcp_receive",
-                       result);
+                               "net_nfc_controller_llcp_receive",
+                               result);
 
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.DisconnectError",
-                               "can not disconnect socket");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.DisconnectError",
+                                       "can not disconnect socket");
 
                        g_object_unref(data->invocation);
                }
@@ -1656,21 +1656,21 @@ static void llcp_handle_disconnect_thread_func(gpointer user_data)
 
 
 static gboolean llcp_handle_config(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               GVariant *arg_config,
-                               GVariant *smack_privilege,
-                               gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               GVariant *arg_config,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        LlcpConfigData *data;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "w") == false) {
+                               smack_privilege,
+                               "nfc-manager::p2p",
+                               "w") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return TRUE;
@@ -1681,19 +1681,19 @@ static gboolean llcp_handle_config(NetNfcGDbusLlcp *llcp,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-               "org.tizen.NetNfcService.AllocationError",
-               "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return FALSE;
        }
        data->llcp = g_object_ref(llcp);
        data->invocation = g_object_ref(invocation);
 
        g_variant_get(arg_config,
-               "(qqyy)",
-               &data->miu,
-               &data->wks,
-               &data->lto,
-               &data->option);
+                       "(qqyy)",
+                       &data->miu,
+                       &data->wks,
+                       &data->lto,
+                       &data->option);
 
        if (net_nfc_server_controller_async_queue_push(
                                llcp_handle_config_thread_func,
@@ -1714,28 +1714,28 @@ static gboolean llcp_handle_config(NetNfcGDbusLlcp *llcp,
 }
 
 static gboolean llcp_handle_listen(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               guint16 arg_miu,
-                               guint8 arg_rw,
-                               gint32 arg_type,
-                               guint8 arg_sap,
-                               const gchar *arg_service_name,
-                               GVariant *smack_privilege,
-                               gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               guint16 arg_miu,
+               guint8 arg_rw,
+               gint32 arg_type,
+               guint8 arg_sap,
+               const gchar *arg_service_name,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        LlcpListenData *data;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+                               smack_privilege,
+                               "nfc-manager::p2p",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return TRUE;
@@ -1746,8 +1746,8 @@ static gboolean llcp_handle_listen(NetNfcGDbusLlcp *llcp,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return FALSE;
        }
        data->llcp = g_object_ref(llcp);
@@ -1782,27 +1782,27 @@ static gboolean llcp_handle_listen(NetNfcGDbusLlcp *llcp,
 }
 
 static gboolean llcp_handle_connect(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               guint16 arg_miu,
-                               guint8 arg_rw,
-                               gint32 arg_type,
-                               const gchar *arg_service_name,
-                               GVariant *smack_privilege,
-                               gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               guint16 arg_miu,
+               guint8 arg_rw,
+               gint32 arg_type,
+               const gchar *arg_service_name,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        LlcpConnectData *data;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+                               smack_privilege,
+                               "nfc-manager::p2p",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return TRUE;
@@ -1813,8 +1813,8 @@ static gboolean llcp_handle_connect(NetNfcGDbusLlcp *llcp,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return FALSE;
        }
        data->llcp = g_object_ref(llcp);
@@ -1848,27 +1848,27 @@ static gboolean llcp_handle_connect(NetNfcGDbusLlcp *llcp,
 }
 
 static gboolean llcp_handle_connect_sap(NetNfcGDbusLlcp *llcp,
-                                       GDBusMethodInvocation *invocation,
-                                       guint32 arg_handle,
-                                       guint32 arg_client_socket,
-                                       guint32 arg_oal_socket,
-                                       guint16 arg_miu,
-                                       guint8 arg_rw,
-                                       gint32 arg_type,
-                                       guint8 arg_sap,
-                                       GVariant *smack_privilege,
-                                       gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               guint16 arg_miu,
+               guint8 arg_rw,
+               gint32 arg_type,
+               guint8 arg_sap,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        LlcpConnectSapData *data;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+                               smack_privilege,
+                               "nfc-manager::p2p",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return TRUE;
@@ -1879,8 +1879,8 @@ static gboolean llcp_handle_connect_sap(NetNfcGDbusLlcp *llcp,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return FALSE;
        }
        data->llcp = g_object_ref(llcp);
@@ -1913,24 +1913,24 @@ static gboolean llcp_handle_connect_sap(NetNfcGDbusLlcp *llcp,
 }
 
 static gboolean llcp_handle_send(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               GVariant *arg_data,
-                               GVariant *smack_privilege,
-                               gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               GVariant *arg_data,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        LlcpSendData *data;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "w") == false) {
+                               smack_privilege,
+                               "nfc-manager::p2p",
+                               "w") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return TRUE;
@@ -1941,8 +1941,8 @@ static gboolean llcp_handle_send(NetNfcGDbusLlcp *llcp,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return FALSE;
        }
        data->llcp = g_object_ref(llcp);
@@ -1979,25 +1979,25 @@ static gboolean llcp_handle_send(NetNfcGDbusLlcp *llcp,
 }
 
 static gboolean llcp_handle_send_to(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               guint8 arg_sap,
-                               GVariant *arg_data,
-                               GVariant *smack_privilege,
-                               gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               guint8 arg_sap,
+               GVariant *arg_data,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        LlcpSendToData *data;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+                               smack_privilege,
+                               "nfc-manager::p2p",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return TRUE;
@@ -2008,8 +2008,8 @@ static gboolean llcp_handle_send_to(NetNfcGDbusLlcp *llcp,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return FALSE;
        }
        data->llcp = g_object_ref(llcp);
@@ -2047,24 +2047,24 @@ static gboolean llcp_handle_send_to(NetNfcGDbusLlcp *llcp,
 }
 
 static gboolean llcp_handle_receive(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               guint32 arg_req_length,
-                               GVariant *smack_privilege,
-                               gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               guint32 arg_req_length,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        LlcpReceiveData *data;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "w") == false) {
+                               smack_privilege,
+                               "nfc-manager::p2p",
+                               "w") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return TRUE;
@@ -2075,8 +2075,8 @@ static gboolean llcp_handle_receive(NetNfcGDbusLlcp *llcp,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return FALSE;
        }
        data->llcp = g_object_ref(llcp);
@@ -2106,24 +2106,24 @@ static gboolean llcp_handle_receive(NetNfcGDbusLlcp *llcp,
 }
 
 static gboolean llcp_handle_receive_from(NetNfcGDbusLlcp *llcp,
-                                       GDBusMethodInvocation *invocation,
-                                       guint32 arg_handle,
-                                       guint32 arg_client_socket,
-                                       guint32 arg_oal_socket,
-                                       guint32 arg_req_length,
-                                       GVariant *smack_privilege,
-                                       gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               guint32 arg_req_length,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        LlcpReceiveData *data;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "w") == false) {
+                               smack_privilege,
+                               "nfc-manager::p2p",
+                               "w") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return TRUE;
@@ -2134,8 +2134,8 @@ static gboolean llcp_handle_receive_from(NetNfcGDbusLlcp *llcp,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return FALSE;
        }
        data->llcp = g_object_ref(llcp);
@@ -2165,23 +2165,23 @@ static gboolean llcp_handle_receive_from(NetNfcGDbusLlcp *llcp,
 }
 
 static gboolean llcp_handle_close(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               GVariant *smack_privilege,
-                               gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        LlcpCloseData *data;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "w") == false) {
+                               smack_privilege,
+                               "nfc-manager::p2p",
+                               "w") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return TRUE;
@@ -2192,8 +2192,8 @@ static gboolean llcp_handle_close(NetNfcGDbusLlcp *llcp,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-               "org.tizen.NetNfcService.AllocationError",
-               "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return FALSE;
        }
        data->llcp = g_object_ref(llcp);
@@ -2222,23 +2222,23 @@ static gboolean llcp_handle_close(NetNfcGDbusLlcp *llcp,
 }
 
 static gboolean llcp_handle_disconnect(NetNfcGDbusLlcp *llcp,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               guint32 arg_client_socket,
-                               guint32 arg_oal_socket,
-                               GVariant *smack_privilege,
-                               gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               guint32 arg_client_socket,
+               guint32 arg_oal_socket,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        LlcpDisconnectData *data;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "w") == false) {
+                               smack_privilege,
+                               "nfc-manager::p2p",
+                               "w") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return TRUE;
@@ -2249,8 +2249,8 @@ static gboolean llcp_handle_disconnect(NetNfcGDbusLlcp *llcp,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return FALSE;
        }
        data->llcp = g_object_ref(llcp);
@@ -2321,8 +2321,8 @@ static void llcp_deactivated_thread_func(gpointer user_data)
        if (handle == NULL)
        {
                DEBUG_SERVER_MSG(
-                       "the target ID = [0x%p] was not connected before."
-                       "current device may be a TARGET", handle);
+                               "the target ID = [0x%p] was not connected before."
+                               "current device may be a TARGET", handle);
        }
        else
        {
@@ -2399,7 +2399,7 @@ static void llcp_listen_thread_func(gpointer user_data)
                        if (info->work_cb != NULL)
                        {
                                info->work_cb(listen_socket->client_socket,
-                                       listen_socket->result, NULL, NULL,info->work_param);
+                                               listen_socket->result, NULL, NULL,info->work_param);
                        }
                }
                else
@@ -2457,10 +2457,10 @@ static void llcp_socket_error_thread_func(gpointer user_data)
                if (param->cb)
                {
                        param->cb(req_llcp_msg->llcp_socket,
-                               req_llcp_msg->result,
-                               NULL,
-                               NULL,
-                               param->user_param);
+                                       req_llcp_msg->result,
+                                       NULL,
+                                       NULL,
+                                       param->user_param);
                }
 
                g_free(param);
@@ -2516,10 +2516,10 @@ static void llcp_send_thread_func(gpointer user_data)
                if (param->cb)
                {
                        param->cb(param->socket,
-                               req_llcp_msg->result,
-                               NULL,
-                               NULL,
-                               param->user_param);
+                                       req_llcp_msg->result,
+                                       NULL,
+                                       NULL,
+                                       param->user_param);
                }
 
                g_free(param);
@@ -2575,10 +2575,10 @@ static void llcp_receive_thread_func(gpointer user_data)
                if (param->cb)
                {
                        param->cb(param->socket,
-                               req_receive_socket->result,
-                               &param->data,
-                               NULL,
-                               param->user_param);
+                                       req_receive_socket->result,
+                                       &param->data,
+                                       NULL,
+                                       param->user_param);
                }
 
                if (param->data.buffer)
@@ -2630,7 +2630,7 @@ static void llcp_receive_from_thread_func(gpointer user_data)
        }
 
        req_receive_from_socket = (net_nfc_request_receive_from_socket_t *)
-                                                               data->req_msg;
+               data->req_msg;
        param = (net_nfc_llcp_param_t *)req_receive_from_socket->user_param;
 
        if (param)
@@ -2638,10 +2638,10 @@ static void llcp_receive_from_thread_func(gpointer user_data)
                if (param->cb)
                {
                        param->cb(param->socket,
-                               req_receive_from_socket->result,
-                               &param->data,
-                               (void *)(int)req_receive_from_socket->sap,
-                               param->user_param);
+                                       req_receive_from_socket->result,
+                                       &param->data,
+                                       (void *)(int)req_receive_from_socket->sap,
+                                       param->user_param);
                }
 
                if (param->data.buffer)
@@ -2700,10 +2700,10 @@ static void llcp_connect_thread_func(gpointer user_data)
                if (param->cb)
                {
                        param->cb(param->socket,
-                               req_llcp_msg->result,
-                               NULL,
-                               NULL,
-                               param->user_param);
+                                       req_llcp_msg->result,
+                                       NULL,
+                                       NULL,
+                                       param->user_param);
                }
 
                g_free(param);
@@ -2759,10 +2759,10 @@ static void llcp_disconnect_thread_func(gpointer user_data)
                if (param->cb)
                {
                        param->cb(param->socket,
-                               req_llcp_msg->result,
-                               NULL,
-                               NULL,
-                               param->user_param);
+                                       req_llcp_msg->result,
+                                       NULL,
+                                       NULL,
+                                       param->user_param);
                }
 
                g_free(param);
@@ -2775,10 +2775,10 @@ static void llcp_disconnect_thread_func(gpointer user_data)
 }
 
 static void llcp_simple_socket_error_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param)
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        LlcpSimpleData *simple_data;
 
@@ -2797,10 +2797,10 @@ static void llcp_simple_socket_error_cb(net_nfc_llcp_socket_t socket,
 }
 
 static void llcp_simple_listen_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param)
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        LlcpSimpleData *simple_data;
 
@@ -2823,10 +2823,10 @@ static void llcp_simple_listen_cb(net_nfc_llcp_socket_t socket,
 }
 
 static void llcp_simple_connect_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param)
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        LlcpSimpleData *simple_data;
 
@@ -2849,10 +2849,10 @@ static void llcp_simple_connect_cb(net_nfc_llcp_socket_t socket,
 }
 
 static void llcp_simple_server_error_cb(net_nfc_llcp_socket_t socket,
-                                       net_nfc_error_e result,
-                                       data_s *data,
-                                       void *extra,
-                                       void *user_param)
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        LlcpSimpleData *simple_data;
 
@@ -2861,20 +2861,20 @@ static void llcp_simple_server_error_cb(net_nfc_llcp_socket_t socket,
        if (simple_data->error_callback)
        {
                simple_data->error_callback(result,
-                                       simple_data->handle,
-                                       socket,
-                                       data,
-                                       simple_data->user_data);
+                               simple_data->handle,
+                               socket,
+                               data,
+                               simple_data->user_data);
        }
 
        g_free(simple_data);
 }
 
 static void llcp_simple_send_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param)
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        LlcpSimpleData *simple_data;
 
@@ -2893,10 +2893,10 @@ static void llcp_simple_send_cb(net_nfc_llcp_socket_t socket,
 }
 
 static void llcp_simple_receive_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param)
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        LlcpSimpleData *simple_data;
 
@@ -3040,7 +3040,7 @@ void net_nfc_server_llcp_disconnect(net_nfc_request_msg_t *req_msg)
 }
 
 net_nfc_error_e net_nfc_server_llcp_set_config(
-                                       net_nfc_llcp_config_info_s *config)
+               net_nfc_llcp_config_info_s *config)
 {
        net_nfc_error_e result;
 
@@ -3077,12 +3077,12 @@ guint8 net_nfc_server_llcp_get_option(void)
 }
 
 net_nfc_error_e net_nfc_server_llcp_simple_server(
-                               net_nfc_target_handle_s *handle,
-                               const char *san,
-                               sap_t sap,
-                               net_nfc_server_llcp_callback callback,
-                               net_nfc_server_llcp_callback error_callback,
-                               gpointer user_data)
+               net_nfc_target_handle_s *handle,
+               const char *san,
+               sap_t sap,
+               net_nfc_server_llcp_callback callback,
+               net_nfc_server_llcp_callback error_callback,
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
 
@@ -3098,8 +3098,8 @@ net_nfc_error_e net_nfc_server_llcp_simple_server(
                return NET_NFC_NULL_PARAMETER;
 
        if (net_nfc_controller_llcp_get_remote_config(handle,
-                                               &config,
-                                               &result) == false)
+                               &config,
+                               &result) == false)
        {
                DEBUG_ERR_MSG("%s failed [%d]",
                                "net_nfc_controller_llcp_get_remote_config",
@@ -3122,12 +3122,12 @@ net_nfc_error_e net_nfc_server_llcp_simple_server(
        simple_data->miu = MIN(config.miu, net_nfc_server_llcp_get_miu());
 
        if (net_nfc_controller_llcp_create_socket(&socket,
-                       NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONORIENTED,
-                       simple_data->miu,
-                       1,
-                       &result,
-                       llcp_simple_socket_error_cb,
-                       simple_data) == false)
+                               NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONORIENTED,
+                               simple_data->miu,
+                               1,
+                               &result,
+                               llcp_simple_socket_error_cb,
+                               simple_data) == false)
        {
                DEBUG_ERR_MSG("%s failed [%d]",
                                "net_nfc_controller_llcp_create_socket",
@@ -3140,8 +3140,8 @@ net_nfc_error_e net_nfc_server_llcp_simple_server(
        simple_data->socket = socket;
 
        if (net_nfc_controller_llcp_bind(socket,
-                                       sap,
-                                       &result) == false)
+                               sap,
+                               &result) == false)
        {
                DEBUG_ERR_MSG("%s failed [%d]",
                                "nte_nfc_controller_llcp_bind",
@@ -3156,11 +3156,11 @@ net_nfc_error_e net_nfc_server_llcp_simple_server(
        }
 
        if (net_nfc_controller_llcp_listen(handle,
-                                       (uint8_t *)san,
-                                       socket,
-                                       &result,
-                                       llcp_simple_listen_cb,
-                                       simple_data) == false)
+                               (uint8_t *)san,
+                               socket,
+                               &result,
+                               llcp_simple_listen_cb,
+                               simple_data) == false)
        {
                DEBUG_ERR_MSG("%s failed [%d]",
                                "net_nfc_controller_llcp_listen",
@@ -3169,8 +3169,8 @@ net_nfc_error_e net_nfc_server_llcp_simple_server(
                if (simple_data->socket != 1)
                {
                        net_nfc_controller_llcp_socket_close(
-                                                       simple_data->socket,
-                                                       &result);
+                                       simple_data->socket,
+                                       &result);
                }
 
                g_free(simple_data);
@@ -3188,12 +3188,12 @@ net_nfc_error_e net_nfc_server_llcp_simple_server(
 }
 
 net_nfc_error_e net_nfc_server_llcp_simple_client(
-                               net_nfc_target_handle_s *handle,
-                               const char *san,
-                               sap_t sap,
-                               net_nfc_server_llcp_callback callback,
-                               net_nfc_server_llcp_callback error_callback,
-                               gpointer user_data)
+               net_nfc_target_handle_s *handle,
+               const char *san,
+               sap_t sap,
+               net_nfc_server_llcp_callback callback,
+               net_nfc_server_llcp_callback error_callback,
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
 
@@ -3206,8 +3206,8 @@ net_nfc_error_e net_nfc_server_llcp_simple_client(
                return NET_NFC_NULL_PARAMETER;
 
        if (net_nfc_controller_llcp_get_remote_config(handle,
-                                               &config,
-                                               &result) == false)
+                               &config,
+                               &result) == false)
        {
                DEBUG_ERR_MSG("%s failed [%d]",
                                "net_nfc_controller_llcp_get_remote_config",
@@ -3225,12 +3225,12 @@ net_nfc_error_e net_nfc_server_llcp_simple_client(
        simple_data->miu = MIN(config.miu, net_nfc_server_llcp_get_miu());
 
        if (net_nfc_controller_llcp_create_socket(&socket,
-                       NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONORIENTED,
-                       simple_data->miu,
-                       1,
-                       &result,
-                       llcp_simple_socket_error_cb,
-                       simple_data) == false)
+                               NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONORIENTED,
+                               simple_data->miu,
+                               1,
+                               &result,
+                               llcp_simple_socket_error_cb,
+                               simple_data) == false)
        {
                DEBUG_ERR_MSG("%s failed [%d]",
                                "net_nfc_controller_llcp_create_socket",
@@ -3245,21 +3245,21 @@ net_nfc_error_e net_nfc_server_llcp_simple_client(
        if (san == NULL)
        {
                if (net_nfc_controller_llcp_connect(handle,
-                                               simple_data->socket,
-                                               sap,
-                                               &result,
-                                               llcp_simple_connect_cb,
-                                               simple_data) == false)
+                                       simple_data->socket,
+                                       sap,
+                                       &result,
+                                       llcp_simple_connect_cb,
+                                       simple_data) == false)
                {
                        DEBUG_ERR_MSG("%s failed [%d]",
-                               "net_nfc_controller_llcp_connect",
-                               result);
+                                       "net_nfc_controller_llcp_connect",
+                                       result);
 
                        if (simple_data->socket != -1)
                        {
                                net_nfc_controller_llcp_socket_close(
-                                                       simple_data->socket,
-                                                       &result);
+                                               simple_data->socket,
+                                               &result);
                        }
 
                        g_free(simple_data);
@@ -3271,21 +3271,21 @@ net_nfc_error_e net_nfc_server_llcp_simple_client(
        else
        {
                if (net_nfc_controller_llcp_connect_by_url(handle,
-                                               simple_data->socket,
-                                               (uint8_t *)san,
-                                               &result,
-                                               llcp_simple_connect_cb,
-                                               simple_data) == false)
+                                       simple_data->socket,
+                                       (uint8_t *)san,
+                                       &result,
+                                       llcp_simple_connect_cb,
+                                       simple_data) == false)
                {
                        DEBUG_ERR_MSG("%s failed [%d]",
-                               "net_nfc_controller_llcp_connect_by_url",
-                               result);
+                                       "net_nfc_controller_llcp_connect_by_url",
+                                       result);
 
                        if (simple_data->socket != -1)
                        {
                                net_nfc_controller_llcp_socket_close(
-                                                       simple_data->socket,
-                                                       &result);
+                                               simple_data->socket,
+                                               &result);
                        }
 
                        g_free(simple_data);
@@ -3303,10 +3303,10 @@ net_nfc_error_e net_nfc_server_llcp_simple_client(
 }
 
 net_nfc_error_e net_nfc_server_llcp_simple_accept(
-                               net_nfc_target_handle_s *handle,
-                               net_nfc_llcp_socket_t socket,
-                               net_nfc_server_llcp_callback error_callback,
-                               gpointer user_data)
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               net_nfc_server_llcp_callback error_callback,
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
 
@@ -3325,13 +3325,13 @@ net_nfc_error_e net_nfc_server_llcp_simple_accept(
        simple_data->user_data = user_data;
 
        if (net_nfc_controller_llcp_accept(socket,
-                                       &result,
-                                       llcp_simple_server_error_cb,
-                                       simple_data) == false)
+                               &result,
+                               llcp_simple_server_error_cb,
+                               simple_data) == false)
        {
                DEBUG_ERR_MSG("%s failed [%d]",
-                       "net_nfc_controller_llcp_accept",
-                       result);
+                               "net_nfc_controller_llcp_accept",
+                               result);
        }
 
        if (result == NET_NFC_BUSY)
@@ -3341,11 +3341,11 @@ net_nfc_error_e net_nfc_server_llcp_simple_accept(
 }
 
 net_nfc_error_e net_nfc_server_llcp_simple_send(
-                                       net_nfc_target_handle_s *handle,
-                                       net_nfc_llcp_socket_t socket,
-                                       data_s *data,
-                                       net_nfc_server_llcp_callback callback,
-                                       gpointer user_data)
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               net_nfc_server_llcp_callback callback,
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
 
@@ -3364,15 +3364,15 @@ net_nfc_error_e net_nfc_server_llcp_simple_send(
        simple_data->user_data = user_data;
 
        if (net_nfc_controller_llcp_send(handle,
-                                       socket,
-                                       data,
-                                       &result,
-                                       llcp_simple_send_cb,
-                                       simple_data) == false)
+                               socket,
+                               data,
+                               &result,
+                               llcp_simple_send_cb,
+                               simple_data) == false)
        {
                DEBUG_ERR_MSG("%s failed [%d]",
-                       "net_nfc_controller_llcp_send",
-                       result);
+                               "net_nfc_controller_llcp_send",
+                               result);
        }
 
        if (result == NET_NFC_BUSY)
@@ -3382,10 +3382,10 @@ net_nfc_error_e net_nfc_server_llcp_simple_send(
 }
 
 net_nfc_error_e net_nfc_server_llcp_simple_receive(
-                                       net_nfc_target_handle_s *handle,
-                                       net_nfc_llcp_socket_t socket,
-                                       net_nfc_server_llcp_callback callback,
-                                       gpointer user_data)
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               net_nfc_server_llcp_callback callback,
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
 
@@ -3404,15 +3404,15 @@ net_nfc_error_e net_nfc_server_llcp_simple_receive(
        simple_data->user_data = user_data;
 
        if (net_nfc_controller_llcp_recv(handle,
-                                       socket,
-                                       net_nfc_server_llcp_get_miu(),
-                                       &result,
-                                       llcp_simple_receive_cb,
-                                       simple_data) == false)
+                               socket,
+                               net_nfc_server_llcp_get_miu(),
+                               &result,
+                               llcp_simple_receive_cb,
+                               simple_data) == false)
        {
                DEBUG_ERR_MSG("%s failed [%d]",
-                       "net_nfc_controller_llcp_send",
-                       result);
+                               "net_nfc_controller_llcp_send",
+                               result);
        }
 
        if (result == NET_NFC_BUSY)
@@ -3442,11 +3442,11 @@ static void _llcp_init()
 inline static service_t *_llcp_find_service(uint32_t sap)
 {
        return (service_t *)g_hash_table_lookup(service_table,
-               (gconstpointer)sap);
+                       (gconstpointer)sap);
 }
 
 static net_nfc_error_e _llcp_add_service(const char *id, uint32_t sap,
-       const char *san, net_nfc_server_llcp_activate_cb cb, void *user_data)
+               const char *san, net_nfc_server_llcp_activate_cb cb, void *user_data)
 {
        service_t *service = NULL;
        net_nfc_error_e result;
@@ -3475,7 +3475,7 @@ static net_nfc_error_e _llcp_add_service(const char *id, uint32_t sap,
                        service->user_data = user_data;
 
                        g_hash_table_insert(service_table, (gpointer)sap,
-                               (gpointer)service);
+                                       (gpointer)service);
 
                        result = NET_NFC_OK;
                } else {
@@ -3529,16 +3529,16 @@ static void _llcp_remove_services(const char *id)
 }
 
 static void _llcp_start_services_cb(gpointer key, gpointer value,
-       gpointer user_data)
+               gpointer user_data)
 {
        service_t *service = (service_t *)value;
 
        /* TODO : start service */
        if (service != NULL && service->cb != NULL) {
                service->cb(NET_NFC_LLCP_START,
-                       (net_nfc_target_handle_s *)user_data,
-                       service->sap,
-                       service->san, service->user_data);
+                               (net_nfc_target_handle_s *)user_data,
+                               service->sap,
+                               service->san, service->user_data);
        }
 }
 
@@ -3548,14 +3548,14 @@ static void _llcp_start_services(net_nfc_target_handle_s *handle)
 }
 
 net_nfc_error_e net_nfc_server_llcp_register_service(const char *id,
-       sap_t sap, const char *san, net_nfc_server_llcp_activate_cb cb,
-       void *user_param)
+               sap_t sap, const char *san, net_nfc_server_llcp_activate_cb cb,
+               void *user_param)
 {
        return _llcp_add_service(id, sap, san, cb, user_param);
 }
 
 net_nfc_error_e net_nfc_server_llcp_unregister_service(const char *id,
-       sap_t sap, const char *san)
+               sap_t sap, const char *san)
 {
        net_nfc_error_e result;
        service_t *service;
@@ -3564,7 +3564,7 @@ net_nfc_error_e net_nfc_server_llcp_unregister_service(const char *id,
        if (service != NULL) {
                /* invoke callback */
                service->cb(NET_NFC_LLCP_UNREGISTERED, NULL, service->sap,
-                       service->san, service->user_data);
+                               service->san, service->user_data);
 
                _llcp_remove_service(sap);
 
@@ -3598,7 +3598,7 @@ net_nfc_error_e net_nfc_server_llcp_unregister_all()
 
        while (g_hash_table_iter_next(&iter, &key, (gpointer)&service)) {
                service->cb(NET_NFC_LLCP_UNREGISTERED, NULL, service->sap,
-                       service->san, service->user_data);
+                               service->san, service->user_data);
 
                g_free(service->san);
                g_free(service->id);
@@ -3611,7 +3611,7 @@ net_nfc_error_e net_nfc_server_llcp_unregister_all()
 }
 
 net_nfc_error_e net_nfc_server_llcp_start_registered_services(
-       net_nfc_target_handle_s *handle)
+               net_nfc_target_handle_s *handle)
 {
        _llcp_start_services(handle);
 
@@ -3647,13 +3647,13 @@ static void net_nfc_server_llcp_process(gpointer user_data)
                                        result);
 
                        if (net_nfc_controller_configure_discovery(
-                                       NET_NFC_DISCOVERY_MODE_RESUME,
-                                       NET_NFC_ALL_ENABLE,
-                                       &result) == false)
+                                               NET_NFC_DISCOVERY_MODE_RESUME,
+                                               NET_NFC_ALL_ENABLE,
+                                               &result) == false)
                        {
                                DEBUG_ERR_MSG("%s is failed [%d]",
-                               "net_nfc_controller_configure_discovery",
-                               result);
+                                               "net_nfc_controller_configure_discovery",
+                                               result);
 
                                net_nfc_controller_exception_handler();
                        }
@@ -3667,8 +3667,8 @@ static void net_nfc_server_llcp_process(gpointer user_data)
        if (net_nfc_controller_llcp_check_llcp(handle, &result) == false)
        {
                DEBUG_ERR_MSG("%s is failed [%d]",
-                       "net_nfc_controller_llcp_check_llcp",
-                       result);
+                               "net_nfc_controller_llcp_check_llcp",
+                               result);
 
                return;
        }
@@ -3678,8 +3678,8 @@ static void net_nfc_server_llcp_process(gpointer user_data)
        if (net_nfc_controller_llcp_activate_llcp(handle, &result) == false)
        {
                DEBUG_ERR_MSG("%s is failed [%d]",
-                       "net_nfc_controller_llcp_activate_llcp",
-                       result);
+                               "net_nfc_controller_llcp_activate_llcp",
+                               result);
 
                return;
        }
@@ -3692,7 +3692,7 @@ static void net_nfc_server_llcp_process(gpointer user_data)
 void net_nfc_server_llcp_target_detected(void *info)
 {
        if (net_nfc_server_controller_async_queue_push(
-               net_nfc_server_llcp_process, NULL) == FALSE)
+                               net_nfc_server_llcp_process, NULL) == FALSE)
        {
                DEBUG_ERR_MSG("can not push to controller thread");
        }
similarity index 85%
rename from src/manager/net_nfc_server_manager.c
rename to daemon/net_nfc_server_manager.c
index 3ccefc2..1582119 100644 (file)
 
 #include "net_nfc_typedef_internal.h"
 #include "net_nfc_debug_internal.h"
-#include "net_nfc_controller_internal.h"
-#include "net_nfc_manager.h"
+#include "net_nfc_server_controller.h"
+#include "net_nfc_server.h"
 #include "net_nfc_server_se.h"
 #include "net_nfc_server_llcp.h"
 #include "net_nfc_server_process_snep.h"
 #include "net_nfc_server_process_npp.h"
 #include "net_nfc_server_process_handover.h"
-#include "net_nfc_server_context_internal.h"
+#include "net_nfc_server_context.h"
 
 typedef struct _ManagerData ManagerData;
 
@@ -79,15 +79,15 @@ static gboolean manager_deactive(void);
 static void manager_handle_active_thread_func(gpointer user_data);
 
 static gboolean manager_handle_set_active(NetNfcGDbusManager *manager,
-                                       GDBusMethodInvocation *invocation,
-                                       gboolean arg_is_active,
-                                       GVariant *smack_privilege,
-                                       gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               gboolean arg_is_active,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean manager_handle_get_server_state(NetNfcGDbusManager *manager,
-                                       GDBusMethodInvocation *invocation,
-                                       GVariant *smack_privilege,
-                                       gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 
 static void manager_active_thread_func(gpointer user_data);
@@ -175,7 +175,7 @@ static gboolean manager_deactive(void)
        return TRUE;
 }
 
-static void  manager_handle_active_thread_func(gpointer user_data)
+static void manager_handle_active_thread_func(gpointer user_data)
 {
        gboolean ret;
 
@@ -201,9 +201,9 @@ static void  manager_handle_active_thread_func(gpointer user_data)
                if(data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.SetActiveError",
-                               "Can not get manager");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.SetActiveError",
+                                       "Can not get manager");
 
                        g_object_unref(data->invocation);
                }
@@ -217,9 +217,9 @@ static void  manager_handle_active_thread_func(gpointer user_data)
                if (data->invocation)
                {
                        g_dbus_method_invocation_return_dbus_error(
-                               data->invocation,
-                               "org.tizen.NetNfcService.SetActiveError",
-                               "Can not set activation");
+                                       data->invocation,
+                                       "org.tizen.NetNfcService.SetActiveError",
+                                       "Can not set activation");
 
                        g_object_unref(data->invocation);
                }
@@ -231,12 +231,12 @@ static void  manager_handle_active_thread_func(gpointer user_data)
        }
 
        net_nfc_gdbus_manager_emit_activated(data->manager,
-                                       data->is_active);
+                       data->is_active);
 
        if (data->invocation)
        {
                net_nfc_gdbus_manager_complete_set_active(data->manager,
-                                                       data->invocation);
+                               data->invocation);
 
                g_object_unref(data->invocation);
        }
@@ -246,7 +246,7 @@ static void  manager_handle_active_thread_func(gpointer user_data)
 
        /* shutdown process if it doesn't need */
        if (data->is_active == false &&
-               net_nfc_server_gdbus_is_server_busy() == false) {
+                       net_nfc_server_gdbus_is_server_busy() == false) {
 
                net_nfc_manager_quit();
        }
@@ -254,21 +254,21 @@ static void  manager_handle_active_thread_func(gpointer user_data)
 
 
 static gboolean manager_handle_set_active(NetNfcGDbusManager *manager,
-                                       GDBusMethodInvocation *invocation,
-                                       gboolean arg_is_active,
-                                       GVariant *smack_privilege,
-                                       gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               gboolean arg_is_active,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        ManagerActivationData *data;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::admin",
-               "rw") == false) {
+                               smack_privilege,
+                               "nfc-manager::admin",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return TRUE;
@@ -281,8 +281,8 @@ static gboolean manager_handle_set_active(NetNfcGDbusManager *manager,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-               "org.tizen.NetNfcService.AllocationError",
-               "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
                return FALSE;
        }
 
@@ -291,8 +291,8 @@ static gboolean manager_handle_set_active(NetNfcGDbusManager *manager,
        data->is_active = arg_is_active;
 
        if (net_nfc_server_controller_async_queue_push(
-                                       manager_handle_active_thread_func,
-                                       data) == FALSE)
+                               manager_handle_active_thread_func,
+                               data) == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.ThreadError",
@@ -307,27 +307,24 @@ static gboolean manager_handle_set_active(NetNfcGDbusManager *manager,
                return FALSE;
        }
 
-       if (arg_is_active)
-               net_nfc_server_restart_polling_loop();
-
        return TRUE;
 }
 
 static gboolean manager_handle_get_server_state(NetNfcGDbusManager *manager,
-                                       GDBusMethodInvocation *invocation,
-                                       GVariant *smack_privilege,
-                                       gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        guint32 state;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::admin",
-               "r") == false) {
+                               smack_privilege,
+                               "nfc-manager::admin",
+                               "r") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return TRUE;
@@ -336,8 +333,8 @@ static gboolean manager_handle_get_server_state(NetNfcGDbusManager *manager,
        state = net_nfc_server_get_state();
 
        net_nfc_gdbus_manager_complete_get_server_state(manager,
-                                               invocation,
-                                               state);
+                       invocation,
+                       state);
        return TRUE;
 }
 
@@ -369,7 +366,7 @@ static void manager_active_thread_func(gpointer user_data)
        }
 
        net_nfc_gdbus_manager_emit_activated(data->manager,
-                                       data->is_active);
+                       data->is_active);
 
        g_free(data);
 }
@@ -446,8 +443,8 @@ void net_nfc_server_manager_set_active(gboolean is_active)
        data->is_active = is_active;
 
        if (net_nfc_server_controller_async_queue_push(
-                                       manager_active_thread_func,
-                                       data) == FALSE)
+                               manager_active_thread_func,
+                               data) == FALSE)
        {
                DEBUG_ERR_MSG("can not push to controller thread");
 
@@ -459,9 +456,6 @@ void net_nfc_server_manager_set_active(gboolean is_active)
                }
        }
 
-       if (is_active)
-               net_nfc_server_restart_polling_loop();
-
        return;
 }
 
similarity index 80%
rename from src/manager/net_nfc_server_ndef.c
rename to daemon/net_nfc_server_ndef.c
index 42d3e7d..b67182d 100644 (file)
 #include "net_nfc_debug_internal.h"
 #include "net_nfc_util_internal.h"
 #include "net_nfc_util_gdbus_internal.h"
-#include "net_nfc_controller_internal.h"
+#include "net_nfc_server_controller.h"
 #include "net_nfc_gdbus.h"
 
 #include "net_nfc_server_common.h"
-#include "net_nfc_server_context_internal.h"
+#include "net_nfc_server_context.h"
 #include "net_nfc_server_tag.h"
 #include "net_nfc_server_ndef.h"
 
@@ -77,30 +77,30 @@ static void ndef_format_thread_func(gpointer user_data);
 
 /* methods */
 static gboolean ndef_handle_read(NetNfcGDbusNdef *ndef,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean ndef_handle_write(NetNfcGDbusNdef *ndef,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               GVariant *arg_data,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               GVariant *arg_data,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean ndef_handle_make_read_only(NetNfcGDbusNdef *ndef,
-                                       GDBusMethodInvocation *invocation,
-                                       guint32 arg_handle,
-                                       GVariant *smack_privilege,
-                                       gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean ndef_handle_format(NetNfcGDbusNdef *ndef,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               GVariant *arg_key,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               GVariant *arg_key,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 
 static void ndef_read_thread_func(gpointer user_data)
@@ -127,9 +127,9 @@ static void ndef_read_thread_func(gpointer user_data)
        data_variant = net_nfc_util_gdbus_data_to_variant(read_data);
 
        net_nfc_gdbus_ndef_complete_read(data->ndef,
-                                       data->invocation,
-                                       (gint)result,
-                                       data_variant);
+                       data->invocation,
+                       (gint)result,
+                       data_variant);
 
        if (read_data) {
                net_nfc_util_free_data(read_data);
@@ -162,8 +162,8 @@ static void ndef_write_thread_func(gpointer user_data)
        }
 
        net_nfc_gdbus_ndef_complete_write(data->ndef,
-               data->invocation,
-               (gint)result);
+                       data->invocation,
+                       (gint)result);
 
        net_nfc_util_free_data(&data->data);
 
@@ -193,8 +193,8 @@ static void ndef_make_read_only_thread_func(gpointer user_data)
        }
 
        net_nfc_gdbus_ndef_complete_make_read_only(data->ndef,
-               data->invocation,
-               (gint)result);
+                       data->invocation,
+                       (gint)result);
 
        g_object_unref(data->invocation);
        g_object_unref(data->ndef);
@@ -222,8 +222,8 @@ static void ndef_format_thread_func(gpointer user_data)
        }
 
        net_nfc_gdbus_ndef_complete_format(data->ndef,
-               data->invocation,
-               (gint)result);
+                       data->invocation,
+                       (gint)result);
 
        net_nfc_util_free_data(&data->key);
 
@@ -234,22 +234,22 @@ static void ndef_format_thread_func(gpointer user_data)
 }
 
 static gboolean ndef_handle_read(NetNfcGDbusNdef *ndef,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               GVariant *smack_privilege,
-                               gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        ReadData *data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "r") == false) {
+                               smack_privilege,
+                               "nfc-manager::tag",
+                               "r") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -260,8 +260,8 @@ static gboolean ndef_handle_read(NetNfcGDbusNdef *ndef,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -271,8 +271,8 @@ static gboolean ndef_handle_read(NetNfcGDbusNdef *ndef,
        data->handle = arg_handle;
 
        result = net_nfc_server_controller_async_queue_push(
-               ndef_read_thread_func,
-               data);
+                       ndef_read_thread_func,
+                       data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
@@ -289,23 +289,23 @@ static gboolean ndef_handle_read(NetNfcGDbusNdef *ndef,
 }
 
 static gboolean ndef_handle_write(NetNfcGDbusNdef *ndef,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               GVariant *arg_data,
-                               GVariant *smack_privilege,
-                               gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               GVariant *arg_data,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        WriteData *data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "w") == false) {
+                               smack_privilege,
+                               "nfc-manager::tag",
+                               "w") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -316,8 +316,8 @@ static gboolean ndef_handle_write(NetNfcGDbusNdef *ndef,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -329,8 +329,8 @@ static gboolean ndef_handle_write(NetNfcGDbusNdef *ndef,
        net_nfc_util_gdbus_variant_to_data_s(arg_data, &data->data);
 
        result = net_nfc_server_controller_async_queue_push(
-               ndef_write_thread_func,
-               data);
+                       ndef_write_thread_func,
+                       data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
@@ -349,22 +349,22 @@ static gboolean ndef_handle_write(NetNfcGDbusNdef *ndef,
 }
 
 static gboolean ndef_handle_make_read_only(NetNfcGDbusNdef *ndef,
-                                       GDBusMethodInvocation *invocation,
-                                       guint32 arg_handle,
-                                       GVariant *smack_privilege,
-                                       gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        MakeReadOnlyData *data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "w") == false) {
+                               smack_privilege,
+                               "nfc-manager::tag",
+                               "w") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -375,8 +375,8 @@ static gboolean ndef_handle_make_read_only(NetNfcGDbusNdef *ndef,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -386,8 +386,8 @@ static gboolean ndef_handle_make_read_only(NetNfcGDbusNdef *ndef,
        data->handle = arg_handle;
 
        result = net_nfc_server_controller_async_queue_push(
-               ndef_make_read_only_thread_func,
-               data);
+                       ndef_make_read_only_thread_func,
+                       data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
@@ -404,23 +404,23 @@ static gboolean ndef_handle_make_read_only(NetNfcGDbusNdef *ndef,
 }
 
 static gboolean ndef_handle_format(NetNfcGDbusNdef *ndef,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_handle,
-                               GVariant *arg_key,
-                               GVariant *smack_privilege,
-                               gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 arg_handle,
+               GVariant *arg_key,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        FormatData *data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "w") == false) {
+                               smack_privilege,
+                               "nfc-manager::tag",
+                               "w") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -431,8 +431,8 @@ static gboolean ndef_handle_format(NetNfcGDbusNdef *ndef,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -443,8 +443,8 @@ static gboolean ndef_handle_format(NetNfcGDbusNdef *ndef,
        net_nfc_util_gdbus_variant_to_data_s(arg_key, &data->key);
 
        result = net_nfc_server_controller_async_queue_push(
-               ndef_format_thread_func,
-               data);
+                       ndef_format_thread_func,
+                       data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
@@ -493,10 +493,10 @@ gboolean net_nfc_server_ndef_init(GDBusConnection *connection)
                        NULL);
 
        result = g_dbus_interface_skeleton_export(
-               G_DBUS_INTERFACE_SKELETON(ndef_skeleton),
-               connection,
-               "/org/tizen/NetNfcService/Ndef",
-               &error);
+                       G_DBUS_INTERFACE_SKELETON(ndef_skeleton),
+                       connection,
+                       "/org/tizen/NetNfcService/Ndef",
+                       &error);
        if (result == FALSE)
        {
                g_error_free(error);
similarity index 80%
rename from src/manager/net_nfc_server_p2p.c
rename to daemon/net_nfc_server_p2p.c
index 84f5ad4..f977622 100644 (file)
 #include "net_nfc_debug_internal.h"
 #include "net_nfc_util_internal.h"
 #include "net_nfc_util_gdbus_internal.h"
-#include "net_nfc_controller_internal.h"
+#include "net_nfc_server_controller.h"
 #include "net_nfc_gdbus.h"
 #include "net_nfc_server_common.h"
-#include "net_nfc_server_context_internal.h"
+#include "net_nfc_server_context.h"
 #include "net_nfc_server_process_snep.h"
 #include "net_nfc_server_p2p.h"
 
@@ -32,19 +32,19 @@ struct _P2pSendData
        NetNfcGDbusP2p *p2p;
        GDBusMethodInvocation *invocation;
        gint32 type;
-       guint32 p2p_handle;
+       net_nfc_target_handle_s *p2p_handle;
        data_s data;
 };
 
 static void p2p_send_data_thread_func(gpointer user_data);
 
 static gboolean p2p_handle_send(NetNfcGDbusP2p *p2p,
-                               GDBusMethodInvocation *invocation,
-                               gint32 arg_type,
-                               GVariant *arg_data,
-                               guint32 handle,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               gint32 arg_type,
+               GVariant *arg_data,
+               guint32 handle,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static NetNfcGDbusP2p *p2p_skeleton = NULL;
 
@@ -52,25 +52,22 @@ static void p2p_send_data_thread_func(gpointer user_data)
 {
        P2pSendData *p2p_data = (P2pSendData *)user_data;
        net_nfc_error_e result;
-       net_nfc_target_handle_s *handle;
 
        g_assert(p2p_data != NULL);
        g_assert(p2p_data->p2p != NULL);
        g_assert(p2p_data->invocation != NULL);
 
-       handle = GUINT_TO_POINTER(p2p_data->p2p_handle);
-
        result = net_nfc_server_snep_default_client_start(
-               GUINT_TO_POINTER(p2p_data->p2p_handle),
-               SNEP_REQ_PUT,
-               &p2p_data->data,
-               -1,
-               p2p_data);
+                       p2p_data->p2p_handle,
+                       SNEP_REQ_PUT,
+                       &p2p_data->data,
+                       -1,
+                       p2p_data);
        if (result != NET_NFC_OK)
        {
                net_nfc_gdbus_p2p_complete_send(p2p_data->p2p,
-                       p2p_data->invocation,
-                       (gint)result);
+                               p2p_data->invocation,
+                               (gint)result);
 
                net_nfc_util_free_data(&p2p_data->data);
 
@@ -82,24 +79,24 @@ static void p2p_send_data_thread_func(gpointer user_data)
 }
 
 static gboolean p2p_handle_send(NetNfcGDbusP2p *p2p,
-                               GDBusMethodInvocation *invocation,
-                               gint32 arg_type,
-                               GVariant *arg_data,
-                               guint32 handle,
-                               GVariant *smack_privilege,
-                               gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               gint32 arg_type,
+               GVariant *arg_data,
+               guint32 handle,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        gboolean result;
        P2pSendData *data;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "w") == false) {
+                               smack_privilege,
+                               "nfc-manager::p2p",
+                               "w") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -110,8 +107,8 @@ static gboolean p2p_handle_send(NetNfcGDbusP2p *p2p,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -119,11 +116,11 @@ static gboolean p2p_handle_send(NetNfcGDbusP2p *p2p,
        data->p2p = g_object_ref(p2p);
        data->invocation = g_object_ref(invocation);
        data->type = arg_type;
-       data->p2p_handle = handle;
+       data->p2p_handle = GUINT_TO_POINTER(handle);
        net_nfc_util_gdbus_variant_to_data_s(arg_data, &data->data);
 
        result = net_nfc_server_controller_async_queue_push(
-               p2p_send_data_thread_func, data);
+                       p2p_send_data_thread_func, data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
@@ -158,10 +155,10 @@ gboolean net_nfc_server_p2p_init(GDBusConnection *connection)
                        NULL);
 
        result = g_dbus_interface_skeleton_export(
-               G_DBUS_INTERFACE_SKELETON(p2p_skeleton),
-               connection,
-               "/org/tizen/NetNfcService/P2p",
-               &error);
+                       G_DBUS_INTERFACE_SKELETON(p2p_skeleton),
+                       connection,
+                       "/org/tizen/NetNfcService/P2p",
+                       &error);
        if (result == FALSE)
        {
                g_error_free(error);
@@ -207,7 +204,7 @@ void net_nfc_server_p2p_discovered(net_nfc_target_handle_h handle)
        DEBUG_ERR_MSG("Emitting p2p discovered signal");
 
        net_nfc_gdbus_p2p_emit_discovered(p2p_skeleton,
-                                       GPOINTER_TO_UINT(handle));
+                       GPOINTER_TO_UINT(handle));
 }
 
 void net_nfc_server_p2p_received(data_h user_data)
@@ -227,7 +224,7 @@ void net_nfc_server_p2p_received(data_h user_data)
 }
 
 void net_nfc_server_p2p_data_sent(net_nfc_error_e result,
-                               gpointer user_data)
+               gpointer user_data)
 {
        P2pSendData *data = (P2pSendData *)user_data;
 
@@ -236,8 +233,8 @@ void net_nfc_server_p2p_data_sent(net_nfc_error_e result,
        g_assert(data->invocation != NULL);
 
        net_nfc_gdbus_p2p_complete_send(data->p2p,
-               data->invocation,
-               (gint)result);
+                       data->invocation,
+                       (gint)result);
 
        net_nfc_util_free_data(&data->data);
 
similarity index 76%
rename from src/manager/net_nfc_server_process_handover.c
rename to daemon/net_nfc_server_process_handover.c
index 9a23850..b2f8a15 100644 (file)
 #include "net_nfc_util_ndef_message.h"
 #include "net_nfc_util_ndef_record.h"
 #include "net_nfc_util_handover.h"
-#include "net_nfc_manager_util_internal.h"
-#include "net_nfc_controller_internal.h"
+#include "net_nfc_server_controller.h"
 #include "net_nfc_server_llcp.h"
-#include "net_nfc_server_handover_internal.h"
+#include "net_nfc_server_process_handover.h"
 #include "net_nfc_server_process_snep.h"
 #include "net_nfc_util_gdbus_internal.h"
 #include "net_nfc_server_handover_bss.h"
+#include "net_nfc_server_handover_bt.h"
 
 typedef void (*_net_nfc_server_handover_create_carrier_msg_cb)(
-                                               net_nfc_error_e result,
-                                               ndef_message_s *selector,
-                                               void *user_param);
+               net_nfc_error_e result,
+               ndef_message_s *selector,
+               void *user_param);
 
 typedef struct _net_nfc_handover_context_t
 {
@@ -48,11 +48,11 @@ typedef struct _net_nfc_handover_context_t
 net_nfc_handover_context_t;
 
 #define NET_NFC_CH_CONTEXT net_nfc_target_handle_s *handle;\
-                       net_nfc_llcp_socket_t socket;\
-                       net_nfc_error_e result;\
-                       int step;\
-                       net_nfc_conn_handover_carrier_type_e type;\
-                       void *user_param;
+       net_nfc_llcp_socket_t socket;\
+       net_nfc_error_e result;\
+       int step;\
+       net_nfc_conn_handover_carrier_type_e type;\
+       void *user_param;
 
 typedef struct _net_nfc_server_handover_create_config_context_t
 {
@@ -72,60 +72,59 @@ typedef struct _net_nfc_server_handover_process_config_context_t
        NET_NFC_CH_CONTEXT;
 
        net_nfc_server_handover_process_carrier_record_cb cb;
-}
-net_nfc_server_handover_process_config_context_t;
+}net_nfc_server_handover_process_config_context_t;
 
 
 
 static void _net_nfc_server_handover_send_response(void *user_param,
-                                       data_h ac_data,
-                                       net_nfc_error_e result);
+               data_h ac_data,
+               net_nfc_error_e result);
 
 static void _net_nfc_server_handover_client_process(
-                                       net_nfc_handover_context_t *context);
+               net_nfc_handover_context_t *context);
 
 static void _net_nfc_server_handover_client_error_cb(
-                                       net_nfc_error_e result,
-                                       net_nfc_target_handle_s *handle,
-                                       net_nfc_llcp_socket_t socket,
-                                       data_s *data,
-                                       void *user_param);
+               net_nfc_error_e result,
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               void *user_param);
 
 static void _net_nfc_server_handover_client_connected_cb(
-                                       net_nfc_error_e result,
-                                       net_nfc_target_handle_s *handle,
-                                       net_nfc_llcp_socket_t socket,
-                                       data_s *data,
-                                       void *user_param);
+               net_nfc_error_e result,
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               void *user_param);
 
 static void _net_nfc_server_handover_get_response_process(
-                                       net_nfc_handover_context_t *context);
+               net_nfc_handover_context_t *context);
 
 static int _net_nfc_server_handover_append_wifi_carrier_config(
                net_nfc_server_handover_create_config_context_t *context);
 
 static net_nfc_error_e
 _net_nfc_server_handover_create_requester_from_rawdata(
-                               ndef_message_s **requestor,
-                               data_s *data);
+               ndef_message_s **requestor,
+               data_s *data);
 
 static net_nfc_error_e
 _net_nfc_server_handover_create_requester_carrier_configs(
-                               net_nfc_conn_handover_carrier_type_e type,
-                               void *cb,
-                                               void *user_param);
+               net_nfc_conn_handover_carrier_type_e type,
+               void *cb,
+               void *user_param);
 
 static bool _net_nfc_server_handover_check_hr_record_validation(
-                                               ndef_message_s *message);
+               ndef_message_s *message);
 
 static bool _net_nfc_server_handover_check_hs_record_validation(
-                                               ndef_message_s *message);
+               ndef_message_s *message);
 
 static net_nfc_error_e
 _net_nfc_server_handover_create_selector_carrier_configs(
-                               net_nfc_conn_handover_carrier_type_e type,
-                               void *cb,
-                               void *user_param);
+               net_nfc_conn_handover_carrier_type_e type,
+               void *cb,
+               void *user_param);
 
 static int _net_nfc_server_handover_iterate_create_carrier_configs(
                net_nfc_server_handover_create_config_context_t *context);
@@ -137,19 +136,19 @@ static int _net_nfc_server_handover_iterate_carrier_configs_step(
                net_nfc_server_handover_create_config_context_t *context);
 
 static void _net_nfc_server_handover_server_process(
-                               net_nfc_handover_context_t *context);
+               net_nfc_handover_context_t *context);
 
 static net_nfc_error_e
 _net_nfc_server_handover_create_low_power_selector_message(
-                                       ndef_message_s *request_msg,
-                                       ndef_message_s *select_msg);
+               ndef_message_s *request_msg,
+               ndef_message_s *select_msg);
 
 ////////////////////////////////////////////////////////////////////////////
 
 static void _net_nfc_server_handover_send_response(
-                                       void *user_param,
-                                       data_h ac_data,
-                                       net_nfc_error_e result)
+               void *user_param,
+               data_h ac_data,
+               net_nfc_error_e result)
 {
        HandoverRequestData *handover_data = NULL;
        guint32 resp_event;
@@ -170,11 +169,11 @@ static void _net_nfc_server_handover_send_response(
        if (handover_data->invocation)
        {
                net_nfc_gdbus_handover_complete_request(
-                                               handover_data->handoverobj,
-                                               handover_data->invocation,
-                                               resp_event,
-                                               resp_type,
-                                               data);
+                               handover_data->handoverobj,
+                               handover_data->invocation,
+                               resp_event,
+                               resp_type,
+                               data);
 
                g_object_unref(handover_data->invocation);
        }
@@ -191,8 +190,8 @@ static void _net_nfc_server_handover_send_response(
 }
 
 static net_nfc_error_e _net_nfc_server_handover_convert_ndef_message_to_data(
-                                       ndef_message_s *msg,
-                                       data_s *data)
+               ndef_message_s *msg,
+               data_s *data)
 {
        net_nfc_error_e result;
        uint32_t length;
@@ -217,12 +216,12 @@ static net_nfc_error_e _net_nfc_server_handover_convert_ndef_message_to_data(
 }
 
 static void _net_nfc_server_handover_bt_get_carrier_record_cb(
-                               net_nfc_error_e result,
-                               net_nfc_conn_handover_carrier_state_e cps,
-                               ndef_record_s *carrier,
-                               uint32_t aux_data_count,
-                               ndef_record_s *aux_data,
-                               void *user_param)
+               net_nfc_error_e result,
+               net_nfc_conn_handover_carrier_state_e cps,
+               ndef_record_s *carrier,
+               uint32_t aux_data_count,
+               ndef_record_s *aux_data,
+               void *user_param)
 {
        net_nfc_server_handover_create_config_context_t *context =
                (net_nfc_server_handover_create_config_context_t *)user_param;
@@ -234,40 +233,40 @@ static void _net_nfc_server_handover_bt_get_carrier_record_cb(
 
                /* FIXME : copy record and append */
                net_nfc_util_create_record(carrier->TNF,
-                                       &carrier->type_s,
-                                       &carrier->id_s,
-                                       &carrier->payload_s,
-                                       &record);
+                               &carrier->type_s,
+                               &carrier->id_s,
+                               &carrier->payload_s,
+                               &record);
 
                if ((result = net_nfc_util_append_carrier_config_record(
-                                       context->ndef_message,
-                                       record,
-                                       cps)) == NET_NFC_OK)
+                                               context->ndef_message,
+                                               record,
+                                               cps)) == NET_NFC_OK)
                {
                        DEBUG_SERVER_MSG("net_nfc_util_append_carrier"
-                                               "_config_record success");
+                                       "_config_record success");
                }
                else
                {
                        DEBUG_ERR_MSG("net_nfc_util_append_carrier"
                                        "_config_record failed [%d]",
-                               result);
+                                       result);
                        net_nfc_util_free_record(record);
                }
 
                g_idle_add(
-               (GSourceFunc)_net_nfc_server_handover_iterate_carrier_configs_to_next,
-               (gpointer)context);
+                               (GSourceFunc)_net_nfc_server_handover_iterate_carrier_configs_to_next,
+                               (gpointer)context);
        }
 
        /* don't free context */
 }
 
 static void _net_nfc_server_handover_bt_process_carrier_record_cb(
-                               net_nfc_error_e result,
-                               net_nfc_conn_handover_carrier_type_e type,
-                               data_s *data,
-                               void *user_param)
+               net_nfc_error_e result,
+               net_nfc_conn_handover_carrier_type_e type,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_server_handover_process_config_context_t *context =
                (net_nfc_server_handover_process_config_context_t *)user_param;
@@ -282,17 +281,16 @@ static void _net_nfc_server_handover_bt_process_carrier_record_cb(
        else
        {
                DEBUG_ERR_MSG("_handover_bt_process_carrier_record failed [%d]",
-                       result);
+                               result);
        }
 
        _net_nfc_util_free_mem(context);
 }
 
 
-net_nfc_error_e
-_net_nfc_server_handover_get_carrier_record_by_priority_order(
-                               ndef_message_s *request,
-                               ndef_record_s **record)
+net_nfc_error_e _net_nfc_server_handover_get_carrier_record_by_priority_order(
+               ndef_message_s *request,
+               ndef_record_s **record)
 {
        net_nfc_error_e result;
        unsigned int carrier_count = 0;
@@ -307,31 +305,31 @@ _net_nfc_server_handover_get_carrier_record_by_priority_order(
        *record = NULL;
 
        if ((result = net_nfc_util_get_alternative_carrier_record_count(
-                               request,
-                               &carrier_count)) == NET_NFC_OK)
+                                       request,
+                                       &carrier_count)) == NET_NFC_OK)
        {
                int idx, priority;
                net_nfc_conn_handover_carrier_type_e carrier_type =
-                               NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN;
+                       NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN;
 
                for (priority = NET_NFC_CONN_HANDOVER_CARRIER_BT;*record == NULL
-                       && priority < NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN;priority++)
+                               && priority < NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN;priority++)
                {
                        /* check each carrier record and create matched record */
                        for (idx = 0; idx < carrier_count; idx++)
                        {
                                if ((net_nfc_util_get_alternative_carrier_type(
-                                       request,
-                                       idx,
-                                       &carrier_type)== NET_NFC_OK)
-                                       && (carrier_type == priority))
+                                                               request,
+                                                               idx,
+                                                               &carrier_type)== NET_NFC_OK)
+                                               && (carrier_type == priority))
                                {
                                        DEBUG_SERVER_MSG("selected carrier type"
                                                        " = [%d]", carrier_type);
                                        net_nfc_util_get_carrier_config_record(
-                                                               request,
-                                                               idx,
-                                                               record);
+                                                       request,
+                                                       idx,
+                                                       record);
                                        result = NET_NFC_OK;
                                        break;
                                }
@@ -341,7 +339,7 @@ _net_nfc_server_handover_get_carrier_record_by_priority_order(
        else
        {
                DEBUG_ERR_MSG("net_nfc_util_get_alternative_carrier"
-                                               "_record_count failed");
+                               "_record_count failed");
        }
 
        LOGD("[%s] END", __func__);
@@ -350,8 +348,8 @@ _net_nfc_server_handover_get_carrier_record_by_priority_order(
 }
 
 static net_nfc_error_e _net_nfc_server_handover_create_requester_from_rawdata(
-                                               ndef_message_s **requestor,
-                                               data_s *data)
+               ndef_message_s **requestor,
+               data_s *data)
 {
        net_nfc_error_e result;
 
@@ -364,7 +362,7 @@ static net_nfc_error_e _net_nfc_server_handover_create_requester_from_rawdata(
        if (result == NET_NFC_OK)
        {
                result = net_nfc_util_convert_rawdata_to_ndef_message(data,
-                       *requestor);
+                               *requestor);
 
                if (result == NET_NFC_OK)
                {
@@ -384,19 +382,19 @@ static net_nfc_error_e _net_nfc_server_handover_create_requester_from_rawdata(
                else
                {
                        DEBUG_ERR_MSG("_net_nfc_ndef_rawdata_to_ndef"
-                                                       "failed [%d]",result);
+                                       "failed [%d]",result);
                }
        } else {
                DEBUG_ERR_MSG("net_nfc_util_create_ndef_message failed [%d]",
-                       result);
+                               result);
        }
 
        return result;
 }
 
 net_nfc_error_e _net_nfc_server_handover_create_selector_from_rawdata(
-                                                       ndef_message_s **selector,
-                                                       data_s *data)
+               ndef_message_s **selector,
+               data_s *data)
 {
        net_nfc_error_e result;
 
@@ -406,15 +404,15 @@ net_nfc_error_e _net_nfc_server_handover_create_selector_from_rawdata(
        *selector = NULL;
 
        if ((result = net_nfc_util_create_ndef_message(selector))
-               == NET_NFC_OK)
+                       == NET_NFC_OK)
        {
                if ((result = net_nfc_util_convert_rawdata_to_ndef_message(data,
-                       *selector)) == NET_NFC_OK)
+                                               *selector)) == NET_NFC_OK)
                {
 
                        /* if record is not Hs record, then */
                        if (_net_nfc_server_handover_check_hs_record_validation(
-                                                       *selector) == true)
+                                               *selector) == true)
                        {
                                result = NET_NFC_OK;
                        }
@@ -429,7 +427,7 @@ net_nfc_error_e _net_nfc_server_handover_create_selector_from_rawdata(
                else
                {
                        DEBUG_ERR_MSG("_net_nfc_ndef_rawdata_to_ndef"
-                               " failed [%d]",result);
+                                       " failed [%d]",result);
                }
        }
        else
@@ -442,7 +440,7 @@ net_nfc_error_e _net_nfc_server_handover_create_selector_from_rawdata(
 }
 
 static bool _net_nfc_server_handover_check_hr_record_validation(
-                                       ndef_message_s *message)
+               ndef_message_s *message)
 {
        unsigned int count;
        ndef_record_s *rec;
@@ -455,10 +453,10 @@ static bool _net_nfc_server_handover_check_hr_record_validation(
        rec = (ndef_record_s *)message->records;
 
        if (memcmp(rec->type_s.buffer, CH_REQ_RECORD_TYPE,
-               rec->type_s.length) != 0)
+                               rec->type_s.length) != 0)
        {
                DEBUG_ERR_MSG("This is not connection handover"
-                                               " request message");
+                               " request message");
                goto ERROR;
        }
 
@@ -469,7 +467,7 @@ static bool _net_nfc_server_handover_check_hr_record_validation(
        }
 
        if (net_nfc_util_get_alternative_carrier_record_count(message, &count)
-               != NET_NFC_OK || count == 0)
+                       != NET_NFC_OK || count == 0)
        {
                DEBUG_ERR_MSG("there is no carrier reference");
                goto ERROR;
@@ -486,7 +484,7 @@ ERROR :
 }
 
 static bool _net_nfc_server_handover_check_hs_record_validation(
-                                       ndef_message_s *message)
+               ndef_message_s *message)
 {
        unsigned int count;
        ndef_record_s *rec;
@@ -499,15 +497,15 @@ static bool _net_nfc_server_handover_check_hs_record_validation(
        rec = (ndef_record_s *)message->records;
 
        if (memcmp(rec->type_s.buffer, CH_SEL_RECORD_TYPE,
-               rec->type_s.length) != 0)
+                               rec->type_s.length) != 0)
        {
                DEBUG_ERR_MSG("This is not connection handover"
-                                               " request message");
+                               " request message");
                goto ERROR;
        }
 
        if (net_nfc_util_get_alternative_carrier_record_count(
-                       message,&count)!= NET_NFC_OK || count == 0)
+                               message,&count)!= NET_NFC_OK || count == 0)
        {
                DEBUG_ERR_MSG("there is no carrrier reference");
                goto ERROR;
@@ -517,7 +515,7 @@ static bool _net_nfc_server_handover_check_hs_record_validation(
        if (rec->payload_s.buffer[0] != CH_VERSION)
        {
                DEBUG_ERR_MSG("connection handover version"
-                                       " is not matched");
+                               " is not matched");
                goto ERROR;
        }
 
@@ -544,7 +542,7 @@ static int _net_nfc_server_handover_iterate_carrier_configs_step(
        if (context->cb != NULL)
        {
                context->cb(NET_NFC_OK, context->ndef_message,
-                       context->user_param);
+                               context->user_param);
        }
 
        if (context->ndef_message != NULL)
@@ -560,7 +558,7 @@ static int _net_nfc_server_handover_iterate_carrier_configs_step(
 }
 
 static int _net_nfc_server_handover_append_wifi_carrier_config(
-       net_nfc_server_handover_create_config_context_t *context)
+               net_nfc_server_handover_create_config_context_t *context)
 {
        LOGD("[%s:%d] START", __func__, __LINE__);
 
@@ -589,8 +587,8 @@ static int _net_nfc_server_handover_append_wifi_carrier_config(
 
                /* complete and return to upper step */
                g_idle_add(
-               (GSourceFunc)_net_nfc_server_handover_iterate_carrier_configs_to_next,
-               (gpointer)context);
+                               (GSourceFunc)_net_nfc_server_handover_iterate_carrier_configs_to_next,
+                               (gpointer)context);
                break;
 
        default :
@@ -618,20 +616,20 @@ static int _net_nfc_server_handover_iterate_carrier_configs_to_next(
                else
                {
                        context->current_type =
-                                       NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN;
+                               NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN;
                }
 
                g_idle_add(
-               (GSourceFunc)_net_nfc_server_handover_iterate_create_carrier_configs,
-               (gpointer)context);
+                               (GSourceFunc)_net_nfc_server_handover_iterate_create_carrier_configs,
+                               (gpointer)context);
        }
        else
        {
                DEBUG_ERR_MSG("context->result is error [%d]", context->result);
 
                g_idle_add(
-               (GSourceFunc)_net_nfc_server_handover_iterate_carrier_configs_step,
-               (gpointer)context);
+                               (GSourceFunc)_net_nfc_server_handover_iterate_carrier_configs_step,
+                               (gpointer)context);
        }
 
        return 0;
@@ -647,36 +645,36 @@ static int _net_nfc_server_handover_iterate_create_carrier_configs(
        case NET_NFC_CONN_HANDOVER_CARRIER_BT :
                DEBUG_MSG("[NET_NFC_CONN_HANDOVER_CARRIER_BT]");
                net_nfc_server_handover_bt_get_carrier_record(
-                       _net_nfc_server_handover_bt_get_carrier_record_cb,
-                       context);
+                               _net_nfc_server_handover_bt_get_carrier_record_cb,
+                               context);
                break;
 
-//     case NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS :
-//             DEBUG_MSG("[NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS]");
-//             g_idle_add(
-//             (GSourceFunc)net_nfc_service_llcp_handover_append_wifi_carrier_config,
-//                             context);
-//             break;
+               //      case NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS :
+               //              DEBUG_MSG("[NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS]");
+               //              g_idle_add(
+               //              (GSourceFunc)net_nfc_service_llcp_handover_append_wifi_carrier_config,
+               //                              context);
+               //              break;
 
-//     case NET_NFC_CONN_HANDOVER_CARRIER_WIFI_IBSS :
-//             DEBUG_MSG("[NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS]");
-//             g_idle_add(
-//             (GSourceFunc)_net_nfc_server_handover_append_wifi_carrier_config,
-//                     context);
-//             break;
+               //      case NET_NFC_CONN_HANDOVER_CARRIER_WIFI_IBSS :
+               //              DEBUG_MSG("[NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS]");
+               //              g_idle_add(
+               //              (GSourceFunc)_net_nfc_server_handover_append_wifi_carrier_config,
+               //                      context);
+               //              break;
 
        case NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN :
                DEBUG_MSG("[NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN]");
                g_idle_add(
-               (GSourceFunc)_net_nfc_server_handover_iterate_carrier_configs_step,
-               (gpointer)context);
+                               (GSourceFunc)_net_nfc_server_handover_iterate_carrier_configs_step,
+                               (gpointer)context);
                break;
 
        default :
                DEBUG_MSG("[unknown : %d]", context->current_type);
                g_idle_add(
-               (GSourceFunc)_net_nfc_server_handover_iterate_carrier_configs_step,
-               (gpointer)context);
+                               (GSourceFunc)_net_nfc_server_handover_iterate_carrier_configs_step,
+                               (gpointer)context);
                break;
        }
 
@@ -685,11 +683,10 @@ static int _net_nfc_server_handover_iterate_create_carrier_configs(
        return 0;
 }
 
-static net_nfc_error_e
-_net_nfc_server_handover_create_requester_carrier_configs(
-                       net_nfc_conn_handover_carrier_type_e type,
-                       void *cb,
-                       void *user_param)
+static net_nfc_error_e _net_nfc_server_handover_create_requester_carrier_configs(
+               net_nfc_conn_handover_carrier_type_e type,
+               void *cb,
+               void *user_param)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_server_handover_create_config_context_t *context = NULL;
@@ -703,7 +700,7 @@ _net_nfc_server_handover_create_requester_carrier_configs(
                if (type == NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN)
                {
                        context->current_type =
-                                       NET_NFC_CONN_HANDOVER_CARRIER_BT;
+                               NET_NFC_CONN_HANDOVER_CARRIER_BT;
                }
                else
                        context->current_type = context->type;
@@ -711,12 +708,12 @@ _net_nfc_server_handover_create_requester_carrier_configs(
                context->cb = cb;
                context->user_param = user_param;
                net_nfc_util_create_handover_request_message(
-                                               &context->ndef_message);
+                               &context->ndef_message);
 
                /* append carrier record */
                g_idle_add(
-               (GSourceFunc)_net_nfc_server_handover_iterate_create_carrier_configs,
-               (gpointer)context);
+                               (GSourceFunc)_net_nfc_server_handover_iterate_create_carrier_configs,
+                               (gpointer)context);
        }
        else
        {
@@ -729,11 +726,10 @@ _net_nfc_server_handover_create_requester_carrier_configs(
        return result;
 }
 
-static net_nfc_error_e
-_net_nfc_server_handover_create_selector_carrier_configs(
-                       net_nfc_conn_handover_carrier_type_e type,
-                       void *cb,
-                       void *user_param)
+static net_nfc_error_e _net_nfc_server_handover_create_selector_carrier_configs(
+               net_nfc_conn_handover_carrier_type_e type,
+               void *cb,
+               void *user_param)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_server_handover_create_config_context_t *context = NULL;
@@ -745,21 +741,19 @@ _net_nfc_server_handover_create_selector_carrier_configs(
        {
                context->type = type;
                if (type == NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN)
-               {
-                       context->current_type =
-                               NET_NFC_CONN_HANDOVER_CARRIER_BT;
-               }
+                       context->current_type = NET_NFC_CONN_HANDOVER_CARRIER_BT;
                else
                        context->current_type = context->type;
-                       context->cb = cb;
-                       context->user_param = user_param;
-                       net_nfc_util_create_handover_select_message(
-                                       &context->ndef_message);
+
+               context->cb = cb;
+               context->user_param = user_param;
+               net_nfc_util_create_handover_select_message(
+                               &context->ndef_message);
 
                /* append carrier record */
                g_idle_add(
-               (GSourceFunc)_net_nfc_server_handover_iterate_create_carrier_configs,
-               (gpointer)context);
+                               (GSourceFunc)_net_nfc_server_handover_iterate_create_carrier_configs,
+                               (gpointer)context);
        }
        else
        {
@@ -772,10 +766,10 @@ _net_nfc_server_handover_create_selector_carrier_configs(
        return result;
 }
 
-static net_nfc_error_e
+       static net_nfc_error_e
 _net_nfc_server_handover_create_low_power_selector_message(
-                                       ndef_message_s *request_msg,
-                                       ndef_message_s *select_msg)
+               ndef_message_s *request_msg,
+               ndef_message_s *select_msg)
 {
        net_nfc_error_e result = NET_NFC_UNKNOWN_ERROR;
        unsigned int carrier_count = 0;
@@ -794,14 +788,14 @@ _net_nfc_server_handover_create_low_power_selector_message(
                int idx;
                ndef_record_s *carrier_record = NULL;
                net_nfc_conn_handover_carrier_type_e carrier_type =
-                               NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN;
+                       NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN;
 
                /* check each carrier record and create matched record */
                for (idx = 0; idx < carrier_count; idx++)
                {
                        if ((net_nfc_util_get_alternative_carrier_type(
-                       request_msg,idx,&carrier_type) != NET_NFC_OK) ||
-                       (carrier_type == NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN))
+                                                       request_msg,idx,&carrier_type) != NET_NFC_OK) ||
+                                       (carrier_type == NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN))
                        {
                                DEBUG_ERR_MSG("net_nfc_util_get_alternative"
                                                "_carrier_type failed or unknown");
@@ -815,19 +809,19 @@ _net_nfc_server_handover_create_low_power_selector_message(
                                net_nfc_carrier_config_s *config = NULL;
 
                                if ((result = net_nfc_util_create_carrier_config(
-                                               &config,carrier_type)) == NET_NFC_OK)
+                                                               &config,carrier_type)) == NET_NFC_OK)
                                {
                                        if ((result =
-                                               net_nfc_util_create_ndef_record_with_carrier_config(
-                                               &carrier_record,config)) == NET_NFC_OK)
+                                                               net_nfc_util_create_ndef_record_with_carrier_config(
+                                                                       &carrier_record,config)) == NET_NFC_OK)
                                        {
                                                DEBUG_SERVER_MSG("net_nfc_util_create_ndef_record_"
-                                                       "with_carrier_config success");
+                                                               "with_carrier_config success");
                                        }
                                        else
                                        {
                                                DEBUG_ERR_MSG("create_ndef_record_with_carrier_config "
-                                                                               "failed [%d]", result);
+                                                               "failed [%d]", result);
                                                net_nfc_util_free_carrier_config(config);
                                                continue;
                                        }
@@ -843,16 +837,16 @@ _net_nfc_server_handover_create_low_power_selector_message(
 
                        /* append carrier configure record to selector message */
                        if ((result = net_nfc_util_append_carrier_config_record(
-                                       select_msg,
-                                       carrier_record,
-                                       NET_NFC_CONN_HANDOVER_CARRIER_INACTIVATE)) == NET_NFC_OK)
+                                                       select_msg,
+                                                       carrier_record,
+                                                       NET_NFC_CONN_HANDOVER_CARRIER_INACTIVATE)) == NET_NFC_OK)
                        {
                                DEBUG_SERVER_MSG("net_nfc_util_append_carrier_config_record success");
                        }
                        else
                        {
                                DEBUG_ERR_MSG("net_nfc_util_append_carrier_config_record"
-                                                                       " failed [%d]", result);
+                                               " failed [%d]", result);
 
                                net_nfc_util_free_record(carrier_record);
                        }
@@ -871,9 +865,9 @@ _net_nfc_server_handover_create_low_power_selector_message(
 }
 
 net_nfc_error_e _net_nfc_server_handover_process_carrier_record(
-                               ndef_record_s *carrier,
-                               void *cb,
-                               void *user_param)
+               ndef_record_s *carrier,
+               void *cb,
+               void *user_param)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_server_handover_process_config_context_t *context = NULL;
@@ -886,8 +880,8 @@ net_nfc_error_e _net_nfc_server_handover_process_carrier_record(
                net_nfc_conn_handover_carrier_type_e type;
 
                net_nfc_util_get_alternative_carrier_type_from_record(
-                       carrier,
-                       &type);
+                               carrier,
+                               &type);
 
                context->type = type;
                context->user_param = user_param;
@@ -900,17 +894,17 @@ net_nfc_error_e _net_nfc_server_handover_process_carrier_record(
                case NET_NFC_CONN_HANDOVER_CARRIER_BT :
                        DEBUG_MSG("[NET_NFC_CONN_HANDOVER_CARRIER_BT]");
                        net_nfc_server_handover_bt_process_carrier_record(
-                               carrier,
-                               _net_nfc_server_handover_bt_process_carrier_record_cb,
-                               context);
+                                       carrier,
+                                       _net_nfc_server_handover_bt_process_carrier_record_cb,
+                                       context);
                        break;
 
                case NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS :
                        DEBUG_MSG("[NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS]");
                        net_nfc_server_handover_bss_process_carrier_record(
-                               carrier,
-                               NULL,
-                               NULL);
+                                       carrier,
+                                       NULL,
+                                       NULL);
                        _net_nfc_util_free_mem(context);
                        break;
 
@@ -938,17 +932,17 @@ net_nfc_error_e _net_nfc_server_handover_process_carrier_record(
 
 #if 0
 static net_nfc_error_e _net_nfc_server_handover_snep_client_cb(
-                                       net_nfc_snep_handle_h handle,
-                                       net_nfc_error_e result,
-                                       uint32_t type,
-                                       data_s *data,
-                                       void *user_param)
+               net_nfc_snep_handle_h handle,
+               net_nfc_error_e result,
+               uint32_t type,
+               data_s *data,
+               void *user_param)
 {
        _net_nfc_server_handover_client_context_t *context =
                (_net_nfc_server_handover_client_context_t *)user_param;
 
        DEBUG_SERVER_MSG("type [%d], result [%d], data [%p], user_param [%p]",
-               type, result, data, user_param);
+                       type, result, data, user_param);
 
        switch (type) {
        case SNEP_RESP_SUCCESS :
@@ -956,29 +950,29 @@ static net_nfc_error_e _net_nfc_server_handover_snep_client_cb(
                        ndef_message_s *selector;
 
                        result = _net_nfc_server_handover_create_selector_from_rawdata(
-                                                       &selector,
-                                                       data);
+                                       &selector,
+                                       data);
                        if (result == NET_NFC_OK) {
                                if (false /* is low power ??? */) {
                                        result =
                                                _net_nfc_server_handover_process_selector_msg(
-                                               selector,
-                                               user_param);
+                                                               selector,
+                                                               user_param);
                                } else {
                                        result =
-                                                _net_nfc_server_handover_process_selector_msg(
-                                               selector,
-                                               user_param);
+                                               _net_nfc_server_handover_process_selector_msg(
+                                                               selector,
+                                                               user_param);
                                }
 
                                if (result != NET_NFC_OK) {
                                        DEBUG_ERR_MSG("_net_nfc_server_handover_process"
-                                               "_selector_msg failed [%d]",result);
+                                                       "_selector_msg failed [%d]",result);
                                        if (context->cb != NULL) {
                                                context->cb(result,
-                                                       context->type,
-                                                       NULL,
-                                                       context->user_param);
+                                                               context->type,
+                                                               NULL,
+                                                               context->user_param);
                                        }
                                        _net_nfc_util_free_mem(context);
                                }
@@ -986,12 +980,12 @@ static net_nfc_error_e _net_nfc_server_handover_snep_client_cb(
                                net_nfc_util_free_ndef_message(selector);
                        } else {
                                DEBUG_ERR_MSG("_net_nfc_server_handover_create"
-                                       "_selector_from_rawdata failed [%d]",result);
+                                               "_selector_from_rawdata failed [%d]",result);
                                if (context->cb != NULL) {
                                        context->cb(result,
-                                               context->type,
-                                               NULL,
-                                               context->user_param);
+                                                       context->type,
+                                                       NULL,
+                                                       context->user_param);
                                }
                                _net_nfc_util_free_mem(context);
                        }
@@ -1009,7 +1003,7 @@ static net_nfc_error_e _net_nfc_server_handover_snep_client_cb(
                        DEBUG_ERR_MSG("error response [0x%02x]", type);
                        if (context->cb != NULL) {
                                context->cb(result, context->type, NULL,
-                                       context->user_param);
+                                               context->user_param);
                        }
                        _net_nfc_util_free_mem(context);
                }
@@ -1021,9 +1015,9 @@ static net_nfc_error_e _net_nfc_server_handover_snep_client_cb(
 
 
 static void _net_nfc_server_handover_create_requester_carrier_configs_cb(
-                                               net_nfc_error_e result,
-                                               ndef_message_s *msg,
-                                               void *user_param)
+               net_nfc_error_e result,
+               ndef_message_s *msg,
+               void *user_param)
 {
        _net_nfc_server_handover_client_context_t *context =
                (_net_nfc_server_handover_client_context_t *)user_param;
@@ -1037,27 +1031,27 @@ static void _net_nfc_server_handover_create_requester_carrier_configs_cb(
        if (msg != NULL) {
                /* convert ndef message */
                if ((result = _net_nfc_server_handover_convert_ndef_message_to_data(msg,
-                       &data)) == NET_NFC_OK) {
+                                               &data)) == NET_NFC_OK) {
                        net_nfc_service_snep_client(context->handle,
-                                               SNEP_SAN,
-                                               0,
-                                               SNEP_REQ_GET,
-                                               &data,
-                                               _net_nfc_server_handover_snep_client_cb,
-                                               context);
+                                       SNEP_SAN,
+                                       0,
+                                       SNEP_REQ_GET,
+                                       &data,
+                                       _net_nfc_server_handover_snep_client_cb,
+                                       context);
 
                        net_nfc_util_free_data(&data);
                }
                else
                {
                        DEBUG_ERR_MSG("_net_nfc_server_handover_convert"
-                               "_ndef_message_to_datafailed [%d]",result);
+                                       "_ndef_message_to_datafailed [%d]",result);
                        if (context->cb != NULL)
                        {
                                context->cb(result,
-                                       context->type,
-                                       NULL,
-                                       context->user_param);
+                                               context->type,
+                                               NULL,
+                                               context->user_param);
                        }
                        _net_nfc_util_free_mem(context);
                }
@@ -1068,9 +1062,9 @@ static void _net_nfc_server_handover_create_requester_carrier_configs_cb(
                if (context->cb != NULL)
                {
                        context->cb(result,
-                               context->type,
-                               NULL,
-                               context->user_param);
+                                       context->type,
+                                       NULL,
+                                       context->user_param);
                }
                _net_nfc_util_free_mem(context);
        }
@@ -1081,12 +1075,12 @@ static void _net_nfc_server_handover_create_requester_carrier_configs_cb(
 #if 0
 
 static void _net_nfc_server_handover_server_create_carrier_configs_cb(
-                                               net_nfc_error_e result,
-                                               ndef_message_s *selector,
-                                               void *user_param)
+               net_nfc_error_e result,
+               ndef_message_s *selector,
+               void *user_param)
 {
        _net_nfc_server_handover_create_config_context_t *context =
-           (_net_nfc_server_handover_create_config_context_t *)user_param;
+               (_net_nfc_server_handover_create_config_context_t *)user_param;
        data_s data;
 
        if (context == NULL)
@@ -1097,46 +1091,46 @@ static void _net_nfc_server_handover_server_create_carrier_configs_cb(
        if (result == NET_NFC_OK)
        {
                result = _net_nfc_server_handover_convert_ndef_message_to_data(
-                                                               selector,
-                                                               &data);
+                               selector,
+                               &data);
 
                if (result == NET_NFC_OK)
                {
                        /* process message */
                        _net_nfc_server_handover_process_carrier_record(
-                                                       context->record,
-                                                       NULL,
-                                                       NULL);
+                                       context->record,
+                                       NULL,
+                                       NULL);
 
                        result = net_nfc_service_snep_server_send_get_response(
-                                                               context->user_param,
-                                                               &data);
+                                       context->user_param,
+                                       &data);
                        if (result != NET_NFC_OK)
                        {
                                DEBUG_ERR_MSG("net_nfc_service_snep_server"
-                                       "_send_get_response failed [%d]",result);
+                                               "_send_get_response failed [%d]",result);
                        }
                        net_nfc_util_free_data(&data);
                }
                else
                {
                        DEBUG_ERR_MSG("_net_nfc_server_handover_convert_ndef_message_to_data"
-                                                               "failed [%d]",result);
+                                       "failed [%d]",result);
                }
        }
        else
        {
                DEBUG_ERR_MSG("_net_nfc_server_handover_create_selector_msg"
-                                               "failed [%d]",result);
+                               "failed [%d]",result);
        }
 
        _net_nfc_util_free_mem(context);
 }
 
 static net_nfc_error_e _net_nfc_server_handover_create_selector_msg(
-                                       net_nfc_snep_handle_h handle,
-                                       ndef_message_s *request,
-                                       void *user_param)
+               net_nfc_snep_handle_h handle,
+               ndef_message_s *request,
+               void *user_param)
 {
        net_nfc_error_e result;
        uint32_t count;
@@ -1154,12 +1148,12 @@ static net_nfc_error_e _net_nfc_server_handover_create_selector_msg(
 
                        /* fill alternative carrier information */
                        if ((result =
-                               _net_nfc_server_handover_get_carrier_record_by_priority_order(
-                                                                       request,
-                                                                       &record)) == NET_NFC_OK)
+                                               _net_nfc_server_handover_get_carrier_record_by_priority_order(
+                                                       request,
+                                                       &record)) == NET_NFC_OK)
                        {
                                net_nfc_conn_handover_carrier_type_e type =
-                                                       NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN;
+                                       NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN;
 
                                if ((result = net_nfc_util_get_alternative_carrier_type_from_record(
                                                                record,
@@ -1172,29 +1166,29 @@ static net_nfc_error_e _net_nfc_server_handover_create_selector_msg(
                                        context->user_param = handle;
 
                                        net_nfc_util_create_record(record->TNF,
-                                               &record->type_s, &record->id_s,
-                                               &record->payload_s,
-                                               &context->record);
+                                                       &record->type_s, &record->id_s,
+                                                       &record->payload_s,
+                                                       &context->record);
 
                                        if ((result = _net_nfc_server_handover_create_selector_carrier_configs(
-                                                       type,
-                                                       _net_nfc_server_handover_server_create_carrier_configs_cb,
-                                                       context)) != NET_NFC_OK)
+                                                                       type,
+                                                                       _net_nfc_server_handover_server_create_carrier_configs_cb,
+                                                                       context)) != NET_NFC_OK)
                                        {
                                                DEBUG_ERR_MSG("_create_selector_carrier_configs "
-                                                                       "failed [%d]", result);
+                                                               "failed [%d]", result);
                                        }
                                }
                                else
                                {
                                        DEBUG_ERR_MSG("get_alternative_carrier_type_from_record "
-                                               "failed [%d]", result);
+                                                       "failed [%d]", result);
                                }
                        }
                        else
                        {
                                DEBUG_ERR_MSG("r_get_carrier_record_by_priority_order"
-                                       " failed [%d]", result);
+                                               " failed [%d]", result);
                        }
                }
                else /* low power && count > 1 */
@@ -1202,27 +1196,27 @@ static net_nfc_error_e _net_nfc_server_handover_create_selector_msg(
                        ndef_message_s selector;
 
                        if ((result = _net_nfc_server_handover_create_low_power_selector_message(
-                                                               request,
-                                                               &selector)) == NET_NFC_OK)
+                                                       request,
+                                                       &selector)) == NET_NFC_OK)
                        {
                                _net_nfc_server_handover_server_create_carrier_configs_cb(
-                                                                               NET_NFC_OK,
-                                                                               &selector,
-                                                                               user_param);
+                                               NET_NFC_OK,
+                                               &selector,
+                                               user_param);
 
                                net_nfc_util_free_ndef_message(&selector);
                        }
                        else
                        {
                                DEBUG_ERR_MSG("_create_low_power_selector_message"
-                                                               "failed [%d]", result);
+                                               "failed [%d]", result);
                        }
                }
        }
        else
        {
                DEBUG_ERR_MSG("net_nfc_util_get_alternative_carrier_record_count"
-                                                               "failed [%d]", result);
+                               "failed [%d]", result);
        }
 
        return result;
@@ -1230,14 +1224,14 @@ static net_nfc_error_e _net_nfc_server_handover_create_selector_msg(
 
 
 static net_nfc_error_e _net_nfc_server_handover_create_server_cb(
-                                       net_nfc_snep_handle_h handle,
-                                       net_nfc_error_e result,
-                                       uint32_t type,
-                                       data_s *data,
-                                       void *user_param)
+               net_nfc_snep_handle_h handle,
+               net_nfc_error_e result,
+               uint32_t type,
+               data_s *data,
+               void *user_param)
 {
        DEBUG_SERVER_MSG("type [0x%02x], result [%d], data [%p], user_param [%p]",
-               type, result, data, user_param);
+                       type, result, data, user_param);
 
        if (result != NET_NFC_OK || data == NULL || data->buffer == NULL)
        {
@@ -1253,21 +1247,21 @@ static net_nfc_error_e _net_nfc_server_handover_create_server_cb(
 
                        /* TODO : send select response to requester */
                        result =
-                       _net_nfc_server_handover_create_requester_from_rawdata(
-                                                                       &request,
-                                                                       data);
+                               _net_nfc_server_handover_create_requester_from_rawdata(
+                                               &request,
+                                               data);
                        if (result == NET_NFC_OK) {
                                if (1/* TODO : check version */)
                                {
                                        _net_nfc_server_handover_create_selector_msg(
-                                               handle,
-                                               request,
-                                               user_param);
+                                                       handle,
+                                                       request,
+                                                       user_param);
                                }
                                else
                                {
                                        DEBUG_ERR_MSG("not supported version [0x%x]",
-                                               result);
+                                                       result);
 
                                        result = NET_NFC_NOT_SUPPORTED;
                                }
@@ -1277,7 +1271,7 @@ static net_nfc_error_e _net_nfc_server_handover_create_server_cb(
                        else
                        {
                                DEBUG_ERR_MSG("_net_nfc_server_handover_create"
-                               "_requester_from_rawdata failed [%d]",result);
+                                               "_requester_from_rawdata failed [%d]",result);
                        }
                }
                break;
@@ -1299,9 +1293,9 @@ static net_nfc_error_e _net_nfc_server_handover_create_server_cb(
 
 
 static net_nfc_error_e _net_nfc_server_handover_select_carrier_record(
-                               ndef_message_s *request,
-                               net_nfc_conn_handover_carrier_type_e *type,
-                               ndef_record_s **record)
+               ndef_message_s *request,
+               net_nfc_conn_handover_carrier_type_e *type,
+               ndef_record_s **record)
 {
        net_nfc_error_e result;
        uint32_t count;
@@ -1311,7 +1305,7 @@ static net_nfc_error_e _net_nfc_server_handover_select_carrier_record(
 
        /* get requester message */
        if ((result = net_nfc_util_get_alternative_carrier_record_count(request,
-               &count)) == NET_NFC_OK)
+                                       &count)) == NET_NFC_OK)
        {
                if (1/* power state */ || count == 1)
                {
@@ -1319,24 +1313,24 @@ static net_nfc_error_e _net_nfc_server_handover_select_carrier_record(
 
                        /* fill alternative carrier information */
                        if ((result =
-                               _net_nfc_server_handover_get_carrier_record_by_priority_order(
+                                               _net_nfc_server_handover_get_carrier_record_by_priority_order(
                                                        request,
                                                        &temp)) == NET_NFC_OK)
                        {
                                if ((result =
-                                       net_nfc_util_get_alternative_carrier_type_from_record(
-                                                       temp,
-                                                       type)) == NET_NFC_OK)
+                                                       net_nfc_util_get_alternative_carrier_type_from_record(
+                                                               temp,
+                                                               type)) == NET_NFC_OK)
                                {
                                        net_nfc_util_create_record(temp->TNF,
-                                               &temp->type_s, &temp->id_s,
-                                               &temp->payload_s,
-                                               record);
+                                                       &temp->type_s, &temp->id_s,
+                                                       &temp->payload_s,
+                                                       record);
                                }
                                else
                                {
                                        DEBUG_ERR_MSG("net_nfc_util_get_alternative"
-                                       "_carrier_type_from_record failed [%d]", result);
+                                                       "_carrier_type_from_record failed [%d]", result);
                                }
                        }
                        else
@@ -1353,7 +1347,7 @@ static net_nfc_error_e _net_nfc_server_handover_select_carrier_record(
        else
        {
                DEBUG_ERR_MSG("net_nfc_util_get_alternative_carrier_record_count "
-                                                       "failed [%d]", result);
+                               "failed [%d]", result);
        }
 
        return result;
@@ -1362,15 +1356,15 @@ static net_nfc_error_e _net_nfc_server_handover_select_carrier_record(
 #endif
 
 static void _net_nfc_server_handover_create_carrier_configs_2_cb(
-                                               net_nfc_error_e result,
-                                               ndef_message_s *selector,
-                                               void *user_param)
+               net_nfc_error_e result,
+               ndef_message_s *selector,
+               void *user_param)
 {
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
 
        DEBUG_SERVER_MSG("_net_nfc_server_handover_server_create_carrier_config_cb"
-                                                       "result [%d]",result);
+                       "result [%d]",result);
 
        if (context == NULL)
        {
@@ -1381,18 +1375,18 @@ static void _net_nfc_server_handover_create_carrier_configs_2_cb(
 
        if (result == NET_NFC_OK) {
                result = _net_nfc_server_handover_convert_ndef_message_to_data(
-                                                       selector,
-                                                       &context->data);
+                               selector,
+                               &context->data);
 
                DEBUG_SERVER_MSG("selector message created, length [%d]",
-                       context->data.length);
+                               context->data.length);
 
                context->state = NET_NFC_LLCP_STEP_03;
        }
        else
        {
                DEBUG_ERR_MSG("_net_nfc_server_handover_create_selector_msg failed [%d]",
-                       result);
+                               result);
                context->state = NET_NFC_MESSAGE_LLCP_ERROR;
        }
 
@@ -1400,16 +1394,16 @@ static void _net_nfc_server_handover_create_carrier_configs_2_cb(
 }
 
 static void _net_nfc_server_handover_process_carrier_record_2_cb(
-                                       net_nfc_error_e result,
-                                       net_nfc_conn_handover_carrier_type_e type,
-                                       data_s *data,
-                                                       void *user_param)
+               net_nfc_error_e result,
+               net_nfc_conn_handover_carrier_type_e type,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
 
        DEBUG_SERVER_MSG("_net_nfc_server_handover_server_process_carrier_record_cb"
-                                                       "result [%d]",result);
+                       "result [%d]",result);
 
        context->result = result;
        if (result == NET_NFC_OK)
@@ -1430,7 +1424,7 @@ static void _net_nfc_server_handover_process_carrier_record_2_cb(
 }
 
 static void _net_nfc_server_handover_get_response_process(
-                               net_nfc_handover_context_t *context)
+               net_nfc_handover_context_t *context)
 {
        net_nfc_error_e result;
 
@@ -1452,7 +1446,7 @@ static void _net_nfc_server_handover_get_response_process(
                if (result != NET_NFC_OK)
                {
                        DEBUG_ERR_MSG("_net_nfc_server_handover_create_"
-                               "selector_carrier_config failed [%d]",result);
+                                       "selector_carrier_config failed [%d]",result);
                }
                break;
 
@@ -1467,7 +1461,7 @@ static void _net_nfc_server_handover_get_response_process(
                if (result != NET_NFC_OK)
                {
                        DEBUG_ERR_MSG("_net_nfc_server_handover_process_carrier_record"
-                                                       "failed [%d]",result);
+                                       "failed [%d]",result);
                }
                break;
 
@@ -1476,8 +1470,8 @@ static void _net_nfc_server_handover_get_response_process(
 
                /* response select message */
                result = net_nfc_server_snep_server_send_get_response(
-                                       (net_nfc_snep_handle_h)context->handle,
-                                       &context->data);
+                               (net_nfc_snep_handle_h)context->handle,
+                               &context->data);
                break;
 
        case NET_NFC_STATE_ERROR :
@@ -1492,17 +1486,17 @@ static void _net_nfc_server_handover_get_response_process(
 }
 
 static bool _net_nfc_server_handover_get_response_cb(
-                               net_nfc_snep_handle_h handle,
-                               uint32_t type,
-                               uint32_t max_len,
-                               data_s *data,
-                               void *user_param)
+               net_nfc_snep_handle_h handle,
+               uint32_t type,
+               uint32_t max_len,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_error_e result;
        ndef_message_s *request;
 
        DEBUG_SERVER_MSG("type [%d], data [%p], user_param [%p]",
-                               type, data, user_param);
+                       type, data, user_param);
 
        if (data == NULL || data->buffer == NULL)
        {
@@ -1512,8 +1506,8 @@ static bool _net_nfc_server_handover_get_response_cb(
 
        /* TODO : send select response to requester */
        result = _net_nfc_server_handover_create_requester_from_rawdata(
-                                                       &request,
-                                                       data);
+                       &request,
+                       data);
 
        if (result == NET_NFC_OK)
        {
@@ -1521,9 +1515,9 @@ static bool _net_nfc_server_handover_get_response_cb(
                ndef_record_s *record;
 
                if (_net_nfc_server_handover_select_carrier_record(
-                                               request,
-                                               &type,
-                                               &record) == NET_NFC_OK)
+                                       request,
+                                       &type,
+                                       &record) == NET_NFC_OK)
                {
                        net_nfc_handover_context_t *context = NULL;
 
@@ -1537,10 +1531,10 @@ static bool _net_nfc_server_handover_get_response_cb(
                                context->state = NET_NFC_LLCP_STEP_02;
 
                                net_nfc_util_create_record(record->TNF,
-                                       &record->type_s,
-                                       &record->id_s,
-                                       &record->payload_s,
-                                       &context->record);
+                                               &record->type_s,
+                                               &record->id_s,
+                                               &record->payload_s,
+                                               &context->record);
 
                                _net_nfc_server_handover_get_response_process(context);
                        }
@@ -1560,7 +1554,7 @@ static bool _net_nfc_server_handover_get_response_cb(
        else
        {
                DEBUG_SERVER_MSG("it is not handover requester message, [%d]",
-                       result);
+                               result);
        }
 
        return (result == NET_NFC_OK);
@@ -1568,10 +1562,10 @@ static bool _net_nfc_server_handover_get_response_cb(
 
 ////////////////////////////////////////////////////////////////////////////////
 static void _net_nfc_server_handover_server_process_carrier_record_cb(
-                               net_nfc_error_e result,
-                               net_nfc_conn_handover_carrier_type_e type,
-                               data_s *data,
-                               void *user_param)
+               net_nfc_error_e result,
+               net_nfc_conn_handover_carrier_type_e type,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
@@ -1593,9 +1587,9 @@ static void _net_nfc_server_handover_server_process_carrier_record_cb(
 }
 
 static void _net_nfc_server_handover_server_create_carrier_config_cb(
-                                               net_nfc_error_e result,
-                                               ndef_message_s *selector,
-                                               void *user_param)
+               net_nfc_error_e result,
+               ndef_message_s *selector,
+               void *user_param)
 {
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
@@ -1613,10 +1607,10 @@ static void _net_nfc_server_handover_server_create_carrier_config_cb(
        if (result == NET_NFC_OK)
        {
                result = _net_nfc_server_handover_convert_ndef_message_to_data(
-                                                               selector,
-                                                               &context->data);
+                               selector,
+                               &context->data);
                DEBUG_SERVER_MSG("selector message created, length [%d]",
-                       context->data.length);
+                               context->data.length);
                context->state = NET_NFC_LLCP_STEP_03;
        }
        else
@@ -1630,11 +1624,11 @@ static void _net_nfc_server_handover_server_create_carrier_config_cb(
 }
 
 static void _net_nfc_server_handover_server_recv_cb(
-                               net_nfc_error_e result,
-                               net_nfc_target_handle_s *handle,
-                               net_nfc_llcp_socket_t socket,
-                               data_s *data,
-                               void *user_param)
+               net_nfc_error_e result,
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
@@ -1648,22 +1642,22 @@ static void _net_nfc_server_handover_server_recv_cb(
        if (result == NET_NFC_OK)
        {
                result = _net_nfc_server_handover_create_requester_from_rawdata(
-                                                       &request,
-                                                       data);
+                               &request,
+                               data);
 
                if (result == NET_NFC_OK)
                {
                        ndef_record_s *record;
 
                        if (_net_nfc_server_handover_select_carrier_record(
-                                                       request,
-                                                       &context->type,
-                                                       &record) == NET_NFC_OK)
+                                               request,
+                                               &context->type,
+                                               &record) == NET_NFC_OK)
                        {
                                net_nfc_util_create_record(record->TNF,
-                                       &record->type_s, &record->id_s,
-                                       &record->payload_s,
-                                       &context->record);
+                                               &record->type_s, &record->id_s,
+                                               &record->payload_s,
+                                               &context->record);
 
                                context->state = NET_NFC_LLCP_STEP_02;
                        }
@@ -1674,18 +1668,18 @@ static void _net_nfc_server_handover_server_recv_cb(
                        }
 
                        net_nfc_util_free_ndef_message(request);
-                       }
+               }
                else
                {
                        DEBUG_ERR_MSG("_net_nfc_server_handover_create"
-                               "_requester_from_rawdata failed [%d]",result);
+                                       "_requester_from_rawdata failed [%d]",result);
                        context->state = NET_NFC_MESSAGE_LLCP_ERROR;
                }
        }
        else
        {
                DEBUG_ERR_MSG("net_nfc_server_llcp_simple_receive failed [%d]",
-                       result);
+                               result);
                context->state = NET_NFC_MESSAGE_LLCP_ERROR;
        }
 
@@ -1693,16 +1687,16 @@ static void _net_nfc_server_handover_server_recv_cb(
 }
 
 static void _net_nfc_server_handover_server_send_cb(net_nfc_error_e result,
-                                       net_nfc_target_handle_s *handle,
-                                       net_nfc_llcp_socket_t socket,
-                                       data_s *data,
-                                       void *user_param)
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
 
        DEBUG_SERVER_MSG("_net_nfc_server_handover_server_send_cb"
-                               " socket [%x], result [%d]", socket, result);
+                       " socket [%x], result [%d]", socket, result);
 
        context->result = result;
 
@@ -1716,7 +1710,7 @@ static void _net_nfc_server_handover_server_send_cb(net_nfc_error_e result,
        else
        {
                DEBUG_ERR_MSG("net_nfc_server_llcp_simple_send failed [%d]",
-                       result);
+                               result);
                context->state = NET_NFC_MESSAGE_LLCP_ERROR;
        }
 
@@ -1724,7 +1718,7 @@ static void _net_nfc_server_handover_server_send_cb(net_nfc_error_e result,
 }
 
 static void _net_nfc_server_handover_server_process(
-                               net_nfc_handover_context_t *context)
+               net_nfc_handover_context_t *context)
 {
        if (context == NULL)
        {
@@ -1747,14 +1741,14 @@ static void _net_nfc_server_handover_server_process(
                DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_02");
 
                context->result = _net_nfc_server_handover_create_selector_carrier_configs(
-                                       context->type,
-                                       _net_nfc_server_handover_server_create_carrier_config_cb,
-                                       context);
+                               context->type,
+                               _net_nfc_server_handover_server_create_carrier_config_cb,
+                               context);
 
                if (context->result != NET_NFC_OK)
                {
                        DEBUG_ERR_MSG("_net_nfc_server_handover_create_selector"
-                               "_carrier_configs failed [%d]", context->result);
+                                       "_carrier_configs failed [%d]", context->result);
                }
                break;
 
@@ -1762,13 +1756,13 @@ static void _net_nfc_server_handover_server_process(
                DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_03");
 
                context->result = _net_nfc_server_handover_process_carrier_record(
-                                       context->record,
-                                       _net_nfc_server_handover_server_process_carrier_record_cb,
-                                       context);
+                               context->record,
+                               _net_nfc_server_handover_server_process_carrier_record_cb,
+                               context);
                if (context->result != NET_NFC_OK)
                {
                        DEBUG_ERR_MSG("_net_nfc_server_handover_process_carrier_"
-                               "record failed [%d]",context->result);
+                                       "record failed [%d]",context->result);
                }
                break;
 
@@ -1777,11 +1771,11 @@ static void _net_nfc_server_handover_server_process(
 
                /* send select message */
                net_nfc_server_llcp_simple_send(
-                       context->handle,
-                       context->socket,
-                       &context->data,
-                       _net_nfc_server_handover_server_send_cb,
-                       context);
+                               context->handle,
+                               context->socket,
+                               &context->data,
+                               _net_nfc_server_handover_server_send_cb,
+                               context);
                break;
 
        case NET_NFC_STATE_ERROR :
@@ -1789,7 +1783,7 @@ static void _net_nfc_server_handover_server_process(
 
                /* error, invoke callback */
                DEBUG_ERR_MSG("handover_server failed, [%d]",
-                       context->result);
+                               context->result);
 
                /* restart?? */
                break;
@@ -1802,17 +1796,17 @@ static void _net_nfc_server_handover_server_process(
 }
 
 static void _net_nfc_server_handover_server_error_cb(
-                       net_nfc_error_e result,
-                       net_nfc_target_handle_s *handle,
-                       net_nfc_llcp_socket_t socket,
-                       data_s *data,
-                       void *user_param)
+               net_nfc_error_e result,
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
 
        DEBUG_ERR_MSG("result [%d], socket [%x], user_param [%p]",
-               result, socket, user_param);
+                       result, socket, user_param);
 
        if (context == NULL)
        {
@@ -1827,14 +1821,14 @@ static void _net_nfc_server_handover_server_error_cb(
 }
 
 static void _net_nfc_server_handover_server_incomming_cb(
-                       net_nfc_error_e result,
-                       net_nfc_target_handle_s *handle,
-                       net_nfc_llcp_socket_t socket,
-                       data_s *data,
-                       void *user_param)
+               net_nfc_error_e result,
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               void *user_param)
 {
        DEBUG_SERVER_MSG("result [%d], socket [%x], user_param [%p]",
-               result, socket, user_param);
+                       result, socket, user_param);
 
        net_nfc_handover_context_t *accept_context = NULL;
 
@@ -1860,7 +1854,7 @@ static void _net_nfc_server_handover_server_incomming_cb(
        if (result != NET_NFC_OK)
        {
                DEBUG_ERR_MSG("net_nfc_server_llcp_simple_accept failed, [%d]",
-                       result);
+                               result);
 
                goto ERROR;
        }
@@ -1881,15 +1875,15 @@ ERROR :
 }
 
 net_nfc_error_e net_nfc_server_handover_default_server_start(
-                               net_nfc_target_handle_s *handle)
+               net_nfc_target_handle_s *handle)
 {
        net_nfc_error_e result;
 
        /* start default handover server using snep */
        result =
-       net_nfc_server_snep_default_server_register_get_response_cb(
-               _net_nfc_server_handover_get_response_cb,
-               NULL);
+               net_nfc_server_snep_default_server_register_get_response_cb(
+                               _net_nfc_server_handover_get_response_cb,
+                               NULL);
 
        /* start default handover server */
        result = net_nfc_server_llcp_simple_server(
@@ -1903,43 +1897,43 @@ net_nfc_error_e net_nfc_server_handover_default_server_start(
        if (result == NET_NFC_OK)
        {
                DEBUG_SERVER_MSG("start handover server, san [%s], sap [%d]",
-                       CH_SAN,CH_SAP);
+                               CH_SAN,CH_SAP);
        }
        else
        {
                DEBUG_ERR_MSG("net_nfc_server_llcp_simple_server failed, [%d]",
-                       result);
+                               result);
        }
 
        return result;
 }
 
 static void _handover_default_activate_cb(int event,
-       net_nfc_target_handle_s *handle,
-       uint32_t sap, const char *san, void *user_param)
+               net_nfc_target_handle_s *handle,
+               uint32_t sap, const char *san, void *user_param)
 {
        net_nfc_error_e result;
 
        DEBUG_SERVER_MSG("event [%d], handle [%p], sap [%d], san [%s]",
-               event, handle, sap, san);
+                       event, handle, sap, san);
 
        if (event == NET_NFC_LLCP_START) {
                /* start default handover server using snep */
                result = net_nfc_server_snep_default_server_register_get_response_cb(
-                       _net_nfc_server_handover_get_response_cb, NULL);
+                               _net_nfc_server_handover_get_response_cb, NULL);
 
                /* start default handover server */
                result = net_nfc_server_llcp_simple_server(handle,
-                       CH_SAN, CH_SAP,
-                       _net_nfc_server_handover_server_incomming_cb,
-                       _net_nfc_server_handover_server_error_cb, NULL);
+                               CH_SAN, CH_SAP,
+                               _net_nfc_server_handover_server_incomming_cb,
+                               _net_nfc_server_handover_server_error_cb, NULL);
 
                if (result == NET_NFC_OK) {
                        DEBUG_SERVER_MSG("start handover server, san [%s], sap [%d]",
-                               CH_SAN, CH_SAP);
+                                       CH_SAN, CH_SAP);
                } else {
                        DEBUG_ERR_MSG("net_nfc_service_llcp_server failed, [%d]",
-                               result);
+                                       result);
                }
        } else if (event == NET_NFC_LLCP_UNREGISTERED) {
                /* unregister server, do nothing */
@@ -1955,10 +1949,10 @@ net_nfc_error_e net_nfc_server_handover_default_server_register()
 
        /* start default snep server */
        return net_nfc_server_llcp_register_service(id,
-               CH_SAP,
-               CH_SAN,
-               _handover_default_activate_cb,
-               NULL);
+                       CH_SAP,
+                       CH_SAN,
+                       _handover_default_activate_cb,
+                       NULL);
 }
 
 net_nfc_error_e net_nfc_server_handover_default_server_unregister()
@@ -1970,17 +1964,17 @@ net_nfc_error_e net_nfc_server_handover_default_server_unregister()
 
        /* start default snep server */
        return net_nfc_server_llcp_unregister_service(id,
-               CH_SAP,
-               CH_SAN);
+                       CH_SAP,
+                       CH_SAN);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 static void _net_nfc_server_handover_client_post_process_cb(
-                       net_nfc_error_e result,
-                       net_nfc_conn_handover_carrier_type_e type,
-                       data_s *data,
-                       void *user_param)
+               net_nfc_error_e result,
+               net_nfc_conn_handover_carrier_type_e type,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
@@ -1996,10 +1990,10 @@ static void _net_nfc_server_handover_client_post_process_cb(
 }
 
 static void _net_nfc_server_handover_client_process_carrier_record_cb(
-                       net_nfc_error_e result,
-                       net_nfc_conn_handover_carrier_type_e type,
-                       data_s *data,
-                       void *user_param)
+               net_nfc_error_e result,
+               net_nfc_conn_handover_carrier_type_e type,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
@@ -2027,11 +2021,11 @@ static void _net_nfc_server_handover_client_process_carrier_record_cb(
 }
 
 static void _net_nfc_server_handover_client_recv_cb(
-                       net_nfc_error_e result,
-                       net_nfc_target_handle_s *handle,
-                       net_nfc_llcp_socket_t socket,
-                       data_s *data,
-                       void *user_param)
+               net_nfc_error_e result,
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
@@ -2049,23 +2043,23 @@ static void _net_nfc_server_handover_client_recv_cb(
                ndef_record_s *record;
 
                result = _net_nfc_server_handover_create_selector_from_rawdata(
-                                       &selector,
-                                       data);
+                               &selector,
+                               data);
 
                if (result == NET_NFC_OK)
                {
                        result =
-                       _net_nfc_server_handover_get_carrier_record_by_priority_order(
-                                       selector,
-                                       &record);
+                               _net_nfc_server_handover_get_carrier_record_by_priority_order(
+                                               selector,
+                                               &record);
 
                        if (result == NET_NFC_OK)
                        {
                                net_nfc_util_create_record(
-                                       record->TNF,
-                                       &record->type_s, &record->id_s,
-                                       &record->payload_s,
-                                       &context->record);
+                                               record->TNF,
+                                               &record->type_s, &record->id_s,
+                                               &record->payload_s,
+                                               &context->record);
 
                                context->state = NET_NFC_LLCP_STEP_04;
                        }
@@ -2079,14 +2073,14 @@ static void _net_nfc_server_handover_client_recv_cb(
                else
                {
                        DEBUG_ERR_MSG("_net_nfc_server_handover_create"
-                               "_selector_from_rawdata failed, [%d]",result);
+                                       "_selector_from_rawdata failed, [%d]",result);
                        context->state = NET_NFC_STATE_ERROR;
                }
        }
        else
        {
                DEBUG_ERR_MSG("net_nfc_server_llcp_simple_receive failed, [%d]",
-                       result);
+                               result);
                context->state = NET_NFC_STATE_ERROR;
        }
 
@@ -2094,11 +2088,11 @@ static void _net_nfc_server_handover_client_recv_cb(
 }
 
 static void _net_nfc_server_handover_client_send_cb(
-                       net_nfc_error_e result,
-                       net_nfc_target_handle_s *handle,
-                       net_nfc_llcp_socket_t socket,
-                       data_s *data,
-                       void *user_param)
+               net_nfc_error_e result,
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
@@ -2119,7 +2113,7 @@ static void _net_nfc_server_handover_client_send_cb(
        else
        {
                DEBUG_ERR_MSG("net_nfc_server_llcp_simple_client failed, [%d]",
-                       result);
+                               result);
                context->state = NET_NFC_STATE_ERROR;
        }
 
@@ -2127,9 +2121,9 @@ static void _net_nfc_server_handover_client_send_cb(
 }
 
 static void _net_nfc_server_handover_client_create_carrier_configs_cb(
-                       net_nfc_error_e result,
-                       ndef_message_s *msg,
-                       void *user_param)
+               net_nfc_error_e result,
+               ndef_message_s *msg,
+               void *user_param)
 {
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
@@ -2143,16 +2137,16 @@ static void _net_nfc_server_handover_client_create_carrier_configs_cb(
        if (msg != NULL)
        {
                if ((result =
-                       _net_nfc_server_handover_convert_ndef_message_to_data(
-                               msg,
-                               &context->data)) == NET_NFC_OK)
+                                       _net_nfc_server_handover_convert_ndef_message_to_data(
+                                               msg,
+                                               &context->data)) == NET_NFC_OK)
                {
                        context->state = NET_NFC_LLCP_STEP_02;
                }
                else
                {
                        DEBUG_ERR_MSG("_net_nfc_server_handover_convert_ndef_"
-                       "message_to_data failed [%d]",result);
+                                       "message_to_data failed [%d]",result);
                        context->state = NET_NFC_STATE_ERROR;
                        context->result = result;
                }
@@ -2170,7 +2164,7 @@ static void _net_nfc_server_handover_client_create_carrier_configs_cb(
 
 ////////////////////////////////////////////////////////////////////////////////
 static void _net_nfc_server_handover_client_process(
-                               net_nfc_handover_context_t *context)
+               net_nfc_handover_context_t *context)
 {
        net_nfc_error_e result;
 
@@ -2185,12 +2179,12 @@ static void _net_nfc_server_handover_client_process(
                DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_01");
 
                if ((result = _net_nfc_server_handover_create_requester_carrier_configs(
-                               context->type,
-                               _net_nfc_server_handover_client_create_carrier_configs_cb,
-                               context)) != NET_NFC_OK)
+                                               context->type,
+                                               _net_nfc_server_handover_client_create_carrier_configs_cb,
+                                               context)) != NET_NFC_OK)
                {
                        DEBUG_ERR_MSG("_net_nfc_server_handover_create_requester"
-                               "_carrier_configs failed [%d]",result);
+                                       "_carrier_configs failed [%d]",result);
                }
                break;
 
@@ -2199,11 +2193,11 @@ static void _net_nfc_server_handover_client_process(
 
                /* send request */
                net_nfc_server_llcp_simple_send(
-                       context->handle,
-                       context->socket,
-                       &context->data,
-                       _net_nfc_server_handover_client_send_cb,
-                       context);
+                               context->handle,
+                               context->socket,
+                               &context->data,
+                               _net_nfc_server_handover_client_send_cb,
+                               context);
                break;
 
        case NET_NFC_LLCP_STEP_03 :
@@ -2211,9 +2205,9 @@ static void _net_nfc_server_handover_client_process(
 
                /* receive response */
                net_nfc_server_llcp_simple_receive(context->handle,
-                       context->socket,
-                       _net_nfc_server_handover_client_recv_cb,
-                       context);
+                               context->socket,
+                               _net_nfc_server_handover_client_recv_cb,
+                               context);
                break;
 
        case NET_NFC_LLCP_STEP_04 :
@@ -2227,7 +2221,7 @@ static void _net_nfc_server_handover_client_process(
                if (result != NET_NFC_OK)
                {
                        DEBUG_ERR_MSG("_net_nfc_server_handover_process_carrier_record"
-                                               "failed [%d]",result);
+                                       "failed [%d]",result);
                }
                break;
 
@@ -2238,9 +2232,9 @@ static void _net_nfc_server_handover_client_process(
                if (context->type == NET_NFC_CONN_HANDOVER_CARRIER_BT)
                {
                        net_nfc_server_handover_bt_post_process(
-                               &context->data,
-                               _net_nfc_server_handover_client_post_process_cb,
-                               context);
+                                       &context->data,
+                                       _net_nfc_server_handover_client_post_process_cb,
+                                       context);
                }
                else
                {
@@ -2277,14 +2271,14 @@ static void _net_nfc_server_handover_client_process(
 
 
 static void _net_nfc_server_handover_client_connected_cb(
-                       net_nfc_error_e result,
-                       net_nfc_target_handle_s *handle,
-                       net_nfc_llcp_socket_t socket,
-                       data_s *data,
-                       void *user_param)
+               net_nfc_error_e result,
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               void *user_param)
 {
        DEBUG_SERVER_MSG("result [%d], socket [%x], user_param [%p]",
-               result, socket, user_param);
+                       result, socket, user_param);
 
        if (result == NET_NFC_OK)
        {
@@ -2313,15 +2307,15 @@ static void _net_nfc_server_handover_client_connected_cb(
 }
 
 static void _net_nfc_server_handover_client_error_cb(
-                       net_nfc_error_e result,
-                       net_nfc_target_handle_s *handle,
-                       net_nfc_llcp_socket_t socket,
-                       data_s *data,
-                       void *user_param)
+               net_nfc_error_e result,
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               void *user_param)
 {
 
        DEBUG_ERR_MSG("result [%d], socket [%x], user_param [%p]",
-               result, socket, user_param);
+                       result, socket, user_param);
 
        if (false)
        {
@@ -2333,8 +2327,8 @@ static void _net_nfc_server_handover_client_error_cb(
 
 
 net_nfc_error_e net_nfc_server_handover_default_client_start(
-       net_nfc_target_handle_s *handle,
-       void *user_data)
+               net_nfc_target_handle_s *handle,
+               void *user_data)
 {
        net_nfc_error_e result;
 
@@ -2348,8 +2342,8 @@ net_nfc_error_e net_nfc_server_handover_default_client_start(
 
        if (result != NET_NFC_OK)
        {
-                       DEBUG_ERR_MSG("net_nfc_server_llcp_simple_client"
-                                       " failed, [%d]",result);
+               DEBUG_ERR_MSG("net_nfc_server_llcp_simple_client"
+                               " failed, [%d]",result);
        }
 
        return result;
similarity index 80%
rename from src/manager/net_nfc_server_process_npp.c
rename to daemon/net_nfc_server_process_npp.c
index fc318ae..27d7ea7 100644 (file)
  */
 #include <arpa/inet.h>
 
+#include "net_nfc_debug_internal.h"
 #include "net_nfc_server_p2p.h"
 #include "net_nfc_server_llcp.h"
-
+#include "net_nfc_server_controller.h"
+#include "net_nfc_server_util.h"
 #include "net_nfc_server_process_npp.h"
 
-#include "net_nfc_controller_internal.h"
-#include "net_nfc_app_util_internal.h"
-#include "net_nfc_debug_internal.h"
-
 typedef struct _net_nfc_npp_entity_t
 {
        uint8_t op;
@@ -75,60 +73,60 @@ struct _NppClientStartData
 #define NPP_ACTION_CODE                        0x01
 
 static net_nfc_error_e npp_create_message(data_s *data,
-                                       data_s *message);
+               data_s *message);
 
 /* server */
 static void npp_server_receive_cb(net_nfc_error_e result,
-                               net_nfc_target_handle_s *handle,
-                               net_nfc_llcp_socket_t socket,
-                               data_s *data,
-                               gpointer user_data);
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               gpointer user_data);
 
 static void npp_server_process(NppData *npp_data);
 
 static void npp_listen_cb(net_nfc_error_e result,
-                       net_nfc_target_handle_s *handle,
-                       net_nfc_llcp_socket_t socket,
-                       data_s *data,
-                       gpointer user_data);
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               gpointer user_data);
 
 /* client */
 static void npp_client_disconnected_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param);
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param);
 
 static void npp_client_send_cb(net_nfc_error_e result,
-                               net_nfc_target_handle_s *handle,
-                               net_nfc_llcp_socket_t socket,
-                               data_s *data,
-                               gpointer user_data);
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               gpointer user_data);
 
 static void npp_client_process(NppData *npp_data);
 
 static void npp_connected_cb(net_nfc_error_e result,
-                               net_nfc_target_handle_s *handle,
-                               net_nfc_llcp_socket_t socket,
-                               data_s *data,
-                               gpointer user_data);
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               gpointer user_data);
 
 static void npp_socket_error_cb(net_nfc_error_e result,
-                               net_nfc_target_handle_s *handle,
-                               net_nfc_llcp_socket_t socket,
-                               data_s *data,
-                               gpointer user_data);
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               gpointer user_data);
 
 static void npp_default_server_cb(net_nfc_error_e result,
-                               data_s *data,
-                               gpointer user_data);
+               data_s *data,
+               gpointer user_data);
 
 static void npp_default_client_cb(net_nfc_error_e result,
-                               data_s *data,
-                               gpointer user_data);
+               data_s *data,
+               gpointer user_data);
 
 static net_nfc_error_e npp_create_message(data_s *data,
-                                       data_s *message)
+               data_s *message)
 {
        uint32_t length = NPP_HEADER_LEN;
        net_nfc_npp_msg_t *msg;
@@ -166,10 +164,10 @@ static net_nfc_error_e npp_create_message(data_s *data,
 }
 
 static void npp_server_receive_cb(net_nfc_error_e result,
-                               net_nfc_target_handle_s *handle,
-                               net_nfc_llcp_socket_t socket,
-                               data_s *data,
-                               gpointer user_data)
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               gpointer user_data)
 {
        NppData *npp_data;
 
@@ -233,7 +231,7 @@ static void npp_server_receive_cb(net_nfc_error_e result,
        if (data->length < NPP_HEADER_LEN)
        {
                DEBUG_ERR_MSG("too short data, length [%d]",
-                       data->length);
+                               data->length);
                /* FIXME!!! what should I do. */
                if(npp_data->callback)
                {
@@ -250,7 +248,7 @@ static void npp_server_receive_cb(net_nfc_error_e result,
                        GET_MINOR_VER(message->version > NPP_MINOR_VER))
        {
                DEBUG_ERR_MSG("not supported version, version [0x%02x]",
-                       message->version);
+                               message->version);
 
                if(npp_data->callback)
                {
@@ -268,7 +266,7 @@ static void npp_server_receive_cb(net_nfc_error_e result,
        if (entity_count > NPP_NDEF_ENTRY)
        {
                DEBUG_ERR_MSG("too many entities, [%d]",
-                       message->entity_count);
+                               message->entity_count);
 
                if(npp_data->callback)
                {
@@ -287,7 +285,7 @@ static void npp_server_receive_cb(net_nfc_error_e result,
 
                if (entity->op != NPP_ACTION_CODE) {
                        DEBUG_ERR_MSG("not supported action code, [0x%02x]",
-                               entity->op);
+                                       entity->op);
 
                        if(npp_data->callback)
                        {
@@ -303,7 +301,7 @@ static void npp_server_receive_cb(net_nfc_error_e result,
                length = htonl(entity->length);
 
                DEBUG_SERVER_MSG("action code [0x%02x], length [%d]",
-                       entity->op, length);
+                               entity->op, length);
 
                if (length > 0)
                {
@@ -331,9 +329,9 @@ static void npp_server_process(NppData *npp_data)
 
        /* receive request */
        result = net_nfc_server_llcp_simple_receive(npp_data->handle,
-                                               npp_data->socket,
-                                               npp_server_receive_cb,
-                                               npp_data);
+                       npp_data->socket,
+                       npp_server_receive_cb,
+                       npp_data);
        if (result != NET_NFC_OK)
        {
                if (npp_data->callback)
@@ -344,10 +342,10 @@ static void npp_server_process(NppData *npp_data)
 }
 
 static void npp_listen_cb(net_nfc_error_e result,
-                       net_nfc_target_handle_s *handle,
-                       net_nfc_llcp_socket_t socket,
-                       data_s *data,
-                       gpointer user_data)
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               gpointer user_data)
 {
        NppData *npp_data;
        NppData *accept_data;
@@ -379,9 +377,9 @@ static void npp_listen_cb(net_nfc_error_e result,
        accept_data->user_data = npp_data->user_data;
 
        result = net_nfc_server_llcp_simple_accept(handle,
-                                               socket,
-                                               npp_socket_error_cb,
-                                               accept_data);
+                       socket,
+                       npp_socket_error_cb,
+                       accept_data);
        if (result != NET_NFC_OK)
        {
                DEBUG_ERR_MSG("%s failed",
@@ -405,19 +403,19 @@ static void npp_listen_cb(net_nfc_error_e result,
 
 /* client */
 static void npp_client_disconnected_cb(net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param)
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        DEBUG_SERVER_MSG("disconnected! [%d]", result);
 }
 
 static void npp_client_send_cb(net_nfc_error_e result,
-                       net_nfc_target_handle_s *handle,
-                       net_nfc_llcp_socket_t socket,
-                       data_s *data,
-                       gpointer user_data)
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               gpointer user_data)
 {
        NppData *npp_data;
 
@@ -433,10 +431,10 @@ static void npp_client_send_cb(net_nfc_error_e result,
        }
 
        net_nfc_controller_llcp_disconnect(npp_data->handle,
-                                       npp_data->socket,
-                                       &result,
-                                       npp_client_disconnected_cb,
-                                       NULL);
+                       npp_data->socket,
+                       &result,
+                       npp_client_disconnected_cb,
+                       NULL);
 
        g_free(npp_data->data.buffer);
        g_free(npp_data);
@@ -467,15 +465,15 @@ static void npp_client_process(NppData *npp_data)
 
        /* send request */
        result = net_nfc_server_llcp_simple_send(npp_data->handle,
-                                               npp_data->socket,
-                                               &data,
-                                               npp_client_send_cb,
-                                               npp_data);
+                       npp_data->socket,
+                       &data,
+                       npp_client_send_cb,
+                       npp_data);
        if (result != NET_NFC_OK)
        {
                DEBUG_ERR_MSG("%s failed [%d]",
-                       "net_nfc_server_llcp_simple_send",
-                       result);
+                               "net_nfc_server_llcp_simple_send",
+                               result);
 
                if (npp_data->callback)
                        npp_data->callback(result, NULL, npp_data->user_data);
@@ -489,10 +487,10 @@ static void npp_client_process(NppData *npp_data)
 }
 
 static void npp_connected_cb(net_nfc_error_e result,
-                       net_nfc_target_handle_s *handle,
-                       net_nfc_llcp_socket_t socket,
-                       data_s *data,
-                       gpointer user_data)
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               gpointer user_data)
 {
        NppData *npp_data;
 
@@ -523,10 +521,10 @@ static void npp_connected_cb(net_nfc_error_e result,
 }
 
 static void npp_socket_error_cb(net_nfc_error_e result,
-                               net_nfc_target_handle_s *handle,
-                               net_nfc_llcp_socket_t socket,
-                               data_s *data,
-                               gpointer user_data)
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               gpointer user_data)
 {
        NppData *npp_data;
 
@@ -544,8 +542,8 @@ static void npp_socket_error_cb(net_nfc_error_e result,
 }
 
 static void npp_default_server_cb(net_nfc_error_e result,
-                               data_s *data,
-                               gpointer user_data)
+               data_s *data,
+               gpointer user_data)
 {
        DEBUG_SERVER_MSG("result [%d], data [%p], user_data [%p]",
                        result, data, user_data);
@@ -567,8 +565,8 @@ static void npp_default_server_cb(net_nfc_error_e result,
 }
 
 static void npp_default_client_cb(net_nfc_error_e result,
-                               data_s *data,
-                               gpointer user_data)
+               data_s *data,
+               gpointer user_data)
 {
        NppClientStartData *npp_client_data;
 
@@ -587,10 +585,10 @@ static void npp_default_client_cb(net_nfc_error_e result,
 
 /* public apis */
 net_nfc_error_e net_nfc_server_npp_server(net_nfc_target_handle_s *handle,
-                                       char *san,
-                                       sap_t sap,
-                                       net_nfc_server_npp_callback callback,
-                                       gpointer user_data)
+               char *san,
+               sap_t sap,
+               net_nfc_server_npp_callback callback,
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
 
@@ -615,15 +613,15 @@ net_nfc_error_e net_nfc_server_npp_server(net_nfc_target_handle_s *handle,
        npp_data->user_data = user_data;
 
        result = net_nfc_server_llcp_simple_server(handle,
-                                               san,
-                                               sap,
-                                               npp_listen_cb,
-                                               npp_socket_error_cb,
-                                               npp_data);
+                       san,
+                       sap,
+                       npp_listen_cb,
+                       npp_socket_error_cb,
+                       npp_data);
        if (result != NET_NFC_OK)
        {
                DEBUG_ERR_MSG("%s failed",
-                       "net_nfc_server_llcp_simple_server");
+                               "net_nfc_server_llcp_simple_server");
 
                if (npp_data->callback)
                        npp_data->callback(result, NULL, npp_data->user_data);
@@ -639,11 +637,11 @@ net_nfc_error_e net_nfc_server_npp_server(net_nfc_target_handle_s *handle,
 }
 
 net_nfc_error_e net_nfc_server_npp_client(net_nfc_target_handle_s *handle,
-                                       char *san,
-                                       sap_t sap,
-                                       data_s *data,
-                                       net_nfc_server_npp_callback callback,
-                                       gpointer user_data)
+               char *san,
+               sap_t sap,
+               data_s *data,
+               net_nfc_server_npp_callback callback,
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;;
        net_nfc_llcp_config_info_s config;
@@ -657,22 +655,22 @@ net_nfc_error_e net_nfc_server_npp_client(net_nfc_target_handle_s *handle,
        }
 
        if(net_nfc_controller_llcp_get_remote_config(handle,
-                                               &config,
-                                               &result) == false)
+                               &config,
+                               &result) == false)
        {
                DEBUG_ERR_MSG("%s failed [%d]",
-                       "net_nfc_controller_llcp_get_remote_config",
-                       result);
+                               "net_nfc_controller_llcp_get_remote_config",
+                               result);
 
                return result;
        }
 
        if (config.miu <
-               data->length + NPP_HEADER_LEN + NPP_ENTITY_HEADER_LEN)
+                       data->length + NPP_HEADER_LEN + NPP_ENTITY_HEADER_LEN)
        {
                DEBUG_ERR_MSG("too large message, max [%d], request [%d]",
-                       config.miu - (NPP_HEADER_LEN + NPP_ENTITY_HEADER_LEN),
-                       data->length);
+                               config.miu - (NPP_HEADER_LEN + NPP_ENTITY_HEADER_LEN),
+                               data->length);
 
                return NET_NFC_INSUFFICIENT_STORAGE;
        }
@@ -687,15 +685,15 @@ net_nfc_error_e net_nfc_server_npp_client(net_nfc_target_handle_s *handle,
        npp_data->data.length = data->length;
 
        result = net_nfc_server_llcp_simple_client(handle,
-                                               san,
-                                               sap,
-                                               npp_connected_cb,
-                                               npp_socket_error_cb,
-                                               npp_data);
+                       san,
+                       sap,
+                       npp_connected_cb,
+                       npp_socket_error_cb,
+                       npp_data);
        if (result != NET_NFC_OK)
        {
                DEBUG_ERR_MSG("%s failed",
-                       "net_nfc_server_llcp_simple_client");
+                               "net_nfc_server_llcp_simple_client");
 
                if (npp_data->callback)
                {
@@ -713,44 +711,44 @@ net_nfc_error_e net_nfc_server_npp_client(net_nfc_target_handle_s *handle,
        if (san != NULL)
        {
                DEBUG_SERVER_MSG("start npp client, san [%s], result [%d]",
-                       san, result);
+                               san, result);
        }
        else
        {
                DEBUG_SERVER_MSG("start npp client, sap [%d], result [%d]",
-                       sap, result);
+                               sap, result);
        }
 
        return result;
 }
 
 net_nfc_error_e net_nfc_server_npp_default_server_start(
-                                       net_nfc_target_handle_s *handle)
+               net_nfc_target_handle_s *handle)
 {
        /* start default npp server */
        return net_nfc_server_npp_server(handle,
-                                       NPP_SAN,
-                                       NPP_SAP,
-                                       npp_default_server_cb,
-                                       (gpointer)1234);
+                       NPP_SAN,
+                       NPP_SAP,
+                       npp_default_server_cb,
+                       (gpointer)1234);
 }
 
 static void _npp_default_activate_cb(int event,
-       net_nfc_target_handle_s *handle,
-       uint32_t sap, const char *san, void *user_param)
+               net_nfc_target_handle_s *handle,
+               uint32_t sap, const char *san, void *user_param)
 {
        net_nfc_error_e result;
 
        DEBUG_SERVER_MSG("event [%d], handle [%p], sap [%d], san [%s]",
-               event, handle, sap, san);
+                       event, handle, sap, san);
 
        if (event == NET_NFC_LLCP_START) {
                /* start default npp server */
                result = net_nfc_server_npp_server(handle, (char *)san, sap,
-                       npp_default_server_cb, user_param);
+                               npp_default_server_cb, user_param);
                if (result != NET_NFC_OK) {
                        DEBUG_ERR_MSG("net_nfc_server_npp_server failed, [%d]",
-                               result);
+                                       result);
                }
        } else if (event == NET_NFC_LLCP_UNREGISTERED) {
                /* unregister server, do nothing */
@@ -766,10 +764,10 @@ net_nfc_error_e net_nfc_server_npp_default_server_register()
 
        /* start default npp server */
        return net_nfc_server_llcp_register_service(id,
-               NPP_SAP,
-               NPP_SAN,
-               _npp_default_activate_cb,
-               NULL);
+                       NPP_SAP,
+                       NPP_SAN,
+                       _npp_default_activate_cb,
+                       NULL);
 }
 
 net_nfc_error_e net_nfc_server_npp_default_server_unregister()
@@ -781,15 +779,15 @@ net_nfc_error_e net_nfc_server_npp_default_server_unregister()
 
        /* start default npp server */
        return net_nfc_server_llcp_unregister_service(id,
-               NPP_SAP,
-               NPP_SAN);
+                       NPP_SAP,
+                       NPP_SAN);
 }
 
 net_nfc_error_e net_nfc_server_npp_default_client_start(
-                               net_nfc_target_handle_s *handle,
-                               data_s *data,
-                               int client,
-                               gpointer user_data)
+               net_nfc_target_handle_s *handle,
+               data_s *data,
+               int client,
+               gpointer user_data)
 {
        NppClientStartData *npp_client_data;
 
@@ -820,11 +818,11 @@ net_nfc_error_e net_nfc_server_npp_default_client_start(
        npp_client_data->user_data = user_data;
 
        result = net_nfc_server_npp_client(handle,
-                                       NPP_SAN,
-                                       NPP_SAP,
-                                       data,
-                                       npp_default_client_cb,
-                                       npp_client_data);
+                       NPP_SAN,
+                       NPP_SAP,
+                       data,
+                       npp_default_client_cb,
+                       npp_client_data);
 
        if (result != NET_NFC_OK)
        {
similarity index 72%
rename from src/manager/net_nfc_server_process_snep.c
rename to daemon/net_nfc_server_process_snep.c
index 1827bfc..988548f 100644 (file)
  */
 
 #include <glib.h>
-#include "net_nfc_server_p2p.h"
 #include "net_nfc_debug_internal.h"
 #include "net_nfc_util_defines.h"
 #include "net_nfc_util_internal.h"
+#include "net_nfc_util_gdbus_internal.h"
 #include "net_nfc_server_llcp.h"
-#include "net_nfc_controller_internal.h"
+#include "net_nfc_server_p2p.h"
+#include "net_nfc_server_controller.h"
 #include "net_nfc_server_snep.h"
+#include "net_nfc_server_util.h"
 #include "net_nfc_server_process_snep.h"
-#include "net_nfc_app_util_internal.h"
-#include "net_nfc_util_gdbus_internal.h"
 
 
 typedef struct _net_nfc_server_snep_msg_t
@@ -98,10 +98,10 @@ typedef struct __net_nfc_server_snep_service_context_t
 _net_nfc_server_snep_service_context_t;
 
 typedef void (*_net_nfc_server_snep_operation_cb)(
-                               net_nfc_error_e result,
-                               uint32_t type,
-                               data_s *data,
-                               void *user_param);
+               net_nfc_error_e result,
+               uint32_t type,
+               data_s *data,
+               void *user_param);
 
 typedef struct _net_nfc_server_snep_op_context_t
 {
@@ -139,36 +139,36 @@ net_nfc_server_snep_op_context_t;
 static GList *list_listen_cb = NULL;
 
 static void _net_nfc_server_snep_recv(
-                               net_nfc_server_snep_op_context_t *context);
+               net_nfc_server_snep_op_context_t *context);
 
 static void _net_nfc_server_snep_send(
-                               net_nfc_server_snep_op_context_t *context);
+               net_nfc_server_snep_op_context_t *context);
 
 static net_nfc_error_e net_nfc_server_snep_recv(
-                               net_nfc_target_handle_s *handle,
-                               net_nfc_llcp_socket_t socket,
-                               _net_nfc_server_snep_operation_cb cb,
-                               void *user_param);
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               _net_nfc_server_snep_operation_cb cb,
+               void *user_param);
 
 static net_nfc_error_e net_nfc_server_snep_send(
-                               net_nfc_target_handle_s *handle,
-                               net_nfc_llcp_socket_t socket,
-                               uint32_t type,
-                               data_s *data,
-                               _net_nfc_server_snep_operation_cb cb,
-                               void *user_param);
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               uint32_t type,
+               data_s *data,
+               _net_nfc_server_snep_operation_cb cb,
+               void *user_param);
 
 
 static void _net_nfc_server_snep_client_process(
-                               net_nfc_server_snep_job_t *job);
+               net_nfc_server_snep_job_t *job);
 
 static void _net_nfc_server_snep_server_process(
-                               net_nfc_server_snep_context_t *context);
+               net_nfc_server_snep_context_t *context);
 
 /**********************************************************************/
 static bool _net_nfc_server_snep_add_get_response_cb(
-                                       net_nfc_server_snep_listen_cb cb,
-                                       void *user_param)
+               net_nfc_server_snep_listen_cb cb,
+               void *user_param)
 {
        net_nfc_server_cb_data_t *data = NULL;
        bool result = false;
@@ -198,8 +198,8 @@ static bool _net_nfc_server_snep_add_get_response_cb(
 }
 
 static gint _net_nfc_server_snep_compare_func_cb(
-                                       gconstpointer a,
-                                       gconstpointer b)
+               gconstpointer a,
+               gconstpointer b)
 {
        net_nfc_server_cb_data_t *data = (net_nfc_server_cb_data_t *)a;
 
@@ -210,22 +210,22 @@ static gint _net_nfc_server_snep_compare_func_cb(
 }
 
 static void _net_nfc_server_snep_del_get_response_cb(
-                                       net_nfc_server_snep_listen_cb cb)
+               net_nfc_server_snep_listen_cb cb)
 {
        GList *list;
 
        list = g_list_find_custom(list_listen_cb,
-                               cb,
-                               _net_nfc_server_snep_compare_func_cb);
+                       cb,
+                       _net_nfc_server_snep_compare_func_cb);
 
        if (list != NULL)
                list_listen_cb = g_list_delete_link(list_listen_cb, list);
 }
 
 static bool _net_nfc_server_snep_process_get_response_cb(
-                               net_nfc_target_handle_s *handle,
-                               data_s *data,
-                               uint32_t max_len)
+               net_nfc_target_handle_s *handle,
+               data_s *data,
+               uint32_t max_len)
 {
        GList *list = list_listen_cb;
 
@@ -238,24 +238,24 @@ static bool _net_nfc_server_snep_process_get_response_cb(
                {
                        DEBUG_SERVER_MSG("invoke callback [%p]", cb_data->cb);
                        if (cb_data->cb(handle,
-                               SNEP_REQ_GET,
-                               max_len,
-                               data,
-                               cb_data->user_param) == true)
-                       return true;
+                                               SNEP_REQ_GET,
+                                               max_len,
+                                               data,
+                                               cb_data->user_param) == true)
+                               return true;
                }
        }
 
        return false;
 }
 
-static net_nfc_server_snep_op_context_t *
+       static net_nfc_server_snep_op_context_t *
 _net_nfc_server_snep_create_send_context(uint32_t type,
-                       net_nfc_target_handle_s *handle,
-                       net_nfc_llcp_socket_t socket,
-                       data_s *data,
-                       void *cb,
-                       void *user_param)
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               void *cb,
+               void *user_param)
 {
        net_nfc_server_snep_op_context_t *context = NULL;
        uint32_t data_len = 0;
@@ -264,10 +264,10 @@ _net_nfc_server_snep_create_send_context(uint32_t type,
        net_nfc_error_e result;
 
        if (net_nfc_controller_llcp_get_remote_config(handle,
-                       &config, &result) == false)
+                               &config, &result) == false)
        {
                DEBUG_ERR_MSG("net_nfc_controller_llcp_get_remote_config failed, [%d]",
-                                       result);
+                               result);
 
                return NULL;
        }
@@ -339,23 +339,23 @@ _net_nfc_server_snep_create_send_context(uint32_t type,
        return context;
 }
 
-static net_nfc_server_snep_op_context_t *
+       static net_nfc_server_snep_op_context_t *
 _net_nfc_server_snep_create_recv_context(
-                       net_nfc_target_handle_s *handle,
-                       net_nfc_llcp_socket_t socket,
-                       void *cb,
-                       void *user_param)
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               void *cb,
+               void *user_param)
 {
        net_nfc_server_snep_op_context_t *context = NULL;
        net_nfc_llcp_config_info_s config;
        net_nfc_error_e result;
 
        if (net_nfc_controller_llcp_get_remote_config(handle,
-                                       &config,
-                                       &result) == false)
+                               &config,
+                               &result) == false)
        {
                DEBUG_ERR_MSG("net_nfc_controller_llcp_get_remote_config failed, [%d]",
-                                       result);
+                               result);
                return NULL;
        }
 
@@ -375,23 +375,23 @@ _net_nfc_server_snep_create_recv_context(
 }
 
 static void _net_nfc_server_snep_destory_context(
-                               net_nfc_server_snep_op_context_t *context)
+               net_nfc_server_snep_op_context_t *context)
 {
        if (context != NULL)
        {
                if (context->data.buffer != NULL)
                        net_nfc_util_free_data(&context->data);
 
-                       _net_nfc_util_free_mem(context);
+               _net_nfc_util_free_mem(context);
        }
 }
 
 static void _net_nfc_server_recv_fragment_cb(
-                               net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param)
+               net_nfc_llcp_socket_t socket,
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        net_nfc_server_snep_op_context_t *context =
                (net_nfc_server_snep_op_context_t *)user_param;
@@ -399,7 +399,7 @@ static void _net_nfc_server_recv_fragment_cb(
        uint32_t length;
 
        DEBUG_SERVER_MSG("_net_nfc_server_recv_fragment_cb,"
-                               " socket [%x], result [%d]",socket, result);
+                       " socket [%x], result [%d]",socket, result);
 
        if (context == NULL)
                return;
@@ -428,7 +428,7 @@ static void _net_nfc_server_recv_fragment_cb(
                if (data->length < SNEP_HEADER_LEN)
                {
                        DEBUG_ERR_MSG("too short data, length [%d]",
-                                               data->length);
+                                       data->length);
                        /* FIXME!!! what should I do. */
                        context->type = SNEP_RESP_BAD_REQ;
                        context->state = NET_NFC_STATE_ERROR;
@@ -441,7 +441,7 @@ static void _net_nfc_server_recv_fragment_cb(
                if (length > SNEP_MAX_LEN)
                {
                        DEBUG_ERR_MSG("too long snep message, length [%d]",
-                                               length);
+                                       length);
                        if (IS_SNEP_REQ(msg->op))
                        {
                                context->type = SNEP_RESP_EXCESS_DATA;
@@ -456,10 +456,10 @@ static void _net_nfc_server_recv_fragment_cb(
                }
 
                if (IS_SNEP_REQ(msg->op) &&
-                       GET_MAJOR_VER(msg->version) > SNEP_MAJOR_VER)
+                               GET_MAJOR_VER(msg->version) > SNEP_MAJOR_VER)
                {
                        DEBUG_ERR_MSG("not supported version, version [0x%02x]",
-                                               msg->version);
+                                       msg->version);
                        context->type = SNEP_RESP_UNSUPPORTED_VER;
                        context->state = NET_NFC_LLCP_STEP_04;
                        context->result = NET_NFC_NOT_SUPPORTED;
@@ -488,7 +488,7 @@ static void _net_nfc_server_recv_fragment_cb(
                }
 
                DEBUG_SERVER_MSG("incoming message, type [0x%02x], length [%d]",
-                                       msg->op, length);
+                               msg->op, length);
 
                context->type = msg->op;
                buffer = msg->data;
@@ -506,14 +506,14 @@ static void _net_nfc_server_recv_fragment_cb(
        {
                /* copy data */
                memcpy(context->data.buffer + context->offset,
-                                       buffer, length);
+                               buffer, length);
                context->offset += length;
 
                DEBUG_SERVER_MSG("receive progress... [%d|%d]",
-                                       context->offset, context->data.length);
+                               context->offset, context->data.length);
 
                if (context->offset >= context->data.length)
-                                  context->state = NET_NFC_LLCP_STEP_RETURN;
+                       context->state = NET_NFC_LLCP_STEP_RETURN;
 
        }
        else
@@ -528,7 +528,7 @@ END :
 
 
 static void _net_nfc_server_recv_fragment(
-                               net_nfc_server_snep_op_context_t *context)
+               net_nfc_server_snep_op_context_t *context)
 {
        net_nfc_error_e result;
 
@@ -551,13 +551,13 @@ static void _net_nfc_server_recv_fragment(
 
 
 void _net_nfc_server_snep_recv_send_cb(
-                               net_nfc_error_e result,
-                               uint32_t type,
-                               data_s *data,
-                               void *user_param)
+               net_nfc_error_e result,
+               uint32_t type,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_server_snep_op_context_t *context =
-                       (net_nfc_server_snep_op_context_t *)user_param;
+               (net_nfc_server_snep_op_context_t *)user_param;
 
        DEBUG_SERVER_MSG("_net_nfc_server_snep_recv_send_cb, result [%d]", result);
 
@@ -569,7 +569,7 @@ void _net_nfc_server_snep_recv_send_cb(
        else
        {
                DEBUG_ERR_MSG("net_nfc_server_snep_send failed, [0x%x][%d]",
-                                       type, result);
+                               type, result);
                context->state = NET_NFC_STATE_ERROR;
                context->result = result;
        }
@@ -578,13 +578,13 @@ void _net_nfc_server_snep_recv_send_cb(
 }
 
 void _net_nfc_server_snep_recv_send_reject_cb(
-                               net_nfc_error_e result,
-                               uint32_t type,
-                               data_s *data,
-                               void *user_param)
+               net_nfc_error_e result,
+               uint32_t type,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_server_snep_op_context_t *context =
-                       (net_nfc_server_snep_op_context_t *)user_param;
+               (net_nfc_server_snep_op_context_t *)user_param;
 
        DEBUG_SERVER_MSG("_net_nfc_server_snep_recv_send_reject_cb,"
                        " result [%d]", result);
@@ -604,7 +604,7 @@ void _net_nfc_server_snep_recv_send_reject_cb(
 }
 
 static void _net_nfc_server_snep_recv(
-                       net_nfc_server_snep_op_context_t *context)
+               net_nfc_server_snep_op_context_t *context)
 {
        if (context == NULL)
                return;
@@ -613,96 +613,96 @@ static void _net_nfc_server_snep_recv(
        {
        case NET_NFC_LLCP_STEP_01 :
        case NET_NFC_LLCP_STEP_03 :
-                       DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_%02d",
+               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_%02d",
                                context->state - NET_NFC_LLCP_STEP_01 + 1);
 
-                       /* receive fragment */
-                       _net_nfc_server_recv_fragment(context);
-                       break;
+               /* receive fragment */
+               _net_nfc_server_recv_fragment(context);
+               break;
 
        case NET_NFC_LLCP_STEP_02 :
-                       {
-                               uint8_t op = context->type;
+               {
+                       uint8_t op = context->type;
 
-                               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_02");
+                       DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_02");
 
-                               /* make correct request/response code */
-                               op = SNEP_MAKE_PAIR_OP(op, SNEP_REQ_CONTINUE);
+                       /* make correct request/response code */
+                       op = SNEP_MAKE_PAIR_OP(op, SNEP_REQ_CONTINUE);
 
-                               /* send response */
-                               net_nfc_server_snep_send(
+                       /* send response */
+                       net_nfc_server_snep_send(
                                        context->handle,
                                        context->socket,
                                        op,
                                        NULL,
                                        _net_nfc_server_snep_recv_send_cb, context);
-                       }
-                       break;
+               }
+               break;
 
        case NET_NFC_LLCP_STEP_04 :
-                       {
-                               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_04");
+               {
+                       DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_04");
 
-                               /* send response */
-                               net_nfc_server_snep_send(
+                       /* send response */
+                       net_nfc_server_snep_send(
                                        context->handle,
                                        context->socket,
                                        context->type, NULL,
                                        _net_nfc_server_snep_recv_send_reject_cb, context);
-                       }
-                       break;
+               }
+               break;
 
        case NET_NFC_LLCP_STEP_RETURN :
-                       {
-                               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_RETURN");
+               {
+                       DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_RETURN");
 
-                               /* complete and invoke callback */
-                               context->cb(
+                       /* complete and invoke callback */
+                       context->cb(
                                        context->result,
                                        context->type,
                                        &context->data,
                                        context->user_param);
 
-                               _net_nfc_server_snep_destory_context(context);
-                       }
-                       break;
+                       _net_nfc_server_snep_destory_context(context);
+               }
+               break;
 
        case NET_NFC_STATE_ERROR :
        default :
-                       DEBUG_ERR_MSG("NET_NFC_STATE_ERROR");
+               DEBUG_ERR_MSG("NET_NFC_STATE_ERROR");
 
-                       /* error, invoke callback */
-                       DEBUG_ERR_MSG("net_nfc_server_snep_recv failed, [%d]",
-                                       context->result);
+               /* error, invoke callback */
+               DEBUG_ERR_MSG("net_nfc_server_snep_recv failed, [%d]",
+                               context->result);
 
-                       context->cb(
+               context->cb(
                                context->result,
                                context->type,
                                NULL,
                                context->user_param);
 
-                       _net_nfc_server_snep_destory_context(context);
+               _net_nfc_server_snep_destory_context(context);
 
-                       break;
+               break;
        }
 }
 
-static net_nfc_error_e
+       static net_nfc_error_e
 net_nfc_server_snep_recv(
-                       net_nfc_target_handle_s *handle,
-                       net_nfc_llcp_socket_t socket,
-                       _net_nfc_server_snep_operation_cb cb,
-                       void *user_param)
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               _net_nfc_server_snep_operation_cb cb,
+               void *user_param)
 {
        net_nfc_server_snep_op_context_t *context;
        net_nfc_error_e result = NET_NFC_OK;
 
        /* create context */
        context = _net_nfc_server_snep_create_recv_context(
-                                               handle,
-                                               socket,
-                                               cb,
-                                               user_param);
+                       handle,
+                       socket,
+                       cb,
+                       user_param);
 
        if (context != NULL)/* send response */
                _net_nfc_server_snep_recv(context);
@@ -713,11 +713,11 @@ net_nfc_server_snep_recv(
 }
 
 static void _net_nfc_server_send_fragment_cb(
-                               net_nfc_llcp_socket_t socket,
-                               net_nfc_error_e result,
-                               data_s *data,
-                               void *extra,
-                               void *user_param)
+               net_nfc_llcp_socket_t socket,
+               net_nfc_error_e result,
+               data_s *data,
+               void *extra,
+               void *user_param)
 {
        net_nfc_server_snep_op_context_t *context =
                (net_nfc_server_snep_op_context_t *)user_param;
@@ -754,14 +754,14 @@ static void _net_nfc_server_send_fragment_cb(
        else
        {
                DEBUG_ERR_MSG("net_nfc_controller_llcp_send failed, [%d]",
-                                       result);
+                               result);
                context->state = NET_NFC_STATE_ERROR;
        }
        _net_nfc_server_snep_send(context);
 }
 
 static void _net_nfc_server_send_fragment(
-                               net_nfc_server_snep_op_context_t *context)
+               net_nfc_server_snep_op_context_t *context)
 {
        data_s req_msg;
        uint32_t remain_len;
@@ -783,14 +783,14 @@ static void _net_nfc_server_send_fragment(
        context->offset += req_msg.length;
 
        if (net_nfc_controller_llcp_send(context->handle,
-                                       context->socket,
-                                       &req_msg,
-                                       &result,
-                                       _net_nfc_server_send_fragment_cb,
-                                       context) == false)
+                               context->socket,
+                               &req_msg,
+                               &result,
+                               _net_nfc_server_send_fragment_cb,
+                               context) == false)
        {
                DEBUG_ERR_MSG("net_nfc_controller_llcp_send failed, [%d]",
-                                       result);
+                               result);
                context->state = NET_NFC_STATE_ERROR;
                context->result = result;
                _net_nfc_server_snep_send(context);
@@ -798,16 +798,16 @@ static void _net_nfc_server_send_fragment(
 }
 
 void _net_nfc_server_snep_send_recv_cb(
-                               net_nfc_error_e result,
-                               uint32_t type,
-                               data_s *data,
-                               void *user_param)
+               net_nfc_error_e result,
+               uint32_t type,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_server_snep_op_context_t *context =
                (net_nfc_server_snep_op_context_t *)user_param;
 
        DEBUG_SERVER_MSG("_net_nfc_server_snep_send_recv_cb,"
-                               " result [%d]", result);
+                       " result [%d]", result);
 
        if (context == NULL)/* TODO */
                return;
@@ -821,47 +821,47 @@ void _net_nfc_server_snep_send_recv_cb(
        {
        case SNEP_REQ_CONTINUE :
        case SNEP_RESP_CONT :
-                       context->state = NET_NFC_LLCP_STEP_03;
-                       break;
+               context->state = NET_NFC_LLCP_STEP_03;
+               break;
 
        case SNEP_REQ_REJECT :
        case SNEP_RESP_REJECT :
-                       context->state = NET_NFC_STATE_ERROR;
-                       context->result = NET_NFC_LLCP_SOCKET_FRAME_REJECTED;
-                       break;
+               context->state = NET_NFC_STATE_ERROR;
+               context->result = NET_NFC_LLCP_SOCKET_FRAME_REJECTED;
+               break;
 
        case SNEP_RESP_NOT_FOUND :
-                       context->state = NET_NFC_STATE_ERROR;
-                       context->result = NET_NFC_NO_DATA_FOUND;
-                       break;
+               context->state = NET_NFC_STATE_ERROR;
+               context->result = NET_NFC_NO_DATA_FOUND;
+               break;
 
        case SNEP_RESP_EXCESS_DATA :
-                       context->state = NET_NFC_STATE_ERROR;
-                       context->result = NET_NFC_INSUFFICIENT_STORAGE;
-                       break;
+               context->state = NET_NFC_STATE_ERROR;
+               context->result = NET_NFC_INSUFFICIENT_STORAGE;
+               break;
 
        case SNEP_RESP_BAD_REQ :
-                       context->state = NET_NFC_STATE_ERROR;
-                       context->result = NET_NFC_INVALID_FORMAT;
-                       break;
+               context->state = NET_NFC_STATE_ERROR;
+               context->result = NET_NFC_INVALID_FORMAT;
+               break;
 
        case SNEP_RESP_NOT_IMPLEMENT :
        case SNEP_RESP_UNSUPPORTED_VER :
-                       context->state = NET_NFC_STATE_ERROR;
-                       context->result = NET_NFC_NOT_ALLOWED_OPERATION;
-                       break;
+               context->state = NET_NFC_STATE_ERROR;
+               context->result = NET_NFC_NOT_ALLOWED_OPERATION;
+               break;
 
        default :
-                       context->state = NET_NFC_STATE_ERROR;
-                       context->result = NET_NFC_OPERATION_FAIL;
-                       break;
+               context->state = NET_NFC_STATE_ERROR;
+               context->result = NET_NFC_OPERATION_FAIL;
+               break;
        }
 
        _net_nfc_server_snep_send(context);
 }
 
 static void _net_nfc_server_snep_send(
-                       net_nfc_server_snep_op_context_t *context)
+               net_nfc_server_snep_op_context_t *context)
 {
        if (context == NULL)
        {
@@ -872,85 +872,85 @@ static void _net_nfc_server_snep_send(
        {
        case NET_NFC_LLCP_STEP_01 :
        case NET_NFC_LLCP_STEP_03 :
-                       DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_%02d",
-                                       context->state - NET_NFC_LLCP_STEP_01 + 1);
+               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_%02d",
+                               context->state - NET_NFC_LLCP_STEP_01 + 1);
 
-                       /* send fragment */
-                       _net_nfc_server_send_fragment(context);
-                       break;
+               /* send fragment */
+               _net_nfc_server_send_fragment(context);
+               break;
 
        case NET_NFC_LLCP_STEP_02 :
-                       DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_02");
+               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_02");
 
-                       /* receive response */
-                       net_nfc_server_snep_recv(
+               /* receive response */
+               net_nfc_server_snep_recv(
                                context->handle,
                                context->socket,
                                _net_nfc_server_snep_send_recv_cb,
                                context);
-                       break;
+               break;
 
        case NET_NFC_LLCP_STEP_RETURN :
-                       DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_RETURN");
+               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_RETURN");
 
-                       /* complete and invoke callback */
-                       context->cb(
+               /* complete and invoke callback */
+               context->cb(
                                context->result,
                                context->type,
                                NULL,
                                context->user_param);
 
-                       _net_nfc_server_snep_destory_context(context);
-                       break;
+               _net_nfc_server_snep_destory_context(context);
+               break;
 
        case NET_NFC_STATE_ERROR :
-                       DEBUG_ERR_MSG("NET_NFC_STATE_ERROR");
+               DEBUG_ERR_MSG("NET_NFC_STATE_ERROR");
 
-                       /* error, invoke callback */
-                       DEBUG_ERR_MSG("net_nfc_server_snep_send failed, [%d]",
-                                       context->result);
+               /* error, invoke callback */
+               DEBUG_ERR_MSG("net_nfc_server_snep_send failed, [%d]",
+                               context->result);
 
-                       context->cb(
+               context->cb(
                                context->result,
                                context->type,
                                NULL,
                                context->user_param);
 
-                       _net_nfc_server_snep_destory_context(context);
-                       break;
+               _net_nfc_server_snep_destory_context(context);
+               break;
 
        default :
-                       DEBUG_ERR_MSG("NET_NFC_LLCP_STEP_??");
+               DEBUG_ERR_MSG("NET_NFC_LLCP_STEP_??");
 
-                       context->cb(NET_NFC_OPERATION_FAIL,
+               context->cb(NET_NFC_OPERATION_FAIL,
                                context->type,
                                NULL,
                                context->user_param);
 
-                       _net_nfc_server_snep_destory_context(context);
-                       break;
+               _net_nfc_server_snep_destory_context(context);
+               break;
        }
 }
 
 net_nfc_error_e net_nfc_server_snep_send(
-                               net_nfc_target_handle_s *handle,
-                               net_nfc_llcp_socket_t socket,
-                               uint32_t type,
-                               data_s *data,
-                               _net_nfc_server_snep_operation_cb cb,
-                               void *user_param)
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               uint32_t type,
+               data_s *data,
+               _net_nfc_server_snep_operation_cb cb,
+               void *user_param)
 {
        net_nfc_server_snep_op_context_t *context;
        net_nfc_error_e result = NET_NFC_OK;
 
        /* create context */
        context = _net_nfc_server_snep_create_send_context(
-                                                       type,
-                                                       handle,
-                                                       socket,
-                                                       data,
-                                                       cb,
-                                                       user_param);
+                       type,
+                       handle,
+                       socket,
+                       data,
+                       cb,
+                       user_param);
 
        if (context != NULL)
        {
@@ -966,16 +966,16 @@ net_nfc_error_e net_nfc_server_snep_send(
 }
 
 static void _net_nfc_server_snep_server_recv_cb(
-                               net_nfc_error_e result,
-                               uint32_t type,
-                               data_s *data,
-                               void *user_param)
+               net_nfc_error_e result,
+               uint32_t type,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_server_snep_context_t *context =
-                       (net_nfc_server_snep_context_t *)user_param;
+               (net_nfc_server_snep_context_t *)user_param;
 
        DEBUG_SERVER_MSG("_net_nfc_server_snep_server_recv_cb"
-                               "result [%d]", result);
+                       "result [%d]", result);
 
        if (context == NULL)
        {
@@ -1000,18 +1000,18 @@ static void _net_nfc_server_snep_server_recv_cb(
                        switch (type)
                        {
                        case SNEP_REQ_GET :
-                                       context->state = NET_NFC_LLCP_STEP_02;
-                                       break;
+                               context->state = NET_NFC_LLCP_STEP_02;
+                               break;
 
                        case SNEP_REQ_PUT :
-                                       context->state = NET_NFC_LLCP_STEP_04;
-                                       break;
+                               context->state = NET_NFC_LLCP_STEP_04;
+                               break;
 
                        default :
-                                       DEBUG_ERR_MSG("invalid request, [%d]", type);
-                                       context->state = NET_NFC_STATE_ERROR;
-                                       context->result = NET_NFC_NOT_ALLOWED_OPERATION;
-                                       break;
+                               DEBUG_ERR_MSG("invalid request, [%d]", type);
+                               context->state = NET_NFC_STATE_ERROR;
+                               context->result = NET_NFC_NOT_ALLOWED_OPERATION;
+                               break;
                        }
                }
                else
@@ -1034,15 +1034,15 @@ static void _net_nfc_server_snep_server_recv_cb(
 
 
 static void _net_nfc_server_snep_server_send_cb(net_nfc_error_e result,
-                                               uint32_t type,
-                                               data_s *data,
-                                               void *user_param)
+               uint32_t type,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_server_snep_context_t *context =
-                       (net_nfc_server_snep_context_t *)user_param;
+               (net_nfc_server_snep_context_t *)user_param;
 
        DEBUG_SERVER_MSG("_net_nfc_server_snep_server_send_cb"
-               ", result [%d]", result);
+                       ", result [%d]", result);
 
        if (context == NULL)/* TODO */
                return;
@@ -1068,7 +1068,7 @@ static void _net_nfc_server_snep_server_send_cb(net_nfc_error_e result,
 
 
 static void _net_nfc_server_snep_server_process(
-                       net_nfc_server_snep_context_t *context)
+               net_nfc_server_snep_context_t *context)
 {
        if (context == NULL)
                return;
@@ -1076,112 +1076,112 @@ static void _net_nfc_server_snep_server_process(
        switch (context->state)
        {
        case NET_NFC_LLCP_STEP_01 :
-                       DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_01");
+               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_01");
 
-                       /* receive request */
-                       net_nfc_server_snep_recv(
-                                       context->handle,
-                                       context->socket,
-                                       _net_nfc_server_snep_server_recv_cb,
-                                       context);
-                       break;
+               /* receive request */
+               net_nfc_server_snep_recv(
+                               context->handle,
+                               context->socket,
+                               _net_nfc_server_snep_server_recv_cb,
+                               context);
+               break;
 
        case NET_NFC_LLCP_STEP_02 :
-                       DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_02");
-
-                       context->state = NET_NFC_LLCP_STEP_03;
+               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_02");
 
-                       if (context->cb == NULL ||
-                                       context->cb((net_nfc_snep_handle_h)context,
-                                                       context->result,
-                                                       context->type,
-                                                       &context->data,
-                                                       context->user_param) != NET_NFC_OK)
-                       {
-                               /* there is no response for GET request */
-                               DEBUG_ERR_MSG("there is no response for GET request");
-
-                               /* receive request */
-                               net_nfc_server_snep_send(context->handle,
-                                                       context->socket,
-                                                       SNEP_RESP_NOT_FOUND,
-                                                       NULL,
-                                                       _net_nfc_server_snep_server_send_cb,
-                                                       context);
-                       }
-                       break;
+               context->state = NET_NFC_LLCP_STEP_03;
 
-       case NET_NFC_LLCP_STEP_03 :
-                       DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_03");
+               if (context->cb == NULL ||
+                               context->cb((net_nfc_snep_handle_h)context,
+                                       context->result,
+                                       context->type,
+                                       &context->data,
+                                       context->user_param) != NET_NFC_OK)
+               {
+                       /* there is no response for GET request */
+                       DEBUG_ERR_MSG("there is no response for GET request");
 
                        /* receive request */
                        net_nfc_server_snep_send(context->handle,
-                                               context->socket,
-                                               SNEP_RESP_SUCCESS,
-                                               &context->data,
-                                               _net_nfc_server_snep_server_send_cb,
-                                               context);
-                       break;
+                                       context->socket,
+                                       SNEP_RESP_NOT_FOUND,
+                                       NULL,
+                                       _net_nfc_server_snep_server_send_cb,
+                                       context);
+               }
+               break;
+
+       case NET_NFC_LLCP_STEP_03 :
+               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_03");
+
+               /* receive request */
+               net_nfc_server_snep_send(context->handle,
+                               context->socket,
+                               SNEP_RESP_SUCCESS,
+                               &context->data,
+                               _net_nfc_server_snep_server_send_cb,
+                               context);
+               break;
 
        case NET_NFC_LLCP_STEP_04 :
-                       DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_04");
+               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_04");
 
-                       if (context->cb != NULL)
-                       {
-                               /* complete and invoke callback */
-                               context->cb(
+               if (context->cb != NULL)
+               {
+                       /* complete and invoke callback */
+                       context->cb(
                                        (net_nfc_snep_handle_h)context,
                                        NET_NFC_OK,
                                        context->type,
                                        &context->data,
                                        context->user_param);
-                       }
+               }
 
-                       /* receive request */
-                       net_nfc_server_snep_send(context->handle,
-                                               context->socket,
-                                               SNEP_RESP_SUCCESS,
-                                               NULL,
-                                               _net_nfc_server_snep_server_send_cb,
-                                               context);
-                       break;
+               /* receive request */
+               net_nfc_server_snep_send(context->handle,
+                               context->socket,
+                               SNEP_RESP_SUCCESS,
+                               NULL,
+                               _net_nfc_server_snep_server_send_cb,
+                               context);
+               break;
 
        case NET_NFC_LLCP_STEP_10 : /* server error, and need to send error code to client */
-                       {
-                               /* FIXME : */
-                       }
-                       break;
+               {
+                       /* FIXME : */
+               }
+               break;
 
        case NET_NFC_STATE_ERROR :
-                       DEBUG_SERVER_MSG("NET_NFC_STATE_ERROR");
+               DEBUG_SERVER_MSG("NET_NFC_STATE_ERROR");
 
-                       /* error, invoke callback */
-                       DEBUG_ERR_MSG("_snep_server_recv failed, [%d]",
-                                       context->result);
+               /* error, invoke callback */
+               DEBUG_ERR_MSG("_snep_server_recv failed, [%d]",
+                               context->result);
 
-                       if (context->cb != NULL)
-                       {
-                               context->cb((net_nfc_snep_handle_h)context,
-                                                       context->result,
-                                                       context->type,
-                                                       NULL,
-                                                       context->user_param);
-                       }
+               if (context->cb != NULL)
+               {
+                       context->cb((net_nfc_snep_handle_h)context,
+                                       context->result,
+                                       context->type,
+                                       NULL,
+                                       context->user_param);
+               }
 
-                       /* restart?? */
-                       break;
+               /* restart?? */
+               break;
 
        default :
-                       DEBUG_ERR_MSG("NET_NFC_LLCP_STEP_??");
-                       /* TODO */
-                       break;
+               DEBUG_ERR_MSG("NET_NFC_LLCP_STEP_??");
+               /* TODO */
+               break;
        }
 }
 
 
 static void _net_nfc_server_snep_clear_queue(
-                       gpointer data,
-                       gpointer user_data)
+               gpointer data,
+               gpointer user_data)
 {
        net_nfc_server_snep_job_t *job = (net_nfc_server_snep_job_t *)data;
 
@@ -1190,8 +1190,8 @@ static void _net_nfc_server_snep_clear_queue(
                if (job->cb != NULL)
                {
                        job->cb((net_nfc_snep_handle_h)job->context,
-                               NET_NFC_OPERATION_FAIL, job->type,
-                               NULL, job->user_param);
+                                       NET_NFC_OPERATION_FAIL, job->type,
+                                       NULL, job->user_param);
                }
 
                if (job->data.buffer != NULL)
@@ -1205,17 +1205,17 @@ static void _net_nfc_server_snep_clear_queue(
 
 
 static void _net_nfc_server_snep_incomming_socket_error_cb(
-                       net_nfc_error_e result,
-                       net_nfc_target_handle_s *handle,
-                       net_nfc_llcp_socket_t socket,
-                       data_s *data,
-                       void *user_param)
+               net_nfc_error_e result,
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_server_snep_context_t *context =
                (net_nfc_server_snep_context_t *)user_param;
 
        DEBUG_SERVER_MSG("_net_nfc_server_snep_incomming_socket_error_cb,"
-               " socket [%x], result [%d]",socket, result);
+                       " socket [%x], result [%d]",socket, result);
 
        if (context == NULL)
        {
@@ -1228,22 +1228,22 @@ static void _net_nfc_server_snep_incomming_socket_error_cb(
        }
 
        g_queue_foreach(&context->queue,
-               _net_nfc_server_snep_clear_queue,
-               NULL);
+                       _net_nfc_server_snep_clear_queue,
+                       NULL);
 
        _net_nfc_util_free_mem(context);
 }
 
 
 static void _net_nfc_server_snep_socket_error_cb(
-                               net_nfc_error_e result,
-                               net_nfc_target_handle_s *handle,
-                               net_nfc_llcp_socket_t socket,
-                               data_s *data,
-                               void *user_param)
+               net_nfc_error_e result,
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_server_snep_context_t *context =
-                       (net_nfc_server_snep_context_t *)user_param;
+               (net_nfc_server_snep_context_t *)user_param;
 
        DEBUG_SERVER_MSG("_net_nfc_server_snep_socket_error_cb"
                        " socket [%x], result [%d]",socket, result);
@@ -1256,10 +1256,10 @@ static void _net_nfc_server_snep_socket_error_cb(
        if (context->cb != NULL)
        {
                context->cb((net_nfc_snep_handle_h)context,
-                                       result,
-                                       NET_NFC_LLCP_STOP,
-                                       NULL,
-                                       context->user_param);
+                               result,
+                               NET_NFC_LLCP_STOP,
+                               NULL,
+                               context->user_param);
        }
 
        /*net_nfc_controller_llcp_socket_close(socket, &result);*/
@@ -1270,22 +1270,22 @@ static void _net_nfc_server_snep_socket_error_cb(
        }
 
        g_queue_foreach(&context->queue,
-               _net_nfc_server_snep_clear_queue,
-               NULL);
+                       _net_nfc_server_snep_clear_queue,
+                       NULL);
 
        _net_nfc_util_free_mem(context);
 }
 
 
 static void _net_nfc_server_snep_incoming_cb(
-                               net_nfc_error_e result,
-                               net_nfc_target_handle_s *handle,
-                               net_nfc_llcp_socket_t socket,
-                               data_s *data,
-                               void *user_param)
+               net_nfc_error_e result,
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_server_snep_context_t *context =
-                                       (net_nfc_server_snep_context_t *)user_param;
+               (net_nfc_server_snep_context_t *)user_param;
        net_nfc_server_snep_context_t *accept_context = NULL;
 
        if (context == NULL)
@@ -1321,9 +1321,9 @@ static void _net_nfc_server_snep_incoming_cb(
        accept_context->state = NET_NFC_LLCP_STEP_01;
 
        result = net_nfc_server_llcp_simple_accept(handle,
-                                               socket,
-                                               _net_nfc_server_snep_incomming_socket_error_cb,
-                                               accept_context);
+                       socket,
+                       _net_nfc_server_snep_incomming_socket_error_cb,
+                       accept_context);
 
        if (result != NET_NFC_OK)
        {
@@ -1348,19 +1348,19 @@ ERROR :
        if (context->cb != NULL)
        {
                context->cb((net_nfc_snep_handle_h)context,
-                                       result,
-                                       context->type,
-                                       NULL,
-                                       context->user_param);
+                               result,
+                               context->type,
+                               NULL,
+                               context->user_param);
        }
 }
 
 net_nfc_error_e net_nfc_server_snep_server(
-                               net_nfc_target_handle_s *handle,
-                               const char *san,
-                               sap_t sap,
-                               net_nfc_server_snep_cb cb,
-                               void *user_param)
+               net_nfc_target_handle_s *handle,
+               const char *san,
+               sap_t sap,
+               net_nfc_server_snep_cb cb,
+               void *user_param)
 {
        net_nfc_error_e result;
        net_nfc_server_snep_context_t *context = NULL;
@@ -1384,11 +1384,11 @@ net_nfc_error_e net_nfc_server_snep_server(
        context->state = NET_NFC_LLCP_STEP_01;
 
        result = net_nfc_server_llcp_simple_server(handle,
-                               san,
-                               sap,
-                               _net_nfc_server_snep_incoming_cb,
-                               _net_nfc_server_snep_socket_error_cb,
-                               context);
+                       san,
+                       sap,
+                       _net_nfc_server_snep_incoming_cb,
+                       _net_nfc_server_snep_socket_error_cb,
+                       context);
 
        if (result != NET_NFC_OK)
        {
@@ -1409,11 +1409,11 @@ ERROR :
 }
 
 net_nfc_error_e net_nfc_server_snep_server_send_get_response(
-                                       net_nfc_snep_handle_h snep_handle,
-                                       data_s *data)
+               net_nfc_snep_handle_h snep_handle,
+               data_s *data)
 {
        net_nfc_server_snep_context_t *context =
-                       (net_nfc_server_snep_context_t *)snep_handle;
+               (net_nfc_server_snep_context_t *)snep_handle;
        net_nfc_error_e result = NET_NFC_OK;
 
        if (context == NULL/* && check valid handle */)
@@ -1463,13 +1463,13 @@ net_nfc_error_e net_nfc_server_snep_server_send_get_response(
 }
 
 static void _net_nfc_server_snep_client_send_cb(
-                               net_nfc_error_e result,
-                               uint32_t type,
-                               data_s *data,
-                               void *user_param)
+               net_nfc_error_e result,
+               uint32_t type,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_server_snep_job_t*job =
-                       (net_nfc_server_snep_job_t *)user_param;
+               (net_nfc_server_snep_job_t *)user_param;
 
        if (job == NULL)
        {
@@ -1496,13 +1496,13 @@ static void _net_nfc_server_snep_client_send_cb(
 }
 
 static void _net_nfc_server_snep_client_recv_cb(
-                               net_nfc_error_e result,
-                               uint32_t type,
-                               data_s *data,
-                               void *user_param)
+               net_nfc_error_e result,
+               uint32_t type,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_server_snep_job_t *job =
-                       (net_nfc_server_snep_job_t *)user_param;
+               (net_nfc_server_snep_job_t *)user_param;
 
        if (job == NULL)
        {
@@ -1524,7 +1524,7 @@ static void _net_nfc_server_snep_client_recv_cb(
                                if (job->data.buffer != NULL)
                                {
                                        memcpy(job->data.buffer, data->buffer,
-                                               data->length);
+                                                       data->length);
                                }
                                else
                                {
@@ -1556,7 +1556,7 @@ static void _net_nfc_server_snep_client_recv_cb(
 static void _net_nfc_server_snep_client_do_job(net_nfc_server_snep_context_t *context)
 {
        if (context->state == NET_NFC_LLCP_IDLE &&
-               g_queue_is_empty(&context->queue) == false) {
+                       g_queue_is_empty(&context->queue) == false) {
                net_nfc_server_snep_job_t *job;
 
                job = g_queue_pop_head(&context->queue);
@@ -1569,7 +1569,7 @@ static void _net_nfc_server_snep_client_do_job(net_nfc_server_snep_context_t *co
 }
 
 static void _net_nfc_server_snep_client_process(
-                       net_nfc_server_snep_job_t *job)
+               net_nfc_server_snep_job_t *job)
 {
        bool finish = false;
 
@@ -1585,11 +1585,11 @@ static void _net_nfc_server_snep_client_process(
 
                /* send request */
                net_nfc_server_snep_send(job->handle,
-                       job->socket,
-                       job->type,
-                       &job->data,
-                       _net_nfc_server_snep_client_send_cb,
-                       job);
+                               job->socket,
+                               job->type,
+                               &job->data,
+                               _net_nfc_server_snep_client_send_cb,
+                               job);
                break;
 
        case NET_NFC_LLCP_STEP_02 :
@@ -1597,9 +1597,9 @@ static void _net_nfc_server_snep_client_process(
 
                /* receive response */
                net_nfc_server_snep_recv(job->handle,
-                       job->socket,
-                       _net_nfc_server_snep_client_recv_cb,
-                       job);
+                               job->socket,
+                               _net_nfc_server_snep_client_recv_cb,
+                               job);
                break;
 
        case NET_NFC_LLCP_STEP_RETURN :
@@ -1609,10 +1609,10 @@ static void _net_nfc_server_snep_client_process(
                if (job->cb != NULL)
                {
                        job->cb((net_nfc_snep_handle_h)job->context,
-                               NET_NFC_OK,
-                               job->type,
-                               &job->data,
-                               job->user_param);
+                                       NET_NFC_OK,
+                                       job->type,
+                                       &job->data,
+                                       job->user_param);
                }
 
                /* finish job */
@@ -1625,14 +1625,14 @@ static void _net_nfc_server_snep_client_process(
 
                /* error, invoke callback */
                DEBUG_ERR_MSG("_snep_server_send failed, [%d]",
-                       job->result);
+                               job->result);
                if (job->cb != NULL)
                {
                        job->cb((net_nfc_snep_handle_h)job->context,
-                               job->result,
-                               job->type,
-                               &job->data,
-                               job->user_param);
+                                       job->result,
+                                       job->type,
+                                       &job->data,
+                                       job->user_param);
                }
 
                /* finish job */
@@ -1658,14 +1658,14 @@ static void _net_nfc_server_snep_client_process(
 }
 
 static void _net_nfc_server_snep_connected_cb(
-                               net_nfc_error_e result,
-                               net_nfc_target_handle_s *handle,
-                               net_nfc_llcp_socket_t socket,
-                               data_s *data,
-                               void *user_param)
+               net_nfc_error_e result,
+               net_nfc_target_handle_s *handle,
+               net_nfc_llcp_socket_t socket,
+               data_s *data,
+               void *user_param)
 {
        net_nfc_server_snep_context_t *context =
-                       (net_nfc_server_snep_context_t *)user_param;
+               (net_nfc_server_snep_context_t *)user_param;
 
        if (context == NULL)
        {
@@ -1688,19 +1688,19 @@ static void _net_nfc_server_snep_connected_cb(
        if (context->cb != NULL)
        {
                context->cb((net_nfc_snep_handle_h)context,
-                                       result,
-                                       NET_NFC_LLCP_START,
-                                       NULL,
-                                       context->user_param);
+                               result,
+                               NET_NFC_LLCP_START,
+                               NULL,
+                               context->user_param);
        }
 }
 
 net_nfc_error_e net_nfc_server_snep_client(
-                               net_nfc_target_handle_s *handle,
-                               const char *san,
-                               sap_t sap,
-                               net_nfc_server_snep_cb cb,
-                               void *user_param)
+               net_nfc_target_handle_s *handle,
+               const char *san,
+               sap_t sap,
+               net_nfc_server_snep_cb cb,
+               void *user_param)
 {
        net_nfc_error_e result;
        net_nfc_server_snep_context_t *context = NULL;
@@ -1723,11 +1723,11 @@ net_nfc_error_e net_nfc_server_snep_client(
        context->user_param = user_param;
 
        result = net_nfc_server_llcp_simple_client(handle,
-                                       san,
-                                       sap,
-                                       _net_nfc_server_snep_connected_cb,
-                                       _net_nfc_server_snep_socket_error_cb,
-                                       context);
+                       san,
+                       sap,
+                       _net_nfc_server_snep_connected_cb,
+                       _net_nfc_server_snep_socket_error_cb,
+                       context);
 
        if (result != NET_NFC_OK)
        {
@@ -1760,11 +1760,11 @@ ERROR :
 
 
 net_nfc_error_e net_nfc_server_snep_client_request(
-                       net_nfc_snep_handle_h snep,
-                       uint8_t type,
-                       data_s *data,
-                       net_nfc_server_snep_cb cb,
-                       void *user_param)
+               net_nfc_snep_handle_h snep,
+               uint8_t type,
+               data_s *data,
+               net_nfc_server_snep_cb cb,
+               void *user_param)
 {
        net_nfc_server_snep_context_t *context = (net_nfc_server_snep_context_t *)snep;
        net_nfc_error_e result = NET_NFC_OK;
@@ -1813,11 +1813,11 @@ net_nfc_error_e net_nfc_server_snep_client_request(
 }
 
 static net_nfc_error_e _net_nfc_server_default_server_cb_(
-                                               net_nfc_snep_handle_h handle,
-                                               net_nfc_error_e result,
-                                               uint32_t type,
-                                               data_s *data,
-                                               void *user_param)
+               net_nfc_snep_handle_h handle,
+               net_nfc_error_e result,
+               uint32_t type,
+               data_s *data,
+               void *user_param)
 {
        DEBUG_SERVER_MSG("type [%d], result [%d], data [%p], user_param [%p]",
                        type, result, data, user_param);
@@ -1831,37 +1831,37 @@ static net_nfc_error_e _net_nfc_server_default_server_cb_(
        switch (type)
        {
        case SNEP_REQ_GET:
-       {
-               net_nfc_server_snep_get_msg_t *msg =
+               {
+                       net_nfc_server_snep_get_msg_t *msg =
                                (net_nfc_server_snep_get_msg_t *)data->buffer;
 
 
-               uint32_t max_len = htonl(msg->length);
-               data_s get_msg = { msg->data,data->length - sizeof(msg->length)};
+                       uint32_t max_len = htonl(msg->length);
+                       data_s get_msg = { msg->data,data->length - sizeof(msg->length)};
 
-               DEBUG_SERVER_MSG("GET : acceptable max_len [%d], message [%d]",
-                               max_len, data->length - sizeof(msg->length));
+                       DEBUG_SERVER_MSG("GET : acceptable max_len [%d], message [%d]",
+                                       max_len, data->length - sizeof(msg->length));
 
 
-               if (_net_nfc_server_snep_process_get_response_cb(handle, &get_msg, max_len))
-               {
-                       result = NET_NFC_OK;
-               }
-               else
-               {
-                       result = NET_NFC_NOT_SUPPORTED;
+                       if (_net_nfc_server_snep_process_get_response_cb(handle, &get_msg, max_len))
+                       {
+                               result = NET_NFC_OK;
+                       }
+                       else
+                       {
+                               result = NET_NFC_NOT_SUPPORTED;
+                       }
                }
-       }
-       break;
+               break;
 
        case SNEP_REQ_PUT :
-       {
-               net_nfc_server_p2p_received(data);
-               net_nfc_app_util_process_ndef(data);;
+               {
+                       net_nfc_server_p2p_received(data);
+                       net_nfc_app_util_process_ndef(data);;
 
-               result = NET_NFC_OK;
-       }
-       break;
+                       result = NET_NFC_OK;
+               }
+               break;
 
        default :
                DEBUG_ERR_MSG("error [%d]", result);
@@ -1873,11 +1873,11 @@ static net_nfc_error_e _net_nfc_server_default_server_cb_(
 
 
 static net_nfc_error_e _net_nfc_server_default_client_cb_(
-                                               net_nfc_snep_handle_h handle,
-                                               net_nfc_error_e result,
-                                               uint32_t type,
-                                               data_s *data,
-                                               void *user_param)
+               net_nfc_snep_handle_h handle,
+               net_nfc_error_e result,
+               uint32_t type,
+               data_s *data,
+               void *user_param)
 {
        _net_nfc_server_snep_service_context_t *context =
                (_net_nfc_server_snep_service_context_t*)user_param;
@@ -1890,24 +1890,24 @@ static net_nfc_error_e _net_nfc_server_default_client_cb_(
 
        switch (type)
        {
-               case SNEP_RESP_SUCCESS :
-               case SNEP_RESP_BAD_REQ :
-               case SNEP_RESP_EXCESS_DATA :
-               case SNEP_RESP_NOT_FOUND :
-               case SNEP_RESP_NOT_IMPLEMENT :
-               case SNEP_RESP_REJECT :
-               case SNEP_RESP_UNSUPPORTED_VER :
-                       context = (_net_nfc_server_snep_service_context_t *)user_param;
+       case SNEP_RESP_SUCCESS :
+       case SNEP_RESP_BAD_REQ :
+       case SNEP_RESP_EXCESS_DATA :
+       case SNEP_RESP_NOT_FOUND :
+       case SNEP_RESP_NOT_IMPLEMENT :
+       case SNEP_RESP_REJECT :
+       case SNEP_RESP_UNSUPPORTED_VER :
+               context = (_net_nfc_server_snep_service_context_t *)user_param;
 
-                       net_nfc_server_p2p_data_sent(result,
-                                               context->user_param);
+               net_nfc_server_p2p_data_sent(result,
+                               context->user_param);
 
-                       _net_nfc_util_free_mem(context);
-                       break;
+               _net_nfc_util_free_mem(context);
+               break;
 
-               default :
-                               DEBUG_ERR_MSG("error [%d]", result);
-                               break;
+       default :
+               DEBUG_ERR_MSG("error [%d]", result);
+               break;
        }
 
        return result;
@@ -1915,17 +1915,17 @@ static net_nfc_error_e _net_nfc_server_default_client_cb_(
 
 
 static net_nfc_error_e _net_nfc_server_default_client_connected_cb_(
-       net_nfc_snep_handle_h handle,
-       net_nfc_error_e result,
-       uint32_t type,
-       data_s *data,
-       void *user_param)
+               net_nfc_snep_handle_h handle,
+               net_nfc_error_e result,
+               uint32_t type,
+               data_s *data,
+               void *user_param)
 {
        _net_nfc_server_snep_service_context_t *context =
                (_net_nfc_server_snep_service_context_t *)user_param;
 
        DEBUG_SERVER_MSG("type [%d], result [%d], data [%p], user_param [%p]",
-       type, result, data, user_param);
+                       type, result, data, user_param);
 
        if (context == NULL)
        {
@@ -1935,10 +1935,10 @@ static net_nfc_error_e _net_nfc_server_default_client_connected_cb_(
        if (result == NET_NFC_OK)
        {
                net_nfc_server_snep_client_request(handle,
-                       context->type,
-                       &context->data,
-                       _net_nfc_server_default_client_cb_,
-                       context);
+                               context->type,
+                               &context->data,
+                               _net_nfc_server_default_client_cb_,
+                               context);
        }
        else
        {
@@ -1954,23 +1954,23 @@ static net_nfc_error_e _net_nfc_server_default_client_connected_cb_(
 
 
 net_nfc_error_e net_nfc_server_snep_default_server_start(
-                                               net_nfc_target_handle_s *handle)
+               net_nfc_target_handle_s *handle)
 {
        /* start default snep server, register your callback */
        return net_nfc_server_snep_server(handle,
-                               SNEP_SAN,
-                               SNEP_SAP,
-                               _net_nfc_server_default_server_cb_,
-                               (void *)1234);
+                       SNEP_SAN,
+                       SNEP_SAP,
+                       _net_nfc_server_default_server_cb_,
+                       (void *)1234);
 }
 
 
 net_nfc_error_e net_nfc_server_snep_default_client_start(
-                               net_nfc_target_handle_s *handle,
-                               int type,
-                               data_s *data,
-                               int client,
-                               void *user_param)
+               net_nfc_target_handle_s *handle,
+               int type,
+               data_s *data,
+               int client,
+               void *user_param)
 {
        _net_nfc_server_snep_service_context_t *context = NULL;
 
@@ -1985,15 +1985,15 @@ net_nfc_error_e net_nfc_server_snep_default_client_start(
                if (context->data.buffer != NULL)
                {
                        memcpy(context->data.buffer, data->buffer,
-                               data->length);
+                                       data->length);
                        context->data.length = data->length;
                }
                /* start default snep client, register your callback */
                return net_nfc_server_snep_client(handle,
-                                       SNEP_SAN,
-                                       SNEP_SAP,
-                                       _net_nfc_server_default_client_connected_cb_,
-                                       context);
+                               SNEP_SAN,
+                               SNEP_SAP,
+                               _net_nfc_server_default_client_connected_cb_,
+                               context);
        }
        else
        {
@@ -2001,10 +2001,10 @@ net_nfc_error_e net_nfc_server_snep_default_client_start(
        }
 }
 
-net_nfc_error_e
+       net_nfc_error_e
 net_nfc_server_snep_default_server_register_get_response_cb(
-                       net_nfc_server_snep_listen_cb cb,
-                       void *user_param)
+               net_nfc_server_snep_listen_cb cb,
+               void *user_param)
 {
        net_nfc_error_e result;
 
@@ -2020,9 +2020,9 @@ net_nfc_server_snep_default_server_register_get_response_cb(
        return result;
 }
 
-net_nfc_error_e
+       net_nfc_error_e
 net_nfc_server_snep_default_server_unregister_get_response_cb(
-                       net_nfc_server_snep_listen_cb cb)
+               net_nfc_server_snep_listen_cb cb)
 {
        _net_nfc_server_snep_del_get_response_cb(cb);
 
@@ -2030,10 +2030,10 @@ net_nfc_server_snep_default_server_unregister_get_response_cb(
 }
 
 net_nfc_error_e net_nfc_server_snep_default_server_send_get_response(
-                               net_nfc_snep_handle_h snep_handle, data_s *data)
+               net_nfc_snep_handle_h snep_handle, data_s *data)
 {
        net_nfc_server_snep_context_t *context =
-                       (net_nfc_server_snep_context_t *)snep_handle;
+               (net_nfc_server_snep_context_t *)snep_handle;
        net_nfc_error_e result = NET_NFC_OK;
 
        if (context == NULL/* && check valid handle */)
@@ -2058,21 +2058,21 @@ net_nfc_error_e net_nfc_server_snep_default_server_send_get_response(
 }
 
 static void _snep_default_activate_cb(int event,
-       net_nfc_target_handle_s *handle,
-       uint32_t sap, const char *san, void *user_param)
+               net_nfc_target_handle_s *handle,
+               uint32_t sap, const char *san, void *user_param)
 {
        net_nfc_error_e result;
 
        DEBUG_SERVER_MSG("event [%d], handle [%p], sap [%d], san [%s]",
-               event, handle, sap, san);
+                       event, handle, sap, san);
 
        if (event == NET_NFC_LLCP_START) {
                /* start snep server */
                result = net_nfc_server_snep_server(handle, (char *)san, sap,
-                       _net_nfc_server_default_server_cb_, user_param);
+                               _net_nfc_server_default_server_cb_, user_param);
                if (result != NET_NFC_OK) {
                        DEBUG_ERR_MSG("net_nfc_service_snep_server failed, [%d]",
-                               result);
+                                       result);
                }
        } else if (event == NET_NFC_LLCP_UNREGISTERED) {
                /* unregister server, do nothing */
@@ -2088,10 +2088,10 @@ net_nfc_error_e net_nfc_server_snep_default_server_register()
 
        /* start default snep server */
        return net_nfc_server_llcp_register_service(id,
-               SNEP_SAP,
-               SNEP_SAN,
-               _snep_default_activate_cb,
-               NULL);
+                       SNEP_SAP,
+                       SNEP_SAN,
+                       _snep_default_activate_cb,
+                       NULL);
 }
 
 net_nfc_error_e net_nfc_server_snep_default_server_unregister()
@@ -2103,17 +2103,17 @@ net_nfc_error_e net_nfc_server_snep_default_server_unregister()
 
        /* start default snep server */
        return net_nfc_server_llcp_unregister_service(id,
-               SNEP_SAP,
-               SNEP_SAN);
+                       SNEP_SAP,
+                       SNEP_SAN);
 }
 
 net_nfc_error_e net_nfc_server_snep_parse_get_request(data_s *request,
-       size_t *max_len, data_s *message)
+               size_t *max_len, data_s *message)
 {
        net_nfc_server_snep_msg_t *msg = NULL;
 
        if (request == NULL || request->buffer == NULL ||
-               request->length == 0 || max_len == NULL || message == NULL) {
+                       request->length == 0 || max_len == NULL || message == NULL) {
                return NET_NFC_NULL_PARAMETER;
        }
 
similarity index 77%
rename from src/manager/net_nfc_server_se.c
rename to daemon/net_nfc_server_se.c
index 6537e3d..96cbc12 100644 (file)
 #include "net_nfc_debug_internal.h"
 #include "net_nfc_util_internal.h"
 #include "net_nfc_util_gdbus_internal.h"
-#include "net_nfc_controller_internal.h"
 #include "net_nfc_gdbus.h"
-#include "net_nfc_manager.h"
+#include "net_nfc_server.h"
 #include "net_nfc_server_common.h"
-#include "net_nfc_server_context_internal.h"
+#include "net_nfc_server_context.h"
 #include "net_nfc_server_manager.h"
+#include "net_nfc_server_controller.h"
+#include "net_nfc_server_util.h"
 #include "net_nfc_server_se.h"
-#include "net_nfc_app_util_internal.h"
 
 
 typedef struct _nfc_se_setting_t
@@ -101,37 +101,37 @@ static void se_send_apdu_thread_func(gpointer user_data);
 static void se_set_data_thread_func(gpointer user_data);
 
 static gboolean se_handle_close_secure_element(
-                       NetNfcGDbusSecureElement *object,
-                       GDBusMethodInvocation *invocation,
-                       guint arg_handle,
-                       GVariant *smack_privilege);
+               NetNfcGDbusSecureElement *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_handle,
+               GVariant *smack_privilege);
 
 static gboolean se_handle_get_atr(
-                       NetNfcGDbusSecureElement *object,
-                       GDBusMethodInvocation *invocation,
-                       guint arg_handle,
-                       GVariant *smack_privilege);
+               NetNfcGDbusSecureElement *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_handle,
+               GVariant *smack_privilege);
 
 
 static gboolean se_handle_open_secure_element(
-                       NetNfcGDbusSecureElement *object,
-                       GDBusMethodInvocation *invocation,
-                       gint arg_type,
-                       GVariant *smack_privilege);
+               NetNfcGDbusSecureElement *object,
+               GDBusMethodInvocation *invocation,
+               gint arg_type,
+               GVariant *smack_privilege);
 
 
 static gboolean se_handle_send_apdu(
-                       NetNfcGDbusSecureElement *object,
-                       GDBusMethodInvocation *invocation,
-                       guint arg_handle,
-                       GVariant* apdudata,
-                       GVariant *smack_privilege);
+               NetNfcGDbusSecureElement *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_handle,
+               GVariant* apdudata,
+               GVariant *smack_privilege);
 
 static gboolean se_handle_set(
-                       NetNfcGDbusSecureElement *object,
-                       GDBusMethodInvocation *invocation,
-                       gint arg_type,
-                       GVariant *smack_privilege);
+               NetNfcGDbusSecureElement *object,
+               GDBusMethodInvocation *invocation,
+               gint arg_type,
+               GVariant *smack_privilege);
 
 
 uint8_t net_nfc_server_se_get_se_type()
@@ -159,11 +159,11 @@ static void net_nfc_server_se_set_se_mode(uint8_t mode)
 static bool net_nfc_server_se_is_ese_handle(net_nfc_target_handle_s *handle)
 {
        return (gdbus_ese_handle != NULL &&
-               gdbus_ese_handle == handle);
+                       gdbus_ese_handle == handle);
 }
 
 static void net_nfc_server_se_set_current_ese_handle(
-                       net_nfc_target_handle_s *handle)
+               net_nfc_target_handle_s *handle)
 {
        gdbus_ese_handle = handle;
 }
@@ -175,8 +175,8 @@ static net_nfc_target_handle_s *net_nfc_server_se_open_ese()
                net_nfc_target_handle_s *handle;
 
                if (net_nfc_controller_secure_element_open(
-                       SECURE_ELEMENT_TYPE_ESE,
-                       &handle, &result) == true)
+                                       SECURE_ELEMENT_TYPE_ESE,
+                                       &handle, &result) == true)
                {
                        net_nfc_server_se_set_current_ese_handle(handle);
 
@@ -185,7 +185,7 @@ static net_nfc_target_handle_s *net_nfc_server_se_open_ese()
                else
                {
                        DEBUG_ERR_MSG("net_nfc_controller_secure_element_open failed [%d]",
-                               result);
+                                       result);
                }
        }
 
@@ -197,10 +197,10 @@ static net_nfc_error_e net_nfc_server_se_close_ese()
        net_nfc_error_e result = NET_NFC_OK;
 
        if (gdbus_ese_handle != NULL &&
-               net_nfc_server_gdbus_is_server_busy() == false) {
+                       net_nfc_server_gdbus_is_server_busy() == false) {
                if (net_nfc_controller_secure_element_close(
-                       gdbus_ese_handle,
-                       &result) == false)
+                                       gdbus_ese_handle,
+                                       &result) == false)
                {
                        net_nfc_controller_exception_handler();
                }
@@ -219,8 +219,8 @@ static TelSimCardStatus_t _se_uicc_check_state(TapiHandle *handle)
        int error;
 
        error = tel_get_sim_init_info(handle,
-               &state,
-               &b_card_changed);
+                       &state,
+                       &b_card_changed);
        if (error != 0)
        {
                DEBUG_ERR_MSG("error = [%d]", error);
@@ -251,23 +251,23 @@ static void _se_uicc_status_noti_cb(TapiHandle *handle,
                        gdbus_se_setting.busy = false;
 
                        net_nfc_controller_set_secure_element_mode(
-                               SECURE_ELEMENT_TYPE_UICC,
-                               SECURE_ELEMENT_VIRTUAL_MODE, &result);
+                                       SECURE_ELEMENT_TYPE_UICC,
+                                       SECURE_ELEMENT_VIRTUAL_MODE, &result);
                        if (result == NET_NFC_OK) {
                                DEBUG_SERVER_MSG(
-                                       "changed to SECURE_ELEMENT_TYPE_UICC");
+                                               "changed to SECURE_ELEMENT_TYPE_UICC");
                                net_nfc_server_se_set_se_type(
-                                       SECURE_ELEMENT_TYPE_UICC);
+                                               SECURE_ELEMENT_TYPE_UICC);
                                net_nfc_server_se_set_se_mode(
-                                       SECURE_ELEMENT_VIRTUAL_MODE);
+                                               SECURE_ELEMENT_VIRTUAL_MODE);
                                if (vconf_set_int(VCONFKEY_NFC_SE_TYPE,
-                                       VCONFKEY_NFC_SE_TYPE_UICC) != 0) {
+                                                       VCONFKEY_NFC_SE_TYPE_UICC) != 0) {
                                        DEBUG_ERR_MSG("vconf_set_int failed");
                                }
                        } else {
                                DEBUG_ERR_MSG(
-                                       "SECURE_ELEMENT_TYPE_UICC, SECURE_ELEMENT_VIRTUAL_MODE failed [%d]",
-                                       result);
+                                               "SECURE_ELEMENT_TYPE_UICC, SECURE_ELEMENT_VIRTUAL_MODE failed [%d]",
+                                               result);
                        }
                }
                break;
@@ -291,9 +291,9 @@ static void _se_uicc_init(void)
                gdbus_uicc_handle = tel_init(cpList[0]);
                if (gdbus_uicc_handle != NULL) {
                        tel_register_noti_event(gdbus_uicc_handle,
-                               TAPI_NOTI_SIM_STATUS,
-                               _se_uicc_status_noti_cb,
-                               NULL);
+                                       TAPI_NOTI_SIM_STATUS,
+                                       _se_uicc_status_noti_cb,
+                                       NULL);
 
                } else {
                        DEBUG_ERR_MSG("tel_init() failed");
@@ -306,7 +306,7 @@ static void _se_uicc_init(void)
 static void _se_uicc_deinit()
 {
        tel_deregister_noti_event(gdbus_uicc_handle,
-               TAPI_NOTI_SIM_STATUS);
+                       TAPI_NOTI_SIM_STATUS);
 
        tel_deinit(gdbus_uicc_handle);
 
@@ -333,7 +333,7 @@ static net_nfc_target_handle_s *_se_uicc_open(void)
 static bool _se_is_uicc_handle(net_nfc_target_handle_s *handle)
 {
        return (gdbus_uicc_handle != NULL &&
-               (TapiHandle *)handle == gdbus_uicc_handle);
+                       (TapiHandle *)handle == gdbus_uicc_handle);
 }
 
 static void _se_uicc_close(net_nfc_target_handle_s *handle)
@@ -352,36 +352,36 @@ net_nfc_error_e net_nfc_server_se_change_se(uint8_t type)
 
                        /*turn off ESE*/
                        net_nfc_controller_set_secure_element_mode(
-                               SECURE_ELEMENT_TYPE_ESE,
-                               SECURE_ELEMENT_OFF_MODE,
-                               &result);
+                                       SECURE_ELEMENT_TYPE_ESE,
+                                       SECURE_ELEMENT_OFF_MODE,
+                                       &result);
 
                        state = _se_uicc_check_state(gdbus_uicc_handle);
                        if (state == TAPI_SIM_STATUS_SIM_INIT_COMPLETED ||
-                               state == TAPI_SIM_STATUS_CARD_NOT_PRESENT ||
-                               state == TAPI_SIM_STATUS_CARD_REMOVED) {
+                                       state == TAPI_SIM_STATUS_CARD_NOT_PRESENT ||
+                                       state == TAPI_SIM_STATUS_CARD_REMOVED) {
                                /*turn on UICC*/
                                net_nfc_controller_set_secure_element_mode(
-                                       SECURE_ELEMENT_TYPE_UICC,
-                                       SECURE_ELEMENT_VIRTUAL_MODE, &result);
+                                               SECURE_ELEMENT_TYPE_UICC,
+                                               SECURE_ELEMENT_VIRTUAL_MODE, &result);
                                if (result == NET_NFC_OK) {
                                        DEBUG_SERVER_MSG(
-                                               "changed to SECURE_ELEMENT_TYPE_UICC");
+                                                       "changed to SECURE_ELEMENT_TYPE_UICC");
 
                                        net_nfc_server_se_set_se_type(
-                                               SECURE_ELEMENT_TYPE_UICC);
+                                                       SECURE_ELEMENT_TYPE_UICC);
                                        net_nfc_server_se_set_se_mode(
-                                               SECURE_ELEMENT_VIRTUAL_MODE);
+                                                       SECURE_ELEMENT_VIRTUAL_MODE);
 
                                        if (vconf_set_int(
-                                               VCONFKEY_NFC_SE_TYPE,
-                                               VCONFKEY_NFC_SE_TYPE_UICC) != 0)
-                                               {
+                                                               VCONFKEY_NFC_SE_TYPE,
+                                                               VCONFKEY_NFC_SE_TYPE_UICC) != 0)
+                                       {
                                                DEBUG_ERR_MSG("vconf_set_int failed");
                                        }
                                } else {
                                        DEBUG_ERR_MSG("SECURE_ELEMENT_TYPE_UICC, SECURE_ELEMENT_VIRTUAL_MODE failed [%d]",
-                                               result);
+                                                       result);
                                }
                        } else {
                                DEBUG_SERVER_MSG("UICC is not ready. waiting UICC event");
@@ -398,15 +398,15 @@ net_nfc_error_e net_nfc_server_se_change_se(uint8_t type)
        case SECURE_ELEMENT_TYPE_ESE :
                /*turn off UICC*/
                net_nfc_controller_set_secure_element_mode(
-                       SECURE_ELEMENT_TYPE_UICC,
-                       SECURE_ELEMENT_OFF_MODE,
-                       &result);
+                               SECURE_ELEMENT_TYPE_UICC,
+                               SECURE_ELEMENT_OFF_MODE,
+                               &result);
 
                /*turn on ESE*/
                net_nfc_controller_set_secure_element_mode(
-                       SECURE_ELEMENT_TYPE_ESE,
-                       SECURE_ELEMENT_VIRTUAL_MODE,
-                       &result);
+                               SECURE_ELEMENT_TYPE_ESE,
+                               SECURE_ELEMENT_VIRTUAL_MODE,
+                               &result);
 
                if (result == NET_NFC_OK) {
                        DEBUG_SERVER_MSG("changed to SECURE_ELEMENT_TYPE_ESE");
@@ -415,7 +415,7 @@ net_nfc_error_e net_nfc_server_se_change_se(uint8_t type)
                        net_nfc_server_se_set_se_mode(SECURE_ELEMENT_VIRTUAL_MODE);
 
                        if (vconf_set_int(VCONFKEY_NFC_SE_TYPE,
-                               VCONFKEY_NFC_SE_TYPE_ESE) != 0) {
+                                               VCONFKEY_NFC_SE_TYPE_ESE) != 0) {
                                DEBUG_ERR_MSG("vconf_set_int failed");
                        }
                } else {
@@ -428,26 +428,26 @@ net_nfc_error_e net_nfc_server_se_change_se(uint8_t type)
                        net_nfc_error_e result_ese, result_uicc;
 
                        net_nfc_server_se_set_se_type(
-                               SECURE_ELEMENT_TYPE_INVALID);
+                                       SECURE_ELEMENT_TYPE_INVALID);
                        net_nfc_server_se_set_se_mode(SECURE_ELEMENT_OFF_MODE);
 
                        /*turn off ESE*/
                        net_nfc_controller_set_secure_element_mode(
-                               SECURE_ELEMENT_TYPE_ESE,
-                               SECURE_ELEMENT_OFF_MODE,
-                               &result_ese);
+                                       SECURE_ELEMENT_TYPE_ESE,
+                                       SECURE_ELEMENT_OFF_MODE,
+                                       &result_ese);
 
                        /*turn off UICC*/
                        net_nfc_controller_set_secure_element_mode(
-                               SECURE_ELEMENT_TYPE_UICC,
-                               SECURE_ELEMENT_OFF_MODE,
-                               &result_uicc);
+                                       SECURE_ELEMENT_TYPE_UICC,
+                                       SECURE_ELEMENT_OFF_MODE,
+                                       &result_uicc);
 
                        if (result_ese != NET_NFC_INVALID_HANDLE
-                               && result_uicc != NET_NFC_INVALID_HANDLE) {
+                                       && result_uicc != NET_NFC_INVALID_HANDLE) {
                                DEBUG_SERVER_MSG("SE off all");
                                if (vconf_set_int(VCONFKEY_NFC_SE_TYPE,
-                                       VCONFKEY_NFC_SE_TYPE_NONE) != 0) {
+                                                       VCONFKEY_NFC_SE_TYPE_NONE) != 0) {
                                        DEBUG_ERR_MSG("vconf_set_int failed");
                                }
 
@@ -485,8 +485,8 @@ static void se_close_secure_element_thread_func(gpointer user_data)
        {
                /* decrease client reference count */
                net_nfc_server_gdbus_decrease_se_count(
-                       g_dbus_method_invocation_get_sender(
-                               detail->invocation));
+                               g_dbus_method_invocation_get_sender(
+                                       detail->invocation));
 
                result = net_nfc_server_se_close_ese();
        }
@@ -496,18 +496,18 @@ static void se_close_secure_element_thread_func(gpointer user_data)
        }
 #if 0
        if ((gdbus_se_prev_type != net_nfc_server_se_get_se_type()) ||
-               (gdbus_se_prev_mode != net_nfc_server_se_get_se_mode()))
+                       (gdbus_se_prev_mode != net_nfc_server_se_get_se_mode()))
        {
                /*return back se mode*/
                net_nfc_controller_set_secure_element_mode(gdbus_se_prev_type,
-                       gdbus_se_prev_mode, &result);
+                               gdbus_se_prev_mode, &result);
 
                net_nfc_server_se_set_se_type(gdbus_se_prev_type);
                net_nfc_server_se_set_se_mode(gdbus_se_prev_mode);
        }
 #endif
        net_nfc_gdbus_secure_element_complete_close_secure_element(
-               detail->object, detail->invocation, result);
+                       detail->object, detail->invocation, result);
 
        g_object_unref(detail->invocation);
        g_object_unref(detail->object);
@@ -516,28 +516,28 @@ static void se_close_secure_element_thread_func(gpointer user_data)
 
        /* shutdown process if it doesn't need */
        if (net_nfc_server_manager_get_active() == false &&
-               net_nfc_server_gdbus_is_server_busy() == false) {
+                       net_nfc_server_gdbus_is_server_busy() == false) {
                net_nfc_manager_quit();
        }
 }
 
 static gboolean se_handle_close_secure_element(
-       NetNfcGDbusSecureElement *object,
-       GDBusMethodInvocation *invocation,
-       guint arg_handle,
-       GVariant *smack_privilege)
+               NetNfcGDbusSecureElement *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_handle,
+               GVariant *smack_privilege)
 {
        SeDataHandle *data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+                               smack_privilege,
+                               "nfc-manager",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -548,8 +548,8 @@ static gboolean se_handle_close_secure_element(
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -559,12 +559,12 @@ static gboolean se_handle_close_secure_element(
        data->handle = (net_nfc_target_handle_s *)arg_handle;
 
        result = net_nfc_server_controller_async_queue_push(
-               se_close_secure_element_thread_func, data);
+                       se_close_secure_element_thread_func, data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.Se.ThreadError",
-                       "can not push to controller thread");
+                               "org.tizen.NetNfcService.Se.ThreadError",
+                               "can not push to controller thread");
 
                g_object_unref(data->object);
                g_object_unref(data->invocation);
@@ -593,7 +593,7 @@ static void se_get_atr_thread_func(gpointer user_data)
        else if (net_nfc_server_se_is_ese_handle(detail->handle) == true)
        {
                net_nfc_controller_secure_element_get_atr(detail->handle, &atr,
-                       &result);
+                               &result);
        }
        else
        {
@@ -605,10 +605,10 @@ static void se_get_atr_thread_func(gpointer user_data)
        data = net_nfc_util_gdbus_data_to_variant(atr);
 
        net_nfc_gdbus_secure_element_complete_get_atr(
-               detail->object,
-               detail->invocation,
-               result,
-               data);
+                       detail->object,
+                       detail->invocation,
+                       result,
+                       data);
 
        if (atr != NULL) {
                net_nfc_util_free_data(atr);
@@ -622,22 +622,22 @@ static void se_get_atr_thread_func(gpointer user_data)
 }
 
 static gboolean se_handle_get_atr(
-       NetNfcGDbusSecureElement *object,
-       GDBusMethodInvocation *invocation,
-       guint arg_handle,
-       GVariant *smack_privilege)
+               NetNfcGDbusSecureElement *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_handle,
+               GVariant *smack_privilege)
 {
        SeDataHandle *data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "r") == false) {
+                               smack_privilege,
+                               "nfc-manager",
+                               "r") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -648,8 +648,8 @@ static gboolean se_handle_get_atr(
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -659,12 +659,12 @@ static gboolean se_handle_get_atr(
        data->handle = (net_nfc_target_handle_s *)arg_handle;
 
        result = net_nfc_server_controller_async_queue_push(
-               se_get_atr_thread_func, data);
+                       se_get_atr_thread_func, data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.Se.ThreadError",
-                       "can not push to controller thread");
+                               "org.tizen.NetNfcService.Se.ThreadError",
+                               "can not push to controller thread");
 
                g_object_unref(data->object);
                g_object_unref(data->invocation);
@@ -695,13 +695,13 @@ static void se_open_secure_element_thread_func(gpointer user_data)
 #if 0 /* opening SE doesn't affect card emulation */
                /*off ESE*/
                net_nfc_controller_set_secure_element_mode(
-                       SECURE_ELEMENT_TYPE_ESE,
-                       SECURE_ELEMENT_OFF_MODE, &result);
+                               SECURE_ELEMENT_TYPE_ESE,
+                               SECURE_ELEMENT_OFF_MODE, &result);
 
                /*Off UICC. UICC SHOULD not be detected by external reader when
-                       being communicated in internal process*/
+                 being communicated in internal process*/
                net_nfc_controller_set_secure_element_mode(SECURE_ELEMENT_TYPE_UICC,
-                       SECURE_ELEMENT_OFF_MODE, &result);
+                               SECURE_ELEMENT_OFF_MODE, &result);
 
                net_nfc_server_se_set_se_type(SECURE_ELEMENT_TYPE_UICC);
                net_nfc_server_se_set_se_mode(SECURE_ELEMENT_OFF_MODE);
@@ -722,8 +722,8 @@ static void se_open_secure_element_thread_func(gpointer user_data)
 #if 0 /* opening SE doesn't affect card emulation */
                /*off UICC*/
                net_nfc_controller_set_secure_element_mode(
-                       SECURE_ELEMENT_TYPE_UICC,
-                       SECURE_ELEMENT_OFF_MODE, &result);
+                               SECURE_ELEMENT_TYPE_UICC,
+                               SECURE_ELEMENT_OFF_MODE, &result);
 #endif
                handle = net_nfc_server_se_open_ese();
                if (handle != NULL)
@@ -739,8 +739,8 @@ static void se_open_secure_element_thread_func(gpointer user_data)
 
                        /* increase client reference count */
                        net_nfc_server_gdbus_increase_se_count(
-                               g_dbus_method_invocation_get_sender(
-                                       detail->invocation));
+                                       g_dbus_method_invocation_get_sender(
+                                               detail->invocation));
                }
                else
                {
@@ -755,10 +755,10 @@ static void se_open_secure_element_thread_func(gpointer user_data)
        }
 
        net_nfc_gdbus_secure_element_complete_open_secure_element(
-               detail->object,
-               detail->invocation,
-               result,
-               (guint)handle);
+                       detail->object,
+                       detail->invocation,
+                       result,
+                       (guint)handle);
 
        g_object_unref(detail->invocation);
        g_object_unref(detail->object);
@@ -767,22 +767,22 @@ static void se_open_secure_element_thread_func(gpointer user_data)
 }
 
 static gboolean se_handle_open_secure_element(
-       NetNfcGDbusSecureElement *object,
-       GDBusMethodInvocation *invocation,
-       gint arg_type,
-       GVariant *smack_privilege)
+               NetNfcGDbusSecureElement *object,
+               GDBusMethodInvocation *invocation,
+               gint arg_type,
+               GVariant *smack_privilege)
 {
        SeDataSeType *data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+                               smack_privilege,
+                               "nfc-manager",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -793,8 +793,8 @@ static gboolean se_handle_open_secure_element(
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -804,12 +804,12 @@ static gboolean se_handle_open_secure_element(
        data->se_type= arg_type;
 
        result = net_nfc_server_controller_async_queue_push(
-               se_open_secure_element_thread_func, data);
+                       se_open_secure_element_thread_func, data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.Se.ThreadError",
-                       "can not push to controller thread");
+                               "org.tizen.NetNfcService.Se.ThreadError",
+                               "can not push to controller thread");
 
                g_object_unref(data->object);
                g_object_unref(data->invocation);
@@ -841,8 +841,13 @@ static void se_send_apdu_thread_func(gpointer user_data)
        }
        else if (net_nfc_server_se_is_ese_handle(detail->handle) == true)
        {
-               ret = net_nfc_controller_secure_element_send_apdu(
-                       detail->handle, &apdu_data, &response, &result);
+               ret = net_nfc_controller_secure_element_send_apdu(detail->handle,
+                       &apdu_data, &response, &result);
+               if (false == ret)
+               {
+                       DEBUG_ERR_MSG("net_nfc_controller_secure_element_send_apdu() Failed");
+                       return;
+               }
        }
        else
        {
@@ -852,10 +857,10 @@ static void se_send_apdu_thread_func(gpointer user_data)
        rspdata = net_nfc_util_gdbus_data_to_variant(response);
 
        net_nfc_gdbus_secure_element_complete_send_apdu(
-               detail->object,
-               detail->invocation,
-               result,
-               rspdata);
+                       detail->object,
+                       detail->invocation,
+                       result,
+                       rspdata);
 
        if (response != NULL)
        {
@@ -874,23 +879,23 @@ static void se_send_apdu_thread_func(gpointer user_data)
 }
 
 static gboolean se_handle_send_apdu(
-       NetNfcGDbusSecureElement *object,
-       GDBusMethodInvocation *invocation,
-       guint arg_handle,
-       GVariant *apdudata,
-       GVariant *smack_privilege)
+               NetNfcGDbusSecureElement *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_handle,
+               GVariant *apdudata,
+               GVariant *smack_privilege)
 {
        SeDataApdu *data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+                               smack_privilege,
+                               "nfc-manager",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -901,8 +906,8 @@ static gboolean se_handle_send_apdu(
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -913,12 +918,12 @@ static gboolean se_handle_send_apdu(
        data->data = g_variant_ref(apdudata);
 
        result = net_nfc_server_controller_async_queue_push(
-               se_send_apdu_thread_func, data);
+                       se_send_apdu_thread_func, data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.Se.ThreadError",
-                       "can not push to controller thread");
+                               "org.tizen.NetNfcService.Se.ThreadError",
+                               "can not push to controller thread");
 
                g_variant_unref(data->data);
 
@@ -948,7 +953,7 @@ static void se_set_data_thread_func(gpointer user_data)
        }
 
        net_nfc_gdbus_secure_element_complete_set(data->object,
-               data->invocation, result);
+                       data->invocation, result);
 
        if (isTypeChanged)
                net_nfc_gdbus_secure_element_emit_se_type_changed(data->object,
@@ -961,22 +966,22 @@ static void se_set_data_thread_func(gpointer user_data)
 }
 
 static gboolean se_handle_set(
-       NetNfcGDbusSecureElement *object,
-       GDBusMethodInvocation *invocation,
-       gint arg_type,
-       GVariant *smack_privilege)
+               NetNfcGDbusSecureElement *object,
+               GDBusMethodInvocation *invocation,
+               gint arg_type,
+               GVariant *smack_privilege)
 {
        SeDataSeType *data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "w") == false) {
+                               smack_privilege,
+                               "nfc-manager",
+                               "w") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -987,8 +992,8 @@ static gboolean se_handle_set(
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -998,12 +1003,12 @@ static gboolean se_handle_set(
        data->se_type = arg_type;
 
        result = net_nfc_server_controller_async_queue_push(
-               se_set_data_thread_func, data);
+                       se_set_data_thread_func, data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.Se.ThreadError",
-                       "can not push to controller thread");
+                               "org.tizen.NetNfcService.Se.ThreadError",
+                               "can not push to controller thread");
 
                g_object_unref(data->object);
                g_object_unref(data->invocation);
@@ -1028,34 +1033,34 @@ gboolean net_nfc_server_se_init(GDBusConnection *connection)
        se_skeleton = net_nfc_gdbus_secure_element_skeleton_new();
 
        g_signal_connect(se_skeleton,
-               "handle-set",
-               G_CALLBACK(se_handle_set),
-               NULL);
+                       "handle-set",
+                       G_CALLBACK(se_handle_set),
+                       NULL);
        g_signal_connect(se_skeleton,
-               "handle-open-secure-element",
-               G_CALLBACK(se_handle_open_secure_element),
-               NULL);
+                       "handle-open-secure-element",
+                       G_CALLBACK(se_handle_open_secure_element),
+                       NULL);
 
        g_signal_connect(se_skeleton,
-               "handle-close-secure-element",
-               G_CALLBACK(se_handle_close_secure_element),
-               NULL);
+                       "handle-close-secure-element",
+                       G_CALLBACK(se_handle_close_secure_element),
+                       NULL);
 
        g_signal_connect(se_skeleton,
-               "handle-get-atr",
-               G_CALLBACK(se_handle_get_atr),
-               NULL);
+                       "handle-get-atr",
+                       G_CALLBACK(se_handle_get_atr),
+                       NULL);
 
        g_signal_connect(se_skeleton,
-               "handle-send-apdu",
-               G_CALLBACK(se_handle_send_apdu),
-               NULL);
+                       "handle-send-apdu",
+                       G_CALLBACK(se_handle_send_apdu),
+                       NULL);
 
        result = g_dbus_interface_skeleton_export(
-               G_DBUS_INTERFACE_SKELETON(se_skeleton),
-               connection,
-               "/org/tizen/NetNfcService/SecureElement",
-               &error);
+                       G_DBUS_INTERFACE_SKELETON(se_skeleton),
+                       connection,
+                       "/org/tizen/NetNfcService/SecureElement",
+                       &error);
        if (result == FALSE)
        {
                DEBUG_ERR_MSG("can not skeleton_export %s", error->message);
@@ -1099,10 +1104,10 @@ static void se_detected_thread_func(gpointer user_data)
        }
 
        g_variant_get((GVariant *)user_data,
-               "uu@a(y)",
-               (guint *)&handle,
-               &devType,
-               &data);
+                       "uu@a(y)",
+                       (guint *)&handle,
+                       &devType,
+                       &data);
 
        net_nfc_server_se_set_current_ese_handle(handle);
 
@@ -1114,10 +1119,10 @@ static void se_detected_thread_func(gpointer user_data)
        }
 
        net_nfc_gdbus_secure_element_emit_ese_detected(
-               se_skeleton,
-               GPOINTER_TO_UINT(handle),
-               devType,
-               data);
+                       se_skeleton,
+                       GPOINTER_TO_UINT(handle),
+                       devType,
+                       data);
 
        g_variant_unref((GVariant *)user_data);
 }
@@ -1133,10 +1138,10 @@ static void se_transcation_thread_func(gpointer user_data)
                DEBUG_SERVER_MSG("launch se app");
 
                net_nfc_app_util_launch_se_transaction_app(
-                       detail->aid.buffer,
-                       detail->aid.length,
-                       detail->param.buffer,
-                       detail->param.length);
+                               detail->aid.buffer,
+                               detail->aid.length,
+                               detail->param.buffer,
+                               detail->param.length);
 
                DEBUG_SERVER_MSG("launch se app end");
        }
@@ -1155,17 +1160,17 @@ void net_nfc_server_se_detected(void *info)
        GVariant *data;
 
        data = net_nfc_util_gdbus_buffer_to_variant(
-               se_target->target_info_values.buffer,
-               se_target->target_info_values.length);
+                       se_target->target_info_values.buffer,
+                       se_target->target_info_values.length);
 
        parameter = g_variant_new("uu@a(y)",
-               GPOINTER_TO_UINT(se_target->handle),
-               se_target->devType,
-               data);
+                       GPOINTER_TO_UINT(se_target->handle),
+                       se_target->devType,
+                       data);
        if (parameter != NULL) {
                if (net_nfc_server_controller_async_queue_push(
-                       se_detected_thread_func,
-                       parameter) == FALSE) {
+                                       se_detected_thread_func,
+                                       parameter) == FALSE) {
                        DEBUG_ERR_MSG("can not push to controller thread");
 
                        g_variant_unref(parameter);
@@ -1190,24 +1195,24 @@ void net_nfc_server_se_transaction_received(void *info)
 
                if (se_event->aid.buffer != NULL && se_event->aid.length > 0) {
                        if (net_nfc_util_alloc_data(&detail->aid,
-                               se_event->aid.length) == true) {
+                                               se_event->aid.length) == true) {
                                memcpy(detail->aid.buffer, se_event->aid.buffer,
-                                       se_event->aid.length);
+                                               se_event->aid.length);
                        }
                }
 
                if (se_event->param.buffer != NULL &&
-                       se_event->param.length > 0) {
+                               se_event->param.length > 0) {
                        if (net_nfc_util_alloc_data(&detail->param,
-                               se_event->param.length) == true) {
+                                               se_event->param.length) == true) {
                                memcpy(detail->param.buffer,
-                                       se_event->param.buffer,
-                                       se_event->param.length);
+                                               se_event->param.buffer,
+                                               se_event->param.length);
                        }
                }
 
                if (net_nfc_server_controller_async_queue_push(
-                       se_transcation_thread_func, detail) == FALSE) {
+                                       se_transcation_thread_func, detail) == FALSE) {
                        DEBUG_ERR_MSG("can not push to controller thread");
 
                        net_nfc_util_free_data(&detail->param);
similarity index 67%
rename from src/manager/net_nfc_server_snep.c
rename to daemon/net_nfc_server_snep.c
index 6476823..41d532f 100644 (file)
 #include "net_nfc_debug_internal.h"
 #include "net_nfc_util_defines.h"
 #include "net_nfc_util_internal.h"
-#include "net_nfc_controller_internal.h"
+#include "net_nfc_server_controller.h"
 #include "net_nfc_server_common.h"
 #include "net_nfc_server_llcp.h"
 #include "net_nfc_server_snep.h"
 #include "net_nfc_server_process_snep.h"
 #include "net_nfc_util_gdbus_internal.h"
-#include "net_nfc_server_context_internal.h"
+#include "net_nfc_server_context.h"
 
 /* declaration */
 static gboolean _handle_start_server(
-       NetNfcGDbusSnep *object,
-       GDBusMethodInvocation *invocation,
-       guint arg_handle,
-       guint arg_sap,
-       const gchar *arg_san,
-       guint arg_user_data,
-       GVariant *arg_privilege);
+               NetNfcGDbusSnep *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_handle,
+               guint arg_sap,
+               const gchar *arg_san,
+               guint arg_user_data,
+               GVariant *arg_privilege);
 
 static gboolean _handle_start_client(
-       NetNfcGDbusSnep *object,
-       GDBusMethodInvocation *invocation,
-       guint arg_handle,
-       guint arg_sap,
-       const gchar *arg_san,
-       guint arg_user_data,
-       GVariant *arg_privilege);
+               NetNfcGDbusSnep *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_handle,
+               guint arg_sap,
+               const gchar *arg_san,
+               guint arg_user_data,
+               GVariant *arg_privilege);
 
 static gboolean _handle_client_send_request(
-       NetNfcGDbusSnep *object,
-       GDBusMethodInvocation *invocation,
-       guint arg_snep_handle,
-       guint arg_type,
-       GVariant *arg_ndef_msg,
-       GVariant *arg_privilege);
+               NetNfcGDbusSnep *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_snep_handle,
+               guint arg_type,
+               GVariant *arg_ndef_msg,
+               GVariant *arg_privilege);
 
 static gboolean _handle_stop_snep(
-       NetNfcGDbusSnep *object,
-       GDBusMethodInvocation *invocation,
-       guint arg_handle,
-       guint arg_snep_handle,
-       GVariant *arg_privilege);
+               NetNfcGDbusSnep *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_handle,
+               guint arg_snep_handle,
+               GVariant *arg_privilege);
 
 static void snep_server_start_thread_func(gpointer user_data);
 
@@ -73,10 +73,10 @@ static void snep_stop_service_thread_func(gpointer user_data);
 static NetNfcGDbusSnep *snep_skeleton =  NULL;
 
 static void _emit_snep_event_signal(GVariant *parameter,
-       net_nfc_snep_handle_h handle,
-       net_nfc_error_e result,
-       uint32_t type,
-       data_s *data)
+               net_nfc_snep_handle_h handle,
+               net_nfc_error_e result,
+               uint32_t type,
+               data_s *data)
 {
        GDBusConnection *connection;
        char *client_id;
@@ -85,25 +85,25 @@ static void _emit_snep_event_signal(GVariant *parameter,
        GError *error = NULL;
 
        g_variant_get(parameter, "(usu)",
-               (guint *)&connection,
-               &client_id,
-               (guint *)&user_data);
+                       (guint *)&connection,
+                       &client_id,
+                       (guint *)&user_data);
 
        arg_data = net_nfc_util_gdbus_data_to_variant(data);
 
        if (g_dbus_connection_emit_signal(
-               connection,
-               client_id,
-               "/org/tizen/NetNfcService/Snep",
-               "org.tizen.NetNfcService.Snep",
-               "SnepEvent",
-               g_variant_new("(uui@a(y)u)",
-                       GPOINTER_TO_UINT(handle),
-                       type,
-                       (gint)result,
-                       arg_data,
-                       GPOINTER_TO_UINT(user_data)),
-               &error) == false) {
+                               connection,
+                               client_id,
+                               "/org/tizen/NetNfcService/Snep",
+                               "org.tizen.NetNfcService.Snep",
+                               "SnepEvent",
+                               g_variant_new("(uui@a(y)u)",
+                                       GPOINTER_TO_UINT(handle),
+                                       type,
+                                       (gint)result,
+                                       arg_data,
+                                       GPOINTER_TO_UINT(user_data)),
+                               &error) == false) {
                if (error != NULL && error->message != NULL) {
                        DEBUG_ERR_MSG("g_dbus_connection_emit_signal failed : %s", error->message);
                } else {
@@ -115,10 +115,10 @@ static void _emit_snep_event_signal(GVariant *parameter,
 }
 
 static net_nfc_error_e _snep_server_cb(net_nfc_snep_handle_h handle,
-       net_nfc_error_e result,
-       uint32_t type,
-       data_s *data,
-       void *user_param)
+               net_nfc_error_e result,
+               uint32_t type,
+               data_s *data,
+               void *user_param)
 {
        GVariant *parameter = (GVariant *)user_param;
 
@@ -134,12 +134,12 @@ static net_nfc_error_e _snep_server_cb(net_nfc_snep_handle_h handle,
                        uint32_t max_len = 0;
 
                        net_nfc_server_snep_parse_get_request(data, &max_len,
-                               temp);
+                                       temp);
                }
                break;
 
        case SNEP_REQ_PUT :
-                       break;
+               break;
 
        default :
                DEBUG_ERR_MSG("error [%d]", result);
@@ -151,7 +151,7 @@ static net_nfc_error_e _snep_server_cb(net_nfc_snep_handle_h handle,
        }
 
        _emit_snep_event_signal(parameter, handle,
-               result, type, data);
+                       result, type, data);
 
        if (type == NET_NFC_LLCP_STOP) {
                g_object_unref(parameter);
@@ -181,13 +181,13 @@ static void snep_server_start_thread_func(gpointer user_data)
        }
 
        g_variant_get((GVariant *)user_data,
-               "(uuuusu)",
-               (guint *)&object,
-               (guint *)&invocation,
-               (guint *)&arg_handle,
-               &arg_sap,
-               &arg_san,
-               (guint *)&arg_user_data);
+                       "(uuuusu)",
+                       (guint *)&object,
+                       (guint *)&invocation,
+                       (guint *)&arg_handle,
+                       &arg_sap,
+                       &arg_san,
+                       (guint *)&arg_user_data);
 
        g_assert(object != NULL);
        g_assert(invocation != NULL);
@@ -195,15 +195,15 @@ static void snep_server_start_thread_func(gpointer user_data)
        connection = g_dbus_method_invocation_get_connection(invocation);
 
        parameter = g_variant_new("(usu)",
-               GPOINTER_TO_UINT(g_object_ref(connection)),
-               g_dbus_method_invocation_get_sender(invocation),
-               GPOINTER_TO_UINT(arg_user_data));
+                       GPOINTER_TO_UINT(g_object_ref(connection)),
+                       g_dbus_method_invocation_get_sender(invocation),
+                       GPOINTER_TO_UINT(arg_user_data));
        if (parameter != NULL) {
                result = net_nfc_server_snep_server(arg_handle,
-                       arg_san,
-                       arg_sap,
-                       _snep_server_cb,
-                       parameter);
+                               arg_san,
+                               arg_sap,
+                               _snep_server_cb,
+                               parameter);
                if (result != NET_NFC_OK) {
                        DEBUG_ERR_MSG("net_nfc_server_snep_server failed, [%d]",
                                        result);
@@ -227,48 +227,48 @@ static void snep_server_start_thread_func(gpointer user_data)
 }
 
 static gboolean _handle_start_server(
-       NetNfcGDbusSnep *object,
-       GDBusMethodInvocation *invocation,
-       guint arg_handle,
-       guint arg_sap,
-       const gchar *arg_san,
-       guint arg_user_data,
-       GVariant *arg_privilege)
+               NetNfcGDbusSnep *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_handle,
+               guint arg_sap,
+               const gchar *arg_san,
+               guint arg_user_data,
+               GVariant *arg_privilege)
 {
        GVariant *parameter;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               arg_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+                               arg_privilege,
+                               "nfc-manager::p2p",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
        }
 
        parameter = g_variant_new("(uuuusu)",
-               GPOINTER_TO_UINT(g_object_ref(object)),
-               GPOINTER_TO_UINT(g_object_ref(invocation)),
-               arg_handle,
-               arg_sap,
-               arg_san,
-               arg_user_data);
+                       GPOINTER_TO_UINT(g_object_ref(object)),
+                       GPOINTER_TO_UINT(g_object_ref(invocation)),
+                       arg_handle,
+                       arg_sap,
+                       arg_san,
+                       arg_user_data);
 
        if (parameter != NULL)
        {
                if ((result = net_nfc_server_controller_async_queue_push(
-                       snep_server_start_thread_func, parameter)) == FALSE)
+                                               snep_server_start_thread_func, parameter)) == FALSE)
                {
                        DEBUG_ERR_MSG("net_nfc_server_controller_async_queue_push failed");
 
                        g_dbus_method_invocation_return_dbus_error(invocation,
-                               "org.tizen.NetNfcService.Snep.ThreadError",
-                               "can not push to controller thread");
+                                       "org.tizen.NetNfcService.Snep.ThreadError",
+                                       "can not push to controller thread");
 
                        g_object_unref(invocation);
                        g_object_unref(object);
@@ -281,8 +281,8 @@ static gboolean _handle_start_server(
                DEBUG_ERR_MSG("g_variant_new failed");
 
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.Snep.MemoryError",
-                       "Out of memory");
+                               "org.tizen.NetNfcService.Snep.MemoryError",
+                               "Out of memory");
 
                result = FALSE;
        }
@@ -291,11 +291,11 @@ static gboolean _handle_start_server(
 }
 
 static net_nfc_error_e _snep_start_client_cb(
-       net_nfc_snep_handle_h handle,
-       net_nfc_error_e result,
-       uint32_t type,
-       data_s *data,
-       void *user_param)
+               net_nfc_snep_handle_h handle,
+               net_nfc_error_e result,
+               uint32_t type,
+               data_s *data,
+               void *user_param)
 {
        GVariant *parameter = (GVariant *)user_param;
 
@@ -332,13 +332,13 @@ static void snep_client_start_thread_func(gpointer user_data)
        }
 
        g_variant_get((GVariant *)user_data,
-               "(uuuusu)",
-               (guint *)&object,
-               (guint *)&invocation,
-               (guint *)&arg_handle,
-               &arg_sap,
-               &arg_san,
-               (guint *)&arg_user_data);
+                       "(uuuusu)",
+                       (guint *)&object,
+                       (guint *)&invocation,
+                       (guint *)&arg_handle,
+                       &arg_sap,
+                       &arg_san,
+                       (guint *)&arg_user_data);
 
        g_assert(object != NULL);
        g_assert(invocation != NULL);
@@ -346,15 +346,15 @@ static void snep_client_start_thread_func(gpointer user_data)
        connection = g_dbus_method_invocation_get_connection(invocation);
 
        parameter = g_variant_new("(usu)",
-               GPOINTER_TO_UINT(g_object_ref(connection)),
-               g_dbus_method_invocation_get_sender(invocation),
-               GPOINTER_TO_UINT(arg_user_data));
+                       GPOINTER_TO_UINT(g_object_ref(connection)),
+                       g_dbus_method_invocation_get_sender(invocation),
+                       GPOINTER_TO_UINT(arg_user_data));
        if (parameter != NULL) {
                result = net_nfc_server_snep_client(arg_handle,
-                       arg_san,
-                       arg_sap,
-                       _snep_start_client_cb,
-                       parameter);
+                               arg_san,
+                               arg_sap,
+                               _snep_start_client_cb,
+                               parameter);
                if (result != NET_NFC_OK) {
                        DEBUG_ERR_MSG("net_nfc_server_snep_client failed, [%d]",
                                        result);
@@ -378,48 +378,48 @@ static void snep_client_start_thread_func(gpointer user_data)
 }
 
 static gboolean _handle_start_client(
-       NetNfcGDbusSnep *object,
-       GDBusMethodInvocation *invocation,
-       guint arg_handle,
-       guint arg_sap,
-       const gchar *arg_san,
-       guint arg_user_data,
-       GVariant *arg_privilege)
+               NetNfcGDbusSnep *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_handle,
+               guint arg_sap,
+               const gchar *arg_san,
+               guint arg_user_data,
+               GVariant *arg_privilege)
 {
        GVariant *parameter;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               arg_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+                               arg_privilege,
+                               "nfc-manager::p2p",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
        }
 
        parameter = g_variant_new("(uuuusu)",
-               GPOINTER_TO_UINT(g_object_ref(object)),
-               GPOINTER_TO_UINT(g_object_ref(invocation)),
-               arg_handle,
-               arg_sap,
-               arg_san,
-               arg_user_data);
+                       GPOINTER_TO_UINT(g_object_ref(object)),
+                       GPOINTER_TO_UINT(g_object_ref(invocation)),
+                       arg_handle,
+                       arg_sap,
+                       arg_san,
+                       arg_user_data);
 
        if (parameter != NULL)
        {
                if ((result = net_nfc_server_controller_async_queue_push(
-                       snep_client_start_thread_func, parameter)) == FALSE)
+                                               snep_client_start_thread_func, parameter)) == FALSE)
                {
                        DEBUG_ERR_MSG("net_nfc_server_controller_async_queue_push failed");
 
                        g_dbus_method_invocation_return_dbus_error(invocation,
-                               "org.tizen.NetNfcService.Snep.ThreadError",
-                               "can not push to controller thread");
+                                       "org.tizen.NetNfcService.Snep.ThreadError",
+                                       "can not push to controller thread");
 
                        g_object_unref(invocation);
                        g_object_unref(object);
@@ -432,8 +432,8 @@ static gboolean _handle_start_client(
                DEBUG_ERR_MSG("g_variant_new failed");
 
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.Snep.MemoryError",
-                       "Out of memory");
+                               "org.tizen.NetNfcService.Snep.MemoryError",
+                               "Out of memory");
 
                result = FALSE;
        }
@@ -442,16 +442,16 @@ static gboolean _handle_start_client(
 }
 
 static net_nfc_error_e _snep_client_request_cb(
-       net_nfc_snep_handle_h handle,
-       net_nfc_error_e result,
-       net_nfc_snep_type_t type,
-       data_s *data,
-       void *user_param)
+               net_nfc_snep_handle_h handle,
+               net_nfc_error_e result,
+               net_nfc_snep_type_t type,
+               data_s *data,
+               void *user_param)
 {
        GVariant *parameter = (GVariant *)user_param;
 
        DEBUG_SERVER_MSG("type [%d], result [%d], data [%p], user_param [%p]",
-               type, result, data, user_param);
+                       type, result, data, user_param);
 
        if (parameter != NULL) {
                NetNfcGDbusSnep *object;
@@ -462,12 +462,12 @@ static net_nfc_error_e _snep_client_request_cb(
                GVariant *arg_data = NULL;
 
                g_variant_get(parameter,
-                       "(uuuu@a(y))",
-                       (guint *)&object,
-                       (guint *)&invocation,
-                       (guint *)&arg_snep_handle,
-                       (guint *)&arg_type,
-                       &arg_ndef_msg);
+                               "(uuuu@a(y))",
+                               (guint *)&object,
+                               (guint *)&invocation,
+                               (guint *)&arg_snep_handle,
+                               (guint *)&arg_type,
+                               &arg_ndef_msg);
 
                if (data != NULL && data->buffer != NULL && data->length > 0) {
                        arg_data = net_nfc_util_gdbus_data_to_variant(data);
@@ -476,10 +476,10 @@ static net_nfc_error_e _snep_client_request_cb(
                }
 
                net_nfc_gdbus_snep_complete_client_request(object,
-                       invocation,
-                       result,
-                       type,
-                       arg_data);
+                               invocation,
+                               result,
+                               type,
+                               arg_data);
 
                g_variant_unref(arg_ndef_msg);
 
@@ -514,12 +514,12 @@ static void snep_client_send_request_thread_func(gpointer user_data)
        }
 
        g_variant_get((GVariant *)user_data,
-               "(uuuu@a(y))",
-               (guint *)&object,
-               (guint *)&invocation,
-               (guint *)&arg_snep_handle,
-               (guint *)&arg_type,
-               &arg_ndef_msg);
+                       "(uuuu@a(y))",
+                       (guint *)&object,
+                       (guint *)&invocation,
+                       (guint *)&arg_snep_handle,
+                       (guint *)&arg_type,
+                       &arg_ndef_msg);
 
        g_assert(object != NULL);
        g_assert(invocation != NULL);
@@ -527,21 +527,21 @@ static void snep_client_send_request_thread_func(gpointer user_data)
        net_nfc_util_gdbus_variant_to_data_s(arg_ndef_msg, &data);
 
        result = net_nfc_server_snep_client_request(arg_snep_handle,
-               arg_type,
-               &data,
-               _snep_client_request_cb,
-               user_data);
+                       arg_type,
+                       &data,
+                       _snep_client_request_cb,
+                       user_data);
        if (result != NET_NFC_OK)
        {
                GVariant *resp;
 
                DEBUG_ERR_MSG("net_nfc_server_snep_client_request  "
-                       "failed, [%d]",result);
+                               "failed, [%d]",result);
 
                resp = net_nfc_util_gdbus_buffer_to_variant(NULL, 0);
 
                net_nfc_gdbus_snep_complete_client_request(object,
-                       invocation, result, NET_NFC_LLCP_STOP, resp);
+                               invocation, result, NET_NFC_LLCP_STOP, resp);
 
                g_object_unref(invocation);
                g_object_unref(object);
@@ -555,46 +555,46 @@ static void snep_client_send_request_thread_func(gpointer user_data)
 }
 
 static gboolean _handle_client_send_request(
-       NetNfcGDbusSnep *object,
-       GDBusMethodInvocation *invocation,
-       guint arg_snep_handle,
-       guint arg_type,
-       GVariant *arg_ndef_msg,
-       GVariant *arg_privilege)
+               NetNfcGDbusSnep *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_snep_handle,
+               guint arg_type,
+               GVariant *arg_ndef_msg,
+               GVariant *arg_privilege)
 {
        GVariant *parameter;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               arg_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+                               arg_privilege,
+                               "nfc-manager::p2p",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
        }
 
        parameter = g_variant_new("(uuuu@a(y))",
-               GPOINTER_TO_UINT(g_object_ref(object)),
-               GPOINTER_TO_UINT(g_object_ref(invocation)),
-               arg_snep_handle,
-               arg_type,
-               arg_ndef_msg);
+                       GPOINTER_TO_UINT(g_object_ref(object)),
+                       GPOINTER_TO_UINT(g_object_ref(invocation)),
+                       arg_snep_handle,
+                       arg_type,
+                       arg_ndef_msg);
 
        if (parameter != NULL)
        {
                if ((result = net_nfc_server_controller_async_queue_push(
-                       snep_client_send_request_thread_func, parameter)) == FALSE)
+                                               snep_client_send_request_thread_func, parameter)) == FALSE)
                {
                        DEBUG_ERR_MSG("net_nfc_server_controller_async_queue_push failed");
 
                        g_dbus_method_invocation_return_dbus_error(invocation,
-                               "org.tizen.NetNfcService.Snep.ThreadError",
-                               "can not push to controller thread");
+                                       "org.tizen.NetNfcService.Snep.ThreadError",
+                                       "can not push to controller thread");
 
                        g_object_unref(invocation);
                        g_object_unref(object);
@@ -607,8 +607,8 @@ static gboolean _handle_client_send_request(
                DEBUG_ERR_MSG("g_variant_new failed");
 
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.Snep.MemoryError",
-                       "Out of memory");
+                               "org.tizen.NetNfcService.Snep.MemoryError",
+                               "Out of memory");
 
                result = FALSE;
        }
@@ -631,25 +631,25 @@ static void snep_stop_service_thread_func(gpointer user_data)
        }
 
        g_variant_get((GVariant *)user_data,
-               "(uuuu)",
-               (guint *)&object,
-               (guint *)&invocation,
-               (guint *)&handle,
-               (guint *)&snep_handle);
+                       "(uuuu)",
+                       (guint *)&object,
+                       (guint *)&invocation,
+                       (guint *)&handle,
+                       (guint *)&snep_handle);
 
        g_assert(object != NULL);
        g_assert(invocation != NULL);
 
        /* TODO :
-       g_dbus_method_invocation_return_dbus_error(
+               g_dbus_method_invocation_return_dbus_error(
                invocation,
                "org.tizen.NetNfcService.Snep.DataError",
                "Cannot stop SNEP service");
-       */
+               */
 
        net_nfc_gdbus_snep_complete_stop_snep(object,
-               invocation,
-               NET_NFC_OK);
+                       invocation,
+                       NET_NFC_OK);
 
        g_object_unref(invocation);
        g_object_unref(object);
@@ -658,44 +658,44 @@ static void snep_stop_service_thread_func(gpointer user_data)
 }
 
 static gboolean _handle_stop_snep(
-       NetNfcGDbusSnep *object,
-       GDBusMethodInvocation *invocation,
-       guint arg_handle,
-       guint arg_snep_handle,
-       GVariant *arg_privilege)
+               NetNfcGDbusSnep *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_handle,
+               guint arg_snep_handle,
+               GVariant *arg_privilege)
 {
        GVariant *parameter;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               arg_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+                               arg_privilege,
+                               "nfc-manager::p2p",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
        }
 
        parameter = g_variant_new("(uuuu)",
-               GPOINTER_TO_UINT(g_object_ref(object)),
-               GPOINTER_TO_UINT(g_object_ref(invocation)),
-               arg_handle,
-               arg_snep_handle);
+                       GPOINTER_TO_UINT(g_object_ref(object)),
+                       GPOINTER_TO_UINT(g_object_ref(invocation)),
+                       arg_handle,
+                       arg_snep_handle);
 
        if (parameter != NULL)
        {
                if ((result = net_nfc_server_controller_async_queue_push(
-                       snep_stop_service_thread_func, parameter)) == FALSE)
+                                               snep_stop_service_thread_func, parameter)) == FALSE)
                {
                        DEBUG_ERR_MSG("net_nfc_server_controller_async_queue_push failed");
 
                        g_dbus_method_invocation_return_dbus_error(invocation,
-                               "org.tizen.NetNfcService.Snep.ThreadError",
-                               "can not push to controller thread");
+                                       "org.tizen.NetNfcService.Snep.ThreadError",
+                                       "can not push to controller thread");
 
                        g_object_unref(invocation);
                        g_object_unref(object);
@@ -708,8 +708,8 @@ static gboolean _handle_stop_snep(
                DEBUG_ERR_MSG("g_variant_new failed");
 
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.Snep.MemoryError",
-                       "Out of memory");
+                               "org.tizen.NetNfcService.Snep.MemoryError",
+                               "Out of memory");
 
                result = FALSE;
        }
@@ -718,13 +718,13 @@ static gboolean _handle_stop_snep(
 }
 
 static void _snep_activate_cb(int event, net_nfc_target_handle_s *handle,
-       uint32_t sap, const char *san, void *user_param)
+               uint32_t sap, const char *san, void *user_param)
 {
        GVariant *parameter = (GVariant *)user_param;
        net_nfc_error_e result = NET_NFC_OK;
 
        DEBUG_SERVER_MSG("event [%d], handle [%p], sap [%d], san [%s]",
-               event, handle, sap, san);
+                       event, handle, sap, san);
 
        if (event == NET_NFC_LLCP_START) {
                GDBusConnection *connection;
@@ -734,31 +734,31 @@ static void _snep_activate_cb(int event, net_nfc_target_handle_s *handle,
 
                /* start server */
                g_variant_get(parameter, "(usu)",
-                       (guint *)&connection,
-                       &client_id,
-                       (guint *)&user_data);
+                               (guint *)&connection,
+                               &client_id,
+                               (guint *)&user_data);
 
                param = g_variant_new("(usu)",
-                       GPOINTER_TO_UINT(g_object_ref(connection)),
-                       client_id,
-                       GPOINTER_TO_UINT(user_data));
+                               GPOINTER_TO_UINT(g_object_ref(connection)),
+                               client_id,
+                               GPOINTER_TO_UINT(user_data));
 
                g_free(client_id);
 
                result = net_nfc_server_snep_server(handle, (char *)san, sap,
-                       _snep_server_cb, param);
+                               _snep_server_cb, param);
                if (result == NET_NFC_OK) {
                        _emit_snep_event_signal(parameter, handle,
-                               result, event, NULL);
+                                       result, event, NULL);
                } else {
                        DEBUG_ERR_MSG("net_nfc_server_snep_server failed, [%d]",
-                               result);
+                                       result);
 
                        g_variant_unref(param);
                }
        } else {
                _emit_snep_event_signal(parameter, handle,
-                       result, NET_NFC_LLCP_UNREGISTERED, NULL);
+                               result, NET_NFC_LLCP_UNREGISTERED, NULL);
 
                /* unregister server */
                g_variant_unref(parameter);
@@ -780,12 +780,12 @@ static void snep_register_server_thread_func(gpointer user_data)
        g_assert(user_data != NULL);
 
        g_variant_get((GVariant *)user_data,
-               "(uuusu)",
-               (guint *)&object,
-               (guint *)&invocation,
-               &arg_sap,
-               &arg_san,
-               &arg_user_data);
+                       "(uuusu)",
+                       (guint *)&object,
+                       (guint *)&invocation,
+                       &arg_sap,
+                       &arg_san,
+                       &arg_user_data);
 
        g_assert(object != NULL);
        g_assert(invocation != NULL);
@@ -793,17 +793,17 @@ static void snep_register_server_thread_func(gpointer user_data)
        connection = g_dbus_method_invocation_get_connection(invocation);
 
        parameter = g_variant_new("(usu)",
-               GPOINTER_TO_UINT(g_object_ref(connection)),
-               g_dbus_method_invocation_get_sender(invocation),
-               arg_user_data);
+                       GPOINTER_TO_UINT(g_object_ref(connection)),
+                       g_dbus_method_invocation_get_sender(invocation),
+                       arg_user_data);
        if (parameter != NULL) {
                /* register default snep server */
                result = net_nfc_server_llcp_register_service(
-                       g_dbus_method_invocation_get_sender(invocation),
-                       arg_sap,
-                       arg_san,
-                       _snep_activate_cb,
-                       parameter);
+                               g_dbus_method_invocation_get_sender(invocation),
+                               arg_sap,
+                               arg_san,
+                               _snep_activate_cb,
+                               parameter);
                if (result != NET_NFC_OK) {
                        DEBUG_ERR_MSG("net_nfc_service_llcp_register_service failed, [%d]", result);
                        g_object_unref(connection);
@@ -815,8 +815,8 @@ static void snep_register_server_thread_func(gpointer user_data)
        }
 
        net_nfc_gdbus_snep_complete_server_register(object,
-               invocation,
-               result);
+                       invocation,
+                       result);
 
        g_free(arg_san);
 
@@ -827,46 +827,46 @@ static void snep_register_server_thread_func(gpointer user_data)
 }
 
 static gboolean _handle_register_server(
-       NetNfcGDbusSnep *object,
-       GDBusMethodInvocation *invocation,
-       guint arg_sap,
-       const gchar *arg_san,
-       guint arg_user_data,
-       GVariant *arg_privilege)
+               NetNfcGDbusSnep *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_sap,
+               const gchar *arg_san,
+               guint arg_user_data,
+               GVariant *arg_privilege)
 {
        GVariant *parameter;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               arg_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+                               arg_privilege,
+                               "nfc-manager::p2p",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
        }
 
        parameter = g_variant_new("(uuusu)",
-               GPOINTER_TO_UINT(g_object_ref(object)),
-               GPOINTER_TO_UINT(g_object_ref(invocation)),
-               arg_sap,
-               arg_san,
-               arg_user_data);
+                       GPOINTER_TO_UINT(g_object_ref(object)),
+                       GPOINTER_TO_UINT(g_object_ref(invocation)),
+                       arg_sap,
+                       arg_san,
+                       arg_user_data);
 
        if (parameter != NULL)
        {
                if ((result = net_nfc_server_controller_async_queue_push(
-                       snep_register_server_thread_func, parameter)) == FALSE)
+                                               snep_register_server_thread_func, parameter)) == FALSE)
                {
                        DEBUG_ERR_MSG("net_nfc_server_controller_async_queue_push failed");
 
                        g_dbus_method_invocation_return_dbus_error(invocation,
-                               "org.tizen.NetNfcService.Snep.ThreadError",
-                               "can not push to controller thread");
+                                       "org.tizen.NetNfcService.Snep.ThreadError",
+                                       "can not push to controller thread");
 
                        g_object_unref(invocation);
                        g_object_unref(object);
@@ -879,8 +879,8 @@ static gboolean _handle_register_server(
                DEBUG_ERR_MSG("g_variant_new failed");
 
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.Snep.MemoryError",
-                       "Out of memory");
+                               "org.tizen.NetNfcService.Snep.MemoryError",
+                               "Out of memory");
 
                result = FALSE;
        }
@@ -900,23 +900,23 @@ static void snep_unregister_server_thread_func(gpointer user_data)
        g_assert(user_data != NULL);
 
        g_variant_get((GVariant *)user_data,
-               "(uuus)",
-               (guint *)&object,
-               (guint *)&invocation,
-               &arg_sap,
-               &arg_san);
+                       "(uuus)",
+                       (guint *)&object,
+                       (guint *)&invocation,
+                       &arg_sap,
+                       &arg_san);
 
        g_assert(object != NULL);
        g_assert(invocation != NULL);
 
        result = net_nfc_server_llcp_unregister_service(
-               g_dbus_method_invocation_get_sender(invocation),
-               arg_sap,
-               arg_san);
+                       g_dbus_method_invocation_get_sender(invocation),
+                       arg_sap,
+                       arg_san);
 
        net_nfc_gdbus_snep_complete_server_unregister(object,
-               invocation,
-               result);
+                       invocation,
+                       result);
 
        g_free(arg_san);
 
@@ -927,44 +927,44 @@ static void snep_unregister_server_thread_func(gpointer user_data)
 }
 
 static gboolean _handle_unregister_server(
-       NetNfcGDbusSnep *object,
-       GDBusMethodInvocation *invocation,
-       guint arg_sap,
-       const gchar *arg_san,
-       GVariant *arg_privilege)
+               NetNfcGDbusSnep *object,
+               GDBusMethodInvocation *invocation,
+               guint arg_sap,
+               const gchar *arg_san,
+               GVariant *arg_privilege)
 {
        GVariant *parameter;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               arg_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+                               arg_privilege,
+                               "nfc-manager::p2p",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
        }
 
        parameter = g_variant_new("(uuus)",
-               GPOINTER_TO_UINT(g_object_ref(object)),
-               GPOINTER_TO_UINT(g_object_ref(invocation)),
-               arg_sap,
-               arg_san);
+                       GPOINTER_TO_UINT(g_object_ref(object)),
+                       GPOINTER_TO_UINT(g_object_ref(invocation)),
+                       arg_sap,
+                       arg_san);
 
        if (parameter != NULL)
        {
                if ((result = net_nfc_server_controller_async_queue_push(
-                       snep_unregister_server_thread_func, parameter)) == FALSE)
+                                               snep_unregister_server_thread_func, parameter)) == FALSE)
                {
                        DEBUG_ERR_MSG("net_nfc_server_controller_async_queue_push failed");
 
                        g_dbus_method_invocation_return_dbus_error(invocation,
-                               "org.tizen.NetNfcService.Snep.ThreadError",
-                               "can not push to controller thread");
+                                       "org.tizen.NetNfcService.Snep.ThreadError",
+                                       "can not push to controller thread");
 
                        g_object_unref(invocation);
                        g_object_unref(object);
@@ -977,8 +977,8 @@ static gboolean _handle_unregister_server(
                DEBUG_ERR_MSG("g_variant_new failed");
 
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.Snep.MemoryError",
-                       "Out of memory");
+                               "org.tizen.NetNfcService.Snep.MemoryError",
+                               "Out of memory");
 
                result = FALSE;
        }
@@ -997,40 +997,40 @@ gboolean net_nfc_server_snep_init(GDBusConnection *connection)
        snep_skeleton = net_nfc_gdbus_snep_skeleton_new();
 
        g_signal_connect(snep_skeleton,
-               "handle-server-register",
-               G_CALLBACK(_handle_register_server),
-               NULL);
+                       "handle-server-register",
+                       G_CALLBACK(_handle_register_server),
+                       NULL);
 
        g_signal_connect(snep_skeleton,
-               "handle-server-unregister",
-               G_CALLBACK(_handle_unregister_server),
-               NULL);
+                       "handle-server-unregister",
+                       G_CALLBACK(_handle_unregister_server),
+                       NULL);
 
        g_signal_connect(snep_skeleton,
-               "handle-server-start",
-               G_CALLBACK(_handle_start_server),
-               NULL);
+                       "handle-server-start",
+                       G_CALLBACK(_handle_start_server),
+                       NULL);
 
        g_signal_connect(snep_skeleton,
-               "handle-client-start",
-               G_CALLBACK(_handle_start_client),
-               NULL);
+                       "handle-client-start",
+                       G_CALLBACK(_handle_start_client),
+                       NULL);
 
        g_signal_connect(snep_skeleton,
-               "handle-client-request",
-               G_CALLBACK(_handle_client_send_request),
-               NULL);
+                       "handle-client-request",
+                       G_CALLBACK(_handle_client_send_request),
+                       NULL);
 
        g_signal_connect(snep_skeleton,
-               "handle-stop-snep",
-               G_CALLBACK(_handle_stop_snep),
-               NULL);
+                       "handle-stop-snep",
+                       G_CALLBACK(_handle_stop_snep),
+                       NULL);
 
        result = g_dbus_interface_skeleton_export(
-               G_DBUS_INTERFACE_SKELETON(snep_skeleton),
-               connection,
-               "/org/tizen/NetNfcService/Snep",
-               &error);
+                       G_DBUS_INTERFACE_SKELETON(snep_skeleton),
+                       connection,
+                       "/org/tizen/NetNfcService/Snep",
+                       &error);
        if (result == FALSE)
        {
                g_error_free(error);
similarity index 70%
rename from src/manager/net_nfc_server_system_handler.c
rename to daemon/net_nfc_server_system_handler.c
index f6fd219..fc3c53f 100644 (file)
 #include "net_nfc_gdbus.h"
 #include "net_nfc_debug_internal.h"
 #include "net_nfc_server_common.h"
-#include "net_nfc_server_context_internal.h"
+#include "net_nfc_server_context.h"
 #include "net_nfc_server_system_handler.h"
 
 
 static NetNfcGDbusPopup *popup_skeleton = NULL;
 
 static gboolean popup_handle_set(NetNfcGDbusPopup *popup_manager,
-       GDBusMethodInvocation *invocation,
-       gboolean state,
-       gint focus_state,
-       GVariant *smack_privilege,
-       gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               gboolean state,
+               gint focus_state,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean popup_handle_get(NetNfcGDbusPopup *popup_manager,
-       GDBusMethodInvocation *invocation,
-       GVariant *smack_privilege,
-       gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean popup_handle_set(NetNfcGDbusPopup *popup_manager,
-       GDBusMethodInvocation *invocation,
-       gboolean state,
-       gint focus_state,
-       GVariant *smack_privilege,
-       gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               gboolean state,
+               gint focus_state,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "w") == false) {
+                               smack_privilege,
+                               "nfc-manager",
+                               "w") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
        }
 
        net_nfc_server_gdbus_set_launch_state(
-               g_dbus_method_invocation_get_sender(invocation),
-               state, focus_state);
+                       g_dbus_method_invocation_get_sender(invocation),
+                       state, focus_state);
 
        net_nfc_gdbus_popup_complete_set(popup_manager, invocation);
 
@@ -64,27 +64,27 @@ static gboolean popup_handle_set(NetNfcGDbusPopup *popup_manager,
 }
 
 static gboolean popup_handle_get(NetNfcGDbusPopup *popup_manager,
-       GDBusMethodInvocation *invocation,
-       GVariant *smack_privilege,
-       gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        gboolean state;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "r") == false) {
+                               smack_privilege,
+                               "nfc-manager",
+                               "r") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
        }
 
        state = net_nfc_server_gdbus_get_launch_state(
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        net_nfc_gdbus_popup_complete_get(popup_manager, invocation, state);
 
@@ -108,20 +108,20 @@ gboolean net_nfc_server_system_handler_init(GDBusConnection *connection)
        }
 
        g_signal_connect(popup_skeleton,
-               "handle-set",
-               G_CALLBACK(popup_handle_set),
-               NULL);
+                       "handle-set",
+                       G_CALLBACK(popup_handle_set),
+                       NULL);
 
        g_signal_connect(popup_skeleton,
-               "handle-get",
-               G_CALLBACK(popup_handle_get),
-               NULL);
+                       "handle-get",
+                       G_CALLBACK(popup_handle_get),
+                       NULL);
 
        result = g_dbus_interface_skeleton_export(
-               G_DBUS_INTERFACE_SKELETON(popup_skeleton),
-               connection,
-               "/org/tizen/NetNfcService/Popup",
-               &error);
+                       G_DBUS_INTERFACE_SKELETON(popup_skeleton),
+                       connection,
+                       "/org/tizen/NetNfcService/Popup",
+                       &error);
        if (result == FALSE)
        {
                DEBUG_ERR_MSG("Can not skeleton_export %s", error->message);
similarity index 85%
rename from src/manager/net_nfc_server_tag.c
rename to daemon/net_nfc_server_tag.c
index c099b6e..113fd9b 100644 (file)
 #include "net_nfc_debug_internal.h"
 #include "net_nfc_util_internal.h"
 #include "net_nfc_util_gdbus_internal.h"
-#include "net_nfc_controller_internal.h"
-#include "net_nfc_app_util_internal.h"
 #include "net_nfc_gdbus.h"
+#include "net_nfc_server_controller.h"
 #include "net_nfc_server_common.h"
-#include "net_nfc_server_context_internal.h"
-#include "net_nfc_server_tag.h"
+#include "net_nfc_server_context.h"
+#include "net_nfc_server_util.h"
 #include "net_nfc_server_p2p.h"
 #include "net_nfc_server_process_handover.h"
 #include "net_nfc_util_ndef_record.h"
+#include "net_nfc_server_tag.h"
 
 typedef struct _CurrentTagInfoData CurrentTagInfoData;
 
@@ -45,11 +45,11 @@ struct _WatchDogData
 
 
 static gboolean tag_is_isp_dep_ndef_formatable(net_nfc_target_handle_s *handle,
-                                       int dev_type);
+               int dev_type);
 
 static gboolean tag_read_ndef_message(net_nfc_target_handle_s *handle,
-                               int dev_type,
-                               data_s **read_ndef);
+               int dev_type,
+               data_s **read_ndef);
 
 static void tag_watchdog_thread_func(gpointer user_data);
 
@@ -60,26 +60,26 @@ static void tag_slave_target_detected_thread_func(gpointer user_data);
 
 /* methods */
 static gboolean tag_handle_is_tag_connected(NetNfcGDbusTag *tag,
-                                       GDBusMethodInvocation *invocation,
-                                       GVariant *smack_privilege,
-                                       gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean tag_handle_get_current_tag_info(NetNfcGDbusTag *tag,
-                                       GDBusMethodInvocation *invocation,
-                                       GVariant *smack_privilege,
-                                       gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean tag_handle_get_current_target_handle(NetNfcGDbusTag *tag,
-                                       GDBusMethodInvocation *invocation,
-                                       GVariant *smack_privilege,
-                                       gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static NetNfcGDbusTag *tag_skeleton = NULL;
 
 static net_nfc_current_target_info_s *current_target_info = NULL;
 
 static gboolean tag_is_isp_dep_ndef_formatable(net_nfc_target_handle_s *handle,
-                                       int dev_type)
+               int dev_type)
 {
        uint8_t cmd[] = { 0x90, 0x60, 0x00, 0x00, 0x00 };
 
@@ -105,8 +105,8 @@ static gboolean tag_is_isp_dep_ndef_formatable(net_nfc_target_handle_s *handle,
        if (response != NULL)
        {
                if (response->length == 9 &&
-                       response->buffer[7] == (uint8_t)0x91 &&
-                       response->buffer[8] == (uint8_t)0xAF)
+                               response->buffer[7] == (uint8_t)0x91 &&
+                               response->buffer[8] == (uint8_t)0xAF)
                {
                        result =  TRUE;
                }
@@ -123,8 +123,8 @@ static gboolean tag_is_isp_dep_ndef_formatable(net_nfc_target_handle_s *handle,
 }
 
 static gboolean tag_read_ndef_message(net_nfc_target_handle_s *handle,
-                               int dev_type,
-                               data_s **read_ndef)
+               int dev_type,
+               data_s **read_ndef)
 {
        net_nfc_error_e result = NET_NFC_OK;
        data_s *temp = NULL;
@@ -142,7 +142,7 @@ static gboolean tag_read_ndef_message(net_nfc_target_handle_s *handle,
                if (tag_is_isp_dep_ndef_formatable(handle, dev_type) == FALSE)
                {
                        DEBUG_ERR_MSG(
-                               "DESFIRE : ISO-DEP ndef not formatable");
+                                       "DESFIRE : ISO-DEP ndef not formatable");
                        return FALSE;
                }
 
@@ -225,7 +225,7 @@ static void tag_watchdog_thread_func(gpointer user_data)
 
 
        /* IMPORTANT, TEMPORARY : switching context to another thread
-          for give CPU time */
+               for give CPU time */
        g_usleep(10000);
 
        handle = watch_dog->handle;
@@ -233,7 +233,7 @@ static void tag_watchdog_thread_func(gpointer user_data)
                        handle->connection_type == NET_NFC_TAG_CONNECTION)
        {
                is_present_target = net_nfc_controller_check_target_presence(
-                                       handle, &result);
+                               handle, &result);
        }
 
        if (is_present_target == true)
@@ -262,8 +262,8 @@ static void tag_watchdog_thread_func(gpointer user_data)
        net_nfc_server_set_state(NET_NFC_SERVER_IDLE);
 
        net_nfc_gdbus_tag_emit_tag_detached(tag_skeleton,
-                                       GPOINTER_TO_UINT(handle),
-                                       watch_dog->dev_type);
+                       GPOINTER_TO_UINT(handle),
+                       watch_dog->dev_type);
 
        g_free(watch_dog);
 }
@@ -292,8 +292,8 @@ static void tag_get_current_tag_info_thread_func(gpointer user_data)
 
        target_info = net_nfc_server_get_target_info();
        if (target_info != NULL &&
-               target_info->devType != NET_NFC_NFCIP1_TARGET &&
-               target_info->devType != NET_NFC_NFCIP1_INITIATOR)
+                       target_info->devType != NET_NFC_NFCIP1_TARGET &&
+                       target_info->devType != NET_NFC_NFCIP1_INITIATOR)
        {
                handle = target_info->handle;
                number_of_keys = target_info->number_of_keys;
@@ -315,7 +315,7 @@ static void tag_get_current_tag_info_thread_func(gpointer user_data)
                if (is_ndef_supported)
                {
                        if (net_nfc_controller_read_ndef(target_info->handle,
-                                       &raw_data, &result) == true)
+                                               &raw_data, &result) == true)
                        {
                                DEBUG_SERVER_MSG("%s is success",
                                                "net_nfc_controller_read_ndef");
@@ -324,17 +324,17 @@ static void tag_get_current_tag_info_thread_func(gpointer user_data)
        }
 
        net_nfc_gdbus_tag_complete_get_current_tag_info(info_data->tag,
-               info_data->invocation,
-               (dev_type != NET_NFC_UNKNOWN_TARGET),
-               GPOINTER_TO_UINT(handle),
-               dev_type,
-               is_ndef_supported,
-               ndef_card_state,
-               max_data_size,
-               actual_data_size,
-               number_of_keys,
-               net_nfc_util_gdbus_data_to_variant(&target_info_values),
-               net_nfc_util_gdbus_data_to_variant(raw_data));
+                       info_data->invocation,
+                       (dev_type != NET_NFC_UNKNOWN_TARGET),
+                       GPOINTER_TO_UINT(handle),
+                       dev_type,
+                       is_ndef_supported,
+                       ndef_card_state,
+                       max_data_size,
+                       actual_data_size,
+                       number_of_keys,
+                       net_nfc_util_gdbus_data_to_variant(&target_info_values),
+                       net_nfc_util_gdbus_data_to_variant(raw_data));
 
        if (raw_data != NULL) {
                net_nfc_util_free_data(raw_data);
@@ -499,8 +499,8 @@ static void tag_slave_target_detected_thread_func(gpointer user_data)
        watch_dog->handle = target->handle;
 
        if (net_nfc_server_controller_async_queue_push(
-                                       tag_watchdog_thread_func,
-                                       watch_dog) == FALSE)
+                               tag_watchdog_thread_func,
+                               watch_dog) == FALSE)
        {
                DEBUG_ERR_MSG("can not create watch dog");
                g_free(watch_dog);
@@ -510,9 +510,9 @@ static void tag_slave_target_detected_thread_func(gpointer user_data)
 
 
 static gboolean tag_handle_is_tag_connected(NetNfcGDbusTag *tag,
-                                       GDBusMethodInvocation *invocation,
-                                       GVariant *smack_privilege,
-                                       gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        /* FIXME : net_nfc_current_target_info_s should be removed */
        net_nfc_current_target_info_s *target_info;
@@ -520,13 +520,13 @@ static gboolean tag_handle_is_tag_connected(NetNfcGDbusTag *tag,
        gboolean is_connected = FALSE;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "r") == false) {
+                               smack_privilege,
+                               "nfc-manager::tag",
+                               "r") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -540,29 +540,29 @@ static gboolean tag_handle_is_tag_connected(NetNfcGDbusTag *tag,
        }
 
        net_nfc_gdbus_tag_complete_is_tag_connected(tag,
-               invocation,
-               is_connected,
-               (gint32)dev_type);
+                       invocation,
+                       is_connected,
+                       (gint32)dev_type);
 
        return TRUE;
 }
 
 static gboolean tag_handle_get_current_tag_info(NetNfcGDbusTag *tag,
-                               GDBusMethodInvocation *invocation,
-                               GVariant *smack_privilege,
-                               gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        CurrentTagInfoData *info_data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "r") == false) {
+                               smack_privilege,
+                               "nfc-manager::tag",
+                               "r") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -573,8 +573,8 @@ static gboolean tag_handle_get_current_tag_info(NetNfcGDbusTag *tag,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-               "org.tizen.NetNfcService.AllocationError",
-               "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -583,8 +583,8 @@ static gboolean tag_handle_get_current_tag_info(NetNfcGDbusTag *tag,
        info_data->invocation = g_object_ref(invocation);
 
        result = net_nfc_server_controller_async_queue_push(
-               tag_get_current_tag_info_thread_func,
-               info_data);
+                       tag_get_current_tag_info_thread_func,
+                       info_data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
@@ -601,9 +601,9 @@ static gboolean tag_handle_get_current_tag_info(NetNfcGDbusTag *tag,
 }
 
 static gboolean tag_handle_get_current_target_handle(NetNfcGDbusTag *tag,
-       GDBusMethodInvocation *invocation,
-       GVariant *smack_privilege,
-       gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        /* FIXME : net_nfc_current_target_info_s should be removed */
        net_nfc_current_target_info_s *target_info;
@@ -611,13 +611,13 @@ static gboolean tag_handle_get_current_target_handle(NetNfcGDbusTag *tag,
        uint32_t devType = NET_NFC_UNKNOWN_TARGET;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "r") == false) {
+                               smack_privilege,
+                               "nfc-manager::tag",
+                               "r") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -631,10 +631,10 @@ static gboolean tag_handle_get_current_target_handle(NetNfcGDbusTag *tag,
        }
 
        net_nfc_gdbus_tag_complete_get_current_target_handle(tag,
-               invocation,
-               (handle != NULL),
-               GPOINTER_TO_UINT(handle),
-               devType);
+                       invocation,
+                       (handle != NULL),
+                       GPOINTER_TO_UINT(handle),
+                       devType);
 
        return TRUE;
 }
@@ -666,10 +666,10 @@ gboolean net_nfc_server_tag_init(GDBusConnection *connection)
                        NULL);
 
        result = g_dbus_interface_skeleton_export(
-               G_DBUS_INTERFACE_SKELETON(tag_skeleton),
-               connection,
-               "/org/tizen/NetNfcService/Tag",
-               &error);
+                       G_DBUS_INTERFACE_SKELETON(tag_skeleton),
+                       connection,
+                       "/org/tizen/NetNfcService/Tag",
+                       &error);
        if (result == FALSE)
        {
                DEBUG_ERR_MSG("can not skeleton_export %s", error->message);
@@ -701,8 +701,8 @@ void net_nfc_server_set_target_info(void *info)
        target = (net_nfc_request_target_detected_t *)info;
 
        current_target_info = g_malloc0(
-                               sizeof(net_nfc_current_target_info_s) +
-                               target->target_info_values.length);
+                       sizeof(net_nfc_current_target_info_s) +
+                       target->target_info_values.length);
 
        current_target_info->handle = target->handle;
        current_target_info->devType = target->devType;
@@ -712,11 +712,11 @@ void net_nfc_server_set_target_info(void *info)
        {
                current_target_info->number_of_keys = target->number_of_keys;
                current_target_info->target_info_values.length =
-                               target->target_info_values.length;
+                       target->target_info_values.length;
 
                memcpy(&current_target_info->target_info_values,
-                       &target->target_info_values,
-                       current_target_info->target_info_values.length);
+                               &target->target_info_values,
+                               current_target_info->target_info_values.length);
        }
 }
 
@@ -745,8 +745,8 @@ void net_nfc_server_free_target_info(void)
 void net_nfc_server_tag_target_detected(void *info)
 {
        if (net_nfc_server_controller_async_queue_push(
-               tag_slave_target_detected_thread_func,
-               NULL) == FALSE)
+                               tag_slave_target_detected_thread_func,
+                               NULL) == FALSE)
        {
                DEBUG_ERR_MSG("can not push to controller thread");
        }
similarity index 78%
rename from src/manager/net_nfc_server_test.c
rename to daemon/net_nfc_server_test.c
index bcd55cf..27c8c64 100644 (file)
 #include "net_nfc_debug_internal.h"
 #include "net_nfc_util_internal.h"
 #include "net_nfc_util_gdbus_internal.h"
-#include "net_nfc_controller_internal.h"
+#include "net_nfc_server_controller.h"
 #include "net_nfc_gdbus.h"
 #include "net_nfc_server_common.h"
-#include "net_nfc_server_context_internal.h"
+#include "net_nfc_server_context.h"
 #include "net_nfc_server_test.h"
 
 typedef struct _TestData TestData;
@@ -64,29 +64,29 @@ static void test_handle_set_ee_data_thread_func(gpointer user_data);
 
 
 static gboolean test_handle_sim_test(NetNfcGDbusTest *test,
-                               GDBusMethodInvocation *invocation,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean test_handle_prbs_test(NetNfcGDbusTest *test,
-                               GDBusMethodInvocation *invocation,
-                               guint32 arg_tech,
-                               guint32 arg_rate,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 arg_tech,
+               guint32 arg_rate,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean test_handle_get_firmware_version(NetNfcGDbusTest *test,
-                               GDBusMethodInvocation *invocation,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean test_handle_set_ee_data(NetNfcGDbusTest *test,
-                               GDBusMethodInvocation *invocation,
-                               guint32 mode,
-                               guint32 reg_id,
-                               GVariant *variant,
-                               GVariant *smack_privilege,
-                               gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint32 mode,
+               guint32 reg_id,
+               GVariant *variant,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 
 static NetNfcGDbusTest *test_skeleton = NULL;
@@ -103,8 +103,8 @@ static void test_handle_sim_test_thread_func(gpointer user_data)
        net_nfc_controller_sim_test(&result);
 
        net_nfc_gdbus_test_complete_sim_test(data->test,
-               data->invocation,
-               (gint)result);
+                       data->invocation,
+                       (gint)result);
 
        g_object_unref(data->invocation);
        g_object_unref(data->test);
@@ -124,8 +124,8 @@ static void test_handle_prbs_test_thread_func(gpointer user_data)
        net_nfc_controller_prbs_test(&result, data->tech, data->rate);
 
        net_nfc_gdbus_test_complete_prbs_test(data->test,
-               data->invocation,
-               (gint)result);
+                       data->invocation,
+                       (gint)result);
 
        g_object_unref(data->invocation);
        g_object_unref(data->test);
@@ -160,9 +160,9 @@ static void test_handle_get_firmware_version_thread_func(gpointer user_data)
        }
 
        net_nfc_gdbus_test_complete_get_firmware_version(data->test,
-               data->invocation,
-               (gint)result,
-               version);
+                       data->invocation,
+                       (gint)result,
+                       version);
 
        g_free(version);
 
@@ -182,13 +182,13 @@ static void test_handle_set_ee_data_thread_func(gpointer user_data)
        g_assert(data->invocation != NULL);
 
        net_nfc_controller_eedata_register_set(&result,
-               data->mode,
-               data->reg_id,
-               &data->data);
+                       data->mode,
+                       data->reg_id,
+                       &data->data);
 
        net_nfc_gdbus_test_complete_set_ee_data(data->test,
-               data->invocation,
-               (gint)result);
+                       data->invocation,
+                       (gint)result);
 
        net_nfc_util_free_data(&data->data);
 
@@ -199,21 +199,21 @@ static void test_handle_set_ee_data_thread_func(gpointer user_data)
 }
 
 static gboolean test_handle_sim_test(NetNfcGDbusTest *test,
-       GDBusMethodInvocation *invocation,
-       GVariant *smack_privilege,
-       gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        TestData *data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+                               smack_privilege,
+                               "nfc-manager",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -226,8 +226,8 @@ static gboolean test_handle_sim_test(NetNfcGDbusTest *test,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -236,8 +236,8 @@ static gboolean test_handle_sim_test(NetNfcGDbusTest *test,
        data->invocation = g_object_ref(invocation);
 
        result = net_nfc_server_controller_async_queue_push(
-               test_handle_sim_test_thread_func,
-               data);
+                       test_handle_sim_test_thread_func,
+                       data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
@@ -254,23 +254,23 @@ static gboolean test_handle_sim_test(NetNfcGDbusTest *test,
 }
 
 static gboolean test_handle_prbs_test(NetNfcGDbusTest *test,
-       GDBusMethodInvocation *invocation,
-       guint32 arg_tech,
-       guint32 arg_rate,
-       GVariant *smack_privilege,
-       gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 arg_tech,
+               guint32 arg_rate,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        TestPrbsData *data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+                               smack_privilege,
+                               "nfc-manager",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return TRUE;
@@ -283,8 +283,8 @@ static gboolean test_handle_prbs_test(NetNfcGDbusTest *test,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -295,8 +295,8 @@ static gboolean test_handle_prbs_test(NetNfcGDbusTest *test,
        data->rate = arg_rate;
 
        result = net_nfc_server_controller_async_queue_push(
-               test_handle_prbs_test_thread_func,
-               data);
+                       test_handle_prbs_test_thread_func,
+                       data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
@@ -313,21 +313,21 @@ static gboolean test_handle_prbs_test(NetNfcGDbusTest *test,
 }
 
 static gboolean test_handle_get_firmware_version(NetNfcGDbusTest *test,
-       GDBusMethodInvocation *invocation,
-       GVariant *smack_privilege,
-       gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        TestData *data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+                               smack_privilege,
+                               "nfc-manager",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -338,8 +338,8 @@ static gboolean test_handle_get_firmware_version(NetNfcGDbusTest *test,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -348,8 +348,8 @@ static gboolean test_handle_get_firmware_version(NetNfcGDbusTest *test,
        data->invocation = g_object_ref(invocation);
 
        result = net_nfc_server_controller_async_queue_push(
-               test_handle_get_firmware_version_thread_func,
-               data);
+                       test_handle_get_firmware_version_thread_func,
+                       data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
@@ -366,24 +366,24 @@ static gboolean test_handle_get_firmware_version(NetNfcGDbusTest *test,
 }
 
 static gboolean test_handle_set_ee_data(NetNfcGDbusTest *test,
-       GDBusMethodInvocation *invocation,
-       guint32 mode,
-       guint32 reg_id,
-       GVariant *variant,
-       GVariant *smack_privilege,
-       gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint32 mode,
+               guint32 reg_id,
+               GVariant *variant,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        TestSetEeData *data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+                               smack_privilege,
+                               "nfc-manager",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -394,8 +394,8 @@ static gboolean test_handle_set_ee_data(NetNfcGDbusTest *test,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -407,12 +407,12 @@ static gboolean test_handle_set_ee_data(NetNfcGDbusTest *test,
        net_nfc_util_gdbus_variant_to_data_s(variant, &data->data);
 
        result = net_nfc_server_controller_async_queue_push(
-               test_handle_set_ee_data_thread_func, data);
+                       test_handle_set_ee_data_thread_func, data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.ThreadError",
-                       "can not push to controller thread");
+                               "org.tizen.NetNfcService.ThreadError",
+                               "can not push to controller thread");
 
                net_nfc_util_free_data(&data->data);
 
@@ -456,10 +456,10 @@ gboolean net_nfc_server_test_init(GDBusConnection *connection)
                        NULL);
 
        result = g_dbus_interface_skeleton_export(
-               G_DBUS_INTERFACE_SKELETON(test_skeleton),
-               connection,
-               "/org/tizen/NetNfcService/Test",
-               &error);
+                       G_DBUS_INTERFACE_SKELETON(test_skeleton),
+                       connection,
+                       "/org/tizen/NetNfcService/Test",
+                       &error);
        if (result == FALSE)
        {
                DEBUG_ERR_MSG("Can not skeleton_export %s", error->message);
similarity index 77%
rename from src/manager/net_nfc_server_transceive.c
rename to daemon/net_nfc_server_transceive.c
index 5364787..64a0d3d 100644 (file)
 #include "net_nfc_debug_internal.h"
 #include "net_nfc_util_internal.h"
 #include "net_nfc_util_gdbus_internal.h"
-#include "net_nfc_controller_internal.h"
+#include "net_nfc_server_controller.h"
 #include "net_nfc_gdbus.h"
 #include "net_nfc_server_common.h"
 #include "net_nfc_server_tag.h"
-#include "net_nfc_server_context_internal.h"
+#include "net_nfc_server_context.h"
 #include "net_nfc_server_transceive.h"
 
 
@@ -33,20 +33,20 @@ static void transceive_thread_func(gpointer user_data);
 static void transceive_data_thread_func(gpointer user_data);
 
 static gboolean transceive_handle(NetNfcGDbusTransceive *transceive,
-       GDBusMethodInvocation *invocation,
-       guint handle,
-       guint dev_type,
-       GVariant *arg_data,
-       GVariant *smack_privilege,
-       gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint handle,
+               guint dev_type,
+               GVariant *arg_data,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 static gboolean transceive_data_handle(NetNfcGDbusTransceive *transceive,
-       GDBusMethodInvocation *invocation,
-       guint handle,
-       guint dev_type,
-       GVariant *arg_data,
-       GVariant *smack_privilege,
-       gpointer user_data);
+               GDBusMethodInvocation *invocation,
+               guint handle,
+               guint dev_type,
+               GVariant *arg_data,
+               GVariant *smack_privilege,
+               gpointer user_data);
 
 
 typedef struct _TransceiveSendData TransceiveSendData;
@@ -78,14 +78,14 @@ static void transceive_data_thread_func(gpointer user_data)
                DEBUG_SERVER_MSG("call transceive");
 
                if (net_nfc_controller_transceive(handle,
-                       &transceive_data->transceive_info,
-                       &data,
-                       &result) == true)
+                                       &transceive_data->transceive_info,
+                                       &data,
+                                       &result) == true)
                {
                        if (data != NULL)
                        {
                                DEBUG_SERVER_MSG("Transceive data received [%d]",
-                                       data->length);
+                                               data->length);
                        }
                }
        }
@@ -99,10 +99,10 @@ static void transceive_data_thread_func(gpointer user_data)
        resp_data = net_nfc_util_gdbus_data_to_variant(data);
 
        net_nfc_gdbus_transceive_complete_transceive_data(
-               transceive_data->transceive,
-               transceive_data->invocation,
-               (gint)result,
-               resp_data);
+                       transceive_data->transceive,
+                       transceive_data->invocation,
+                       (gint)result,
+                       resp_data);
 
        if (data)
        {
@@ -119,24 +119,24 @@ static void transceive_data_thread_func(gpointer user_data)
 }
 
 static gboolean transceive_data_handle(NetNfcGDbusTransceive *transceive,
-       GDBusMethodInvocation *invocation,
-       guint handle,
-       guint dev_type,
-       GVariant *arg_data,
-       GVariant *smack_privilege,
-       gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint handle,
+               guint dev_type,
+               GVariant *arg_data,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        TransceiveSendData *data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+                               smack_privilege,
+                               "nfc-manager",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -147,8 +147,8 @@ static gboolean transceive_data_handle(NetNfcGDbusTransceive *transceive,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.AllocationError",
-                       "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -158,15 +158,15 @@ static gboolean transceive_data_handle(NetNfcGDbusTransceive *transceive,
        data->transceive_handle = handle;
        data->transceive_info.dev_type = dev_type;
        net_nfc_util_gdbus_variant_to_data_s(arg_data,
-               &data->transceive_info.trans_data);
+                       &data->transceive_info.trans_data);
 
        result = net_nfc_server_controller_async_queue_push(
-               transceive_data_thread_func, data);
+                       transceive_data_thread_func, data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.Transceive.ThreadError",
-                       "can not push to controller thread");
+                               "org.tizen.NetNfcService.Transceive.ThreadError",
+                               "can not push to controller thread");
 
                net_nfc_util_free_data(&data->transceive_info.trans_data);
 
@@ -197,15 +197,15 @@ static void transceive_thread_func(gpointer user_data)
                DEBUG_MSG("call transceive");
 
                if (net_nfc_controller_transceive(handle,
-                       &transceive_data->transceive_info,
-                       &data,
-                       &result) == true)
+                                       &transceive_data->transceive_info,
+                                       &data,
+                                       &result) == true)
                {
                        if (data != NULL)
                        {
                                DEBUG_SERVER_MSG(
-                                       "Transceive data received [%d]",
-                                       data->length);
+                                               "Transceive data received [%d]",
+                                               data->length);
 
                                /* free resource because it doesn't need */
                                g_free(data->buffer);
@@ -223,9 +223,9 @@ static void transceive_thread_func(gpointer user_data)
        DEBUG_SERVER_MSG("transceive result : %d", result);
 
        net_nfc_gdbus_transceive_complete_transceive(
-               transceive_data->transceive,
-               transceive_data->invocation,
-               (gint)result);
+                       transceive_data->transceive,
+                       transceive_data->invocation,
+                       (gint)result);
 
        net_nfc_util_free_data(&transceive_data->transceive_info.trans_data);
 
@@ -236,24 +236,24 @@ static void transceive_thread_func(gpointer user_data)
 }
 
 static gboolean transceive_handle(NetNfcGDbusTransceive *transceive,
-       GDBusMethodInvocation *invocation,
-       guint handle,
-       guint dev_type,
-       GVariant *arg_data,
-       GVariant *smack_privilege,
-       gpointer user_data)
+               GDBusMethodInvocation *invocation,
+               guint handle,
+               guint dev_type,
+               GVariant *arg_data,
+               GVariant *smack_privilege,
+               gpointer user_data)
 {
        TransceiveSendData *data;
        gboolean result;
 
        INFO_MSG(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
+                       g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
        if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+                               smack_privilege,
+                               "nfc-manager",
+                               "rw") == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
 
                return FALSE;
@@ -264,8 +264,8 @@ static gboolean transceive_handle(NetNfcGDbusTransceive *transceive,
        {
                DEBUG_ERR_MSG("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
-               "org.tizen.NetNfcService.AllocationError",
-               "Can not allocate memory");
+                               "org.tizen.NetNfcService.AllocationError",
+                               "Can not allocate memory");
 
                return FALSE;
        }
@@ -275,15 +275,15 @@ static gboolean transceive_handle(NetNfcGDbusTransceive *transceive,
        data->transceive_handle = handle;
        data->transceive_info.dev_type = dev_type;
        net_nfc_util_gdbus_variant_to_data_s(arg_data,
-               &data->transceive_info.trans_data);
+                       &data->transceive_info.trans_data);
 
        result = net_nfc_server_controller_async_queue_push(
-               transceive_thread_func, data);
+                       transceive_thread_func, data);
        if (result == FALSE)
        {
                g_dbus_method_invocation_return_dbus_error(invocation,
-                       "org.tizen.NetNfcService.Transceive.ThreadError",
-                       "can not push to controller thread");
+                               "org.tizen.NetNfcService.Transceive.ThreadError",
+                               "can not push to controller thread");
 
                net_nfc_util_free_data(&data->transceive_info.trans_data);
 
@@ -318,10 +318,10 @@ gboolean net_nfc_server_transceive_init(GDBusConnection *connection)
                        NULL);
 
        result = g_dbus_interface_skeleton_export(
-               G_DBUS_INTERFACE_SKELETON(transceive_skeleton),
-               connection,
-               "/org/tizen/NetNfcService/Transceive",
-               &error);
+                       G_DBUS_INTERFACE_SKELETON(transceive_skeleton),
+                       connection,
+                       "/org/tizen/NetNfcService/Transceive",
+                       &error);
        if (result == FALSE)
        {
                g_error_free(error);
similarity index 84%
rename from src/manager/net_nfc_app_util.c
rename to daemon/net_nfc_server_util.c
index f4bba55..88d7f86 100644 (file)
@@ -1,26 +1,27 @@
 /*
 * 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.
 */
-
-
+ * 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.
+ */
+#define _GNU_SOURCE
+#include <string.h>
 #include <dirent.h>
+#include <errno.h>
 #include <pwd.h>
 #include <grp.h>
 #include <sys/stat.h>
-#include <time.h>
 #include <sys/time.h>
+#include <time.h>
 #include <pthread.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <openssl/bio.h>
 #include <openssl/buffer.h>
 
-#include "appsvc.h"
-#include "aul.h"
-#include "vconf.h"
-#include "Ecore_X.h"
+#include <vconf.h>
+#include <svi.h>
+#include <wav_player.h>
+#include <appsvc.h>
+#include <aul.h>
+#include <Ecore_X.h>
 
 #include "net_nfc_typedef.h"
 #include "net_nfc_typedef_internal.h"
 #include "net_nfc_util_internal.h"
 #include "net_nfc_util_ndef_message.h"
 #include "net_nfc_util_ndef_record.h"
-#include "net_nfc_manager_util_internal.h"
-#include "net_nfc_app_util_internal.h"
-#include "net_nfc_server_context_internal.h"
+#include "net_nfc_server_context.h"
 #include "net_nfc_server_se.h"
-//#include "syspopup_caller.h"
+#include "net_nfc_server_util.h"
+
+#define NET_NFC_MANAGER_SOUND_PATH_TASK_START  "/usr/share/nfc-manager-daemon/sounds/Operation_sdk.wav"
+#define NET_NFC_MANAGER_SOUND_PATH_TASK_END    "/usr/share/nfc-manager-daemon/sounds/Operation_sdk.wav"
+#define NET_NFC_MANAGER_SOUND_PATH_TASK_ERROR  "/usr/share/nfc-manager-daemon/sounds/Operation_sdk.wav"
 
 #define OSP_K_COND             "__OSP_COND_NAME__"
 #define OSP_K_COND_TYPE                "nfc"
 #define OSP_K_LAUNCH_TYPE      "__OSP_LAUNCH_TYPE__"
 
-static bool _net_nfc_app_util_get_operation_from_record(ndef_record_s *record, char *operation, size_t length);
-static bool _net_nfc_app_util_get_mime_from_record(ndef_record_s *record, char *mime, size_t length);
-#ifdef USE_FULL_URI
-static bool _net_nfc_app_util_get_uri_from_record(ndef_record_s *record, char *uri, size_t length);
-#endif
-static bool _net_nfc_app_util_get_data_from_record(ndef_record_s *record, char *data, size_t length);
-
 static const char osp_launch_type_condition[] = "condition";
 
-net_nfc_error_e net_nfc_app_util_process_ndef(data_s *data)
-{
-       net_nfc_error_e result = NET_NFC_UNKNOWN_ERROR;
-       ndef_message_s *msg = NULL;
-       char operation[2048] = { 0, };
-       char mime[2048] = { 0, };
-       char text[2048] = { 0, };
-#ifdef USE_FULL_URI
-       char uri[2048] = { 0, };
-#endif
-       int ret = 0;
-
-       if (data == NULL || data->buffer == NULL || data->length == 0)
-       {
-               DEBUG_ERR_MSG("net_nfc_app_util_process_ndef NET_NFC_NULL_PARAMETER");
-               return NET_NFC_NULL_PARAMETER;
-       }
-
-       /* create file */
-       if ((result = net_nfc_app_util_store_ndef_message(data)) != NET_NFC_OK)
-       {
-               DEBUG_ERR_MSG("net_nfc_app_util_store_ndef_message failed [%d]", result);
-               return result;
-       }
-
-       /* check state of launch popup */
-       if(net_nfc_app_util_check_launch_state() == TRUE)
-       {
-               DEBUG_SERVER_MSG("skip launch popup!!!");
-               result = NET_NFC_OK;
-               return result;
-       }
-
-       if (net_nfc_util_create_ndef_message(&msg) != NET_NFC_OK)
-       {
-               DEBUG_ERR_MSG("memory alloc fail..");
-               return NET_NFC_ALLOC_FAIL;
-       }
-
-       /* parse ndef message and fill appsvc data */
-       if ((result = net_nfc_util_convert_rawdata_to_ndef_message(data, msg)) != NET_NFC_OK)
-       {
-               DEBUG_ERR_MSG("net_nfc_app_util_store_ndef_message failed [%d]", result);
-               goto ERROR;
-       }
-
-       if (_net_nfc_app_util_get_operation_from_record(msg->records, operation, sizeof(operation)) == FALSE)
-       {
-               DEBUG_ERR_MSG("_net_nfc_app_util_get_operation_from_record failed [%d]", result);
-               result = NET_NFC_UNKNOWN_ERROR;
-               goto ERROR;
-       }
-
-       if (_net_nfc_app_util_get_mime_from_record(msg->records, mime, sizeof(mime)) == FALSE)
-       {
-               DEBUG_ERR_MSG("_net_nfc_app_util_get_mime_from_record failed [%d]", result);
-               result = NET_NFC_UNKNOWN_ERROR;
-               goto ERROR;
-       }
-#ifdef USE_FULL_URI
-       if (_net_nfc_app_util_get_uri_from_record(msg->records, uri, sizeof(uri)) == FALSE)
-       {
-               DEBUG_ERR_MSG("_net_nfc_app_util_get_uri_from_record failed [%d]", result);
-               result = NET_NFC_UNKNOWN_ERROR;
-               goto ERROR;
-       }
-#endif
-       /* launch appsvc */
-       if (_net_nfc_app_util_get_data_from_record(msg->records, text, sizeof(text)) == FALSE)
-       {
-               DEBUG_ERR_MSG("_net_nfc_app_util_get_data_from_record failed [%d]", result);
-               result = NET_NFC_UNKNOWN_ERROR;
-               goto ERROR;
-       }
-
-       ret = net_nfc_app_util_appsvc_launch(operation, uri, mime, text);
-#if 0
-       if (ret == APPSVC_RET_ENOMATCH)
-       {
-               /* TODO : check again */
-               ret = net_nfc_app_util_appsvc_launch(operation, uri, mime, text);
-       }
-#endif
-
-       DEBUG_SERVER_MSG("net_nfc_app_util_appsvc_launch return %d", ret);
-
-       result = NET_NFC_OK;
-
-ERROR :
-       net_nfc_util_free_ndef_message(msg);
-
-       return result;
-}
-
-bool _net_nfc_app_util_change_file_owner_permission(FILE *file)
+static bool _net_nfc_app_util_change_file_owner_permission(FILE *file)
 {
        char *buffer = NULL;
        size_t buffer_len = 0;
@@ -210,7 +114,7 @@ bool _net_nfc_app_util_change_file_owner_permission(FILE *file)
        return true;
 }
 
-net_nfc_error_e net_nfc_app_util_store_ndef_message(data_s *data)
+static net_nfc_error_e net_nfc_app_util_store_ndef_message(data_s *data)
 {
        net_nfc_error_e result = NET_NFC_UNKNOWN_ERROR;
        char file_name[1024] = { 0, };
@@ -224,7 +128,7 @@ net_nfc_error_e net_nfc_app_util_store_ndef_message(data_s *data)
 
        /* check and make directory */
        snprintf(file_name, sizeof(file_name), "%s/%s", NET_NFC_MANAGER_DATA_PATH,
-               NET_NFC_MANAGER_DATA_PATH_MESSAGE);
+                       NET_NFC_MANAGER_DATA_PATH_MESSAGE);
 
        if (stat(file_name, &st) == -1)
        {
@@ -246,7 +150,7 @@ net_nfc_error_e net_nfc_app_util_store_ndef_message(data_s *data)
 
        /* create file */
        snprintf(file_name, sizeof(file_name), "%s/%s/%s", NET_NFC_MANAGER_DATA_PATH,
-               NET_NFC_MANAGER_DATA_PATH_MESSAGE, NET_NFC_MANAGER_NDEF_FILE_NAME);
+                       NET_NFC_MANAGER_DATA_PATH_MESSAGE, NET_NFC_MANAGER_NDEF_FILE_NAME);
        SECURE_LOGD("file path : %s", file_name);
 
        unlink(file_name);
@@ -278,80 +182,6 @@ net_nfc_error_e net_nfc_app_util_store_ndef_message(data_s *data)
        return result;
 }
 
-bool net_nfc_app_util_is_dir(const char* path_name)
-{
-       struct stat statbuf = { 0 };
-
-       if (stat(path_name, &statbuf) == -1)
-       {
-               return false;
-       }
-
-       if (S_ISDIR(statbuf.st_mode) != 0)
-       {
-               return true;
-       }
-       else
-       {
-               return false;
-       }
-}
-
-void net_nfc_app_util_clean_storage(char* src_path)
-{
-       struct dirent* ent = NULL;
-       DIR* dir = NULL;
-
-       char path[1024] = { 0 };
-
-       if ((dir = opendir(src_path)) == NULL)
-       {
-               return;
-       }
-
-       while ((ent = readdir(dir)) != NULL)
-       {
-               if (strncmp(ent->d_name, ".", 1) == 0 || strncmp(ent->d_name, "..", 2) == 0)
-               {
-                       continue;
-               }
-               else
-               {
-                       snprintf(path, 1024, "%s/%s", src_path, ent->d_name);
-
-                       if (net_nfc_app_util_is_dir(path) != false)
-                       {
-                               net_nfc_app_util_clean_storage(path);
-                               rmdir(path);
-                       }
-                       else
-                       {
-                               unlink(path);
-                       }
-               }
-       }
-
-       closedir(dir);
-
-       rmdir(src_path);
-}
-
-static void _to_lower_utf_8(char *str)
-{
-       while (*str != 0)
-       {
-               if (*str >= 'A' && *str <= 'Z')
-                       *str += ('a' - 'A');
-
-               str++;
-       }
-}
-
-static void _to_lower(int type, char *str)
-{
-       _to_lower_utf_8(str);
-}
-
 static bool _net_nfc_app_util_get_operation_from_record(ndef_record_s *record, char *operation, size_t length)
 {
        bool result = false;
@@ -370,7 +200,7 @@ static bool _net_nfc_app_util_get_operation_from_record(ndef_record_s *record, c
 
        case NET_NFC_RECORD_MIME_TYPE :
                op_text = "http://tizen.org/appcontrol/operation/nfc/mime";
-               break;
+               break;
 
        case NET_NFC_RECORD_URI : /* Absolute URI */
                op_text = "http://tizen.org/appcontrol/operation/nfc/uri";
@@ -399,6 +229,22 @@ static bool _net_nfc_app_util_get_operation_from_record(ndef_record_s *record, c
        return result;
 }
 
+static void _to_lower_utf_8(char *str)
+{
+       while (*str != 0)
+       {
+               if (*str >= 'A' && *str <= 'Z')
+                       *str += ('a' - 'A');
+
+               str++;
+       }
+}
+
+static void _to_lower(int type, char *str)
+{
+       _to_lower_utf_8(str);
+}
+
 static bool _net_nfc_app_util_get_mime_from_record(ndef_record_s *record, char *mime, size_t length)
 {
        bool result = false;
@@ -413,7 +259,7 @@ static bool _net_nfc_app_util_get_mime_from_record(ndef_record_s *record, char *
        case NET_NFC_RECORD_WELL_KNOWN_TYPE :
                {
                        if (record->type_s.buffer == NULL || record->type_s.length == 0 ||
-                               record->payload_s.buffer == NULL || record->payload_s.length == 0)
+                                       record->payload_s.buffer == NULL || record->payload_s.length == 0)
                        {
                                DEBUG_ERR_MSG("Broken NDEF Message [NET_NFC_RECORD_WELL_KNOWN_TYPE]");
                                break;
@@ -520,7 +366,7 @@ static bool _net_nfc_app_util_get_uri_from_record(ndef_record_s *record, char *d
                        char *uri = NULL;
 
                        if (net_nfc_util_create_uri_string_from_uri_record(record, &uri) == NET_NFC_OK &&
-                               uri != NULL)
+                                       uri != NULL)
                        {
                                //DEBUG_SERVER_MSG("uri record : %s", uri);
                                snprintf(data, length, "%s", uri);
@@ -599,7 +445,7 @@ static bool _net_nfc_app_util_get_data_from_record(ndef_record_s *record, char *
        case NET_NFC_RECORD_WELL_KNOWN_TYPE :
                {
                        if (record->type_s.buffer == NULL || record->type_s.length == 0
-                               || record->payload_s.buffer == NULL || record->payload_s.length == 0)
+                                       || record->payload_s.buffer == NULL || record->payload_s.length == 0)
                        {
                                DEBUG_ERR_MSG("Broken NDEF Message [NET_NFC_RECORD_WELL_KNOWN_TYPE]");
                                break;
@@ -638,6 +484,158 @@ static bool _net_nfc_app_util_get_data_from_record(ndef_record_s *record, char *
        return result;
 }
 
+net_nfc_error_e net_nfc_app_util_process_ndef(data_s *data)
+{
+       net_nfc_error_e result = NET_NFC_UNKNOWN_ERROR;
+       ndef_message_s *msg = NULL;
+       char operation[2048] = { 0, };
+       char mime[2048] = { 0, };
+       char text[2048] = { 0, };
+#ifdef USE_FULL_URI
+       char uri[2048] = { 0, };
+#endif
+       int ret = 0;
+
+       if (data == NULL || data->buffer == NULL || data->length == 0)
+       {
+               DEBUG_ERR_MSG("net_nfc_app_util_process_ndef NET_NFC_NULL_PARAMETER");
+               return NET_NFC_NULL_PARAMETER;
+       }
+
+       /* create file */
+       if ((result = net_nfc_app_util_store_ndef_message(data)) != NET_NFC_OK)
+       {
+               DEBUG_ERR_MSG("net_nfc_app_util_store_ndef_message failed [%d]", result);
+               return result;
+       }
+
+       /* check state of launch popup */
+       if(net_nfc_app_util_check_launch_state() == TRUE)
+       {
+               DEBUG_SERVER_MSG("skip launch popup!!!");
+               result = NET_NFC_OK;
+               return result;
+       }
+
+       if (net_nfc_util_create_ndef_message(&msg) != NET_NFC_OK)
+       {
+               DEBUG_ERR_MSG("memory alloc fail..");
+               return NET_NFC_ALLOC_FAIL;
+       }
+
+       /* parse ndef message and fill appsvc data */
+       if ((result = net_nfc_util_convert_rawdata_to_ndef_message(data, msg)) != NET_NFC_OK)
+       {
+               DEBUG_ERR_MSG("net_nfc_app_util_store_ndef_message failed [%d]", result);
+               goto ERROR;
+       }
+
+       if (_net_nfc_app_util_get_operation_from_record(msg->records, operation, sizeof(operation)) == FALSE)
+       {
+               DEBUG_ERR_MSG("_net_nfc_app_util_get_operation_from_record failed [%d]", result);
+               result = NET_NFC_UNKNOWN_ERROR;
+               goto ERROR;
+       }
+
+       if (_net_nfc_app_util_get_mime_from_record(msg->records, mime, sizeof(mime)) == FALSE)
+       {
+               DEBUG_ERR_MSG("_net_nfc_app_util_get_mime_from_record failed [%d]", result);
+               result = NET_NFC_UNKNOWN_ERROR;
+               goto ERROR;
+       }
+#ifdef USE_FULL_URI
+       if (_net_nfc_app_util_get_uri_from_record(msg->records, uri, sizeof(uri)) == FALSE)
+       {
+               DEBUG_ERR_MSG("_net_nfc_app_util_get_uri_from_record failed [%d]", result);
+               result = NET_NFC_UNKNOWN_ERROR;
+               goto ERROR;
+       }
+#endif
+       /* launch appsvc */
+       if (_net_nfc_app_util_get_data_from_record(msg->records, text, sizeof(text)) == FALSE)
+       {
+               DEBUG_ERR_MSG("_net_nfc_app_util_get_data_from_record failed [%d]", result);
+               result = NET_NFC_UNKNOWN_ERROR;
+               goto ERROR;
+       }
+
+       ret = net_nfc_app_util_appsvc_launch(operation, uri, mime, text);
+#if 0
+       if (ret == APPSVC_RET_ENOMATCH)
+       {
+               /* TODO : check again */
+               ret = net_nfc_app_util_appsvc_launch(operation, uri, mime, text);
+       }
+#endif
+
+       DEBUG_SERVER_MSG("net_nfc_app_util_appsvc_launch return %d", ret);
+
+       result = NET_NFC_OK;
+
+ERROR :
+       net_nfc_util_free_ndef_message(msg);
+
+       return result;
+}
+
+static bool net_nfc_app_util_is_dir(const char* path_name)
+{
+       struct stat statbuf = { 0 };
+
+       if (stat(path_name, &statbuf) == -1)
+       {
+               return false;
+       }
+
+       if (S_ISDIR(statbuf.st_mode) != 0)
+       {
+               return true;
+       }
+       else
+       {
+               return false;
+       }
+}
+
+void net_nfc_app_util_clean_storage(char* src_path)
+{
+       struct dirent* ent = NULL;
+       DIR* dir = NULL;
+
+       char path[1024] = { 0 };
+
+       if ((dir = opendir(src_path)) == NULL)
+       {
+               return;
+       }
+
+       while ((ent = readdir(dir)) != NULL)
+       {
+               if (strncmp(ent->d_name, ".", 1) == 0 || strncmp(ent->d_name, "..", 2) == 0)
+               {
+                       continue;
+               }
+               else
+               {
+                       snprintf(path, 1024, "%s/%s", src_path, ent->d_name);
+
+                       if (net_nfc_app_util_is_dir(path) != false)
+                       {
+                               net_nfc_app_util_clean_storage(path);
+                               rmdir(path);
+                       }
+                       else
+                       {
+                               unlink(path);
+                       }
+               }
+       }
+
+       closedir(dir);
+
+       rmdir(src_path);
+}
+
 void net_nfc_app_util_aul_launch_app(char* package_name, bundle* kb)
 {
        int result = 0;
@@ -679,7 +677,7 @@ int net_nfc_app_util_appsvc_launch(const char *operation, const char *uri, const
        {
                DEBUG_SERVER_MSG("operation : %s", operation);
                appsvc_set_operation(bd, operation);
-       }
+       }
 
        if (uri != NULL && strlen(uri) > 0)
        {
@@ -893,3 +891,88 @@ bool net_nfc_app_util_check_launch_state()
 
        return result;
 }
+
+static void _play_sound_callback(int id, void *data)
+{
+       DEBUG_MSG("_play_sound_callback");
+
+       if (WAV_PLAYER_ERROR_NONE != wav_player_stop(id))
+       {
+               DEBUG_MSG("wav_player_stop failed");
+       }
+}
+
+void net_nfc_manager_util_play_sound(net_nfc_sound_type_e sound_type)
+{
+       int bSoundOn = 0;
+       int bVibrationOn = 0;
+
+       if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &bSoundOn) != 0)
+       {
+               DEBUG_MSG("vconf_get_bool failed for Sound");
+               return;
+       }
+
+       if (vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &bVibrationOn) != 0)
+       {
+               DEBUG_MSG("vconf_get_bool failed for Vibration");
+               return;
+       }
+
+       if ((sound_type > NET_NFC_TASK_ERROR) || (sound_type < NET_NFC_TASK_START))
+       {
+               DEBUG_MSG("Invalid Sound Type");
+               return;
+       }
+
+       if (bVibrationOn)
+       {
+               int svi_handle = -1;
+
+               DEBUG_MSG("Play Vibration");
+
+               if (SVI_SUCCESS == svi_init(&svi_handle))
+               {
+                       if (SVI_SUCCESS == svi_play_vib(svi_handle, SVI_VIB_TOUCH_SIP))
+                       {
+                               DEBUG_MSG("svi_play_vib success");
+                       }
+
+                       svi_fini(svi_handle);
+               }
+       }
+
+       if (bSoundOn)
+       {
+               char *sound_path = NULL;
+
+               DEBUG_MSG("Play Sound");
+
+               switch (sound_type)
+               {
+               case NET_NFC_TASK_START :
+                       sound_path = strdup(NET_NFC_MANAGER_SOUND_PATH_TASK_START);
+                       break;
+               case NET_NFC_TASK_END :
+                       sound_path = strdup(NET_NFC_MANAGER_SOUND_PATH_TASK_END);
+                       break;
+               case NET_NFC_TASK_ERROR :
+                       sound_path = strdup(NET_NFC_MANAGER_SOUND_PATH_TASK_ERROR);
+                       break;
+               }
+
+               if (sound_path != NULL)
+               {
+                       if (WAV_PLAYER_ERROR_NONE == wav_player_start(sound_path, SOUND_TYPE_MEDIA, _play_sound_callback, NULL, NULL))
+                       {
+                               DEBUG_MSG("wav_player_start success");
+                       }
+
+                       _net_nfc_util_free_mem(sound_path);
+               }
+               else
+               {
+                       DEBUG_ERR_MSG("Invalid Sound Path");
+               }
+       }
+}
similarity index 83%
rename from src/manager/include/net_nfc_app_util_internal.h
rename to daemon/net_nfc_server_util.h
index dd60a02..1b216e6 100644 (file)
@@ -13,8 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef __NET_NFC_APP_UTIL_INTERNAL_H__
-#define __NET_NFC_APP_UTIL_INTERNAL_H__
+#ifndef __NET_NFC_SERVER_UTIL_H__
+#define __NET_NFC_SERVER_UTIL_H__
 
 #include <aul.h>
 #include "net_nfc_typedef_internal.h"
 #define MESSAGE_STORAGE "/opt/share/service/nfc-manager"
 #endif
 
-net_nfc_error_e net_nfc_app_util_store_ndef_message(data_s *data);
+typedef enum
+{
+       NET_NFC_TASK_START = 0x00,
+       NET_NFC_TASK_END,
+       NET_NFC_TASK_ERROR
+} net_nfc_sound_type_e;
+
+void net_nfc_manager_util_play_sound(net_nfc_sound_type_e sound_type);
+
 net_nfc_error_e net_nfc_app_util_process_ndef(data_s *data);
 void net_nfc_app_util_aul_launch_app(char* package_name, bundle* kb);
 void net_nfc_app_util_clean_storage(char* src_path);
-bool net_nfc_app_util_is_dir(const char* path_name);
 int net_nfc_app_util_appsvc_launch(const char *operation, const char *uri, const char *mime, const char *data);
 int net_nfc_app_util_launch_se_transaction_app(uint8_t *aid, uint32_t aid_len, uint8_t *param, uint32_t param_len);
 int net_nfc_app_util_encode_base64(uint8_t *buffer, uint32_t buf_len, char *result, uint32_t max_result);
 int net_nfc_app_util_decode_base64(const char *buffer, uint32_t buf_len, uint8_t *result, uint32_t *res_len);
 bool net_nfc_app_util_check_launch_state();
 
-#endif //__NET_NFC_APP_UTIL_INTERNAL_H__
+#endif //__NET_NFC_SERVER_UTIL_H__
similarity index 96%
rename from src/manager/net_nfc_server_vconf.c
rename to daemon/net_nfc_server_vconf.c
index 5476c8c..174ea9a 100644 (file)
@@ -30,10 +30,10 @@ static gboolean powered_off_by_flightmode = FALSE;
 static void vconf_set_flight_mode(int boolval);
 
 static void net_nfc_server_vconf_pm_state_changed(keynode_t *key,
-                                               void *user_data);
+               void *user_data);
 
 static void net_nfc_server_vconf_flight_mode_changed(keynode_t *key,
-                                               void *user_data);
+               void *user_data);
 
 
 static void vconf_set_flight_mode(int boolval)
@@ -51,7 +51,7 @@ static void vconf_set_flight_mode(int boolval)
 }
 
 static void net_nfc_server_vconf_pm_state_changed(keynode_t *key,
-                                               void *user_data)
+               void *user_data)
 {
        gint state = 0;
        gint pm_state = 0;
@@ -81,7 +81,7 @@ static void net_nfc_server_vconf_pm_state_changed(keynode_t *key,
 }
 
 static void net_nfc_server_vconf_flight_mode_changed(keynode_t *key,
-                                               void *user_data)
+               void *user_data)
 {
        gint flight_mode = 0;
        gint nfc_state = 0;
@@ -101,7 +101,7 @@ static void net_nfc_server_vconf_flight_mode_changed(keynode_t *key,
        if (result != 0)
        {
                DEBUG_ERR_MSG("Can not get %s",
-                              "VCONFKEY_NET_STATE");
+                               "VCONFKEY_NET_STATE");
        }
 
        DEBUG_SERVER_MSG("nfc_state %d", nfc_state);
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644 (file)
index 72e2214..0000000
+++ /dev/null
@@ -1,614 +0,0 @@
-nfc-manager (0.0.1-77) unstable; urgency=low
-
-  * JSR257 NDEF absoluteURI issue resolved
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-77
-
- -- Sechang Sohn <sc.sohn@samsung.com> Thu, 31 May 2012 10:18:24 +0900
-
-nfc-manager (0.0.1-76) unstable; urgency=low
-
-  * Add the function checking nfc feature
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-76
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com>  Wed, 30 May 2012 16:24:50 +0900
-
-nfc-manager (0.0.1-75) unstable; urgency=low
-
-  * Modify the plugin check routine
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-75
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Thu, 24 May 2012 17:00:11 +0900
-
-nfc-manager (0.0.1-74) unstable; urgency=low
-
-  * Add signature RTD library and ndef-tool
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-74
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com>  Mon, 21 May 2012 15:32:08 +0900
-
-nfc-manager (0.0.1-73) unstable; urgency=low
-
-  * Modify the Private vconf.
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-73
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Mon, 16 May 2012 11:00:11 +0900
-
-nfc-manager (0.0.1-72) unstable; urgency=low
-
-  * Modify the absolute uri.
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-72
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Mon, 14 May 2012 17:00:11 +0900
-
-nfc-manager (0.0.1-71) unstable; urgency=low
-
-  * Add the routine to initialize the vconf for nfc
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-71
-
- -- Junyong Sim <junyong.sim@samsung.com>  Mon, 07 May 2012 16:37:50 +0900
-
-nfc-manager (0.0.1-70) unstable; urgency=low
-
-  * Remove unused file
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-70
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com>  Fri, 04 May 2012 14:21:29 +0900
-
-nfc-manager (0.0.1-69) unstable; urgency=low
-
-  * Add the pm's lock&unlock api.
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-69
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Thu, 03 May 2012 17:00:11 +0900
-
-nfc-manager (0.0.1-68) unstable; urgency=low
-
-  * Remove the nfc-agent's daemon
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-68
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Thu, 26 Apr 2012 17:17:17 +0900
-
-nfc-manager (0.0.1-67) unstable; urgency=low
-
-  * initialize vconf value : db/nfc/feature
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-67
-
- -- Junyong Sim <junyong.sim@samsung.com>  Tue, 24 Apr 2012 21:17:17 +0900
-
-nfc-manager (0.0.1-66) unstable; urgency=low
-
-  * apply the access control in SE transaction.
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-66
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com>  Fri, 20 Apr 2012 11:00:00 +0900
-
-nfc-manager (0.0.1-65) unstable; urgency=low
-
-  * Check the state using nfc set state func
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-65
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Thu, 19 Apr 2012 13:54:15 +0900
-
-nfc-manager (0.0.1-64) unstable; urgency=low
-
-  * Modify the spec & net_nfc_set_state's return value
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-64
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Thu, 05 Apr 2012 19:32:15 +0900
-
-nfc-manager (0.0.1-63) unstable; urgency=low
-
-  * package upload
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-63
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Wed, 04 Apr 2012 16:58:15 +0900
-
-nfc-manager (0.0.1-62) unstable; urgency=low
-
-  * Check the plugin's so file for Pulic Version
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-62
-
- -- Sungjae Lim <neuezieil.lim@samsung.com>  Wed, 04 Apr 2012 10:58:15 +0900
-
-nfc-manager (0.0.1-61) unstable; urgency=low
-
-  * Add the routine to check tag stage
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-61
-
- -- Junyong Sim <junyong.sim@samsung.com>  Thu, 29 Mar 2012 14:38:15 +0900
-
-nfc-manager (0.0.1-60) unstable; urgency=low
-
-  * Modify SE event
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-60
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Fri, 16 Mar 2012 16:11:31 +0900
-
-nfc-manager (0.0.1-59) unstable; urgency=low
-
-  * change appsvc operation
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-59
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com>  Thu, 15 Mar 2012 15:30:00 +0900
-
-nfc-manager (0.0.1-58) unstable; urgency=low
-
-  * bug fix about trans param
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-58
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Thu, 15 Mar 2012 11:06:38 +0900
-
-nfc-manager (0.0.1-57) unstable; urgency=low
-
-  * remove capi dependency
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-57
-
- -- Junyong Sim <junyong.sim@samsung.com>  Wed, 14 Mar 2012 19:54:13 +0900
-
-nfc-manager (0.0.1-56) unstable; urgency=low
-
-  * Broadcasting enable
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-56
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Mon, 12 Mar 2012 16:52:39 +0900
-
-nfc-manager (0.0.1-55) unstable; urgency=low
-
-  * Tag connection check api change
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-55
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Wed, 07 Mar 2012 17:21:51 +0900
-
-nfc-manager (0.0.1-54) unstable; urgency=low
-
-  * add new client api
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-54
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Tue, 06 Mar 2012 20:30:19 +0900
-
-nfc-manager (0.0.1-53) unstable; urgency=low
-
-  * fix the crash issue of nfc manager in emulator
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-53
-
- -- Junyong Sim <junyong.sim@samsung.com>  Mon, 05 Mar 2012 10:02:00 +0900
-
-nfc-manager (0.0.1-52) unstable; urgency=low
-
-  * Upload package
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-52
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com>  Mon, 27 Feb 2012 17:00:00 +0900
-
-nfc-manager (0.0.1-51) unstable; urgency=low
-
-  * Implement the check routin to distinguish the driver
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-51
-
- -- Sechang Sohn <sc.sohn@samsung.com>  Tue, 21 Feb 2012 13:06:37 +0900
-
-nfc-manager (0.0.1-50) unstable; urgency=low
-
-  * Implement the check routin to distinguish the driver
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-50
-
- -- Sungjae Lim <neuezieil.lim@samsung.com>  Mon, 20 Feb 2012 10:36:28 +0900
-
-nfc-manager (0.0.1-49) unstable; urgency=low
-
-  * Update changelog
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-49
-
- -- Junyong Sim <junyong.sim@samsung.com>  Mon, 06 Feb 2012 10:36:28 +0900
-
-nfc-manager (0.0.1-48) unstable; urgency=low
-
-  * Implement the polling loop after wake-up.
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-48
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Fri, 03 Feb 2012 14:47:35 +0900
-
-nfc-manager (0.0.1-47) unstable; urgency=low
-
-  * Modify the LTO value from 10 to 100.
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-47
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Wed, 01 Feb 2012 09:23:35 +0900
-
-nfc-manager (0.0.1-46) unstable; urgency=low
-
-  * Fix build error when is using cxx compiler
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-46
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com>  Thu, 26 Jan 2012 15:00:35 +0900
-
-nfc-manager (0.0.1-45) unstable; urgency=low
-
-  * Change IPC request algorithm from client to server
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-45
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com>  Thu, 29 Dec 2011 13:00:35 +0900
-
-nfc-manager (0.0.1-44) unstable; urgency=low
-
-  * modify changelog
-  * Git: slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-44
-
- -- Junyong Sim <junyong.sim@samsung.com>  Thu, 15 Dec 2011 18:58:35 +0900
-
-nfc-manager (0.0.1-43) unstable; urgency=low
-
-  * Change ambiguous value name and option name
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-43
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Wed, 07 Dec 2011 12:45:19 +0900
-
-nfc-manager (0.0.1-42) unstable; urgency=low
-
-  * Clean unused code
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-42
-
- -- Wonkyu kwon <wonkyu.kwon@samsung.com>  Tue, 06 Dec 2011 17:40:00 +0900
-nfc-manager (0.0.1-41) unstable; urgency=low
-
-  *Modify the code
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-41
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Tue, 06 Dec 2011 12:40:45 +0900
-
-nfc-manager (0.0.1-40) unstable; urgency=low
-
-  *Change AUTHORS.
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-40
-
- -- Junyong Sim <junyong.sim@samsung.com>  Sat, 03 Dec 2011 13:05:45 +0900
-
-nfc-manager (0.0.1-39) unstable; urgency=low
-
-  *Package Upload.
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-39
-
- -- sungjae.lim <neueziel.lim@samsung.com>  Fri, 02 Dec 2011 19:57:07 +0900
-
-nfc-manager (0.0.1-38) unstable; urgency=low
-
-  *Change the boilerplate.
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-38
-
- -- sungjae.lim <neueziel.lim@samsung.com>  Fri, 02 Dec 2011 19:00:07 +0900
-
-nfc-manager (0.0.1-37) unstable; urgency=low
-
-  *Change the function name for 3rd part.
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-37
-
- -- sungjae.lim <neueziel.lim@samsung.com>  Fri, 02 Dec 2011 11:20:07 +0900
-
-nfc-manager (0.0.1-36) unstable; urgency=low
-
-  *Bug fix.
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-36
-
- -- constant.lee <constant.lee@samsung.com>  Thu, 01 Dec 2011 21:08:07 +0900
-
-nfc-manager (0.0.1-35) unstable; urgency=low
-
-  *Change the boilerplate.
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-35
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Thu, 01 Dec 2011 15:55:42 +0900
-
-nfc-manager (0.0.1-34) unstable; urgency=low
-
-  * Package upload
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-34
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com>  Wed, 30 Nov 2011 18:00:00 +0900
-
-nfc-manager (0.0.1-33) unstable; urgency=low
-
-  *some error value change
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-33
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Tue, 29 Nov 2011 14:45:40 +0900
-
-nfc-manager (0.0.1-32) unstable; urgency=low
-
-  *NET_NFC_MESSSAGE_P2P_RECEIVE problem fix 
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-32
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Tue, 29 Nov 2011 13:07:01 +0900
-
-nfc-manager (0.0.1-31) unstable; urgency=low
-
-  *p2p popup problem fix.
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-31 
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Fri, 25 Nov 2011 15:04:48 +0900
-
-nfc-manager (0.0.1-30) unstable; urgency=low
-
-  *bug fix
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag : nfc-manager_0.0.1-30 
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Fri, 18 Nov 2011 12:45:58 +0900
-
-nfc-manager (0.0.1-29) unstable; urgency=low
-
-  *LLCP problem was fixed. and some message name change.
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-29
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Wed, 16 Nov 2011 22:55:18 +0900
-
-nfc-manager (0.0.1-28) unstable; urgency=low
-
-  *NXP parser was seperated to net_nfc_util_ndef_parser.c
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-28 
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Wed, 02 Nov 2011 18:30:57 +0900
-
-nfc-manager (0.0.1-27) unstable; urgency=low
-
-  *Modify app launch condition
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-27
-
- -- Wonkyu Kwon <wonkyu.kwon@samsung.com>  Wed, 02 Nov 2011 13:50:00 +0900
-
-nfc-manager (0.0.1-26) unstable; urgency=low
-
-  *ndef memory problem fix
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-26
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Mon, 31 Oct 2011 17:54:56 +0900
-
-nfc-manager (0.0.1-25) unstable; urgency=low
-
-  *LLCP flow change. 
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-25
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Fri, 28 Oct 2011 14:57:26 +0900
-
-nfc-manager (0.0.1-24) unstable; urgency=low
-
-  *Change the boilerplate.
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-24
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Thu, 27 Oct 2011 14:55:42 +0900
-
-nfc-manager (0.0.1-23) unstable; urgency=low
-
-  *Add the NPP for android NFC.
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-23
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Wed, 26 Oct 2011 17:19:02 +0900
-
-nfc-manager (0.0.1-22) unstable; urgency=low
-
-  *Modify the code for Prevent.
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-22
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Mon, 24 Oct 2011 19:38:59 +0900
-
-nfc-manager (0.0.1-21ubuntu2) unstable; urgency=low
-
-  *add server state.
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-21
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Wed, 12 Oct 2011 20:10:02 +0900
-
-nfc-manager (0.0.1-20ubuntu1) unstable; urgency=low
-
-  *bug fix. when read ndef fail, data was free two times.
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-20 
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Mon, 10 Oct 2011 18:51:42 +0900
-
-nfc-manager (0.0.1-19) unstable; urgency=low
-
-  *Add message broadcasting. and implement net_nfc_get_server_state
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-19
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Thu, 06 Oct 2011 16:01:59 +0900
-
-nfc-manager (0.0.1-18) unstable; urgency=low
-
-  *Add the prefix net to the NFC Manager FW
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-18
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Thu, 22 Sep 2011 16:51:30 +0900
-
-nfc-manager (0.0.1-17) unstable; urgency=low
-
-  *Add the prefix net to the common and client lib
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-17
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Tue, 20 Sep 2011 10:48:30 +0900
-
-nfc-manager (0.0.1-16) unstable; urgency=low
-
-  *Modify the manager for setting and exchanger
-  *Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  *Tag: nfc-manager_0.0.1-16
-
- -- Sungjae Lim <neueziel.lim@samsung.com>  Wed, 7 Sep 2011 19:19:20 +0900
-
-nfc-manager (0.0.1-15) unstable; urgency=low
-
-  * add NDEF parser
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-15
-
- -- Sangsoo Lee <constant.lee@samsung.com>  Wed, 24 Aug 2011 15:27:30 +0900
-
-nfc-manager (0.0.1-14) unstable; urgency=low
-
-  * change the traceive function parameter
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-14
-
- -- root <bumj.kim@samsung.com>  Mon, 27 Jun 2011 20:15:09 +0900
-
-nfc-manager (0.0.1-13) unstable; urgency=low
-
-  * updates package for CAPI
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-13
-
- -- root <bumj.kim@samsung.com>  Fri, 24 Jun 2011 18:52:20 +0900
-
-nfc-manager (0.0.1-12) unstable; urgency=low
-
-  * adding missing header file
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-12
-
- -- root <bumj.kim@samsung.com>  Wed, 15 Jun 2011 10:04:58 +0900
-
-nfc-manager (0.0.1-11) unstable; urgency=low
-
-  * Change llcp connection policy and sepcific API for tags
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-11
-
- -- root <bumj.kim@samsung.com>  Wed, 15 Jun 2011 09:47:21 +0900
-
-nfc-manager (0.0.1-10) unstable; urgency=low
-
-  * fix the compile error and add comments of exception
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-10
-
- -- root <bumj.kim@samsung.com>  Wed, 18 May 2011 14:31:45 +0900
-
-nfc-manager (0.0.1-9) unstable; urgency=low
-
-  * update NFC manager API and split the solution package and manger package
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-9 
-
- -- root <bumj.kim@samsung.com>  Wed, 18 May 2011 14:27:37 +0900
-
-nfc-manager (0.0.1-8) unstable; urgency=low
-
-  * remove the dependency of bt-engine 
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-8 
-
- -- Bumjoon Kim <bumj.kim@samsung.com>  Fri, 11 Mar 2011 09:52:48 +0900
-
-nfc-manager (0.0.1-7) unstable; urgency=low
-
-  * fix the prevent issues extra
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-7 
-
- -- Bumjoon Kim <bumj.kim@samsung.com>  Thu, 17 Feb 2011 17:12:47 +0900
-
-nfc-manager (0.0.1-6) unstable; urgency=low
-
-  * fix the prevent issues 
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-6 
-
- -- Bumjoon Kim <bumj.kim@samsung.com>  Tue, 15 Feb 2011 21:12:22 +0900
-
-nfc-manager (0.0.1-5) unstable; urgency=low
-
-  * enhance the stablity of nfc-manager
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-5 
-
- -- Bumjoon Kim <bumj.kim@samsung.com>  Tue, 01 Feb 2011 18:21:56 +0900
-
-nfc-manager (0.0.1-4) unstable; urgency=low
-
-  * Vice President demo version
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-4 
-
- -- Bumjoon Kim <bumj.kim@samsung.com>  Thu, 27 Jan 2011 13:49:18 +0900
-
-nfc-manager (0.0.1-3) unstable; urgency=low
-
-  * adding settup switch to enable disable nfc-manager
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-3 
-
- -- Bumjoon Kim <bumj.kim@samsung.com>  Mon, 24 Jan 2011 16:21:44 +0900
-
-nfc-manager (0.0.1-2) unstable; urgency=low
-
-  * nfc-manager and stand alone mode is enabled 
-  * Git: 165.213.180.234:slp/pkgs/n/nfc-manager
-  * Tag: nfc-manager_0.0.1-2
-
- -- Bumjoon Kim <bumj.kim@samsung.com>  Tue, 04 Jan 2011 20:21:19 +0900
-
-nfc-manager (0.0.1-1) unstable; urgency=low
-
-  * first source package for building
-
- -- hyogil.kim <hyogil.kim@samsung.com>  Wed, 3 Nov 2010 13:43:34 +0900
-
diff --git a/debian/compat b/debian/compat
deleted file mode 100644 (file)
index 7ed6ff8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian/control b/debian/control
deleted file mode 100644 (file)
index 5706b1d..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-Source: nfc-manager
-Section: libs
-Priority: extra
-Maintainer: Sangsoo Lee <constant.lee@samsung.com>, Sungjae Lim <sungjae.lim@samsung.com>, Sechang Sohn <sc.sohn@samsung.com>
-Build-Depends: debhelper (>= 5), libaul-1-dev, libglib2.0-dev, libvconf-dev, libsecurity-server-client-dev, libbluetooth-frwk-dev,libdbus-glib-1-dev, dlog-dev, libecore-dev, libslp-tapi-dev, libappsvc-dev, libcurl-dev, libheynoti-dev, libsvi-dev, libssl-dev, smartcard-service-dev, smartcard-service-common-dev, libslp-pm-dev
-Standards-Version: 0.0.1
-
-Package: libnfc-common-lib-0
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: NFC Common Library
-
-Package: libnfc-common-lib-dev
-Section: libs
-Architecture: any
-Depends: ${misc:Depends}, libnfc-common-lib-0 (= ${Source-Version})
-Description: NFC Common Library
-
-Package: libnfc-common-lib-dbg
-Section: debug
-Architecture: any
-Depends: ${misc:Depends}, libnfc-common-lib-0 (= ${Source-Version})
-Description: NFC Common Library (unstripped)
-
-Package: libnfc-manager-0
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libnfc-common-lib-0 (= ${Source-Version})
-Description: NFC freamework
-
-Package: libnfc-manager-dev
-Section: libs
-Architecture: any
-Depends: ${misc:Depends}, libnfc-manager-0 (= ${Source-Version})
-Description: NFC freamework
-
-Package: libnfc-manager-dbg
-Section: debug
-Architecture: any
-Depends: ${misc:Depends}, libnfc-manager-0 (= ${Source-Version})
-Description: NFC-manager (unstripped)
diff --git a/debian/libnfc-common-lib-0.install.in b/debian/libnfc-common-lib-0.install.in
deleted file mode 100644 (file)
index 0a7df14..0000000
+++ /dev/null
@@ -1 +0,0 @@
-@PREFIX@/lib/libnfc-common-lib.so.*
diff --git a/debian/libnfc-common-lib-0.postinst.in b/debian/libnfc-common-lib-0.postinst.in
deleted file mode 100644 (file)
index 2993487..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-#Add boot sequence script
-if [ ${USER} == "root" ]
-then
-vconftool set -t bool memory/private/nfc-manager/popup_disabled 0 -u 5000
-else
-vconftool set -t bool memory/private/nfc-manager/popup_disabled 0
-fi
diff --git a/debian/libnfc-common-lib-dbg.install.in b/debian/libnfc-common-lib-dbg.install.in
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/debian/libnfc-common-lib-dev.install.in b/debian/libnfc-common-lib-dev.install.in
deleted file mode 100644 (file)
index 836131f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-@PREFIX@/lib/pkgconfig/nfc-common-lib.pc
-@PREFIX@/include/nfc-common-lib/*
-@PREFIX@/lib/libnfc-common-lib.so
diff --git a/debian/libnfc-manager-0.init.in b/debian/libnfc-manager-0.init.in
deleted file mode 100644 (file)
index c5557cc..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:          nfc-agent
-# Required-Start:    
-# Required-Stop:
-# Default-Start:     3 5
-# Default-Stop:      0
-# Short-Description: NFC agent
-# Description:       NFC agent
-#                    
-#                    
-### END INIT INFO
-
-# Author: Wonkyu Kwon <wonkyu.kwon@samsung.com>
-
-# PATH should only include /usr/* if it runs after the mountnfs.sh script
-DAEMON=/usr/bin/nfc-manager-daemon
-DAEMON_ARGS=""             # Arguments to run the daemon with
-
-# Exit if the package is not installed
-[ -x $DAEMON ] || exit 0
-
-$DAEMON $DAEMON_ARGS &
diff --git a/debian/libnfc-manager-0.install.in b/debian/libnfc-manager-0.install.in
deleted file mode 100644 (file)
index 71fe461..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-@PREFIX@/lib/libnfc.so.*
-@PREFIX@/bin/*
-/etc/init.d/*
-/etc/rc.d/*
-
diff --git a/debian/libnfc-manager-0.postinst.in b/debian/libnfc-manager-0.postinst.in
deleted file mode 100644 (file)
index 30520f4..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-#Add boot sequence script
-if [ ${USER} == "root" ]
-then
-vconftool set -t bool db/nfc/feature 0 -u 5000
-vconftool set -t bool db/nfc/enable 0 -u 5000
-vconftool set -t bool db/nfc/sbeam 0 -u 5000
-else
-vconftool set -t bool db/nfc/feature 0
-vconftool set -t bool db/nfc/enable 0
-vconftool set -t bool db/nfc/sbeam 0
-fi
diff --git a/debian/libnfc-manager-dbg.install.in b/debian/libnfc-manager-dbg.install.in
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/debian/libnfc-manager-dev.install.in b/debian/libnfc-manager-dev.install.in
deleted file mode 100644 (file)
index 52e34bd..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-@PREFIX@/lib/pkgconfig/nfc.pc
-@PREFIX@/include/nfc/*
-@PREFIX@/lib/libnfc.so
diff --git a/debian/rules b/debian/rules
deleted file mode 100755 (executable)
index 22a2767..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-CFLAGS ?= -Wall -g
-CXXFLAGS ?=  -Wall -g
-LDFLAGS ?= 
-PREFIX ?= /usr
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-       CFLAGS += -O0
-       CXXFLAGS += -O0
-else
-       CFLAGS += -O2
-       CXXFLAGS += -O2
-endif
-
-LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
-
-CMAKE_TMP_DIR = $(CURDIR)/cmake_tmp
-
-
-configure: configure-stamp
-configure-stamp:
-       dh_testdir
-       # Add here commands to configure the package.
-       mkdir -p $(CMAKE_TMP_DIR);
-       cd $(CMAKE_TMP_DIR); CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX=$(PREFIX)
-
-       touch configure-stamp
-
-build: build-stamp
-
-build-stamp: configure-stamp 
-       dh_testdir
-
-       # Add here commands to compile the package.
-       cd $(CMAKE_TMP_DIR) && $(MAKE)
-       #docbook-to-man debian/wavplayer.sgml > wavplayer.1
-
-       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
-               cat $$f > $${f%.in}; \
-               sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
-       done
-
-
-       touch $@
-
-clean:
-       dh_testdir
-       dh_testroot
-       rm -f build-stamp configure-stamp
-
-       # Add here commands to clean up after the build process.
-       -cd $(CMAKE_TMP_DIR) && $(MAKE) clean
-       rm -rf $(CMAKE_TMP_DIR)
-
-       rm -rf CMakeCache.txt
-       rm -rf CMakeFiles
-       rm -rf cmake_install.cmake
-       rm -rf Makefile
-       rm -rf install_manifest.txt
-       rm -rf *.so
-
-       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
-               rm -f $${f%.in}; \
-       done
-
-       dh_clean 
-
-install: build
-       dh_testdir
-       dh_testroot
-       dh_clean -k 
-       dh_installdirs
-
-       mkdir -p $(CURDIR)/debian/tmp/etc/init.d
-       cp -af $(CURDIR)/debian/libnfc-manager-0.init.in $(CURDIR)/debian/tmp/etc/init.d/libnfc-manager-0
-       
-       # Add here commands to install the package into debian/wavplayer.
-       cd $(CMAKE_TMP_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
-       
-       mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/
-       mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc5.d/
-       
-       ln -s /etc/init.d/libnfc-manager-0 $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/S81libnfc-manager-0
-       ln -s /etc/init.d/libnfc-manager-0 $(CURDIR)/debian/tmp/etc/rc.d/rc5.d/S81libnfc-manager-0
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
-       dh_testdir
-       dh_testroot
-#      dh_installchangelogs 
-#      dh_installdocs
-#      dh_installexamples
-       dh_install --sourcedir=debian/tmp
-#      dh_installmenu
-#      dh_installdebconf       
-#      dh_installlogrotate
-#      dh_installemacsen
-#      dh_installpam
-#      dh_installmime
-#      dh_python
-#      dh_installinit
-#      dh_installcron
-#      dh_installinfo
-#      dh_installman
-       dh_link
-       dh_strip --dbg-package=libnfc-manager-dbg --dbg-package=libnfc-common-lib-dbg
-       dh_compress
-       dh_fixperms
-#      dh_perl
-       dh_makeshlibs
-       dh_installdeb
-       dh_shlibdeps
-       dh_gencontrol
-       dh_md5sums
-       dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
index d4c076b..c0b3673 100644 (file)
@@ -138,8 +138,7 @@ WARN_LOGFILE           =
 # directories like "/usr/src/myproject". Separate the files or directories
 # with spaces.
 
-#INPUT                  = .. 
-INPUT                  = ../src/commonlib/include/net_nfc_typedef.h ../src/clientlib/include/net_nfc_target_info.h ../src/clientlib/include/net_nfc_llcp.h ../src/clientlib/include/net_nfc_exchanger.h ../src/clientlib/include/net_nfc_ndef_message.h ../src/clientlib/include/net_nfc_data.h ../src/clientlib/include/net_nfc_ndef_record.h ../src/clientlib/include/net_nfc_apdu.h ../src/clientlib/include/net_nfc_tag.h ../src/clientlib/include/net_nfc.h ../src/clientlib/include/net_nfc_ndef_message_handover.h ../src/clientlib/include/net_nfc_tag_felica.h ../src/clientlib/include/net_nfc_tag_jewel.h ../src/clientlib/include/net_nfc_tag_mifare.h
+INPUT                  = ../common/include/ ../client/include/
 
 
 # This tag can be used to specify the character encoding of the source files that
diff --git a/packaging/libnfc-manager-0.init.in b/packaging/libnfc-manager-0.init.in
deleted file mode 100644 (file)
index 9137e56..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:          nfc-manager-daemon
-# Required-Start:
-# Required-Stop:
-# Default-Start:     3 5
-# Default-Stop:      0
-# Short-Description: NFC manager
-# Description:       NFC manager
-#
-#
-### END INIT INFO
-
-# Author: Wonkyu Kwon <wonkyu.kwon@samsung.com>
-
-# PATH should only include /usr/* if it runs after the mountnfs.sh script
-DAEMON=/usr/bin/nfc-manager-daemon
-DAEMON_ARGS="--daemon"             # Arguments to run the daemon with
-VCONFTOOL=/usr/bin/vconftool
-
-# Exit if the package is not installed
-[ -x $DAEMON ] || exit 0
-[ -x $VCONFTOOL ] || exit 0
-
-#if vconftool get db/nfc/enable | grep -q "db/nfc/enable, value = 1 (bool)"
-#then
-       if ! ps -f --ppid 1 | grep -q nfc-manager-daemon
-       then
-               $DAEMON $DAEMON_ARGS &
-       fi
-#fi
index d66805e..6421b9a 100644 (file)
@@ -2,11 +2,10 @@ Name:       nfc-manager
 Summary:    NFC framework manager
 Version: 0.1.0
 Release:    0
-Group:      libs
+Group:      Network & Connectivity/NFC
 License:    Flora Software License
 Source0:    %{name}-%{version}.tar.gz
-Source1:    libnfc-manager-0.init.in
-Source2:    nfc-manager.service
+Source1:    %{name}.service
 Source1001:    %{name}.manifest
 BuildRequires: cmake
 BuildRequires: pkgconfig(aul)
@@ -38,7 +37,7 @@ Requires:         nfc-client-lib = %{version}
 
 
 %description
-NFC library Manager.
+Tizen NFC framework manager.
 
 
 %prep
@@ -47,7 +46,7 @@ cp %{SOURCE1001} .
 
 %package -n nfc-common-lib
 Summary:    NFC common library
-Group:      Development/Libraries
+Group:      Network & Connectivity/Development
 
 
 %description -n nfc-common-lib
@@ -56,70 +55,68 @@ NFC Common library.
 
 %package -n nfc-common-lib-devel
 Summary:    NFC common library (devel)
-Group:      libs
+Group:      Network & Connectivity/Development
 Requires:   nfc-common-lib = %{version}
 
 
 %description -n nfc-common-lib-devel
-NFC common library (devel)
+NFC manager common library for internal development.
 
 
 %package -n nfc-client-lib
 Summary:    NFC client library
-Group:      Development/Libraries
+Group:      Network & Connectivity/NFC
 Requires:   nfc-common-lib = %{version}
 
 
 %description -n nfc-client-lib
-NFC Client library.
+NFC manager Client library for NFC client applications.
 
 
 %package -n nfc-client-lib-devel
 Summary:    NFC client library (devel)
-Group:      libs
+Group:      Network & Connectivity/Development
 Requires:   nfc-client-lib = %{version}
 
 
 %description -n nfc-client-lib-devel
-NFC client library (devel)
+NFC manager Client library for developing NFC client applications.
 
 
-#%package -n nfc-client-test
+
+#%%package -n nfc-client-test
 #Summary:    NFC client test
-#Group:      Development/Libraries
-#Requires:   %{name} = %{version}-%{release}
+#Group:      Network & Connectivity/NFC
+#Requires:   %%{name} = %%{version}
 
 
-#%description -n nfc-client-test
+#%%description -n nfc-client-test
 #NFC client test (devel)
 
 
 %build
-export LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--as-needed"
-LDFLAGS="$LDFLAGS" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version}
 
 
 %install
 %make_install
 
-install -D -m 0755 %SOURCE1 %{buildroot}%{_sysconfdir}/init.d/libnfc-manager-0
 mkdir -p %{buildroot}/opt/usr/share/nfc_debug
 
 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
-cp -af %{SOURCE2} %{buildroot}%{_libdir}/systemd/system/
+cp -af %{SOURCE1} %{buildroot}%{_libdir}/systemd/system/
 ln -s ../%{name}.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/%{name}.service
 
 %post
 /sbin/ldconfig
-#ln -s /etc/init.d/libnfc-manager-0 /etc/rc.d/rc3.d/S81libnfc-manager-0 -f
-#ln -s /etc/init.d/libnfc-manager-0 /etc/rc.d/rc5.d/S81libnfc-manager-0 -f
-
 
 systemctl daemon-reload
 if [ $1 == 1 ]; then
     systemctl restart %{name}.service
 fi
 
+%post -n nfc-common-lib -p /sbin/ldconfig
 
 %post -n nfc-client-lib
 /sbin/ldconfig
@@ -131,31 +128,23 @@ vconftool set -t bool db/nfc/enable 0 -u 5000 -f
 
 %postun
 /sbin/ldconfig
-#mkdir -p /etc/rc.d/rc3.d
-#mkdir -p /etc/rc.d/rc5.d
-#rm -f /etc/rc.d/rc3.d/S81libnfc-manager-0
-#rm -f /etc/rc.d/rc5.d/S81libnfc-manager-0
-
 if [ $1 == 0 ]; then
     systemctl stop %{name}.service
 fi
 systemctl daemon-reload
 
-
-%post -n nfc-common-lib -p /sbin/ldconfig
-
-
 %postun -n nfc-common-lib -p /sbin/ldconfig
 
+%postun -n nfc-client-lib -p /sbin/ldconfig
+
 
 %files
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
 %{_bindir}/nfc-manager-daemon
-#%{_bindir}/ndef-tool
+#%%{_bindir}/ndef-tool
 %{_libdir}/systemd/system/%{name}.service
 %{_libdir}/systemd/system/multi-user.target.wants/%{name}.service
-%{_sysconfdir}/init.d/libnfc-manager-0
 %{_datadir}/dbus-1/services/org.tizen.NetNfcService.service
 %{_datadir}/packages/%{name}.xml
 %{_datadir}/nfc-manager-daemon/sounds/*
@@ -171,7 +160,6 @@ systemctl daemon-reload
 
 
 %files -n nfc-client-lib-devel
-%manifest %{name}.manifest
 %defattr(-,root,root,-)
 %{_libdir}/libnfc.so
 %{_libdir}/pkgconfig/nfc.pc
@@ -181,21 +169,19 @@ systemctl daemon-reload
 %files -n nfc-common-lib
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
-%{_libdir}/libnfc-common-lib.so.*
-%{_datadir}/nfc-manager-daemon/sounds/*
+%{_libdir}/libnfc-common.so.*
 %license LICENSE.Flora
 
 
 %files -n nfc-common-lib-devel
-%manifest %{name}.manifest
 %defattr(-,root,root,-)
-%{_libdir}/libnfc-common-lib.so
-%{_libdir}/pkgconfig/nfc-common-lib.pc
-%{_includedir}/nfc-common-lib/*.h
+%{_libdir}/libnfc-common.so
+%{_libdir}/pkgconfig/nfc-common.pc
+%{_includedir}/nfc-common/*.h
 
 
-#%files -n nfc-client-test
-#%manifest nfc-client-test.manifest
-#%defattr(-,root,root,-)
-#%{_bindir}/nfc_client
-#%license LICENSE.Flora
+#%%files -n nfc-client-test
+#%%manifest nfc-client-test.manifest
+#%%defattr(-,root,root,-)
+#%%{_bindir}/nfc_client
+#%%license LICENSE.Flora
diff --git a/src/clientlib/CMakeLists.txt b/src/clientlib/CMakeLists.txt
deleted file mode 100644 (file)
index 26e69bd..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(nfc-client-lib C)
-
-#SET(NFC_CLIENT_LIB "nfc-client-lib")
-SET(NFC_CLIENT_LIB "nfc")
-SET(VERSION_MAJOR 1)
-SET(VERSION ${VERSION_MAJOR}.0.0)
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
-include_directories(${CMAKE_SOURCE_DIR}/src/commonlib)
-include_directories(${CMAKE_SOURCE_DIR}/src/commonlib/include)
-include_directories(${CMAKE_SOURCE_DIR}/src/manager/include)
-
-AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} CLIENT_SRCS)
-
-IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-       SET(CMAKE_BUILD_TYPE "Release")
-ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(clientlib_pkges REQUIRED security-server dlog ecore-x vconf)
-
-FOREACH(flag ${clientlib_pkges_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-MESSAGE("CHECK MODULE in MANAGER ${clientlib_pkges_LDFLAGS}")
-
-# this for NFC flag
-
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -pipe -fomit-frame-pointer -Wall -Wno-trigraphs -Werror-implicit-function-declaration  -fno-strict-aliasing -Wl,-zdefs -fvisibility=hidden")
-
-SET(ARM_CFLAGS "${ARM_CLAGS} -mapcs -mno-sched-prolog -mabi=aapcs-linux -Uarm -fno-common -fpic")
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration")
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-
-FIND_PROGRAM(UNAME NAMES uname)
-EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
-IF("${ARCH}" MATCHES "^arm.*")
-       ADD_DEFINITIONS("-DTARGET")
-       MESSAGE("add -DTARGET")
-       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARM_CFLAGS}")
-ENDIF()
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
-
-ADD_LIBRARY(${NFC_CLIENT_LIB} SHARED ${CLIENT_SRCS})
-SET_TARGET_PROPERTIES(${NFC_CLIENT_LIB} PROPERTIES SOVERSION ${VERSION_MAJOR})
-SET_TARGET_PROPERTIES(${NFC_CLIENT_LIB} PROPERTIES VERSION ${VERSION})
-TARGET_LINK_LIBRARIES(${NFC_CLIENT_LIB} ${clientlib_pkges_LDFLAGS} nfc-common-lib)
-
-LINK_DIRECTORIES(${CMAKE_BUILD_DIR}/src/commonlib)
-
-
-SET(CLIENT_HEADER
-       ${CMAKE_SOURCE_DIR}/src/commonlib/include/net_nfc_typedef.h
-       include/net_nfc.h
-       include/net_nfc_data.h
-       include/net_nfc_target_info.h
-       include/net_nfc_ndef_message.h
-       include/net_nfc_ndef_record.h
-       include/net_nfc_sign_record.h
-       include/net_nfc_ndef_message_handover.h
-       include/net_nfc_client_context.h
-       include/net_nfc_client_manager.h
-       include/net_nfc_client_system_handler.h
-       include/net_nfc_client_transceive.h
-       include/net_nfc_client_tag.h
-       include/net_nfc_client_ndef.h
-       include/net_nfc_client_llcp.h
-       include/net_nfc_client_p2p.h
-       include/net_nfc_client_snep.h
-       include/net_nfc_client_exchanger.h
-       include/net_nfc_client_handover.h
-       include/net_nfc_client_se.h
-       include/net_nfc_client_tag_felica.h
-       include/net_nfc_client_tag_jewel.h
-       include/net_nfc_tag_mifare.h
-       include/net_nfc_client_test.h
-)
-
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/nfc.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/nfc.pc)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/nfc.pc DESTINATION lib/pkgconfig)
-
-INSTALL(TARGETS ${NFC_CLIENT_LIB} DESTINATION lib)
-
-FOREACH(hfile ${CLIENT_HEADER})
-               INSTALL(FILES ${hfile} DESTINATION include/nfc)
-ENDFOREACH(hfile)
diff --git a/src/clientlib/net_nfc_client_ndef_message_handover.c b/src/clientlib/net_nfc_client_ndef_message_handover.c
deleted file mode 100644 (file)
index 3640e43..0000000
+++ /dev/null
@@ -1,162 +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_ndef_message_handover.h"
-
-#include "net_nfc_typedef_internal.h"
-#include "net_nfc_debug_internal.h"
-#include "net_nfc_util_internal.h"
-#include "net_nfc_util_handover.h"
-
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
-#include <glib.h>
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_carrier_config (net_nfc_carrier_config_h * config, net_nfc_conn_handover_carrier_type_e type)
-{
-       return  net_nfc_util_create_carrier_config ((net_nfc_carrier_config_s **) config, type);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_add_carrier_config_property (net_nfc_carrier_config_h config, uint16_t attribute, uint16_t size, uint8_t * data)
-{
-       return net_nfc_util_add_carrier_config_property ((net_nfc_carrier_config_s *) config, attribute, size, data);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_remove_carrier_config_property (net_nfc_carrier_config_h config, uint16_t attribute)
-{
-       return net_nfc_util_remove_carrier_config_property ((net_nfc_carrier_config_s *) config, attribute);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_carrier_config_property (net_nfc_carrier_config_h config, uint16_t attribute, uint16_t * size, uint8_t ** data)
-{
-       return net_nfc_util_get_carrier_config_property ((net_nfc_carrier_config_s *) config, attribute, size, data);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_append_carrier_config_group (net_nfc_carrier_config_h config, net_nfc_property_group_h group)
-{
-       return net_nfc_util_append_carrier_config_group ((net_nfc_carrier_config_s *) config, (net_nfc_carrier_property_s *) group);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_remove_carrier_config_group (net_nfc_carrier_config_h config, net_nfc_property_group_h group)
-{
-       return net_nfc_util_remove_carrier_config_group ((net_nfc_carrier_config_s *) config, (net_nfc_carrier_property_s *) group);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_carrier_config_group (net_nfc_carrier_config_h config, int index, net_nfc_property_group_h * group)
-{
-       return net_nfc_util_get_carrier_config_group ((net_nfc_carrier_config_s *) config, index, (net_nfc_carrier_property_s **) group);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_free_carrier_config (net_nfc_carrier_config_h config)
-{
-       return net_nfc_util_free_carrier_config ((net_nfc_carrier_config_s *) config);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_carrier_config_group (net_nfc_property_group_h * group, uint16_t attribute)
-{
-       return net_nfc_util_create_carrier_config_group ((net_nfc_carrier_property_s **) group, attribute);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_add_carrier_config_group_property (net_nfc_property_group_h group, uint16_t attribute, uint16_t size, uint8_t * data)
-{
-       return net_nfc_util_add_carrier_config_group_property ((net_nfc_carrier_property_s*) group, attribute, size, data);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_carrier_config_group_property (net_nfc_property_group_h group, uint16_t attribute, uint16_t *size, uint8_t ** data)
-{
-       return net_nfc_util_get_carrier_config_group_property ((net_nfc_carrier_property_s*) group, attribute, size, data);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_remove_carrier_config_group_property (net_nfc_property_group_h group, uint16_t attribute)
-{
-       return net_nfc_util_remove_carrier_config_group_property ((net_nfc_carrier_property_s*) group, attribute);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_free_carrier_group (net_nfc_property_group_h group)
-{
-       return net_nfc_util_free_carrier_group ((net_nfc_carrier_property_s*) group);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_ndef_record_with_carrier_config (ndef_record_h * record, net_nfc_carrier_config_h config)
-{
-       return net_nfc_util_create_ndef_record_with_carrier_config ((ndef_record_s**) record, (net_nfc_carrier_config_s *) config);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_carrier_config_from_config_record (net_nfc_carrier_config_h * config, ndef_record_h record)
-{
-       return  net_nfc_util_create_carrier_config_from_config_record ((net_nfc_carrier_config_s **) config, (ndef_record_s *) record);
-
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_append_carrier_config_record (ndef_message_h message, ndef_record_h record, net_nfc_conn_handover_carrier_state_e power_status)
-{
-       return net_nfc_util_append_carrier_config_record ((ndef_message_s *) message, (ndef_record_s *) record, power_status);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_remove_carrier_config_record (ndef_message_h message, ndef_record_h record)
-{
-       return net_nfc_util_remove_carrier_config_record ((ndef_message_s *) message, (ndef_record_s *) record);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_carrier_config_record (ndef_message_h message, int index, ndef_record_h * record)
-{
-       return net_nfc_util_get_carrier_config_record ((ndef_message_s *) message, index, (ndef_record_s **) record);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_handover_random_number(ndef_message_h message, unsigned short* random_number)
-{
-       return net_nfc_util_get_handover_random_number((ndef_message_s *) message,  random_number);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_alternative_carrier_record_count (ndef_message_h message,  unsigned int * count)
-{
-       return net_nfc_util_get_alternative_carrier_record_count ((ndef_message_s *) message,  count);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_alternative_carrier_power_status (ndef_message_h message, int index, net_nfc_conn_handover_carrier_state_e * power_state)
-{
-       return net_nfc_util_get_alternative_carrier_power_status ((ndef_message_s *) message, index, power_state);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_set_alternative_carrier_power_status (ndef_message_h message, int index, net_nfc_conn_handover_carrier_state_e power_status)
-{
-       return net_nfc_util_set_alternative_carrier_power_status ((ndef_message_s *) message, index, power_status);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_get_alternative_carrier_type (ndef_message_h message, int index, net_nfc_conn_handover_carrier_type_e * type)
-{
-       return net_nfc_util_get_alternative_carrier_type ((ndef_message_s *) message,  index, type);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_handover_request_message (ndef_message_h * message)
-{
-       return net_nfc_util_create_handover_request_message ((ndef_message_s **) message);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_handover_select_message (ndef_message_h * message)
-{
-       return net_nfc_util_create_handover_select_message((ndef_message_s **) message);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_create_handover_error_record (ndef_record_h * record, uint8_t reason, uint32_t data)
-{
-       return net_nfc_util_create_handover_error_record ((ndef_record_s**) record, reason, data);
-}
-
-
diff --git a/src/clientlib/net_nfc_client_sign_record.c b/src/clientlib/net_nfc_client_sign_record.c
deleted file mode 100644 (file)
index 9d93847..0000000
+++ /dev/null
@@ -1,42 +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_util_sign_record.h"
-
-#ifndef NET_NFC_EXPORT_API
-#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
-#endif
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_sign_records(ndef_message_h msg, int begin_index, int end_index, char *cert_file, char *password)
-{
-       return net_nfc_util_sign_records((ndef_message_s *)msg, begin_index, end_index, cert_file, password);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_sign_ndef_message(ndef_message_h msg, char *cert_file, char *password)
-{
-       return net_nfc_util_sign_ndef_message((ndef_message_s *)msg, cert_file, password);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_verify_signature_ndef_message(ndef_message_h msg)
-{
-       return net_nfc_util_verify_signature_ndef_message((ndef_message_s *)msg);
-}
-
-NET_NFC_EXPORT_API net_nfc_error_e net_nfc_verify_signature_records(ndef_record_h begin_record, ndef_record_h sign_record)
-{
-       return net_nfc_util_verify_signature_records((ndef_record_s *)begin_record, (ndef_record_s *)sign_record);
-}
diff --git a/src/clientlib/net_nfc_client_util.c b/src/clientlib/net_nfc_client_util.c
deleted file mode 100644 (file)
index 60e6125..0000000
+++ /dev/null
@@ -1,21 +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 <stdlib.h>
-#include <string.h>
-
-#include "net_nfc_client_util_internal.h"
-
diff --git a/src/clientlib/nfc.pc.in b/src/clientlib/nfc.pc.in
deleted file mode 100644 (file)
index 1930885..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=/usr
-exec_prefix=${prefix}/bin
-libdir=@LIB_INSTALL_DIR@
-includedir=${prefix}/include
-
-Name: nfc
-Description: NFC
-Version: $version
-Requires:
-Libs: -lnfc
-Cflags: -I/usr/include/nfc
\ No newline at end of file
diff --git a/src/commonlib/CMakeLists.txt b/src/commonlib/CMakeLists.txt
deleted file mode 100644 (file)
index 6098a8d..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(nfc-common-lib C)
-
-SET(NFC_COMMON_LIB "nfc-common-lib")
-SET(VERSION_MAJOR 1)
-SET(VERSION ${VERSION_MAJOR}.0.0)
-
-FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen)
-EXEC_PROGRAM(${GDBUS_CODEGEN} ARGS
-               " \\
-               --generate-c-code ${CMAKE_CURRENT_SOURCE_DIR}/net_nfc_gdbus \\
-               --c-namespace NetNfcGDbus\\
-               --interface-prefix org.tizen.NetNfcService. \\
-               ${CMAKE_CURRENT_SOURCE_DIR}/net_nfc.xml \\
-               ")
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} COMMON_LIB_SRCS)
-
-IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-       SET(CMAKE_BUILD_TYPE "Release")
-ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(commonlib_pkges REQUIRED
-               glib-2.0 gio-2.0 gio-unix-2.0 dlog bluetooth-api libssl)
-
-FOREACH(flag ${commonlib_pkges_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-MESSAGE("CHECK MODULE in COMMON_LIB ${commonlib_pkges_LDFLAGS}")
-
-# this for NFC flag
-
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -pipe -fomit-frame-pointer -Wall -Wno-trigraphs -Werror-implicit-function-declaration  -fno-strict-aliasing -Wl,-zdefs")
-
-SET(ARM_CFLAGS "${ARM_CLAGS} -mapcs -mno-sched-prolog -mabi=aapcs-linux -Uarm -fno-common -fpic")
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration")
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-
-FIND_PROGRAM(UNAME NAMES uname)
-EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
-IF("${ARCH}" MATCHES "^arm.*")
-       ADD_DEFINITIONS("-DTARGET")
-       MESSAGE("add -DTARGET")
-       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARM_CFLAGS}")
-ENDIF()
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-
-ADD_LIBRARY(${NFC_COMMON_LIB} SHARED ${COMMON_LIB_SRCS})
-SET_TARGET_PROPERTIES(${NFC_COMMON_LIB} PROPERTIES SOVERSION ${VERSION_MAJOR})
-SET_TARGET_PROPERTIES(${NFC_COMMON_LIB} PROPERTIES VERSION ${VERSION})
-
-TARGET_LINK_LIBRARIES(${NFC_COMMON_LIB} ${commonlib_pkges_LDFLAGS})
-
-SET(COMMON_LIB_HEADER
-       include/net_nfc_typedef.h
-       include/net_nfc_util_internal.h
-       include/net_nfc_oem_controller.h
-       include/net_nfc_typedef_internal.h
-       include/net_nfc_util_ndef_message.h
-       include/net_nfc_util_handover.h
-       include/net_nfc_util_ndef_record.h
-       include/net_nfc_util_sign_record.h
-)
-
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${NFC_COMMON_LIB}.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/${NFC_COMMON_LIB}.pc)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${NFC_COMMON_LIB}.pc DESTINATION lib/pkgconfig)
-INSTALL(TARGETS ${NFC_COMMON_LIB} DESTINATION lib)
-
-FOREACH(hfile ${COMMON_LIB_HEADER})
-        INSTALL(FILES ${hfile} DESTINATION include/nfc-common-lib)
-ENDFOREACH(hfile)
-
diff --git a/src/commonlib/nfc-common-lib.pc.in b/src/commonlib/nfc-common-lib.pc.in
deleted file mode 100644 (file)
index 1df1eee..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# Package Information for pkg-config
-
-prefix=/usr
-exec_prefix=/usr/bin
-libdir=/usr/lib
-includedir=/usr/include/nfc-common-lib
-
-Name: nfc-common-lib
-Description: NFC Common Library
-Version: 1.0
-Requires: 
-Libs: -L/usr/lib -lnfc-common-lib
-Cflags: -I/usr/include/nfc-common-lib
diff --git a/src/manager/CMakeLists.txt b/src/manager/CMakeLists.txt
deleted file mode 100644 (file)
index af454bf..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-#PROJECT(nfc C)
-PROJECT(nfc-manager-daemon C)
-
-SET(NFC_MANAGER_DAEMON "nfc-manager-daemon")
-
-include_directories(${CMAKE_SOURCE_DIR}/src/commonlib/)
-include_directories(${CMAKE_SOURCE_DIR}/src/commonlib/include)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/ MANAGER_SRCS)
-
-IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-       SET(CMAKE_BUILD_TYPE "Release")
-ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(manager_pkges REQUIRED aul glib-2.0 gio-unix-2.0 security-server vconf dlog tapi appsvc libcurl bluetooth-api libssl svi capi-media-wav-player pkgmgr pkgmgr-info capi-network-wifi ecore-x pmapi)
-FOREACH(flag ${manager_pkges_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-MESSAGE("CHECK MODULE in MANAGER ${manager_pkges_LDFLAGS}")
-
-# this for NFC flag
-
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -pipe -fomit-frame-pointer -Wall -Wno-trigraphs -Werror-implicit-function-declaration  -fno-strict-aliasing -Wl,-zdefs -fvisibility=hidden")
-
-SET(ARM_CFLAGS "${ARM_CLAGS} -mapcs -mno-sched-prolog -mabi=aapcs-linux -Uarm -fno-common -fpic")
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration")
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-
-FIND_PROGRAM(UNAME NAMES uname)
-EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
-IF("${ARCH}" MATCHES "^arm.*")
-       ADD_DEFINITIONS("-DTARGET")
-       MESSAGE("add -DTARGET")
-       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARM_CFLAGS}")
-ENDIF()
-
-ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
-ADD_DEFINITIONS("-DNFC_MANAGER_MODULEDIR=\"${MODULEDIR}\"")
-
-ADD_DEFINITIONS("-DUSE_FULL_URI")
-#ADD_DEFINITIONS("-DESE_ALWAYS_ON")
-
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
-
-ADD_EXECUTABLE(${NFC_MANAGER_DAEMON} ${MANAGER_SRCS})
-
-TARGET_LINK_LIBRARIES(${NFC_MANAGER_DAEMON} ${manager_pkges_LDFLAGS} pthread dl rt nfc-common-lib nfc)
-LINK_DIRECTORIES(${CMAKE_BUILD_DIR}/src/commonlib ${CMAKE_BUILD_DIR}/src/clientlib)
-INSTALL(TARGETS ${NFC_MANAGER_DAEMON} DESTINATION bin)
-
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.tizen.NetNfcService.service DESTINATION share/dbus-1/services)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/nfc-manager.xml DESTINATION share/packages)
-INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/sounds DESTINATION share/nfc-manager-daemon)
diff --git a/src/manager/include/net_nfc_manager.h b/src/manager/include/net_nfc_manager.h
deleted file mode 100644 (file)
index f57cb71..0000000
+++ /dev/null
@@ -1,21 +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_MANAGER_H__
-#define __NET_NFC_MANAGER_H__
-
-void net_nfc_manager_quit();
-
-#endif //__NET_NFC_MANAGER_H__
diff --git a/src/manager/include/net_nfc_manager_util_internal.h b/src/manager/include/net_nfc_manager_util_internal.h
deleted file mode 100644 (file)
index 684ac01..0000000
+++ /dev/null
@@ -1,44 +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_MANAGER_UTIL_INTERNAL_H__
-#define __NET_NFC_MANAGER_UTIL_INTERNAL_H__
-
-#define NET_NFC_MANAGER_DATA_PATH              "/opt/data/nfc-manager-daemon"
-#define NET_NFC_MANAGER_DATA_PATH_MESSAGE      "message"
-#define NET_NFC_MANAGER_DATA_PATH_CONFIG       "config"
-#define NET_NFC_MANAGER_NDEF_FILE_NAME         "ndef-message.txt"
-#define NET_NFC_MANAGER_LLCP_CONFIG_FILE_NAME  "nfc-manager-config.txt"
-
-#define NET_NFC_MANAGER_SOUND_PATH_TASK_START  "/usr/share/nfc-manager-daemon/sounds/Operation_sdk.wav"
-#define NET_NFC_MANAGER_SOUND_PATH_TASK_END    "/usr/share/nfc-manager-daemon/sounds/Operation_sdk.wav"
-#define NET_NFC_MANAGER_SOUND_PATH_TASK_ERROR  "/usr/share/nfc-manager-daemon/sounds/Operation_sdk.wav"
-
-#define BUFFER_LENGTH_MAX                      1024
-
-#define READ_BUFFER_LENGTH_MAX                 BUFFER_LENGTH_MAX
-#define WRITE_BUFFER_LENGTH_MAX                        BUFFER_LENGTH_MAX
-#define NET_NFC_MAX_LLCP_SOCKET_BUFFER         BUFFER_LENGTH_MAX
-
-typedef enum
-{
-       NET_NFC_TASK_START = 0x00,
-       NET_NFC_TASK_END,
-       NET_NFC_TASK_ERROR
-} net_nfc_sound_type_e;
-
-void net_nfc_manager_util_play_sound(net_nfc_sound_type_e sound_type);
-
-#endif //__NET_NFC_MANAGER_UTIL_INTERNAL_H__
diff --git a/src/manager/net_nfc_manager.c b/src/manager/net_nfc_manager.c
deleted file mode 100644 (file)
index 0b6a028..0000000
+++ /dev/null
@@ -1,205 +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 <stdio.h>
-#include <unistd.h>
-#include <glib.h>
-#include <pthread.h>
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus-glib-bindings.h>
-#include <gio/gio.h>
-#include <sys/utsname.h>
-
-#include <vconf.h>
-
-#include "net_nfc_server_common.h"
-#include "net_nfc_server_vconf.h"
-#include "net_nfc_server_manager.h"
-#include "net_nfc_server_se.h"
-#include "net_nfc_server_tag.h"
-#include "net_nfc_debug_internal.h"
-#include "net_nfc_typedef_internal.h"
-#include "net_nfc_app_util_internal.h"
-#include "net_nfc_controller_internal.h"
-#include "net_nfc_util_internal.h"
-#include "net_nfc_util_defines.h"
-#include "net_nfc_manager.h"
-#include "net_nfc_server.h"
-
-static gboolean use_daemon = FALSE;
-
-GOptionEntry option_entries[] = {
-       { "daemon", 'd', 0, G_OPTION_ARG_NONE, &use_daemon,
-               "Use Daemon mode", NULL },
-       { NULL }
-};
-
-static GMainLoop *loop = NULL;
-
-void net_nfc_manager_quit()
-{
-       DEBUG_MSG("net_nfc_manager_quit kill the nfc-manager daemon!!");
-       if (loop != NULL) {
-               g_main_loop_quit(loop);
-       }
-}
-
-static void on_bus_acquired(GDBusConnection *connection,
-                       const gchar *path,
-                       gpointer user_data)
-{
-       gint state;
-
-       DEBUG_MSG("bus path : %s", path);
-
-       net_nfc_server_gdbus_init();
-
-       net_nfc_server_controller_init();
-
-       if (vconf_get_bool(VCONFKEY_NFC_STATE, &state) != 0)
-       {
-               DEBUG_MSG("VCONFKEY_NFC_STATE is not exist");
-               net_nfc_manager_quit();
-
-               return;
-       }
-
-       net_nfc_server_vconf_init();
-
-       if (state == 1)
-               net_nfc_server_manager_set_active(TRUE);
-#ifndef ESE_ALWAYS_ON
-       else if (use_daemon == TRUE)
-               net_nfc_server_controller_deinit();
-#endif
-}
-
-static void on_name_acquired(GDBusConnection *connection,
-                       const gchar *name,
-                       gpointer user_data)
-{
-       DEBUG_SERVER_MSG("name : %s", name);
-}
-
-static void on_name_lost(GDBusConnection *connnection,
-                       const gchar *name,
-                       gpointer user_data)
-{
-       DEBUG_SERVER_MSG("name : %s", name);
-
-       net_nfc_manager_quit();
-}
-
-
-int main(int argc, char *argv[])
-{
-
-       void *handle = NULL;
-       guint id = 0;
-       gboolean use_daemon = FALSE;
-
-       GOptionContext *option_context;
-       GError *error = NULL;
-
-       if (!g_thread_supported())
-       {
-               g_thread_init(NULL);
-       }
-
-       g_type_init();
-
-       option_context = g_option_context_new("Nfc manager");
-       g_option_context_add_main_entries(option_context,
-                                       option_entries,
-                                       NULL);
-
-       if (g_option_context_parse(option_context,
-                               &argc,
-                               &argv,
-                               &error) == FALSE)
-       {
-               DEBUG_ERR_MSG("can not parse option: %s",
-                               error->message);
-               g_error_free(error);
-
-               g_option_context_free(option_context);
-               return 0;
-       }
-
-       DEBUG_SERVER_MSG("start nfc manager");
-       DEBUG_SERVER_MSG("use_daemon : %d", use_daemon);
-
-       net_nfc_manager_init_log();
-
-       net_nfc_app_util_clean_storage(MESSAGE_STORAGE);
-
-       handle = net_nfc_controller_onload();
-       if (handle == NULL)
-       {
-               DEBUG_ERR_MSG("load plugin library is failed");
-
-               if (vconf_set_bool(VCONFKEY_NFC_FEATURE,
-                               VCONFKEY_NFC_FEATURE_OFF) != 0)
-               {
-                       DEBUG_ERR_MSG("VCONFKEY_NFC_FEATURE set to %d failed",
-                                       VCONFKEY_NFC_FEATURE_OFF);
-               }
-
-               if (vconf_set_bool(VCONFKEY_NFC_STATE, 0) != 0)
-               {
-                       DEBUG_ERR_MSG("VCONFKEY_NFC_STATE set to %d failed",
-                                       0);
-               }
-
-               goto EXIT;
-       }
-
-       if (vconf_set_bool(VCONFKEY_NFC_FEATURE, VCONFKEY_NFC_FEATURE_ON) != 0)
-       {
-               DEBUG_ERR_MSG("VCONFKEY_NFC_FEATURE set to %d failed",
-                               VCONFKEY_NFC_FEATURE_ON);
-       }
-
-       id = g_bus_own_name(G_BUS_TYPE_SYSTEM,
-               "org.tizen.NetNfcService",
-               G_BUS_NAME_OWNER_FLAGS_NONE,
-               on_bus_acquired,
-               on_name_acquired,
-               on_name_lost,
-               NULL,
-               NULL);
-
-       loop = g_main_loop_new(NULL, FALSE);
-       g_main_loop_run(loop);
-
-EXIT :
-       net_nfc_server_vconf_deinit();
-       net_nfc_server_controller_deinit();
-       net_nfc_server_gdbus_deinit();
-
-       if (id)
-       {
-               g_bus_unown_name(id);
-       }
-
-       net_nfc_controller_unload(handle);
-
-       net_nfc_manager_fini_log();
-
-       g_option_context_free(option_context);
-
-       return 0;
-}
\ No newline at end of file
diff --git a/src/manager/net_nfc_manager_util.c b/src/manager/net_nfc_manager_util.c
deleted file mode 100644 (file)
index 0bbad2e..0000000
+++ /dev/null
@@ -1,111 +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 <stdlib.h>
-#include <string.h>
-
-#include "vconf.h"
-#include "svi.h"
-#include "wav_player.h"
-
-#include "net_nfc_debug_internal.h"
-#include "net_nfc_util_internal.h"
-#include "net_nfc_manager_util_internal.h"
-
-static void _play_sound_callback(int id, void *data)
-{
-       DEBUG_MSG("_play_sound_callback");
-
-       if (WAV_PLAYER_ERROR_NONE != wav_player_stop(id))
-       {
-               DEBUG_MSG("wav_player_stop failed");
-       }
-}
-
-void net_nfc_manager_util_play_sound(net_nfc_sound_type_e sound_type)
-{
-       int bSoundOn = 0;
-       int bVibrationOn = 0;
-
-       if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &bSoundOn) != 0)
-       {
-               DEBUG_MSG("vconf_get_bool failed for Sound");
-               return;
-       }
-
-       if (vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &bVibrationOn) != 0)
-       {
-               DEBUG_MSG("vconf_get_bool failed for Vibration");
-               return;
-       }
-
-       if ((sound_type > NET_NFC_TASK_ERROR) || (sound_type < NET_NFC_TASK_START))
-       {
-               DEBUG_MSG("Invalid Sound Type");
-               return;
-       }
-
-       if (bVibrationOn)
-       {
-               int svi_handle = -1;
-
-               DEBUG_MSG("Play Vibration");
-
-               if (SVI_SUCCESS == svi_init(&svi_handle))
-               {
-                       if (SVI_SUCCESS == svi_play_vib(svi_handle, SVI_VIB_TOUCH_SIP))
-                       {
-                               DEBUG_MSG("svi_play_vib success");
-                       }
-
-                       svi_fini(svi_handle);
-               }
-       }
-
-       if (bSoundOn)
-       {
-               char *sound_path = NULL;
-
-               DEBUG_MSG("Play Sound");
-
-               switch (sound_type)
-               {
-               case NET_NFC_TASK_START :
-                       sound_path = strdup(NET_NFC_MANAGER_SOUND_PATH_TASK_START);
-                       break;
-               case NET_NFC_TASK_END :
-                       sound_path = strdup(NET_NFC_MANAGER_SOUND_PATH_TASK_END);
-                       break;
-               case NET_NFC_TASK_ERROR :
-                       sound_path = strdup(NET_NFC_MANAGER_SOUND_PATH_TASK_ERROR);
-                       break;
-               }
-
-               if (sound_path != NULL)
-               {
-                       if (WAV_PLAYER_ERROR_NONE == wav_player_start(sound_path, SOUND_TYPE_MEDIA, _play_sound_callback, NULL, NULL))
-                       {
-                               DEBUG_MSG("wav_player_start success");
-                       }
-
-                       _net_nfc_util_free_mem(sound_path);
-               }
-               else
-               {
-                       DEBUG_ERR_MSG("Invalid Sound Path");
-               }
-       }
-}
diff --git a/test_clinet_app/bt_paring/Makefile b/test_clinet_app/bt_paring/Makefile
deleted file mode 100644 (file)
index b29816b..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-LOCAL_PATH=.
-
-#phLibNfc
-
-export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
-
-#sources
-
-SRCS = $(LOCAL_PATH)/bt_paring.c
-       
-#includes
-
-USER_HEADER =`pkg-config --cflags nfc bluetooth-api`
-             
-LOCAL_CFLAGS = $(USER_HEADER)
-
-CC = arm-linux-gnueabi-gcc
-
-TARGET = bt_paring
-
-
-CFLAGS = $(LOCAL_CFLAGS) -g
-LDFLAGS = -lpthread `pkg-config --libs nfc bluetooth-api`
-
-
-SRC = $(SRCS)
-OBJS = $(SRC:.c=.o)
-RM = rm
-
-
-.SUFFIXES: .c .o
-       
-.c.o:
-       $(CC) -c $(CFLAGS) -o $*.o $< 
-
-all: $(TARGET)
-
-$(TARGET): $(OBJS)
-       $(CC) -o $@ $(OBJS) $(LDFLAGS) -g
-       
-run: all
-       $(TARGET)
-
-clean: 
-       $(RM) -f $(OBJS) $(TARGET)
-
diff --git a/test_clinet_app/bt_paring/bt_paring.c b/test_clinet_app/bt_paring/bt_paring.c
deleted file mode 100644 (file)
index 60bcbf8..0000000
+++ /dev/null
@@ -1,215 +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 <stdio.h>
-#include <stdlib.h>
-
-#include <bluetooth-api.h>
-#include <glib.h>
-
-#include <net_nfc.h>
-
-#include <pthread.h>
-
-void bt_event_callback(int event, bluetooth_event_param_t* param, void *user_data);
-void bt_test_bond_device(bluetooth_device_address_t* bt_address);
-GMainLoop* main_loop = NULL;
-
-void initialize()
-{
-       if(!g_thread_supported())
-       {
-               g_thread_init(NULL);
-       }
-
-       dbus_g_thread_init();
-       g_type_init();
-}
-
-
-int main()
-{
-       initialize();
-
-       //bluetooth_enable_adapter();
-
-        //main_loop = g_main_loop_new(NULL, FALSE);
-       //g_main_loop_run(main_loop);
-
-#if 1
-
-       ndef_message_h ndef_message = NULL;
-       net_nfc_conn_handover_info_h conn_handover_info = NULL;
-
-
-       if(net_nfc_retrieve_current_ndef_message(&ndef_message) == NET_NFC_OK)
-       {
-               printf("retrieve ndef message from nfc storage \n");
-
-               int count = 0;
-
-               net_nfc_get_ndef_message_record_count(ndef_message, &count);
-
-               int i = 0;
-               while(i < count){
-
-                       ndef_record_h record = NULL;
-                       net_nfc_get_record_by_index(ndef_message, i++, &record);
-
-                       if(record != NULL){
-
-                               net_nfc_record_tnf_e TNF = NET_NFC_RECORD_EMPTY;
-                               data_h record_type = NULL;
-
-                               if((net_nfc_get_record_tnf(record, &TNF) == NET_NFC_OK) && (net_nfc_get_record_type(record, &record_type) == NET_NFC_OK ) ){
-
-                                       uint8_t* buffer = net_nfc_get_data_buffer(record_type);
-                                       int buffer_length = net_nfc_get_data_length(record_type);
-
-                                        // record is WTK and Hs
-                                       if((TNF == NET_NFC_RECORD_WELL_KNOWN_TYPE) && (buffer != NULL) && (buffer_length > 1) && (buffer[0] == 'H') && (buffer[1] == 's')){
-                                               printf("record is found \n");
-                                               net_nfc_parse_connection_handover_ndef_message(ndef_message, &conn_handover_info);
-
-                                               if(conn_handover_info != NULL){
-                                                       uint8_t carrier_count = 0;
-                                                       net_nfc_get_connection_handover_alternative_carrier_count(conn_handover_info, &carrier_count);
-
-                                                       int j = 0;
-                                                       while(j < carrier_count){
-
-                                                               net_nfc_conn_handover_carrier_info_h carrier_info = NULL;
-                                                               net_nfc_get_connection_handover_carrier_handle_by_index(conn_handover_info, j++, &carrier_info);
-
-                                                               if(carrier_info != NULL){
-                                                                       data_h configuration = NULL;
-                                                                       net_nfc_get_carrier_configuration(carrier_info, &configuration);
-
-                                                                       if(configuration != NULL)
-                                                                       {
-                                                                               uint8_t* buffer = net_nfc_get_data_buffer(configuration);
-                                                                               if(buffer != NULL)
-                                                                               {
-                                                                                       printf("bt addr [%X][%X][%X][%X][%X][%X] \n", buffer[2], buffer[3], buffer[4], buffer[5], buffer[6], buffer[7]);
-                                                                                       bluetooth_device_address_t bt_address = {{buffer[2], buffer[3], buffer[4], buffer[5], buffer[6], buffer[7]}};
-                                                                                       bt_test_bond_device(&bt_address);
-                                                                               }
-                                                                               else
-                                                                                       printf("buffer is NULL");
-                                                                       }
-                                                               }
-
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               }
-
-       }
-
-#endif
-       return 0;
-}
-
-void bt_test_bond_device(bluetooth_device_address_t* bt_address)
-{
-       int ret_val;
-
-        ret_val = bluetooth_register_callback(bt_event_callback, NULL);
-
-       if (ret_val >= BLUETOOTH_ERROR_NONE)
-        {
-                printf("bluetooth_register_callback returned Success");
-        }
-        else
-        {
-                printf("bluetooth_register_callback returned failiure [0x%04x]", ret_val);
-                return ;
-        }
-
-        ret_val = bluetooth_check_adapter();
-
-        if (ret_val < BLUETOOTH_ERROR_NONE)
-        {
-                printf("bluetooth_check_adapter returned failiure [0x%04x]", ret_val);
-        }
-        else
-        {
-                printf("BT state [0x%04x]", ret_val);
-        }
-
-       int error = 0;
-
-        if((error = bluetooth_bond_device(bt_address)) < 0)
-        {
-               printf("Api failed: %d", error);
-        }
-        else
-        {
-               main_loop = g_main_loop_new(NULL, FALSE);
-               g_main_loop_run(main_loop);
-        }
-
-}
-
-void bt_event_callback(int event, bluetooth_event_param_t* param, void *user_data)
-{
-       switch(event)
-       {
-               case BLUETOOTH_EVENT_ENABLED:
-                       printf("BLUETOOTH_EVENT_ENABLED:\n");
-               break;
-               case BLUETOOTH_EVENT_DISABLED:
-                       printf("BLUETOOTH_EVENT_DISABLED:\n");
-               break;
-               case BLUETOOTH_EVENT_LOCAL_NAME_CHANGED:
-                       printf("BLUETOOTH_EVENT_LOCAL_NAME_CHANGED:\n");
-               break;
-               case BLUETOOTH_EVENT_DISCOVERY_STARTED:
-                       printf("BLUETOOTH_EVENT_DISCOVERY_STARTED:\n");
-               break;
-               case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
-                       printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:\n");
-               break;
-               case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
-                       printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:\n");
-               break;
-               case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
-                       printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED:\n");
-               break;
-               case BLUETOOTH_EVENT_BONDING_FINISHED:
-                       printf("BLUETOOTH_EVENT_BONDING_FINISHED:\n");
-
-                       if (param->result >= BLUETOOTH_ERROR_NONE)
-                        {
-                                bluetooth_device_info_t *device_info = NULL;
-                                device_info  = (bluetooth_device_info_t *)param->param_data;
-                                printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X] mjr[%#x] min[%#x] srv[%#x] \n", device_info->device_name.name, \
-                                        device_info->device_address.addr[0], device_info->device_address.addr[1], device_info->device_address.addr[2], \
-                                        device_info->device_address.addr[3], device_info->device_address.addr[4], device_info->device_address.addr[5], \
-                                        device_info->device_class.major_class, device_info->device_class.minor_class, device_info->device_class.service_class);
-                        }
-
-                       g_main_loop_quit (main_loop);
-
-               break;
-               default:
-                       printf("BLUETOOTH_EVENT = [%d]:\n", event);
-               break;
-       }
-}
diff --git a/test_clinet_app/ndef-tool/CMakeLists.txt b/test_clinet_app/ndef-tool/CMakeLists.txt
deleted file mode 100644 (file)
index ca1a224..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(ndef-tool C)
-
-SET(NDEF_TOOL "ndef-tool")
-
-include_directories(${CMAKE_SOURCE_DIR}/src/commonlib)
-include_directories(${CMAKE_SOURCE_DIR}/src/commonlib/include)
-include_directories(${CMAKE_SOURCE_DIR}/src/clientlib/include)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/ TOOL_SRC)
-
-IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-       SET(CMAKE_BUILD_TYPE "Release")
-ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(tool_pkgs REQUIRED glib-2.0 gobject-2.0)
-
-FOREACH(flag ${tool_pkgs_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-# this for NFC flag
-
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -pipe -fomit-frame-pointer -Wall -Wno-trigraphs -Werror-implicit-function-declaration  -fno-strict-aliasing -Wl,-zdefs -fvisibility=hidden")
-
-SET(ARM_CFLAGS "${ARM_CLAGS} -mapcs -mno-sched-prolog -mabi=aapcs-linux -Uarm -fno-common -fpic")
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-
-FIND_PROGRAM(UNAME NAMES uname)
-EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
-IF("${ARCH}" MATCHES "^arm.*")
-       ADD_DEFINITIONS("-DTARGET")
-       MESSAGE("add -DTARGET")
-       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARM_CFLAGS}")
-ENDIF()
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
-
-ADD_EXECUTABLE(${NDEF_TOOL} ${TOOL_SRC})
-
-TARGET_LINK_LIBRARIES(${NDEF_TOOL} ${tool_pkgs_LDFLAGS} pthread dl rt nfc-common-lib nfc)
-LINK_DIRECTORIES(${CMAKE_BUILD_DIR}/src/commonlib ${CMAKE_BUILD_DIR}/src/clientlib)
-
-INSTALL(TARGETS ${NDEF_TOOL} DESTINATION bin)
-
-
diff --git a/test_clinet_app/nfc_client/CMakeLists.txt b/test_clinet_app/nfc_client/CMakeLists.txt
deleted file mode 100644 (file)
index dc583ef..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(nfc_client C)
-
-SET(NFC_CLIENT "nfc_client")
-
-include_directories(${CMAKE_SOURCE_DIR}/src/commonlib/include)
-include_directories(${CMAKE_SOURCE_DIR}/src/clientlib/include)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/ TOOL_SRC)
-
-IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-       SET(CMAKE_BUILD_TYPE "Release")
-ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(tool_pkgs REQUIRED glib-2.0 gobject-2.0)
-
-FOREACH(flag ${tool_pkgs_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-# this for NFC flag
-
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -pipe -fomit-frame-pointer -Wall -Wno-trigraphs -Werror-implicit-function-declaration  -fno-strict-aliasing -Wl,-zdefs -fvisibility=hidden")
-
-SET(ARM_CFLAGS "${ARM_CLAGS} -mapcs -mno-sched-prolog -mabi=aapcs-linux -Uarm -fno-common -fpie")
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-
-FIND_PROGRAM(UNAME NAMES uname)
-EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
-IF("${ARCH}" MATCHES "^arm.*")
-       ADD_DEFINITIONS("-DTARGET")
-       MESSAGE("add -DTARGET")
-       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARM_CFLAGS}")
-ENDIF()
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
-
-ADD_EXECUTABLE(${NFC_CLIENT} ${TOOL_SRC})
-
-TARGET_LINK_LIBRARIES(${NFC_CLIENT} ${tool_pkgs_LDFLAGS} pthread dl rt nfc-common-lib nfc)
-LINK_DIRECTORIES(${CMAKE_BUILD_DIR}/src/commonlib ${CMAKE_BUILD_DIR}/src/clientlib)
-
-INSTALL(TARGETS ${NFC_CLIENT} DESTINATION bin)
-
-
diff --git a/test_clinet_app/nfc_client/Makefile b/test_clinet_app/nfc_client/Makefile
deleted file mode 100644 (file)
index 82a1825..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-LOCAL_PATH=.
-
-#phLibNfc
-
-export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
-
-#sources
-
-SRCS = $(LOCAL_PATH)/main.c
-       
-#includes
-
-USER_HEADER =`pkg-config --cflags nfc glib-2.0 gobject-2.0`
-
-LOCAL_CFLAGS = $(USER_HEADER)
-
-CC = arm-linux-gnueabi-gcc
-
-TARGET = nfc-test
-
-
-CFLAGS = $(LOCAL_CFLAGS) -g
-LDFLAGS = -lpthread `pkg-config --libs nfc glib-2.0 gobject-2.0`
-
-
-SRC = $(SRCS)
-OBJS = $(SRC:.c=.o)
-RM = rm
-
-
-.SUFFIXES: .c .o
-       
-.c.o:
-       $(CC) -c $(CFLAGS) -o $*.o $< 
-
-all: $(TARGET)
-
-$(TARGET): $(OBJS)
-       $(CC) -o $@ $(OBJS) $(LDFLAGS)
-       
-run: all
-       $(TARGET)
-
-clean: 
-       $(RM) -f $(OBJS) $(TARGET)
-
index cf3eb6f..298b93f 100644 (file)
@@ -1,45 +1,17 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-
-PROJECT(tests C)
+LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/client/include)
 
 SET(NFC_CLIENT_TEST "nfc-client-test")
 
-include_directories(${CMAKE_SOURCE_DIR}/src/clientlib/include)
-include_directories(${CMAKE_SOURCE_DIR}/src/commonlib/include)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
+FILE(GLOB TESTS_SRCS *.c)
 
-INCLUDE(FindPkgConfig)
 pkg_check_modules(tests_pkgs REQUIRED glib-2.0)
-
 FOREACH(flag ${tests_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
 
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fpie")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
-ADD_EXECUTABLE(${NFC_CLIENT_TEST}
-               main.c
-               net_nfc_test_manager.c
-               net_nfc_test_tag.c
-               net_nfc_test_ndef.c
-               net_nfc_test_test.c
-               net_nfc_test_p2p.c
-               net_nfc_test_transceive.c
-               net_nfc_test_handover.c
-               net_nfc_test_client.c
-               net_nfc_test_jewel.c
-               net_nfc_test_tag_mifare.c
-               net_nfc_test_tag_felica.c
-               net_nfc_test_exchanger.c
-               net_nfc_test_llcp.c
-               net_nfc_test_snep.c
-               net_nfc_test_se.c
-               net_nfc_test_sys_handler.c
-               net_nfc_test_util.c
-               )
-
-TARGET_LINK_LIBRARIES(${NFC_CLIENT_TEST} ${tests_pkgs_LD_FLAGS} nfc)
-LINK_DIRECTORIES(${CMAKE_BUILD_DIR}/src/clientlib
-               ${CMAKE_BUILD_DIR}/src/commonlib)
+ADD_EXECUTABLE(${NFC_CLIENT_TEST} ${TESTS_SRCS})
+TARGET_LINK_LIBRARIES(${NFC_CLIENT_TEST} ${tests_pkgs_LDFLAGS} nfc)
diff --git a/tests/include/net_nfc_test_client.h b/tests/include/net_nfc_test_client.h
deleted file mode 100644 (file)
index 62902e4..0000000
+++ /dev/null
@@ -1,37 +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_TEST_CLIENT_H__
-#define __NET_NFC_TEST_CLIENT_H__
-
-#include <glib.h>
-
-
-void net_nfc_test_initialize(gpointer data,
-                               gpointer user_data);
-
-void net_nfc_test_deinitialize(gpointer data,
-                               gpointer user_data);
-
-void net_nfc_test_is_nfc_supported(gpointer data,
-                               gpointer user_data);
-
-void net_nfc_test_get_nfc_state(gpointer data,
-                               gpointer user_data);
-
-#endif//__NET_NFC_TEST_CLIENT_H__
-
diff --git a/tests/include/net_nfc_test_llcp.h b/tests/include/net_nfc_test_llcp.h
deleted file mode 100644 (file)
index 1491955..0000000
+++ /dev/null
@@ -1,168 +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_TEST_LLCP_H__
-#define __NET_NFC_TEST_LLCP_H__
-
-#include <glib.h>
-
-
-void net_nfc_test_llcp_default_config(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_default_config_sync(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_get_local_config(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_custom_config(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_custom_config_sync(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_get_local_config(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_get_config_miu(gpointer data,
-                       gpointer user_data);
-
-
-void net_nfc_test_llcp_get_config_wks(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_get_config_lto(gpointer data,
-                       gpointer user_data);
-
-
-void net_nfc_test_llcp_get_config_option(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_set_config_miu(gpointer data,
-                       gpointer user_data);
-
-
-void net_nfc_test_llcp_set_config_wks(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_set_config_lto(gpointer data,
-                       gpointer user_data);
-
-
-void net_nfc_test_llcp_set_config_option(gpointer data,
-                       gpointer user_data);
-
-
-void net_nfc_test_llcp_free_config(gpointer data,
-                       gpointer user_data);
-
-
-void net_nfc_test_llcp_create_custom_socket_option(gpointer data,
-                       gpointer user_data);
-
-
-void net_nfc_test_llcp_create_default_socket_option(gpointer data,
-                       gpointer user_data);
-
-
-void net_nfc_test_llcp_get_local_socket_option(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_get_socket_option_miu(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_set_socket_option_miu(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_get_socket_option_rw(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_set_socket_option_rw(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_get_socket_option_type(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_set_socket_option_type(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_free_socket_option(gpointer data,
-                       gpointer user_data);
-
-
-void net_nfc_test_llcp_listen(gpointer data,
-                               gpointer user_data);
-
-void net_nfc_test_llcp_listen_sync(gpointer data,
-                               gpointer user_data);
-
-void net_nfc_test_llcp_receive(gpointer data,
-                               gpointer user_data);
-
-void net_nfc_test_llcp_receive_sync(gpointer data,
-                               gpointer user_data);
-
-void net_nfc_test_llcp_receive_from(gpointer data,
-                               gpointer user_data);
-
-void net_nfc_test_llcp_receive_from_sync(gpointer data,
-                               gpointer user_data);
-
-void net_nfc_test_llcp_create_socket(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_close_socket(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_close_socket_sync(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_connect(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_connect_sync(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_connect_sap(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_connect_sap_sync(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_send(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_send_sync(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_send_to(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_send_to_sync(gpointer data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_disconnect(gpointer func_data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_disconnect_server(gpointer func_data,
-                       gpointer user_data);
-
-void net_nfc_test_llcp_disconnect_sync(gpointer func_data,
-                       gpointer user_data);
-
-#endif//__NET_NFC_TEST_LLCP_H__
-
diff --git a/tests/include/net_nfc_test_sys_handler.h b/tests/include/net_nfc_test_sys_handler.h
deleted file mode 100755 (executable)
index e22adc3..0000000
+++ /dev/null
@@ -1,28 +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_TEST_SYS_HANDLER_H__
-#define __NET_NFC_TEST_SYS_HANDLER_H__
-
-#include <glib.h>
-
-void net_nfc_test_sys_handler_set_launch_popup_state(gpointer data,
-                               gpointer user_data);
-
-void net_nfc_test_sys_handler_get_launch_popup_state(gpointer data,
-                               gpointer user_data);
-
-#endif//__NET_NFC_TEST_SYS_HANDLER_H__
index a095382..7baae5d 100644 (file)
@@ -987,8 +987,6 @@ int main(int argc, char *argv[])
 {
        gint i;
 
-       g_type_init();
-
        if (argc == 2 && strcmp(argv[1], "--help") == 0)
        {
                g_print("nfc-client-test: nfc-client-test [inteface.name]\n");
@@ -1025,7 +1023,7 @@ int main(int argc, char *argv[])
                strv = pos->data;
 
                if (strcmp(strv[0], "Manager") != 0 ||
-                       strcmp(strv[1], "SetActive") != 0)
+                               strcmp(strv[1], "SetActive") != 0)
                {
                        gchar **manager_strv;
 
index 9487baa..9b37667 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include <glib-object.h>
+
 #include "net_nfc_test_client.h"
 #include "net_nfc_client_context.h"
 #include "net_nfc_test_client.h"
@@ -34,8 +35,7 @@ static void run_next_callback(gpointer user_data)
        }
 }
 
-void net_nfc_test_initialize(gpointer data,
-                               gpointer user_data)
+void net_nfc_test_initialize(gpointer data, gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
 
@@ -52,8 +52,7 @@ void net_nfc_test_initialize(gpointer data,
        run_next_callback(user_data);
 }
 
-void net_nfc_test_deinitialize(gpointer data,
-                               gpointer user_data)
+void net_nfc_test_deinitialize(gpointer data, gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
 
@@ -62,8 +61,7 @@ void net_nfc_test_deinitialize(gpointer data,
        g_print("Client Deinitialization Completed & Result is %d\n", result);
 }
 
-void net_nfc_test_is_nfc_supported(gpointer data,
-                               gpointer user_data)
+void net_nfc_test_is_nfc_supported(gpointer data, gpointer user_data)
 {
        int feature = 0;
        net_nfc_error_e result = NET_NFC_OK;
@@ -83,8 +81,7 @@ void net_nfc_test_is_nfc_supported(gpointer data,
        run_next_callback(user_data);
 }
 
-void net_nfc_test_get_nfc_state(gpointer data,
-                               gpointer user_data)
+void net_nfc_test_get_nfc_state(gpointer data, gpointer user_data)
 {
        int state = 0;
        net_nfc_error_e result = NET_NFC_OK;
diff --git a/tests/net_nfc_test_client.h b/tests/net_nfc_test_client.h
new file mode 100644 (file)
index 0000000..bc78d45
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * 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_TEST_CLIENT_H__
+#define __NET_NFC_TEST_CLIENT_H__
+
+#include <glib.h>
+
+void net_nfc_test_initialize(gpointer data, gpointer user_data);
+void net_nfc_test_deinitialize(gpointer data, gpointer user_data);
+void net_nfc_test_is_nfc_supported(gpointer data, gpointer user_data);
+void net_nfc_test_get_nfc_state(gpointer data, gpointer user_data);
+
+#endif //__NET_NFC_TEST_CLIENT_H__
+
index 5c89a1b..d254ae0 100644 (file)
@@ -64,8 +64,7 @@ static net_nfc_exchanger_data_h _net_nfc_test_create_exchgr_data()
        return exch_data;
 }
 
-void net_nfc_test_handle_exchanger_data(gpointer data,
-                               gpointer user_data)
+void net_nfc_test_handle_exchanger_data(gpointer data, gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        ndef_message_h msg = NULL;
@@ -96,8 +95,7 @@ void net_nfc_test_handle_exchanger_data(gpointer data,
        return;
 }
 
-void net_nfc_test_send_exchanger_data(gpointer data,
-                               gpointer user_data)
+void net_nfc_test_send_exchanger_data(gpointer data, gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -107,14 +105,13 @@ void net_nfc_test_send_exchanger_data(gpointer data,
        handle = net_nfc_test_device_get_target_handle();
 
        result = net_nfc_client_send_exchanger_data(exch_data,
-                               handle,
-                               user_data);
+                       handle,
+                       user_data);
        g_print("Send exchanger result : %d\n", result);
        run_next_callback(user_data);
 }
 
-void net_nfc_test_exchanger_request_connection_handover(gpointer data,
-                               gpointer user_data)
+void net_nfc_test_exchanger_request_connection_handover(gpointer data, gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_conn_handover_carrier_type_e type = NET_NFC_CONN_HANDOVER_CARRIER_BT;
@@ -127,8 +124,7 @@ void net_nfc_test_exchanger_request_connection_handover(gpointer data,
        run_next_callback(user_data);
 }
 
-void net_nfc_test_exchanger_get_alternative_carrier_type(gpointer data,
-                               gpointer user_data)
+void net_nfc_test_exchanger_get_alternative_carrier_type(gpointer data, gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        /*Handover info needs to check-.As of now passing NULL*/
@@ -142,7 +138,7 @@ void net_nfc_test_exchanger_get_alternative_carrier_type(gpointer data,
 }
 
 void net_nfc_test_exchanger_get_alternative_carrier_data(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        /*Handover info needs to check-.As of now passing NULL*/
similarity index 96%
rename from tests/include/net_nfc_test_exchanger.h
rename to tests/net_nfc_test_exchanger.h
index 08a6bf9..6c91835 100644 (file)
@@ -38,4 +38,4 @@ void net_nfc_test_exchanger_get_alternative_carrier_type(gpointer data,
 void net_nfc_test_exchanger_get_alternative_carrier_data(gpointer data,
                                gpointer user_data);
 
-#endif//__NET_NFC_TEST_EXCHANGER_H__
+#endif //__NET_NFC_TEST_EXCHANGER_H__
index ce6ffdd..ced566d 100644 (file)
@@ -27,9 +27,9 @@
 static void run_next_callback(gpointer user_data);
 
 static void p2p_connection_handover_cb(net_nfc_error_e result,
-                                               net_nfc_conn_handover_carrier_type_e type,
-                                               data_h data,
-                                               void *user_data);
+               net_nfc_conn_handover_carrier_type_e type,
+               data_h data,
+               void *user_data);
 
 net_nfc_connection_handover_info_h global_info = NULL;
 
@@ -45,9 +45,9 @@ static void run_next_callback(gpointer user_data)
 }
 
 static void p2p_connection_handover_cb(net_nfc_error_e result,
-                                       net_nfc_conn_handover_carrier_type_e type,
-                                       data_h data,
-                                       void *user_data)
+               net_nfc_conn_handover_carrier_type_e type,
+               data_h data,
+               void *user_data)
 {
        g_print("Connection handover completed\n");
 
@@ -67,7 +67,7 @@ static void p2p_connection_handover_cb(net_nfc_error_e result,
 }
 
 void net_nfc_test_p2p_connection_handover(gpointer data,
-                                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_conn_handover_carrier_type_e type = NET_NFC_CONN_HANDOVER_CARRIER_BT;
@@ -78,14 +78,14 @@ void net_nfc_test_p2p_connection_handover(gpointer data,
        g_print("handle for handover  : %p \n", handle);
 
        result = net_nfc_client_p2p_connection_handover(
-                                       handle,
-                                       type,
-                                       p2p_connection_handover_cb,
-                                       user_data);
+                       handle,
+                       type,
+                       p2p_connection_handover_cb,
+                       user_data);
 }
 
 void  net_nfc_test_p2p_connection_handover_sync(gpointer data,
-                                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_conn_handover_carrier_type_e type;
@@ -97,19 +97,18 @@ void  net_nfc_test_p2p_connection_handover_sync(gpointer data,
        handle = net_nfc_test_device_get_target_handle();
 
        result = net_nfc_client_p2p_connection_handover_sync(
-                                       handle,
-                                       type,
-                                       &out_carrier,
-                                       &out_data);
+                       handle,
+                       type,
+                       &out_carrier,
+                       &out_data);
 
        g_print("Received out carrier type & carrier type  %d, %d\n", out_carrier, type);
        print_received_data(out_data);
        run_next_callback(user_data);
 }
 
-
 void net_nfc_test_handover_get_alternative_carrier_type(gpointer data,
-                                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_conn_handover_carrier_type_e type;
@@ -119,7 +118,7 @@ void net_nfc_test_handover_get_alternative_carrier_type(gpointer data,
 }
 
 void net_nfc_test_handover_handle_alternative_carrier_data(gpointer data,
-                                                       gpointer user_datarrierData)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        data_h out_data = NULL;
@@ -133,5 +132,4 @@ void net_nfc_test_handover_handle_alternative_carrier_data(gpointer data,
 
        result = net_nfc_client_handover_free_alternative_carrier_data(hand_info);
        g_print("Free alternative carrier data  %d", result);
-
 }
similarity index 96%
rename from tests/include/net_nfc_test_handover.h
rename to tests/net_nfc_test_handover.h
index 1307350..8c51e58 100644 (file)
@@ -38,5 +38,5 @@ void net_nfc_test_handover_get_alternative_carrier_type(gpointer data,
                                                gpointer user_data);
 
 
-#endif//__NET_NFC_TEST_HANDOVER_H__
+#endif //__NET_NFC_TEST_HANDOVER_H__
 
index 33d1a13..ebd1479 100644 (file)
@@ -1,18 +1,18 @@
 /*
-* 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.
-*/
+ * 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_test_jewel.h"
 #include "net_nfc_typedef_internal.h"
@@ -27,11 +27,11 @@ static net_nfc_target_handle_h get_handle();
 static void run_next_callback(gpointer user_data);
 
 static void jewel_read_cb(net_nfc_error_e result,
-                               data_h resp_data,
-                               void *user_data);
+               data_h resp_data,
+               void *user_data);
 ;
 static void jewel_write_cb(net_nfc_error_e result,
-                               void* user_data);
+               void* user_data);
 
 
 static net_nfc_target_handle_h get_handle()
@@ -62,8 +62,8 @@ static void run_next_callback(gpointer user_data)
 /*********************************** Callbacks *************************************/
 
 static void jewel_read_cb(net_nfc_error_e result,
-                               data_h resp_data,
-                               void *user_data)
+               data_h resp_data,
+               void *user_data)
 {
 
        g_print("jewel_read_cb Completed %d\n", result);
@@ -74,7 +74,7 @@ static void jewel_read_cb(net_nfc_error_e result,
 }
 
 static void jewel_write_cb(net_nfc_error_e result,
-                               void* user_data)
+               void* user_data)
 {
        g_print("jewel_write_cb Completed %d\n", result);
 
@@ -86,7 +86,7 @@ static void jewel_write_cb(net_nfc_error_e result,
 
 
 void net_nfc_test_tag_jewel_read_id(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -94,12 +94,12 @@ void net_nfc_test_tag_jewel_read_id(gpointer data,
        handle = get_handle();
 
        result = net_nfc_client_jewel_read_id(handle,
-                                       jewel_read_cb,
-                                       user_data);
+                       jewel_read_cb,
+                       user_data);
 }
 
 void net_nfc_test_tag_jewel_read_byte(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -109,14 +109,14 @@ void net_nfc_test_tag_jewel_read_byte(gpointer data,
        handle = get_handle();
 
        result = net_nfc_client_jewel_read_byte(handle,
-                                       block,
-                                       byte,
-                                       jewel_read_cb,
-                                       user_data);
+                       block,
+                       byte,
+                       jewel_read_cb,
+                       user_data);
 }
 
 void net_nfc_test_tag_jewel_read_all(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -124,12 +124,12 @@ void net_nfc_test_tag_jewel_read_all(gpointer data,
        handle = get_handle();
 
        result = net_nfc_client_jewel_read_all(handle,
-                                       jewel_read_cb,
-                                       user_data);
+                       jewel_read_cb,
+                       user_data);
 }
 
 void net_nfc_test_tag_jewel_write_with_erase(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -140,15 +140,15 @@ void net_nfc_test_tag_jewel_write_with_erase(gpointer data,
        handle = get_handle();
 
        result = net_nfc_client_jewel_write_with_erase(handle,
-                                       block,
-                                       byte,
-                                       data_to_write,
-                                       jewel_write_cb,
-                                       user_data);
+                       block,
+                       byte,
+                       data_to_write,
+                       jewel_write_cb,
+                       user_data);
 }
 
 void net_nfc_test_tag_jewel_write_with_no_erase(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -159,10 +159,9 @@ void net_nfc_test_tag_jewel_write_with_no_erase(gpointer data,
        handle = get_handle();
 
        result = net_nfc_client_jewel_write_with_erase(handle,
-                                       block,
-                                       byte,
-                                       data_to_write,
-                                       jewel_write_cb,
-                                       user_data);
+                       block,
+                       byte,
+                       data_to_write,
+                       jewel_write_cb,
+                       user_data);
 }
-
index ce9ff00..e2ab811 100644 (file)
@@ -67,8 +67,8 @@ static void llcp_custom_config_cb(net_nfc_error_e result,
 }
 
 static void llcp_listen_socket_cb(net_nfc_error_e result,
-                               net_nfc_llcp_socket_t client_socket,
-                               void *user_data)
+               net_nfc_llcp_socket_t client_socket,
+               void *user_data)
 {
 
        g_print("llcp_listen_socket_cb  Completed %d\n", client_socket);
@@ -78,8 +78,8 @@ static void llcp_listen_socket_cb(net_nfc_error_e result,
 }
 
 static void llcp_receive_socket_cb(net_nfc_error_e result,
-                               data_h data,
-                               void *user_data)
+               data_h data,
+               void *user_data)
 {
        data_h received_data = data;
 
@@ -91,9 +91,9 @@ static void llcp_receive_socket_cb(net_nfc_error_e result,
 }
 
 static void llcp_receive_from_socket_cb(net_nfc_error_e result,
-                                               sap_t sap,
-                                               data_h data,
-                                               void *user_data)
+               sap_t sap,
+               data_h data,
+               void *user_data)
 {
        data_h received_data = data;
 
@@ -108,8 +108,8 @@ static void llcp_receive_from_socket_cb(net_nfc_error_e result,
 
 
 static void llcp_connect_socket_cb(net_nfc_error_e result,
-                               net_nfc_llcp_socket_t client_socket,
-                               void *user_data)
+               net_nfc_llcp_socket_t client_socket,
+               void *user_data)
 {
        g_print("llcp_connect_socket_cb Completed %d\n", client_socket);
        g_print("llcp_connect_socket_cb Completed %d\n", result);
@@ -119,8 +119,8 @@ static void llcp_connect_socket_cb(net_nfc_error_e result,
 
 
 static void llcp_connect_sap_cb(net_nfc_error_e result,
-                               net_nfc_llcp_socket_t client_socket,
-                               void *user_data)
+               net_nfc_llcp_socket_t client_socket,
+               void *user_data)
 {
        g_print("llcp_connect_socket_cb Completed %d\n", client_socket);
        g_print("llcp_connect_socket_cb Completed %d\n", result);
@@ -130,8 +130,8 @@ static void llcp_connect_sap_cb(net_nfc_error_e result,
 
 
 static void llcp_send_socket_cb(net_nfc_error_e result,
-                               net_nfc_llcp_socket_t client_socket,
-                               void *user_data)
+               net_nfc_llcp_socket_t client_socket,
+               void *user_data)
 {
        g_print("llcp_send_socket_cb    Completed %d\n", client_socket);
        g_print("llcp_send_socket_cb    Completed %d\n", result);
@@ -141,8 +141,8 @@ static void llcp_send_socket_cb(net_nfc_error_e result,
 }
 
 static void llcp_send_to_socket_cb(net_nfc_error_e result,
-                               net_nfc_llcp_socket_t client_socket,
-                               void *user_data)
+               net_nfc_llcp_socket_t client_socket,
+               void *user_data)
 {
        g_print("llcp_send_to_socket_cb Completed %d\n", client_socket);
        g_print("llcp_send_to_socket_cb Completed %d\n", result);
@@ -152,8 +152,8 @@ static void llcp_send_to_socket_cb(net_nfc_error_e result,
 }
 
 static void llcp_disconnect_socket_cb(net_nfc_error_e result,
-                               net_nfc_llcp_socket_t client_socket,
-                               void *user_data)
+               net_nfc_llcp_socket_t client_socket,
+               void *user_data)
 {
        g_print("llcp_send_to_socket_cb Completed %d\n", client_socket);
        g_print("llcp_send_to_socket_cb Completed %d\n", result);
@@ -163,8 +163,8 @@ static void llcp_disconnect_socket_cb(net_nfc_error_e result,
 }
 
 static void llcp_close_completed_cb(net_nfc_error_e result,
-                               net_nfc_llcp_socket_t client_socket,
-                               void *user_data)
+               net_nfc_llcp_socket_t client_socket,
+               void *user_data)
 {
 
        g_print("llcp_close_completed_cb Completed %d\n", client_socket);
@@ -176,7 +176,7 @@ static void llcp_close_completed_cb(net_nfc_error_e result,
 /*********************************** Function Calls *************************************/
 
 void net_nfc_test_llcp_default_config(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
 
@@ -190,13 +190,13 @@ void net_nfc_test_llcp_default_config(gpointer data,
 
        }
        result = net_nfc_client_llcp_config(llcp_config_default,
-                                       llcp_default_config_cb,
-                                       user_data);
+                       llcp_default_config_cb,
+                       user_data);
 
 }
 
 void net_nfc_test_llcp_default_config_sync(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
 
@@ -220,7 +220,7 @@ void net_nfc_test_llcp_default_config_sync(gpointer data,
 
 
 void net_nfc_test_llcp_custom_config(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
 
        net_nfc_error_e result;
@@ -235,15 +235,15 @@ void net_nfc_test_llcp_custom_config(gpointer data,
 
        }
        result = net_nfc_client_llcp_config(llcp_config,
-                                       llcp_custom_config_cb,
-                                       user_data);
+                       llcp_custom_config_cb,
+                       user_data);
 
 }
 
 
 
 void net_nfc_test_llcp_custom_config_sync(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
 
        net_nfc_error_e result;
@@ -267,7 +267,7 @@ void net_nfc_test_llcp_custom_config_sync(gpointer data,
 }
 
 void net_nfc_test_llcp_get_local_config(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_llcp_config_info_h local_config;
        net_nfc_error_e result;
@@ -292,9 +292,9 @@ void net_nfc_test_llcp_get_local_config(gpointer data,
 
 /*commented because remote config API is not available*/
 /*
-void net_nfc_test_llcp_get_remote_config(gpointer data,
-                       gpointer user_data)
-{
+       void net_nfc_test_llcp_get_remote_config(gpointer data,
+       gpointer user_data)
+       {
        net_nfc_llcp_config_info_h local_config;
        net_nfc_error_e result;
 
@@ -302,9 +302,9 @@ void net_nfc_test_llcp_get_remote_config(gpointer data,
 
        if(result != NET_NFC_OK)
        {
-               g_print(" llcp create custom config failed: %d\n", result);
-               run_next_callback(user_data);
-               return;
+       g_print(" llcp create custom config failed: %d\n", result);
+       run_next_callback(user_data);
+       return;
 
        }
 
@@ -313,11 +313,11 @@ void net_nfc_test_llcp_get_remote_config(gpointer data,
        g_print(" net_nfc_test_llcp_get_local_config: %d\n", local_config->lto);
        g_print("net_nfc_test_llcp_get_local_config: %d\n", local_config->option);
 
-}
-*/
+       }
+       */
 
 void net_nfc_test_llcp_get_config_miu(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
 
        net_nfc_error_e result;
@@ -343,7 +343,7 @@ void net_nfc_test_llcp_get_config_miu(gpointer data,
 
 
 void net_nfc_test_llcp_get_config_wks(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        uint16_t wks;
@@ -366,7 +366,7 @@ void net_nfc_test_llcp_get_config_wks(gpointer data,
 }
 
 void net_nfc_test_llcp_get_config_lto(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        uint8_t lto;
@@ -391,7 +391,7 @@ void net_nfc_test_llcp_get_config_lto(gpointer data,
 
 
 void net_nfc_test_llcp_get_config_option(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        uint8_t option;
@@ -416,7 +416,7 @@ void net_nfc_test_llcp_get_config_option(gpointer data,
 
 
 void net_nfc_test_llcp_set_config_miu(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        uint16_t miu = 128;
@@ -441,7 +441,7 @@ void net_nfc_test_llcp_set_config_miu(gpointer data,
 
 
 void net_nfc_test_llcp_set_config_wks(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        uint16_t wks = 1;
@@ -466,7 +466,7 @@ void net_nfc_test_llcp_set_config_wks(gpointer data,
 
 
 void net_nfc_test_llcp_set_config_lto(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        uint16_t lto = 10;
@@ -490,7 +490,7 @@ void net_nfc_test_llcp_set_config_lto(gpointer data,
 
 
 void net_nfc_test_llcp_set_config_option(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
 
        net_nfc_error_e result;
@@ -514,7 +514,7 @@ void net_nfc_test_llcp_set_config_option(gpointer data,
 
 
 void net_nfc_test_llcp_free_config(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
 
@@ -536,15 +536,14 @@ void net_nfc_test_llcp_free_config(gpointer data,
 
 
 void net_nfc_test_llcp_create_custom_socket_option(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
-
        net_nfc_error_e result;
 
        result = net_nfc_client_llcp_create_socket_option(&test_option,
-                                               128,
-                                               1,
-                                               NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONORIENTED);
+                       128,
+                       1,
+                       NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONORIENTED);
 
        if(result != NET_NFC_OK)
        {
@@ -560,9 +559,8 @@ void net_nfc_test_llcp_create_custom_socket_option(gpointer data,
 }
 
 void net_nfc_test_llcp_create_default_socket_option(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
-
        net_nfc_error_e result;
 
        result = net_nfc_client_llcp_create_socket_option_default(&test_option);
@@ -580,31 +578,29 @@ void net_nfc_test_llcp_create_default_socket_option(gpointer data,
 }
 
 void net_nfc_test_llcp_get_local_socket_option(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        net_nfc_llcp_socket_option_h option_local;
 
        result = net_nfc_client_llcp_get_local_socket_option(client_test_socket,&option_local);
 
-if(result != NET_NFC_OK)
-{
-       g_print(" net_nfc_test_llcp_get_local_socket_option failed: %d\n", result);
-       run_next_callback(user_data);
-       return;
-}
-
-g_print(" net_nfc_test_llcp_get_local_socket_option: %d\n", option_local->miu);
-g_print("net_nfc_test_llcp_get_local_socket_option: %d\n", option_local->rw);
-g_print(" net_nfc_test_llcp_get_local_socket_option: %d\n", option_local->type);
-
-run_next_callback(user_data);
+       if(result != NET_NFC_OK)
+       {
+               g_print(" net_nfc_test_llcp_get_local_socket_option failed: %d\n", result);
+               run_next_callback(user_data);
+               return;
+       }
 
+       g_print(" net_nfc_test_llcp_get_local_socket_option: %d\n", option_local->miu);
+       g_print("net_nfc_test_llcp_get_local_socket_option: %d\n", option_local->rw);
+       g_print(" net_nfc_test_llcp_get_local_socket_option: %d\n", option_local->type);
 
+       run_next_callback(user_data);
 }
 
 void net_nfc_test_llcp_get_socket_option_miu(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        uint16_t miu;
@@ -625,7 +621,7 @@ void net_nfc_test_llcp_get_socket_option_miu(gpointer data,
 
 
 void net_nfc_test_llcp_set_socket_option_miu(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        uint16_t miu = 128;
@@ -644,9 +640,8 @@ void net_nfc_test_llcp_set_socket_option_miu(gpointer data,
 }
 
 void net_nfc_test_llcp_get_socket_option_rw(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
-
        net_nfc_error_e result;
        uint8_t rw;
 
@@ -665,9 +660,8 @@ void net_nfc_test_llcp_get_socket_option_rw(gpointer data,
 
 
 void net_nfc_test_llcp_set_socket_option_rw(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
-
        net_nfc_error_e result;
        uint8_t rw = 1;
 
@@ -685,7 +679,7 @@ void net_nfc_test_llcp_set_socket_option_rw(gpointer data,
 }
 
 void net_nfc_test_llcp_get_socket_option_type(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        net_nfc_socket_type_e type;
@@ -705,9 +699,8 @@ void net_nfc_test_llcp_get_socket_option_type(gpointer data,
 
 
 void net_nfc_test_llcp_set_socket_option_type(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
-
        net_nfc_error_e result;
        net_nfc_socket_type_e type = NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONORIENTED;
 
@@ -725,7 +718,7 @@ void net_nfc_test_llcp_set_socket_option_type(gpointer data,
 }
 
 void net_nfc_test_llcp_free_socket_option(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
 
@@ -744,17 +737,17 @@ void net_nfc_test_llcp_free_socket_option(gpointer data,
 
 
 void net_nfc_test_llcp_listen(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
 
        net_nfc_client_llcp_create_socket(&server_test_socket,NULL);
 
        result = net_nfc_client_llcp_listen(server_test_socket,
-                               "urn:nfc:xsn:samsung.com:testllcp" ,
-                               16 ,
-                               llcp_listen_socket_cb,
-                               NULL);
+                       "urn:nfc:xsn:samsung.com:testllcp" ,
+                       16 ,
+                       llcp_listen_socket_cb,
+                       NULL);
 
        if(result != NET_NFC_OK)
        {
@@ -764,7 +757,7 @@ void net_nfc_test_llcp_listen(gpointer data,
 }
 
 void net_nfc_test_llcp_listen_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        net_nfc_llcp_socket_t out_socket;
@@ -772,9 +765,9 @@ void net_nfc_test_llcp_listen_sync(gpointer data,
        net_nfc_client_llcp_create_socket(&server_test_socket,NULL);
 
        result = net_nfc_client_llcp_listen_sync(server_test_socket,
-                               "urn:nfc:xsn:samsung.com:testllcp" ,
-                               16 ,
-                               &out_socket);
+                       "urn:nfc:xsn:samsung.com:testllcp" ,
+                       16 ,
+                       &out_socket);
 
        if(result != NET_NFC_OK)
        {
@@ -790,16 +783,16 @@ void net_nfc_test_llcp_listen_sync(gpointer data,
 
 
 void net_nfc_test_llcp_receive(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
 
        net_nfc_error_e result;
 
 
        result = net_nfc_client_llcp_receive(server_test_socket,
-                               512,
-                               llcp_receive_socket_cb,
-                               NULL);
+                       512,
+                       llcp_receive_socket_cb,
+                       NULL);
 
        if(result != NET_NFC_OK)
        {
@@ -810,15 +803,15 @@ void net_nfc_test_llcp_receive(gpointer data,
 
 
 void net_nfc_test_llcp_receive_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        data_h out_data;
 
 
        result = net_nfc_client_llcp_receive_sync(server_test_socket,
-                               512,
-                               &out_data);
+                       512,
+                       &out_data);
 
        if(result != NET_NFC_OK)
        {
@@ -834,15 +827,15 @@ void net_nfc_test_llcp_receive_sync(gpointer data,
 
 
 void net_nfc_test_llcp_receive_from(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
 
 
        result = net_nfc_client_llcp_receive_from(server_test_socket,
-                               512,
-                               llcp_receive_from_socket_cb,
-                               NULL);
+                       512,
+                       llcp_receive_from_socket_cb,
+                       NULL);
 
        if(result != NET_NFC_OK)
        {
@@ -852,16 +845,16 @@ void net_nfc_test_llcp_receive_from(gpointer data,
 }
 
 void net_nfc_test_llcp_receive_from_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        data_h out_data;
        sap_t sap_data;
 
        result = net_nfc_client_llcp_receive_from_sync(server_test_socket,
-                               512,
-                               &sap_data,
-                               &out_data);
+                       512,
+                       &sap_data,
+                       &out_data);
 
        if(result != NET_NFC_OK)
        {
@@ -877,7 +870,7 @@ void net_nfc_test_llcp_receive_from_sync(gpointer data,
 
 
 void net_nfc_test_llcp_create_socket(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
 
        net_nfc_client_llcp_create_socket(&client_test_socket, NULL);
@@ -888,13 +881,13 @@ void net_nfc_test_llcp_create_socket(gpointer data,
 
 
 void net_nfc_test_llcp_close_socket(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
 
        result = net_nfc_client_llcp_close(client_test_socket,
-                                                       llcp_close_completed_cb,
-                                                       user_data);
+                       llcp_close_completed_cb,
+                       user_data);
 
        g_print(" net_nfc_test_llcp_close_socket %d\n",result);
 
@@ -902,13 +895,13 @@ void net_nfc_test_llcp_close_socket(gpointer data,
 
 
 void net_nfc_test_llcp_close_socket_sync(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_llcp_socket_t out_socket;
        net_nfc_error_e result;
 
        result = net_nfc_client_llcp_close_sync(client_test_socket,
-                                                       &out_socket);
+                       &out_socket);
 
        g_print(" net_nfc_test_llcp_close_socket %d\n",result);
 
@@ -916,16 +909,16 @@ void net_nfc_test_llcp_close_socket_sync(gpointer data,
 
 
 void net_nfc_test_llcp_connect(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
 
        net_nfc_client_llcp_create_socket(&client_test_socket, NULL);
 
        result = net_nfc_client_llcp_connect(client_test_socket,
-                               "urn:nfc:xsn:samsung.com:testllcp",
-                               llcp_connect_socket_cb,
-                               user_data);
+                       "urn:nfc:xsn:samsung.com:testllcp",
+                       llcp_connect_socket_cb,
+                       user_data);
 
        if(result != NET_NFC_OK)
        {
@@ -936,7 +929,7 @@ void net_nfc_test_llcp_connect(gpointer data,
 }
 
 void net_nfc_test_llcp_connect_sync(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        net_nfc_llcp_socket_t out_socket;
@@ -944,8 +937,8 @@ void net_nfc_test_llcp_connect_sync(gpointer data,
        net_nfc_client_llcp_create_socket(&client_test_socket, NULL);
 
        result = net_nfc_client_llcp_connect_sync(client_test_socket,
-                               "urn:nfc:xsn:samsung.com:testllcp",
-                               &out_socket);
+                       "urn:nfc:xsn:samsung.com:testllcp",
+                       &out_socket);
 
        if(result != NET_NFC_OK)
        {
@@ -959,16 +952,16 @@ void net_nfc_test_llcp_connect_sync(gpointer data,
 }
 
 void net_nfc_test_llcp_connect_sap(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
 
        net_nfc_client_llcp_create_socket(&client_test_socket, NULL);
 
        result = net_nfc_client_llcp_connect_sap(client_test_socket,
-                               16,
-                               llcp_connect_sap_cb,
-                               user_data);
+                       16,
+                       llcp_connect_sap_cb,
+                       user_data);
 
        if(result != NET_NFC_OK)
        {
@@ -979,7 +972,7 @@ void net_nfc_test_llcp_connect_sap(gpointer data,
 }
 
 void net_nfc_test_llcp_connect_sap_sync(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        net_nfc_llcp_socket_t out_socket;
@@ -987,8 +980,8 @@ void net_nfc_test_llcp_connect_sap_sync(gpointer data,
        net_nfc_client_llcp_create_socket(&client_test_socket, NULL);
 
        result = net_nfc_client_llcp_connect_sap_sync(client_test_socket,
-                               16,
-                               &out_socket);
+                       16,
+                       &out_socket);
 
        if(result != NET_NFC_OK)
        {
@@ -1004,7 +997,7 @@ void net_nfc_test_llcp_connect_sap_sync(gpointer data,
 
 
 void net_nfc_test_llcp_send(gpointer func_data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        data_h data;
@@ -1013,9 +1006,9 @@ void net_nfc_test_llcp_send(gpointer func_data,
        net_nfc_create_data (&data, (const uint8_t*)str ,strlen (str) + 1);
 
        result = net_nfc_client_llcp_send(client_test_socket,
-                               data,
-                               llcp_send_socket_cb,
-                               user_data);
+                       data,
+                       llcp_send_socket_cb,
+                       user_data);
 
        if(result != NET_NFC_OK)
        {
@@ -1027,7 +1020,7 @@ void net_nfc_test_llcp_send(gpointer func_data,
 
 
 void net_nfc_test_llcp_send_sync(gpointer func_data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        data_h data;
@@ -1037,8 +1030,8 @@ void net_nfc_test_llcp_send_sync(gpointer func_data,
        net_nfc_create_data (&data, (const uint8_t*)str ,strlen (str) + 1);
 
        result = net_nfc_client_llcp_send_sync(client_test_socket,
-                               data,
-                               &out_socket);
+                       data,
+                       &out_socket);
 
        if(result != NET_NFC_OK)
        {
@@ -1054,7 +1047,7 @@ void net_nfc_test_llcp_send_sync(gpointer func_data,
 
 
 void net_nfc_test_llcp_send_to(gpointer func_data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        data_h data;
@@ -1063,10 +1056,10 @@ void net_nfc_test_llcp_send_to(gpointer func_data,
        net_nfc_create_data (&data, (const uint8_t*)str ,strlen (str) + 1);
 
        result = net_nfc_client_llcp_send_to(client_test_socket,
-                               16,
-                               data,
-                               llcp_send_to_socket_cb,
-                               user_data);
+                       16,
+                       data,
+                       llcp_send_to_socket_cb,
+                       user_data);
 
        if(result != NET_NFC_OK)
        {
@@ -1078,7 +1071,7 @@ void net_nfc_test_llcp_send_to(gpointer func_data,
 
 
 void net_nfc_test_llcp_send_to_sync(gpointer func_data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        data_h data;
@@ -1088,9 +1081,9 @@ void net_nfc_test_llcp_send_to_sync(gpointer func_data,
        net_nfc_create_data (&data, (const uint8_t*)str ,strlen (str) + 1);
 
        result = net_nfc_client_llcp_send_to_sync(client_test_socket,
-                               16,
-                               data,
-                               &out_socket);
+                       16,
+                       data,
+                       &out_socket);
 
        if(result != NET_NFC_OK)
        {
@@ -1106,13 +1099,13 @@ void net_nfc_test_llcp_send_to_sync(gpointer func_data,
 
 
 void net_nfc_test_llcp_disconnect(gpointer func_data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
 
        result = net_nfc_client_llcp_disconnect(client_test_socket,
-                               llcp_disconnect_socket_cb,
-                               user_data);
+                       llcp_disconnect_socket_cb,
+                       user_data);
 
        if(result != NET_NFC_OK)
        {
@@ -1123,13 +1116,13 @@ void net_nfc_test_llcp_disconnect(gpointer func_data,
 }
 
 void net_nfc_test_llcp_disconnect_server(gpointer func_data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
 
        result = net_nfc_client_llcp_disconnect(server_test_socket,
-                               llcp_disconnect_socket_cb,
-                               user_data);
+                       llcp_disconnect_socket_cb,
+                       user_data);
 
        if(result != NET_NFC_OK)
        {
@@ -1141,7 +1134,7 @@ void net_nfc_test_llcp_disconnect_server(gpointer func_data,
 
 
 void net_nfc_test_llcp_disconnect_sync(gpointer func_data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        net_nfc_llcp_socket_t out_socket;
diff --git a/tests/net_nfc_test_llcp.h b/tests/net_nfc_test_llcp.h
new file mode 100644 (file)
index 0000000..a8d7dd0
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * 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_TEST_LLCP_H__
+#define __NET_NFC_TEST_LLCP_H__
+
+#include <glib.h>
+
+
+void net_nfc_test_llcp_default_config(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_default_config_sync(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_get_local_config(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_custom_config(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_custom_config_sync(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_get_local_config(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_get_config_miu(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_get_config_wks(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_get_config_lto(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_get_config_option(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_set_config_miu(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_set_config_wks(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_set_config_lto(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_set_config_option(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_free_config(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_create_custom_socket_option(gpointer data,
+       gpointer user_data);
+void net_nfc_test_llcp_create_default_socket_option(gpointer data,
+       gpointer user_data);
+void net_nfc_test_llcp_get_local_socket_option(gpointer data,
+       gpointer user_data);
+void net_nfc_test_llcp_get_socket_option_miu(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_set_socket_option_miu(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_get_socket_option_rw(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_set_socket_option_rw(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_get_socket_option_type(gpointer data,
+       gpointer user_data);
+void net_nfc_test_llcp_set_socket_option_type(gpointer data,
+       gpointer user_data);
+void net_nfc_test_llcp_free_socket_option(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_listen(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_listen_sync(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_receive(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_receive_sync(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_receive_from(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_receive_from_sync(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_create_socket(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_close_socket(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_close_socket_sync(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_connect(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_connect_sync(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_connect_sap(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_connect_sap_sync(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_send(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_send_sync(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_send_to(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_send_to_sync(gpointer data, gpointer user_data);
+void net_nfc_test_llcp_disconnect(gpointer func_data, gpointer user_data);
+void net_nfc_test_llcp_disconnect_server(gpointer func_data, gpointer user_data);
+void net_nfc_test_llcp_disconnect_sync(gpointer func_data, gpointer user_data);
+
+#endif //__NET_NFC_TEST_LLCP_H__
\ No newline at end of file
index 60a9018..c125f5c 100644 (file)
@@ -27,11 +27,11 @@ static void set_activated_cb(bool state,
                void *user_data);
 
 static void set_active_completed_cb(net_nfc_error_e result,
-                               void *user_data);
+               void *user_data);
 
 static void get_server_state_completed_cb(net_nfc_error_e result,
-                               unsigned int state,
-                               void *user_data);
+               unsigned int state,
+               void *user_data);
 
 static void run_next_callback(gpointer user_data)
 {
@@ -59,7 +59,7 @@ static void print_server_state(gint state)
                if (state & NET_NFC_SNEP_CLIENT_CONNECTED)
                {
                        g_print("\tNET_NFC_SNEP_CLIENT_CONNECTED(%d)\n",
-                                                               state);
+                                       state);
                }
                if (state & NET_NFC_NPP_CLIENT_CONNECTED)
                        g_print("\tNET_NFC_NPP_CLIENT_CONNECTED(%d)\n", state);
@@ -71,21 +71,21 @@ static void print_server_state(gint state)
 }
 
 static void set_activated_cb(bool state,
-                       void *user_data)
+               void *user_data)
 {
        g_print("Activated state %d\n", state);
 }
 
 static void set_active_completed_cb(net_nfc_error_e result,
-                               void *user_data)
+               void *user_data)
 {
        g_print("SetActive Completed %d\n", result);
        run_next_callback(user_data);
 }
 
 static void get_server_state_completed_cb(net_nfc_error_e result,
-                               unsigned int state,
-                               void *user_data)
+               unsigned int state,
+               void *user_data)
 {
        g_print("GetServerState Completed %d\n", result);
 
@@ -95,24 +95,24 @@ static void get_server_state_completed_cb(net_nfc_error_e result,
 }
 
 void net_nfc_test_manager_set_active(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_client_manager_set_activated(set_activated_cb, NULL);
 
        net_nfc_client_manager_set_active(1,
-                                       set_active_completed_cb,
-                                       user_data);
+                       set_active_completed_cb,
+                       user_data);
 }
 
 void net_nfc_test_manager_get_server_state(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_client_manager_get_server_state(get_server_state_completed_cb,
-                                               user_data);
+                       user_data);
 }
 
 void net_nfc_test_manager_set_active_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        gint i;
 
@@ -131,7 +131,7 @@ void net_nfc_test_manager_set_active_sync(gpointer data,
 }
 
 void net_nfc_test_manager_get_server_state_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        guint state = 0;
index e0e356b..16d1211 100644 (file)
@@ -36,8 +36,8 @@ static void print_ndef_message(ndef_message_h message);
 static net_nfc_target_handle_h ndef_get_handle(void);
 
 static ndef_message_h create_ndef_message_text(const gchar *str,
-                                       const gchar *lang,
-                                       net_nfc_encode_type_e encode);
+               const gchar *lang,
+               net_nfc_encode_type_e encode);
 
 static void set_string(const gchar *str);
 
@@ -52,7 +52,7 @@ static void ndef_write_cb(net_nfc_error_e result,
                void *user_data);
 
 static void ndef_make_read_only_cb(net_nfc_error_e result,
-                               void *user_data);
+               void *user_data);
 
 static void ndef_format_cb(net_nfc_error_e result,
                void *user_data);
@@ -106,14 +106,14 @@ static void print_record_well_known_type(ndef_record_h record)
        net_nfc_get_encoding_type_from_text_record(record, &enc);
        switch (enc)
        {
-               case NET_NFC_ENCODE_UTF_8:
-                       g_print("Encoding: UTF-8\n");
-                       break;
-               case NET_NFC_ENCODE_UTF_16:
-                       g_print("Encoding: UTF-16\n");
-                       break;
-               default:
-                       g_print("Encoding: Unknown\n");
+       case NET_NFC_ENCODE_UTF_8:
+               g_print("Encoding: UTF-8\n");
+               break;
+       case NET_NFC_ENCODE_UTF_16:
+               g_print("Encoding: UTF-16\n");
+               break;
+       default:
+               g_print("Encoding: Unknown\n");
        }
 }
 
@@ -168,24 +168,24 @@ static void print_record(ndef_record_h record)
 
        switch(tnf)
        {
-               case NET_NFC_RECORD_EMPTY:
-                       break;
-               case NET_NFC_RECORD_WELL_KNOWN_TYPE:
-                       print_record_well_known_type(record);
-                       break;
-               case NET_NFC_RECORD_MIME_TYPE:
-                       break;
-               case NET_NFC_RECORD_URI:
-                       break;
-               case NET_NFC_RECORD_EXTERNAL_RTD:
-                       break;
-               case NET_NFC_RECORD_UNKNOWN:
-                       break;
-               case NET_NFC_RECORD_UNCHAGNED:
-                       break;
-               default:
-                       g_print("TNF: unknown error\n");
-                       break;
+       case NET_NFC_RECORD_EMPTY:
+               break;
+       case NET_NFC_RECORD_WELL_KNOWN_TYPE:
+               print_record_well_known_type(record);
+               break;
+       case NET_NFC_RECORD_MIME_TYPE:
+               break;
+       case NET_NFC_RECORD_URI:
+               break;
+       case NET_NFC_RECORD_EXTERNAL_RTD:
+               break;
+       case NET_NFC_RECORD_UNKNOWN:
+               break;
+       case NET_NFC_RECORD_UNCHAGNED:
+               break;
+       default:
+               g_print("TNF: unknown error\n");
+               break;
        }
 }
 
@@ -201,7 +201,7 @@ static void print_ndef_message(ndef_message_h message)
        }
 
        if (net_nfc_get_ndef_message_record_count(message,
-                                               &count) != NET_NFC_OK)
+                               &count) != NET_NFC_OK)
        {
                g_print("can not get count of record\n");
                return;
@@ -214,8 +214,8 @@ static void print_ndef_message(ndef_message_h message)
                g_print("Record count : %d\n", i+1);
 
                if (net_nfc_get_record_by_index(message,
-                                               i,
-                                               &record) != NET_NFC_OK)
+                                       i,
+                                       &record) != NET_NFC_OK)
                {
                        g_print("can not get record from index %d\n", i);
                        continue;
@@ -255,8 +255,8 @@ static net_nfc_target_handle_h ndef_get_handle(void)
 }
 
 static ndef_message_h create_ndef_message_text(const gchar *str,
-                                       const gchar *lang,
-                                       net_nfc_encode_type_e encode)
+               const gchar *lang,
+               net_nfc_encode_type_e encode)
 {
        ndef_record_h record = NULL;
        ndef_message_h message = NULL;
@@ -268,9 +268,9 @@ static ndef_message_h create_ndef_message_text(const gchar *str,
        }
 
        if (net_nfc_create_text_type_record(&record,
-                                       str,
-                                       lang,
-                                       encode) != NET_NFC_OK)
+                               str,
+                               lang,
+                               encode) != NET_NFC_OK)
        {
                g_printerr("Can not create text record(%s, %d): %s\n",
                                lang, encode, str);
@@ -280,7 +280,7 @@ static ndef_message_h create_ndef_message_text(const gchar *str,
        }
 
        if (net_nfc_append_record_to_ndef_message(message,
-                                       record) != NET_NFC_OK)
+                               record) != NET_NFC_OK)
        {
                g_printerr("Can not append record to message\n");
                net_nfc_free_ndef_message(message);
@@ -356,7 +356,7 @@ static void ndef_write_cb(net_nfc_error_e result,
 
 
 static void ndef_make_read_only_cb(net_nfc_error_e result,
-                               void *user_data)
+               void *user_data)
 {
        g_print("Make Read only Completed %d\n", result);
 
@@ -375,7 +375,7 @@ static void ndef_format_cb(net_nfc_error_e result,
 
 
 void net_nfc_test_ndef_read(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_target_handle_h handle;
 
@@ -392,12 +392,12 @@ void net_nfc_test_ndef_read(gpointer data,
        g_print("Handle is %#x\n", GPOINTER_TO_UINT(handle));
 
        net_nfc_client_ndef_read(handle,
-                               ndef_read_cb,
-                               user_data);
+                       ndef_read_cb,
+                       user_data);
 }
 
 void net_nfc_test_ndef_write(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_target_handle_h handle;
        ndef_message_h message;
@@ -425,8 +425,8 @@ void net_nfc_test_ndef_write(gpointer data,
        }
 
        message = create_ndef_message_text(str,
-                                       "en-US",
-                                       NET_NFC_ENCODE_UTF_8);
+                       "en-US",
+                       NET_NFC_ENCODE_UTF_8);
 
        g_free(str);
 
@@ -439,14 +439,14 @@ void net_nfc_test_ndef_write(gpointer data,
        }
 
        net_nfc_client_ndef_write(handle,
-                               message,
-                               ndef_write_cb,
-                               user_data);
+                       message,
+                       ndef_write_cb,
+                       user_data);
 
 }
 
 void net_nfc_test_ndef_make_read_only(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_target_handle_h handle;
 
@@ -462,12 +462,12 @@ void net_nfc_test_ndef_make_read_only(gpointer data,
        g_print("Handle is %#x\n", GPOINTER_TO_UINT(handle));
 
        net_nfc_client_ndef_make_read_only(handle,
-                                       ndef_make_read_only_cb,
-                                       user_data);
+                       ndef_make_read_only_cb,
+                       user_data);
 }
 
 void net_nfc_test_ndef_format(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_target_handle_h handle;
        data_h key;
@@ -485,9 +485,9 @@ void net_nfc_test_ndef_format(gpointer data,
        net_nfc_create_data(&key, format_data, 6);
 
        net_nfc_client_ndef_format(handle,
-                               key,
-                               ndef_format_cb,
-                               user_data);
+                       key,
+                       ndef_format_cb,
+                       user_data);
 
        net_nfc_free_data(key);
 
@@ -495,7 +495,7 @@ void net_nfc_test_ndef_format(gpointer data,
 }
 
 void net_nfc_test_ndef_read_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_target_handle_h handle;
        ndef_message_h message = NULL;
@@ -513,7 +513,7 @@ void net_nfc_test_ndef_read_sync(gpointer data,
        g_print("Handle is %#x\n", GPOINTER_TO_UINT(handle));
 
        result = net_nfc_client_ndef_read_sync(handle,
-                                       &message);
+                       &message);
 
        g_print("Read Ndef: %d\n", result);
 
@@ -525,7 +525,7 @@ void net_nfc_test_ndef_read_sync(gpointer data,
 }
 
 void net_nfc_test_ndef_write_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        gchar *str = NULL;
 
@@ -554,8 +554,8 @@ void net_nfc_test_ndef_write_sync(gpointer data,
        }
 
        message = create_ndef_message_text(str,
-                                       "en-US",
-                                       NET_NFC_ENCODE_UTF_8);
+                       "en-US",
+                       NET_NFC_ENCODE_UTF_8);
 
        g_free(str);
 
@@ -576,7 +576,7 @@ void net_nfc_test_ndef_write_sync(gpointer data,
 }
 
 void net_nfc_test_ndef_make_read_only_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_target_handle_h handle;
        net_nfc_error_e result;
@@ -601,7 +601,7 @@ void net_nfc_test_ndef_make_read_only_sync(gpointer data,
 }
 
 void net_nfc_test_ndef_format_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_target_handle_h handle;
        net_nfc_error_e result;
index 0311050..54b686a 100644 (file)
@@ -31,10 +31,10 @@ static net_nfc_target_handle_h global_handle = NULL;
 static void run_next_callback(gpointer user_data);
 
 static void p2p_send(net_nfc_error_e result,
-                       void *user_data);
+               void *user_data);
 
 static void p2p_device_discovered(net_nfc_target_handle_h handle,
-                               void *user_data);
+               void *user_data);
 
 
 static void p2p_device_detached(void * user_data);
@@ -54,7 +54,7 @@ static void run_next_callback(gpointer user_data)
 }
 
 static void p2p_send(net_nfc_error_e result,
-                       void *user_data)
+               void *user_data)
 {
        g_print("P2P send  Completed %d\n", result);
 
@@ -62,7 +62,7 @@ static void p2p_send(net_nfc_error_e result,
 }
 
 static void p2p_device_discovered(net_nfc_target_handle_h handle,
-                               void *user_data)
+               void *user_data)
 {
        g_print("Target is Discovered\n");
        global_handle = handle;
@@ -88,7 +88,7 @@ static void p2p_device_data_received(data_h p2p_data, void *user_data)
 }
 
 void net_nfc_test_p2p_send(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
 
        net_nfc_error_e result = NET_NFC_OK;
@@ -113,14 +113,14 @@ void net_nfc_test_p2p_send(gpointer data,
        g_print("Handle is %#x\n", GPOINTER_TO_UINT(global_handle));
 
        net_nfc_client_p2p_send(
-                               exch_data,
-                               global_handle,
-                               p2p_send,
-                               user_data);
+                       exch_data,
+                       global_handle,
+                       p2p_send,
+                       user_data);
 }
 
 void net_nfc_test_p2p_send_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        ndef_message_h msg = NULL;
@@ -141,7 +141,7 @@ void net_nfc_test_p2p_send_sync(gpointer data,
 }
 
 void net_nfc_test_p2p_set_device_discovered(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        g_print("Waiting for Device Discovered Singal\n");
 
@@ -151,17 +151,17 @@ void net_nfc_test_p2p_set_device_discovered(gpointer data,
 }
 
 void net_nfc_test_p2p_set_device_detached(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_client_p2p_set_device_detached(p2p_device_detached,
-                                               user_data);
+                       user_data);
 }
 
 void net_nfc_test_p2p_set_data_received(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_client_p2p_set_data_received(p2p_device_data_received,
-                                               user_data);
+                       user_data);
 }
 
 net_nfc_target_handle_h net_nfc_test_device_get_target_handle(void)
index f8386ee..5222b86 100644 (file)
@@ -31,21 +31,21 @@ static void send_apdu_cb(net_nfc_error_e result, data_h data, void *user_data);
 static void set_secure_element_cb(net_nfc_error_e result, void *user_data);
 
 static void open_secure_element_cb(net_nfc_error_e result,
-       net_nfc_target_handle_h handle, void *user_data);
+               net_nfc_target_handle_h handle, void *user_data);
 
 static void close_secure_element_cb(net_nfc_error_e result, void *user_data);
 
 static void get_atr_secure_element_cb(net_nfc_error_e result, data_h data,
-       void *user_data);
+               void *user_data);
 
 static void se_set_event_cb(net_nfc_message_e event, void *user_data);
 
 static void se_ese_detection_cb(net_nfc_target_handle_h handle,
-                               int dev_type, data_h data, void *user_data);
+               int dev_type, data_h data, void *user_data);
 
 static void se_set_transaction_cb(data_h aid,
-                               data_h param,
-                               void *user_data);
+               data_h param,
+               void *user_data);
 
 /*This handle would be intialized by open secure element callback function*/
 static net_nfc_target_handle_h global_handle = NULL;
@@ -75,7 +75,7 @@ static void set_secure_element_cb(net_nfc_error_e result, void* user_data)
 }
 
 static void open_secure_element_cb(net_nfc_error_e result,
-       net_nfc_target_handle_h handle, void* user_data)
+               net_nfc_target_handle_h handle, void* user_data)
 {
        g_print("Open secure element completed\n");
        // assigning received handle
@@ -91,7 +91,7 @@ static void close_secure_element_cb(net_nfc_error_e result, void* user_data)
 }
 
 static void get_atr_secure_element_cb(net_nfc_error_e result, data_h data,
-       void* user_data)
+               void* user_data)
 {
        g_print("get atr completed\n");
        print_received_data(data);
@@ -106,9 +106,9 @@ static void se_set_event_cb(net_nfc_message_e event, void* user_data)
 }
 
 static void se_ese_detection_cb(net_nfc_target_handle_h handle,
-                               int dev_type,
-                               data_h data,
-                               void *user_data)
+               int dev_type,
+               data_h data,
+               void *user_data)
 {
        g_print("Set ese detection callback successfully\n");
        g_print("Handle is %#x\n", GPOINTER_TO_UINT(handle));
@@ -117,8 +117,8 @@ static void se_ese_detection_cb(net_nfc_target_handle_h handle,
 }
 
 static void se_set_transaction_cb(data_h aid,
-                               data_h param,
-                               void *user_data)
+               data_h param,
+               void *user_data)
 {
        g_print("Set transaction callback successfully\n");
        g_print("*****displaying Aid data****\n");
@@ -129,7 +129,7 @@ static void se_set_transaction_cb(data_h aid,
 }
 
 void net_nfc_test_se_send_apdu(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        data_h apdu_data = NULL;
@@ -138,13 +138,13 @@ void net_nfc_test_se_send_apdu(gpointer data,
        net_nfc_create_data(&apdu_data, apdu_cmd, 4);
 
        result = net_nfc_client_se_send_apdu(global_handle,
-                               apdu_data,
-                               send_apdu_cb,
-                               user_data);
+                       apdu_data,
+                       send_apdu_cb,
+                       user_data);
 }
 
 void net_nfc_test_se_send_apdu_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        data_h apdu_data = NULL;
@@ -153,8 +153,8 @@ void net_nfc_test_se_send_apdu_sync(gpointer data,
 
        net_nfc_create_data(&apdu_data, apdu_cmd, 4);
        result = net_nfc_client_se_send_apdu_sync(global_handle,
-                               apdu_data,
-                               &response);
+                       apdu_data,
+                       &response);
 
        g_print(" Send apdu data sync completed %d\n", result);
        print_received_data(response);
@@ -162,19 +162,19 @@ void net_nfc_test_se_send_apdu_sync(gpointer data,
 }
 
 void net_nfc_test_se_set_secure_element_type(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_se_type_e se_type = NET_NFC_SE_TYPE_UICC;
 
        result = net_nfc_client_se_set_secure_element_type(
-                               se_type,
-                               set_secure_element_cb,
-                               user_data);
+                       se_type,
+                       set_secure_element_cb,
+                       user_data);
 }
 
 void net_nfc_test_se_set_secure_element_type_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_se_type_e se_type = NET_NFC_SE_TYPE_UICC;
@@ -185,27 +185,26 @@ void net_nfc_test_se_set_secure_element_type_sync(gpointer data,
 }
 
 void net_nfc_test_se_open_internal_secure_element(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_se_type_e se_type = NET_NFC_SE_TYPE_UICC;
 
        result = net_nfc_client_se_open_internal_secure_element(
-                               se_type,
-                               open_secure_element_cb,
-                               user_data);
-
+                       se_type,
+                       open_secure_element_cb,
+                       user_data);
 }
 
 void net_nfc_test_se_open_internal_secure_element_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_se_type_e se_type = NET_NFC_SE_TYPE_UICC;
 
        result = net_nfc_client_se_open_internal_secure_element_sync(
-                               se_type,
-                               &global_handle);
+                       se_type,
+                       &global_handle);
 
        g_print("Handle is %#x\n", GPOINTER_TO_UINT(global_handle));
        g_print(" open secure element completed %d\n", result);
@@ -213,19 +212,18 @@ void net_nfc_test_se_open_internal_secure_element_sync(gpointer data,
 }
 
 void net_nfc_test_se_close_internal_secure_element(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
 
        result = net_nfc_client_se_close_internal_secure_element(
-                               global_handle,
-                               close_secure_element_cb,
-                               user_data);
-
+                       global_handle,
+                       close_secure_element_cb,
+                       user_data);
 }
 
 void net_nfc_test_se_close_internal_secure_element_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
 
@@ -235,27 +233,26 @@ void net_nfc_test_se_close_internal_secure_element_sync(gpointer data,
 }
 
 void net_nfc_test_se_get_atr(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
 
 
        result = net_nfc_client_se_get_atr(
-                               global_handle,
-                               get_atr_secure_element_cb,
-                               user_data);
-
+                       global_handle,
+                       get_atr_secure_element_cb,
+                       user_data);
 }
 
 void net_nfc_test_se_get_atr_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        data_h attr_data = NULL;
 
        result = net_nfc_client_se_get_atr_sync(
-                               global_handle,
-                               &attr_data);
+                       global_handle,
+                       &attr_data);
 
        g_print("Get atr data sync completed %d\n", result);
        print_received_data(attr_data);
@@ -263,42 +260,42 @@ void net_nfc_test_se_get_atr_sync(gpointer data,
 }
 
 void net_nfc_test_se_set_event_cb(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_client_se_set_event_cb(se_set_event_cb,
-                               user_data);
+                       user_data);
 }
 
 void net_nfc_test_se_unset_event_cb(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_client_se_unset_event_cb();
        g_print(" Event unset callback successfully\n");
 }
 
 void net_nfc_test_se_set_ese_detection_cb(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_client_se_set_ese_detection_cb(se_ese_detection_cb,
-                               user_data);
+                       user_data);
 }
 
 void net_nfc_test_se_unset_ese_detection_cb(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_client_se_unset_ese_detection_cb();
        g_print("Detection unset callback successfuly\n");
 }
 
 void net_nfc_test_se_set_transaction_event_cb(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_client_se_set_transaction_event_cb(se_set_transaction_cb,
-                               user_data);
+                       user_data);
 }
 
 void net_nfc_test_se_unset_transaction_event_cb(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_client_se_unset_transaction_event_cb();
        g_print("Transaction unset callback successfully\n");
index 8949ebd..c668e3c 100644 (file)
@@ -30,34 +30,34 @@ static net_nfc_snep_handle_h snep_handle = NULL;
 static void run_next_callback(gpointer user_data);
 
 static void snep_tag_discovered_cb(net_nfc_target_info_h info,
-                       void *user_data);
+               void *user_data);
 
 static void snep_tag_detached_cb(void *user_data);
 
 static void snep_start_server_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_snep_type_t event,
+               net_nfc_error_e result,
+               ndef_message_h msg,
+               void *user_data);
 
 static void snep_start_client_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_snep_type_t event,
+               net_nfc_error_e result,
+               ndef_message_h msg,
+               void *user_data);
 
 static void snep_send_request_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_snep_type_t event,
+               net_nfc_error_e result,
+               ndef_message_h msg,
+               void *user_data);
 
 
 static void snep_register_server_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_snep_type_t event,
+               net_nfc_error_e result,
+               ndef_message_h msg,
+               void *user_data);
 
 /******************************Callbacks*********************************************/
 
@@ -79,7 +79,7 @@ static void snep_tag_detached_cb(void *user_data)
 }
 
 static void snep_tag_discovered_cb(net_nfc_target_info_h info,
-                       void *user_data)
+               void *user_data)
 {
        g_print("TagDiscovered\n");
 
@@ -88,10 +88,10 @@ static void snep_tag_discovered_cb(net_nfc_target_info_h info,
 }
 
 static void snep_start_server_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_snep_type_t event,
+               net_nfc_error_e result,
+               ndef_message_h msg,
+               void *user_data)
 {
 
        snep_handle = target;
@@ -106,10 +106,10 @@ static void snep_start_server_cb(net_nfc_snep_handle_h target,
 }
 
 static void snep_start_client_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_snep_type_t event,
+               net_nfc_error_e result,
+               ndef_message_h msg,
+               void *user_data)
 {
 
        g_print("snep_start_client_cb Completed %d\n", event);
@@ -120,10 +120,10 @@ static void snep_start_client_cb(net_nfc_snep_handle_h target,
 
 
 static void snep_send_request_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_snep_type_t event,
+               net_nfc_error_e result,
+               ndef_message_h msg,
+               void *user_data)
 {
 
        g_print("snep_send_request_cb Completed %d\n", event);
@@ -136,19 +136,19 @@ static void snep_send_request_cb(net_nfc_snep_handle_h target,
 
 
 static void snep_register_server_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_snep_type_t event,
+               net_nfc_error_e result,
+               ndef_message_h msg,
+               void *user_data)
+{
 
-               g_print("snep_register_server_cb Completed %d\n", event);
-               g_print("snep_register_server_cb Completed %d\n", result);
+       g_print("snep_register_server_cb Completed %d\n", event);
+       g_print("snep_register_server_cb Completed %d\n", result);
 
-               net_nfc_util_print_ndef_message (msg);
+       net_nfc_util_print_ndef_message (msg);
 
-               run_next_callback(user_data);
-       }
+       run_next_callback(user_data);
+}
 
 /*
 static void snep_unregister_server_cb(net_nfc_snep_handle_h target,
@@ -170,7 +170,7 @@ static void snep_unregister_server_cb(net_nfc_snep_handle_h target,
 /******************************API Calls*********************************************/
 
 void net_nfc_test_snep_set_tag_discovered(gpointer data,
-                                       gpointer user_data)
+               gpointer user_data)
 {
        g_print("Waiting for TagDiscovered Singal\n");
 
@@ -183,15 +183,15 @@ void net_nfc_test_snep_set_tag_discovered(gpointer data,
 
 
 void net_nfc_test_snep_start_server(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
 
        result = net_nfc_client_snep_start_server(target_info->handle,
-                                       "urn:nfc:xsn:samsung.com:testllcp",
-                                       16,
-                                       snep_start_server_cb,
-                                       user_data);
+                       "urn:nfc:xsn:samsung.com:testllcp",
+                       16,
+                       snep_start_server_cb,
+                       user_data);
 
        if(result != NET_NFC_OK)
        {
@@ -203,7 +203,7 @@ void net_nfc_test_snep_start_server(gpointer data,
 
 
 void net_nfc_test_snep_start_server_sync(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        /*
 
@@ -232,15 +232,15 @@ void net_nfc_test_snep_start_server_sync(gpointer data,
 
 
 void net_nfc_test_snep_start_client(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
 
        result = net_nfc_client_snep_start_client(target_info->handle,
-                                       "urn:nfc:xsn:samsung.com:testllcp",
-                                       16,
-                                       snep_start_client_cb,
-                                       user_data);
+                       "urn:nfc:xsn:samsung.com:testllcp",
+                       16,
+                       snep_start_client_cb,
+                       user_data);
 
        if(result != NET_NFC_OK)
        {
@@ -251,7 +251,7 @@ void net_nfc_test_snep_start_client(gpointer data,
 
 
 void net_nfc_test_snep_start_client_sync(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        /*
 
@@ -277,7 +277,7 @@ void net_nfc_test_snep_start_client_sync(gpointer data,
 }
 
 void net_nfc_test_snep_send_client_request(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result= NET_NFC_OK;
        net_nfc_error_e error = NET_NFC_OK;
@@ -285,24 +285,24 @@ void net_nfc_test_snep_send_client_request(gpointer data,
        ndef_record_h record = NULL;
 
        if( (error = net_nfc_create_uri_type_record(&record,
-                                                       "http://www.naver.com",
-                                                       NET_NFC_SCHEMA_FULL_URI)) == NET_NFC_OK)
+                                       "http://www.naver.com",
+                                       NET_NFC_SCHEMA_FULL_URI)) == NET_NFC_OK)
+       {
+               if( (error = net_nfc_create_ndef_message(&msg)) == NET_NFC_OK)
                {
-                       if( (error = net_nfc_create_ndef_message(&msg)) == NET_NFC_OK)
-                       {
-                               if( (error = net_nfc_append_record_to_ndef_message(
+                       if( (error = net_nfc_append_record_to_ndef_message(
                                                        msg,
                                                        record)) == NET_NFC_OK)
-                                       {
-                                               result = net_nfc_client_snep_send_client_request(
-                                                                                       target_info->handle,
-                                                                                       NET_NFC_SNEP_GET,
-                                                                                       msg,
-                                                                                       snep_send_request_cb,
-                                                                                       user_data);
-                                       }
-                               }
+                       {
+                               result = net_nfc_client_snep_send_client_request(
+                                               target_info->handle,
+                                               NET_NFC_SNEP_GET,
+                                               msg,
+                                               snep_send_request_cb,
+                                               user_data);
+                       }
                }
+       }
 
        if(result != NET_NFC_OK)
        {
@@ -314,7 +314,7 @@ void net_nfc_test_snep_send_client_request(gpointer data,
 
 
 void net_nfc_test_snep_send_client_request_sync(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        /*
 
@@ -362,15 +362,15 @@ void net_nfc_test_snep_send_client_request_sync(gpointer data,
 
 
 void net_nfc_test_snep_register_server(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result= NET_NFC_OK;
 
        result = net_nfc_client_snep_register_server(
-                                       "urn:nfc:xsn:samsung.com:testllcp",
-                                       16,
-                                       snep_register_server_cb,
-                                       user_data);
+                       "urn:nfc:xsn:samsung.com:testllcp",
+                       16,
+                       snep_register_server_cb,
+                       user_data);
 
        if(result != NET_NFC_OK)
        {
@@ -380,13 +380,13 @@ void net_nfc_test_snep_register_server(gpointer data,
 }
 
 void net_nfc_test_snep_unregister_server(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result= NET_NFC_OK;
 
        result = net_nfc_client_snep_unregister_server(
-                                       "urn:nfc:xsn:samsung.com:testllcp",
-                                       16);
+                       "urn:nfc:xsn:samsung.com:testllcp",
+                       16);
 
        if(result != NET_NFC_OK)
        {
@@ -397,7 +397,7 @@ void net_nfc_test_snep_unregister_server(gpointer data,
 
 
 void net_nfc_test_snep_stop_service(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
 /*
        net_nfc_error_e result= NET_NFC_OK;
@@ -416,13 +416,13 @@ void net_nfc_test_snep_stop_service(gpointer data,
 
 
 void net_nfc_test_snep_stop_service_sync(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result= NET_NFC_OK;
 
        result = net_nfc_client_snep_stop_service_sync(
-                                       target_info->handle,
-                                       snep_handle);
+                       target_info->handle,
+                       snep_handle);
 
        if(result != NET_NFC_OK)
        {
old mode 100755 (executable)
new mode 100644 (file)
index c473415..2a1fbd8
@@ -1,18 +1,18 @@
 /*
-* 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.
-*/
+ * 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 <glib-object.h>
 
@@ -28,7 +28,7 @@ static void run_next_callback(gpointer user_data);
 
 static void run_next_callback(gpointer user_data)
 {
-               if (user_data)
+       if (user_data)
        {
                GCallback callback;
 
@@ -40,7 +40,7 @@ static void run_next_callback(gpointer user_data)
 /********************** Function Calls ******************************/
 
 void net_nfc_test_sys_handler_set_launch_popup_state(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        int enable = 1;
@@ -60,7 +60,7 @@ void net_nfc_test_sys_handler_set_launch_popup_state(gpointer data,
 }
 
 void net_nfc_test_sys_handler_get_launch_popup_state(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        int state = 0;
similarity index 65%
rename from src/clientlib/include/net_nfc_client_util_internal.h
rename to tests/net_nfc_test_sys_handler.h
index 5fbb4f4..6609726 100644 (file)
  * limitations under the License.
  */
 
-#ifndef __NET_NFC_CLIENT_UTIL_INTERNAL_H__
-#define __NET_NFC_CLIENT_UTIL_INTERNAL_H__
+#ifndef __NET_NFC_TEST_SYS_HANDLER_H__
+#define __NET_NFC_TEST_SYS_HANDLER_H__
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <glib.h>
 
+void net_nfc_test_sys_handler_set_launch_popup_state(gpointer data,
+               gpointer user_data);
 
-#ifdef __cplusplus
-}
-#endif
+void net_nfc_test_sys_handler_get_launch_popup_state(gpointer data,
+               gpointer user_data);
 
-#endif //__NET_NFC_CLIENT_UTIL_INTERNAL_H__
\ No newline at end of file
+#endif //__NET_NFC_TEST_SYS_HANDLER_H__
index 6f10a7b..1ecb175 100644 (file)
@@ -31,21 +31,21 @@ static void print_get_current_tag_info(net_nfc_target_info_h info);
 static void print_get_current_target_handle(net_nfc_target_handle_h handle);
 
 static void is_tag_connected_completed(net_nfc_error_e result,
-                               net_nfc_target_type_e dev_type,
-                               void *user_data);
+               net_nfc_target_type_e dev_type,
+               void *user_data);
 
 static void get_current_tag_info_completed(net_nfc_error_e result,
-                               net_nfc_target_info_h info,
-                               void *user_data);
+               net_nfc_target_info_h info,
+               void *user_data);
 
 static void get_current_target_handle_completed(net_nfc_error_e result,
-                               net_nfc_target_handle_h handle,
-                               void *user_data);
+               net_nfc_target_handle_h handle,
+               void *user_data);
 
 static void tag_detached(void *user_data);
 
 static void tag_discovered(net_nfc_target_info_h info,
-                               void *user_data);
+               void *user_data);
 
 static net_nfc_target_info_h global_info = NULL;
 
@@ -66,44 +66,44 @@ static gchar *tag_type_to_string(net_nfc_target_type_e dev_type)
 {
        switch(dev_type)
        {
-               case NET_NFC_UNKNOWN_TARGET:
-                       return "Unknown Target";
-               case NET_NFC_GENERIC_PICC:
-                       return "Generic PICC";
-               case NET_NFC_ISO14443_A_PICC:
-                       return "ISO14443 PICC";
-               case NET_NFC_ISO14443_4A_PICC:
-                       return "ISO14443 4A PICC";
-               case NET_NFC_ISO14443_3A_PICC:
-                       return "ISO14443 3A PICC";
-               case NET_NFC_MIFARE_MINI_PICC:
-                       return "Mifare mini PICC";
-               case NET_NFC_MIFARE_1K_PICC:
-                       return "Mifare 1K PICC";
-               case NET_NFC_MIFARE_4K_PICC:
-                       return "Mifare 4K PICC";
-               case NET_NFC_MIFARE_ULTRA_PICC:
-                       return "Mifare Ultra PICC";
-               case NET_NFC_MIFARE_DESFIRE_PICC:
-                       return "Mifare Desfire PICC";
-               case NET_NFC_ISO14443_B_PICC:
-                       return "ISO14443 B PICC";
-               case NET_NFC_ISO14443_4B_PICC:
-                       return "ISO14443 4B PICC";
-               case NET_NFC_ISO14443_BPRIME_PICC:
-                       return "ISO14443 BPRIME PICC";
-               case NET_NFC_FELICA_PICC:
-                       return "Felica PICC";
-               case NET_NFC_JEWEL_PICC:
-                       return "Jewel PICC";
-               case NET_NFC_ISO15693_PICC:
-                       return "ISO15693 PICC";
-               case NET_NFC_NFCIP1_TARGET:
-                       return "NFCIP1 Target";
-               case NET_NFC_NFCIP1_INITIATOR:
-                       return "NFCIP1 Initiator";
-               default:
-                       break;
+       case NET_NFC_UNKNOWN_TARGET:
+               return "Unknown Target";
+       case NET_NFC_GENERIC_PICC:
+               return "Generic PICC";
+       case NET_NFC_ISO14443_A_PICC:
+               return "ISO14443 PICC";
+       case NET_NFC_ISO14443_4A_PICC:
+               return "ISO14443 4A PICC";
+       case NET_NFC_ISO14443_3A_PICC:
+               return "ISO14443 3A PICC";
+       case NET_NFC_MIFARE_MINI_PICC:
+               return "Mifare mini PICC";
+       case NET_NFC_MIFARE_1K_PICC:
+               return "Mifare 1K PICC";
+       case NET_NFC_MIFARE_4K_PICC:
+               return "Mifare 4K PICC";
+       case NET_NFC_MIFARE_ULTRA_PICC:
+               return "Mifare Ultra PICC";
+       case NET_NFC_MIFARE_DESFIRE_PICC:
+               return "Mifare Desfire PICC";
+       case NET_NFC_ISO14443_B_PICC:
+               return "ISO14443 B PICC";
+       case NET_NFC_ISO14443_4B_PICC:
+               return "ISO14443 4B PICC";
+       case NET_NFC_ISO14443_BPRIME_PICC:
+               return "ISO14443 BPRIME PICC";
+       case NET_NFC_FELICA_PICC:
+               return "Felica PICC";
+       case NET_NFC_JEWEL_PICC:
+               return "Jewel PICC";
+       case NET_NFC_ISO15693_PICC:
+               return "ISO15693 PICC";
+       case NET_NFC_NFCIP1_TARGET:
+               return "NFCIP1 Target";
+       case NET_NFC_NFCIP1_INITIATOR:
+               return "NFCIP1 Initiator";
+       default:
+               break;
        }
        return "Invalid Target";
 }
@@ -155,8 +155,8 @@ static void print_get_current_target_handle(net_nfc_target_handle_h handle)
        handle_id = GPOINTER_TO_UINT(handle);
 
        g_print("Tag handle %x, Current Tag handle %x\n",
-                               global_handle_id,
-                               handle_id);
+                       global_handle_id,
+                       handle_id);
        if (global_handle_id == handle_id)
                g_print("Current Tag is matched discovered Tag\n");
 }
@@ -167,12 +167,12 @@ static void tag_detached(void *user_data)
 }
 
 static void is_tag_connected_completed(net_nfc_error_e result,
-                               net_nfc_target_type_e dev_type,
-                               void *user_data)
+               net_nfc_target_type_e dev_type,
+               void *user_data)
 {
        g_print("IsTagConnected Completed %d\n", result);
        g_print("--- dev type : %s (%d)\n", tag_type_to_string(dev_type),
-                                       dev_type);
+                       dev_type);
 
        if (result == NET_NFC_OK)
                print_is_tag_connected(dev_type);
@@ -183,8 +183,8 @@ static void is_tag_connected_completed(net_nfc_error_e result,
 }
 
 static void get_current_tag_info_completed(net_nfc_error_e result,
-                               net_nfc_target_info_h info,
-                               void *user_data)
+               net_nfc_target_info_h info,
+               void *user_data)
 {
        g_print("GetCurrentTagInfo Completed %d\n", result);
 
@@ -195,8 +195,8 @@ static void get_current_tag_info_completed(net_nfc_error_e result,
 }
 
 static void get_current_target_handle_completed(net_nfc_error_e result,
-                               net_nfc_target_handle_h handle,
-                               void *user_data)
+               net_nfc_target_handle_h handle,
+               void *user_data)
 {
        g_print("GetCurrentTargetHandle Completed %d\n", result);
 
@@ -208,7 +208,7 @@ static void get_current_target_handle_completed(net_nfc_error_e result,
 
 
 static void tag_discovered(net_nfc_target_info_h info,
-                               void *user_data)
+               void *user_data)
 {
        g_print("TagDiscovered\n");
 
@@ -220,29 +220,29 @@ static void tag_discovered(net_nfc_target_info_h info,
 
 
 void net_nfc_test_tag_is_tag_connected(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_client_tag_is_tag_connected(is_tag_connected_completed,
-                               user_data);
+                       user_data);
 }
 
 void net_nfc_test_tag_get_current_tag_info(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_client_tag_get_current_tag_info(get_current_tag_info_completed,
-                               user_data);
+                       user_data);
 }
 
 void net_nfc_test_tag_get_current_target_handle(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_client_tag_get_current_target_handle(
-                               get_current_target_handle_completed,
-                               user_data);
+                       get_current_target_handle_completed,
+                       user_data);
 }
 
 void net_nfc_test_tag_is_tag_connected_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        net_nfc_target_type_e dev_type;
@@ -258,7 +258,7 @@ void net_nfc_test_tag_is_tag_connected_sync(gpointer data,
 }
 
 void net_nfc_test_tag_get_current_tag_info_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        net_nfc_target_info_h info;
@@ -272,7 +272,7 @@ void net_nfc_test_tag_get_current_tag_info_sync(gpointer data,
 }
 
 void net_nfc_test_tag_get_current_target_handle_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        net_nfc_target_handle_h handle;
@@ -286,7 +286,7 @@ void net_nfc_test_tag_get_current_target_handle_sync(gpointer data,
 }
 
 void net_nfc_test_tag_set_tag_discovered(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        g_print("Waiting for TagDiscovered Signal\n");
 
@@ -305,7 +305,7 @@ net_nfc_target_info_h net_nfc_test_tag_get_target_info(void)
 }
 
 void net_nfc_test_tag_set_tag_detached(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        g_print("Waiting for TagDetached Singal\n");
 
index d5dd810..5d65c1d 100644 (file)
@@ -1,18 +1,18 @@
 /*
-* 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.
-*/
+ * 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_test_tag_felica.h"
 #include "net_nfc_typedef_internal.h"
@@ -27,8 +27,8 @@ static net_nfc_target_handle_h get_handle();
 static void run_next_callback(gpointer user_data);
 
 static void felica_cb(net_nfc_error_e result,
-                               data_h resp_data,
-                               void *user_data);
+               data_h resp_data,
+               void *user_data);
 
 
 static net_nfc_target_handle_h get_handle()
@@ -56,8 +56,8 @@ static void run_next_callback(gpointer user_data)
 }
 
 static void felica_cb(net_nfc_error_e result,
-                               data_h resp_data,
-                               void *user_data)
+               data_h resp_data,
+               void *user_data)
 {
        g_print("felica_cb Completed %d\n", result);
 
@@ -67,7 +67,7 @@ static void felica_cb(net_nfc_error_e result,
 }
 
 void net_nfc_test_felica_poll(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -78,15 +78,11 @@ void net_nfc_test_felica_poll(gpointer data,
        if (handle == NULL)
                return ;
 
-       result = net_nfc_client_felica_poll(handle,
-                               req_code,
-                               time_slot,
-                               felica_cb,
-                               user_data);
+       result = net_nfc_client_felica_poll(handle, req_code, time_slot, felica_cb, user_data);
 }
 
 void net_nfc_test_felica_request_service(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -99,15 +95,15 @@ void net_nfc_test_felica_request_service(gpointer data,
                return ;
 
        result = net_nfc_client_felica_request_service(handle,
-                               number_of_area_service,
-                               area_service_list,
-                               number_of_services,
-                               felica_cb,
-                               user_data);
+                       number_of_area_service,
+                       area_service_list,
+                       number_of_services,
+                       felica_cb,
+                       user_data);
 }
 
 void net_nfc_test_felica_request_response(gpointer data,
-                                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -116,13 +112,11 @@ void net_nfc_test_felica_request_response(gpointer data,
        if (handle == NULL)
                return ;
 
-       result = net_nfc_client_felica_request_response(handle,
-                               felica_cb,
-                               user_data);
+       result = net_nfc_client_felica_request_response(handle, felica_cb, user_data);
 }
 
 void net_nfc_test_felica_read_without_encryption(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -136,16 +130,16 @@ void net_nfc_test_felica_read_without_encryption(gpointer data,
                return ;
 
        result = net_nfc_client_felica_read_without_encryption(handle,
-                               number_of_services,
-                               service_list,
-                               number_of_blocks,
-                               block_list,
-                               felica_cb,
-                               user_data);
+                       number_of_services,
+                       service_list,
+                       number_of_blocks,
+                       block_list,
+                       felica_cb,
+                       user_data);
 }
 
 void net_nfc_test_felica_write_without_encryption(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -160,17 +154,17 @@ void net_nfc_test_felica_write_without_encryption(gpointer data,
                return ;
 
        result = net_nfc_client_felica_write_without_encryption(handle,
-                               number_of_services,
-                               service_list,
-                               number_of_blocks,
-                               block_list,
-                               data_to_write,
-                               felica_cb,
-                               user_data);
+                       number_of_services,
+                       service_list,
+                       number_of_blocks,
+                       block_list,
+                       data_to_write,
+                       felica_cb,
+                       user_data);
 }
 
 void net_nfc_test_felica_request_system_code(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -179,7 +173,5 @@ void net_nfc_test_felica_request_system_code(gpointer data,
        if (handle == NULL)
                return ;
 
-       result = net_nfc_client_felica_request_system_code(handle,
-                               felica_cb,
-                               user_data);
+       result = net_nfc_client_felica_request_system_code(handle, felica_cb, user_data);
 }
index b0d0239..439356f 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 
-#include "net_nfc_tag_mifare.h"
+#include "net_nfc_client_tag_mifare.h"
 #include "net_nfc_test_tag_mifare.h"
 #include "net_nfc_target_info.h"
 #include "net_nfc_typedef_internal.h"
@@ -26,8 +26,8 @@
 static net_nfc_target_handle_h tag_get_handle(void);
 
 static void mifare_read_cb(net_nfc_error_e result,
-                               data_h resp_data,
-                               void *user_data);
+               data_h resp_data,
+               void *user_data);
 
 static void mifare_write_block_cb(net_nfc_error_e result, void* user_data);
 
@@ -70,8 +70,8 @@ static void run_next_callback(gpointer user_data)
 }
 
 static void mifare_read_cb(net_nfc_error_e result,
-                               data_h resp_data,
-                               void *user_data)
+               data_h resp_data,
+               void *user_data)
 {
        g_print("mifare_read_cb Completed %d\n", result);
        print_received_data(resp_data);
@@ -137,7 +137,7 @@ static void mifare_write_auth_keyB_cb(net_nfc_error_e result, void* user_data)
 
 
 void net_nfc_test_tag_mifare_read(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e  result  = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -154,13 +154,13 @@ void net_nfc_test_tag_mifare_read(gpointer data,
        g_print("Handle is %#x\n", GPOINTER_TO_UINT(handle));
 
        result = net_nfc_client_mifare_read(handle,
-                               block_index,
-                               mifare_read_cb,
-                               user_data);
+                       block_index,
+                       mifare_read_cb,
+                       user_data);
 }
 
 void net_nfc_test_tag_mifare_write_block(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e  result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -183,14 +183,14 @@ void net_nfc_test_tag_mifare_write_block(gpointer data,
        g_print("Handle is %#x\n", GPOINTER_TO_UINT(handle));
 
        result = net_nfc_client_mifare_write_block(handle,
-                               block_index,
-                               (data_h)& write_data,
-                               mifare_write_block_cb,
-                               user_data);
+                       block_index,
+                       (data_h)& write_data,
+                       mifare_write_block_cb,
+                       user_data);
 }
 
 void net_nfc_test_tag_mifare_write_page(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e  result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -213,14 +213,14 @@ void net_nfc_test_tag_mifare_write_page(gpointer data,
        g_print("Handle is %#x\n", GPOINTER_TO_UINT(handle));
 
        result = net_nfc_client_mifare_write_page(handle,
-                               block_index,
-                               (data_h)& write_data,
-                               mifare_write_page_cb,
-                               user_data);
+                       block_index,
+                       (data_h)& write_data,
+                       mifare_write_page_cb,
+                       user_data);
 }
 
 void net_nfc_test_tag_mifare_increment(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e  result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -236,15 +236,16 @@ void net_nfc_test_tag_mifare_increment(gpointer data,
                return;
        }
        g_print("Handle is %#x\n", GPOINTER_TO_UINT(handle));
+
        result = net_nfc_client_mifare_increment(handle,
-                               block_index,
-                               value,
-                               mifare_write_mifare_incr_cb,
-                               user_data);
+                       block_index,
+                       value,
+                       mifare_write_mifare_incr_cb,
+                       user_data);
 }
 
 void net_nfc_test_tag_mifare_decrement(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e  result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -260,15 +261,16 @@ void net_nfc_test_tag_mifare_decrement(gpointer data,
                return;
        }
        g_print("Handle is %#x\n", GPOINTER_TO_UINT(handle));
+
        result = net_nfc_client_mifare_decrement(handle,
-                               block_index,
-                               value,
-                               mifare_write_mifare_decr_cb,
-                               user_data);
+                       block_index,
+                       value,
+                       mifare_write_mifare_decr_cb,
+                       user_data);
 }
 
 void net_nfc_test_tag_mifare_transfer(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e  result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -283,14 +285,15 @@ void net_nfc_test_tag_mifare_transfer(gpointer data,
                return;
        }
        g_print("Handle is %#x\n", GPOINTER_TO_UINT(handle));
+
        result = net_nfc_client_mifare_transfer(handle,
-                               block_index,
-                               mifare_write_mifare_transfer_cb,
-                               user_data);
+                       block_index,
+                       mifare_write_mifare_transfer_cb,
+                       user_data);
 }
 
 void net_nfc_test_tag_mifare_restore(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e  result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -307,13 +310,13 @@ void net_nfc_test_tag_mifare_restore(gpointer data,
        g_print("Handle is %#x\n", GPOINTER_TO_UINT(handle));
 
        result = net_nfc_client_mifare_restore(handle,
-                               block_index,
-                               mifare_write_mifare_restore_cb,
-                               user_data);
+                       block_index,
+                       mifare_write_mifare_restore_cb,
+                       user_data);
 }
 
 void net_nfc_test_tag_mifare_authenticate_with_keyA(gpointer data,
-                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e  result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -334,15 +337,15 @@ void net_nfc_test_tag_mifare_authenticate_with_keyA(gpointer data,
        g_print("default key create %d", result);
 
        result = net_nfc_client_mifare_authenticate_with_keyA(
-                               handle,
-                               sector_index,
-                               auth_key,
-                               mifare_write_auth_keyA_cb,
-                               user_data);
+                       handle,
+                       sector_index,
+                       auth_key,
+                       mifare_write_auth_keyA_cb,
+                       user_data);
 }
 
 void net_nfc_test_tag_mifare_authenticate_with_keyB(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        net_nfc_target_handle_h handle = NULL;
@@ -363,9 +366,9 @@ void net_nfc_test_tag_mifare_authenticate_with_keyB(gpointer data,
        g_print("default key create %d", result);
 
        result = net_nfc_client_mifare_authenticate_with_keyB(
-                               handle,
-                               sector_index,
-                               auth_key,
-                               mifare_write_auth_keyB_cb,
-                               user_data);
+                       handle,
+                       sector_index,
+                       auth_key,
+                       mifare_write_auth_keyB_cb,
+                       user_data);
 }
index bc8c958..6d6314c 100644 (file)
 static void run_next_callback(gpointer user_data);
 
 static void sim_test_completed(net_nfc_error_e result,
-                       void *user_data);
+               void *user_data);
 
 static void prbs_test_completed(net_nfc_error_e result,
-                               void *user_data);
+               void *user_data);
 
 static void get_firmware_version_completed(net_nfc_error_e result,
-                                       char *version,
-                                       void *user_data);
+               char *version,
+               void *user_data);
 
 static void set_ee_data_completed(net_nfc_error_e reuslt,
-                               void *user_data);
+               void *user_data);
 
 
 
@@ -50,7 +50,7 @@ static void run_next_callback(gpointer user_data)
 
 
 static void sim_test_completed(net_nfc_error_e result,
-                       void *user_data)
+               void *user_data)
 {
        g_print("SimTestCompleted Completed %d\n", result);
        run_next_callback(user_data);
@@ -59,7 +59,7 @@ static void sim_test_completed(net_nfc_error_e result,
 
 
 static void prbs_test_completed(net_nfc_error_e result,
-                               void *user_data)
+               void *user_data)
 {
        g_print("PrbsTest Completed %d\n", result);
        run_next_callback(user_data);
@@ -68,8 +68,8 @@ static void prbs_test_completed(net_nfc_error_e result,
 
 
 static void get_firmware_version_completed(net_nfc_error_e result,
-                                       char *version,
-                                       void *user_data)
+               char *version,
+               void *user_data)
 {
        g_print("GetFirmwareVersion Completed %d: %s\n", result, version);
        run_next_callback(user_data);
@@ -78,7 +78,7 @@ static void get_firmware_version_completed(net_nfc_error_e result,
 
 
 static void set_ee_data_completed(net_nfc_error_e result,
-                               void *user_data)
+               void *user_data)
 {
        g_print("SetEeData Completed %d\n", result);
        run_next_callback(user_data);
@@ -86,7 +86,7 @@ static void set_ee_data_completed(net_nfc_error_e result,
 
 
 void net_nfc_test_test_sim_test(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_client_test_sim_test(sim_test_completed, user_data);
 }
@@ -94,32 +94,32 @@ void net_nfc_test_test_sim_test(gpointer data,
 
 
 void net_nfc_test_test_prbs_test(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        /* FIXME : fill right value */
        uint32_t tech = 0;
        uint32_t rate = 0;
 
        net_nfc_client_test_prbs_test(tech,
-                               rate,
-                               prbs_test_completed,
-                               user_data);
+                       rate,
+                       prbs_test_completed,
+                       user_data);
 }
 
 
 
 void net_nfc_test_test_get_firmware_version(gpointer data,
-                                       gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_client_test_get_firmware_version(
-                                       get_firmware_version_completed,
-                                       user_data);
+                       get_firmware_version_completed,
+                       user_data);
 }
 
 
 
 void net_nfc_test_test_set_ee_data(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
 
        /* FIXME : fill right value */
@@ -128,17 +128,17 @@ void net_nfc_test_test_set_ee_data(gpointer data,
        data_h ee_data = (data_h)data;
 
        net_nfc_client_test_set_ee_data(mode,
-                                       reg_id,
-                                       ee_data,
-                                       set_ee_data_completed,
-                                       user_data);
+                       reg_id,
+                       ee_data,
+                       set_ee_data_completed,
+                       user_data);
 
 }
 
 
 
 void net_nfc_test_test_sim_test_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        result = net_nfc_client_test_sim_test_sync();
@@ -149,7 +149,7 @@ void net_nfc_test_test_sim_test_sync(gpointer data,
 
 
 void net_nfc_test_test_prbs_test_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
 
@@ -165,7 +165,7 @@ void net_nfc_test_test_prbs_test_sync(gpointer data,
 
 
 void net_nfc_test_test_get_firmware_version_sync(gpointer data,
-                                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result;
        char *version = NULL;
@@ -180,7 +180,7 @@ void net_nfc_test_test_get_firmware_version_sync(gpointer data,
 
 
 void net_nfc_test_test_set_ee_data_sync(gpointer data,
-                                       gpointer user_data)
+               gpointer user_data)
 {
 
        net_nfc_error_e result;
@@ -191,8 +191,8 @@ void net_nfc_test_test_set_ee_data_sync(gpointer data,
        data_h ee_data = (data_h)data;
 
        result = net_nfc_client_test_set_ee_data_sync(mode,
-                                               reg_id,
-                                               ee_data);
+                       reg_id,
+                       ee_data);
        g_print("SetEeData: %d\n", result);
        run_next_callback(user_data);
 
index 273f3a5..bf328c7 100644 (file)
 
 
 static void call_transceive_data_cb(net_nfc_error_e result,
-                               data_h resp_data,
-                               void *user_data);
+               data_h resp_data,
+               void *user_data);
 
 static void call_transceive_cb(net_nfc_error_e result,
-                               void* user_data);
+               void* user_data);
 
 static void run_next_callback(gpointer user_data);
 
@@ -45,7 +45,7 @@ static void run_next_callback(gpointer user_data)
 
 
 static void call_transceive_cb(net_nfc_error_e result,
-                               void* user_data)
+               void* user_data)
 {
        g_print("call_transceive_cb Completed %d\n", result);
 
@@ -53,8 +53,8 @@ static void call_transceive_cb(net_nfc_error_e result,
 }
 
 static void call_transceive_data_cb(net_nfc_error_e result,
-                               data_h resp_data,
-                               void *user_data)
+               data_h resp_data,
+               void *user_data)
 {
        g_print("call_transceive_data_cb Completed %d\n", result);
        print_received_data(resp_data);
@@ -63,7 +63,7 @@ static void call_transceive_data_cb(net_nfc_error_e result,
 }
 
 void net_nfc_test_transceive(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        data_s raw_data = {NULL,};
@@ -75,13 +75,13 @@ void net_nfc_test_transceive(gpointer data,
        net_nfc_get_tag_handle(info, &handle);
 
        result =net_nfc_client_transceive(handle,
-                               (data_h)&raw_data,
-                               call_transceive_cb,
-                               user_data);
+                       (data_h)&raw_data,
+                       call_transceive_cb,
+                       user_data);
 }
 
 void net_nfc_test_transceive_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        data_s raw_data = {NULL,};
@@ -98,7 +98,7 @@ void net_nfc_test_transceive_sync(gpointer data,
 }
 
 void net_nfc_test_transceive_data(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        data_s raw_data = {NULL,};
@@ -110,13 +110,13 @@ void net_nfc_test_transceive_data(gpointer data,
        net_nfc_get_tag_handle(info, &handle);
 
        result = net_nfc_client_transceive_data(handle,
-                               (data_h) &raw_data,
-                               call_transceive_data_cb,
-                               user_data);
+                       (data_h) &raw_data,
+                       call_transceive_data_cb,
+                       user_data);
 }
 
 void net_nfc_test_transceive_data_sync(gpointer data,
-                               gpointer user_data)
+               gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
        data_s raw_data = {NULL};
@@ -128,8 +128,8 @@ void net_nfc_test_transceive_data_sync(gpointer data,
 
        net_nfc_get_tag_handle(info, &handle);
 
-       result = net_nfc_client_transceive_data_sync(handle,
-                               &raw_data,
-                               &response);
-       print_received_data(response);
+       result = net_nfc_client_transceive_data_sync(handle, &raw_data, &response);
+
+       if (NET_NFC_OK == result)
+               print_received_data(response);
 }
diff --git a/tools/bt-paring/CMakeLists.txt b/tools/bt-paring/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3eb1c6a
--- /dev/null
@@ -0,0 +1,21 @@
+LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/client/include)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+SET(BT_PARING "bt-paring")
+
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/ BT_SRC)
+
+pkg_check_modules(bt_pkgs REQUIRED bluetooth-api)
+
+FOREACH(flag ${bt_pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+ADD_EXECUTABLE(${BT_PARING} ${BT_SRC})
+
+TARGET_LINK_LIBRARIES(${BT_PARING} ${bt_pkgs_LDFLAGS} pthread nfc)
+
+INSTALL(TARGETS ${BT_PARING} DESTINATION bin)
diff --git a/tools/bt-paring/bt_paring.c b/tools/bt-paring/bt_paring.c
new file mode 100644 (file)
index 0000000..925b91e
--- /dev/null
@@ -0,0 +1,221 @@
+/*
+ * 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 <stdio.h>
+#include <stdlib.h>
+
+#include <bluetooth-api.h>
+#include <glib.h>
+
+#include <net_nfc.h>
+
+#include <pthread.h>
+
+void bt_event_callback(int event, bluetooth_event_param_t* param, void *user_data);
+void bt_test_bond_device(bluetooth_device_address_t* bt_address);
+GMainLoop* main_loop = NULL;
+
+void initialize()
+{
+       if(!g_thread_supported())
+       {
+               g_thread_init(NULL);
+       }
+
+       dbus_g_thread_init();
+       g_type_init();
+}
+
+
+int main()
+{
+       initialize();
+
+       //bluetooth_enable_adapter();
+
+       //main_loop = g_main_loop_new(NULL, FALSE);
+       //g_main_loop_run(main_loop);
+
+#if 1
+
+       ndef_message_h ndef_message = NULL;
+       net_nfc_conn_handover_info_h conn_handover_info = NULL;
+
+
+       if(net_nfc_retrieve_current_ndef_message(&ndef_message) == NET_NFC_OK)
+       {
+               printf("retrieve ndef message from nfc storage \n");
+
+               int count = 0;
+
+               net_nfc_get_ndef_message_record_count(ndef_message, &count);
+
+               int i = 0;
+               while(i < count)
+               {
+                       ndef_record_h record = NULL;
+                       net_nfc_get_record_by_index(ndef_message, i++, &record);
+
+                       if (record != NULL)
+                       {
+
+                               net_nfc_record_tnf_e TNF = NET_NFC_RECORD_EMPTY;
+                               data_h record_type = NULL;
+
+                               if ((net_nfc_get_record_tnf(record, &TNF) == NET_NFC_OK)
+                                               && (net_nfc_get_record_type(record, &record_type) == NET_NFC_OK ))
+                               {
+
+                                       uint8_t* buffer = net_nfc_get_data_buffer(record_type);
+                                       int buffer_length = net_nfc_get_data_length(record_type);
+
+                                       // record is WTK and Hs
+                                       if((TNF == NET_NFC_RECORD_WELL_KNOWN_TYPE) && (buffer != NULL)
+                                                       && (buffer_length > 1) && (buffer[0] == 'H') && (buffer[1] == 's'))
+                                       {
+                                               printf("record is found \n");
+                                               net_nfc_parse_connection_handover_ndef_message(ndef_message, &conn_handover_info);
+
+                                               if (conn_handover_info != NULL)
+                                               {
+                                                       uint8_t carrier_count = 0;
+                                                       net_nfc_get_connection_handover_alternative_carrier_count(conn_handover_info, &carrier_count);
+
+                                                       int j = 0;
+                                                       while(j < carrier_count)
+                                                       {
+                                                               net_nfc_conn_handover_carrier_info_h carrier_info = NULL;
+                                                               net_nfc_get_connection_handover_carrier_handle_by_index(conn_handover_info, j++, &carrier_info);
+
+                                                               if(carrier_info != NULL)
+                                                               {
+                                                                       data_h configuration = NULL;
+                                                                       net_nfc_get_carrier_configuration(carrier_info, &configuration);
+
+                                                                       if(configuration != NULL)
+                                                                       {
+                                                                               uint8_t* buffer = net_nfc_get_data_buffer(configuration);
+                                                                               if(buffer != NULL)
+                                                                               {
+                                                                                       printf("bt addr [%X][%X][%X][%X][%X][%X] \n", buffer[2], buffer[3], buffer[4], buffer[5], buffer[6], buffer[7]);
+                                                                                       bluetooth_device_address_t bt_address = {{buffer[2], buffer[3], buffer[4], buffer[5], buffer[6], buffer[7]}};
+                                                                                       bt_test_bond_device(&bt_address);
+                                                                               }
+                                                                               else
+                                                                                       printf("buffer is NULL");
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+       }
+
+#endif
+       return 0;
+}
+
+void bt_test_bond_device(bluetooth_device_address_t* bt_address)
+{
+       int ret_val;
+
+       ret_val = bluetooth_register_callback(bt_event_callback, NULL);
+
+       if (ret_val >= BLUETOOTH_ERROR_NONE)
+       {
+               printf("bluetooth_register_callback returned Success");
+       }
+       else
+       {
+               printf("bluetooth_register_callback returned failiure [0x%04x]", ret_val);
+               return ;
+       }
+
+       ret_val = bluetooth_check_adapter();
+
+       if (ret_val < BLUETOOTH_ERROR_NONE)
+       {
+               printf("bluetooth_check_adapter returned failiure [0x%04x]", ret_val);
+       }
+       else
+       {
+               printf("BT state [0x%04x]", ret_val);
+       }
+
+       int error = 0;
+
+       if((error = bluetooth_bond_device(bt_address)) < 0)
+       {
+               printf("Api failed: %d", error);
+       }
+       else
+       {
+               main_loop = g_main_loop_new(NULL, FALSE);
+               g_main_loop_run(main_loop);
+       }
+
+}
+
+void bt_event_callback(int event, bluetooth_event_param_t* param, void *user_data)
+{
+       switch(event)
+       {
+       case BLUETOOTH_EVENT_ENABLED:
+               printf("BLUETOOTH_EVENT_ENABLED:\n");
+               break;
+       case BLUETOOTH_EVENT_DISABLED:
+               printf("BLUETOOTH_EVENT_DISABLED:\n");
+               break;
+       case BLUETOOTH_EVENT_LOCAL_NAME_CHANGED:
+               printf("BLUETOOTH_EVENT_LOCAL_NAME_CHANGED:\n");
+               break;
+       case BLUETOOTH_EVENT_DISCOVERY_STARTED:
+               printf("BLUETOOTH_EVENT_DISCOVERY_STARTED:\n");
+               break;
+       case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
+               printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:\n");
+               break;
+       case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
+               printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:\n");
+               break;
+       case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
+               printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED:\n");
+               break;
+       case BLUETOOTH_EVENT_BONDING_FINISHED:
+               printf("BLUETOOTH_EVENT_BONDING_FINISHED:\n");
+
+               if (param->result >= BLUETOOTH_ERROR_NONE)
+               {
+                       bluetooth_device_info_t *device_info = NULL;
+                       device_info  = (bluetooth_device_info_t *)param->param_data;
+                       printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X] mjr[%#x] min[%#x] srv[%#x] \n", device_info->device_name.name, \
+                                       device_info->device_address.addr[0], device_info->device_address.addr[1], device_info->device_address.addr[2], \
+                                       device_info->device_address.addr[3], device_info->device_address.addr[4], device_info->device_address.addr[5], \
+                                       device_info->device_class.major_class, device_info->device_class.minor_class, device_info->device_class.service_class);
+               }
+
+               g_main_loop_quit (main_loop);
+
+               break;
+       default:
+               printf("BLUETOOTH_EVENT = [%d]:\n", event);
+               break;
+       }
+}
diff --git a/tools/ndef-tool/CMakeLists.txt b/tools/ndef-tool/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5e5649e
--- /dev/null
@@ -0,0 +1,23 @@
+LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/client/include)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+SET(NDEF_TOOL "ndef-tool")
+
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/ TOOL_SRC)
+
+pkg_check_modules(tool_pkgs REQUIRED glib-2.0 gobject-2.0)
+
+FOREACH(flag ${tool_pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+ADD_EXECUTABLE(${NDEF_TOOL} ${TOOL_SRC})
+
+TARGET_LINK_LIBRARIES(${NDEF_TOOL} ${tool_pkgs_LDFLAGS} pthread dl rt nfc)
+
+INSTALL(TARGETS ${NDEF_TOOL} DESTINATION bin)
+
+
similarity index 96%
rename from test_clinet_app/ndef-tool/ndef-tool-display.c
rename to tools/ndef-tool/ndef-tool-display.c
index 22f10ad..f76693e 100644 (file)
@@ -1,18 +1,18 @@
 /*
 * 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.
 */
+ * 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 <stddef.h>
@@ -280,7 +280,7 @@ static void _display_hs(ndef_record_h record)
                uint32_t length = net_nfc_get_data_length(data);
 
                fprintf(stdout, " Version : %d.%d\n", ((*buffer) >> 4) & 0x0F,
-                       (*buffer) & 0x0F);
+                               (*buffer) & 0x0F);
                fprintf(stdout, " -- Containing NDEF message -- \n");
 
                ndef_message_h msg;
@@ -309,7 +309,7 @@ static void _display_hr(ndef_record_h record)
                uint32_t length = net_nfc_get_data_length(data);
 
                fprintf(stdout, " Version : %d.%d\n", ((*buffer) >> 4) & 0x0F,
-                       (*buffer) & 0x0F);
+                               (*buffer) & 0x0F);
                fprintf(stdout, " -- Containing NDEF message -- \n");
 
                ndef_message_h msg;
@@ -687,8 +687,8 @@ static void _display_record_length(ndef_record_h record)
 
        net_nfc_get_record_tnf(record, &tnf);
        if (tnf != NET_NFC_RECORD_EMPTY &&
-               tnf != NET_NFC_RECORD_UNKNOWN &&
-               tnf != NET_NFC_RECORD_UNCHAGNED)
+                       tnf != NET_NFC_RECORD_UNKNOWN &&
+                       tnf != NET_NFC_RECORD_UNCHAGNED)
        {
                data_h data;
 
@@ -746,7 +746,7 @@ static void _display_record(ndef_record_h record, int index)
        net_nfc_get_record_flags(record, &header);
 
        fprintf(stdout, " MB[%d], ME[%d], CF[%d], SR[%d], IL[%d]\n", net_nfc_get_record_mb(header), net_nfc_get_record_me(header),
-               net_nfc_get_record_cf(header), net_nfc_get_record_sr(header), net_nfc_get_record_il(header));
+                       net_nfc_get_record_cf(header), net_nfc_get_record_sr(header), net_nfc_get_record_il(header));
 
        _display_tnf(record);
 
similarity index 64%
rename from test_clinet_app/ndef-tool/ndef-tool-sign.c
rename to tools/ndef-tool/ndef-tool-sign.c
index 762e7e3..9ff41ae 100644 (file)
@@ -1,18 +1,18 @@
 /*
 * 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.
 */
+ * 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 <stddef.h>
similarity index 91%
rename from test_clinet_app/ndef-tool/ndef-tool-tag.c
rename to tools/ndef-tool/ndef-tool-tag.c
index ca5696a..6da378f 100644 (file)
@@ -1,18 +1,18 @@
 /*
 * 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.
 */
+ * 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 <stddef.h>
@@ -126,19 +126,19 @@ static void _p2p_send_cb(net_nfc_target_handle_h handle, void *user_data)
 }
 
 static void _handover_completed_cb(net_nfc_error_e result,
-       data_h data, void *user_data)
+               data_h data, void *user_data)
 {
-//     response_context_t *context = (response_context_t *)user_data;
-//     data_h rawdata;
+       //      response_context_t *context = (response_context_t *)user_data;
+       //      data_h rawdata;
 
        if (result == NET_NFC_OK)
                fprintf(stdout, "handover success!!!\n\n");
        else
                fprintf(stdout, "handover failed.\n\n");
 
-//     net_nfc_create_rawdata_from_ndef_message((ndef_message_h)context->user_param, &rawdata);
-//
-//     net_nfc_ex
+       //      net_nfc_create_rawdata_from_ndef_message((ndef_message_h)context->user_param, &rawdata);
+       //
+       //      net_nfc_ex
        g_main_loop_quit(main_loop);
 }
 
@@ -169,8 +169,8 @@ static void _open_se_cb(net_nfc_error_e result, net_nfc_target_handle_h handle,
 
 static void _send_apdu_se_cb(net_nfc_error_e result, net_nfc_target_handle_h handle, void *user_data)
 {
-//     response_context_t *context = (response_context_t *)user_data;
-//     data_h rawdata;
+       //      response_context_t *context = (response_context_t *)user_data;
+       //      data_h rawdata;
 
        if (result == NET_NFC_OK)
        {
@@ -199,11 +199,11 @@ static void _handover_cb(net_nfc_target_handle_h handle, void *user_data)
        fprintf(stdout, "\ntry to handover...\n\n");
 
        net_nfc_exchanger_request_connection_handover(handle,
-               NET_NFC_CONN_HANDOVER_CARRIER_BT);
+                       NET_NFC_CONN_HANDOVER_CARRIER_BT);
 }
 
 void _nfc_response_cb(net_nfc_message_e message, net_nfc_error_e result,
-       void *data, void *user_param, void *trans_data)
+               void *data, void *user_param, void *trans_data)
 {
        response_context_t *context = (response_context_t *)user_param;
 
@@ -293,11 +293,6 @@ static void _initialize_tag_context(response_context_t *context)
 {
        int ret = 0;
 
-       if (!g_thread_supported())
-       {
-               g_thread_init(NULL);
-       }
-
        ret = net_nfc_initialize();
        if (ret == NET_NFC_OK)
        {
similarity index 95%
rename from test_clinet_app/ndef-tool/ndef-tool.c
rename to tools/ndef-tool/ndef-tool.c
index 386bf08..a29636e 100644 (file)
@@ -1,18 +1,18 @@
 /*
 * 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.
 */
+ * 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 <stddef.h>
@@ -29,7 +29,7 @@
 static GMainLoop *main_loop = NULL;
 
 void _activation_complete_cb(net_nfc_message_e message, net_nfc_error_e result,
-       void *data, void *user_param, void *trans_data)
+               void *data, void *user_param, void *trans_data)
 {
        switch (message)
        {
@@ -303,14 +303,14 @@ bool _remove_record_from_file(const char *file_name, int index)
 
 #define __COMPARE_OPTION(__dst, __s, __l) \
        ((__IS_SHORT_OPTION(__dst) && ((__dst)[1] == (__s))) || \
-       (__IS_LONG_OPTION(__dst) && (strcmp((__dst) + 2, (__l)) == 0)))
+        (__IS_LONG_OPTION(__dst) && (strcmp((__dst) + 2, (__l)) == 0)))
 
 #define __DO_NEXT_ARG \
-               if (++i >= argc || __IS_OPTION(argv[i]) == true) \
-               { \
-                       operation = OPERATION_ERROR; \
-                       break; \
-               }
+       if (++i >= argc || __IS_OPTION(argv[i]) == true) \
+       { \
+               operation = OPERATION_ERROR; \
+               break; \
+       }
 
 int main(int argc, char *argv[])
 {
similarity index 99%
rename from test_clinet_app/ndef-tool/ndef-tool.h
rename to tools/ndef-tool/ndef-tool.h
index 3f0b251..e658977 100644 (file)
@@ -4,7 +4,7 @@
   * 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
diff --git a/tools/nfc-client/CMakeLists.txt b/tools/nfc-client/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ccc6bab
--- /dev/null
@@ -0,0 +1,25 @@
+LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/client/include)
+
+SET(NFC_CLIENT "nfc-client")
+
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/ TOOL_SRC)
+
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+       SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+
+pkg_check_modules(tool_pkgs REQUIRED glib-2.0 gobject-2.0)
+
+FOREACH(flag ${tool_pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+ADD_EXECUTABLE(${NFC_CLIENT} ${TOOL_SRC})
+TARGET_LINK_LIBRARIES(${NFC_CLIENT} ${tool_pkgs_LDFLAGS} pthread dl rt nfc)
+
+INSTALL(TARGETS ${NFC_CLIENT} DESTINATION bin)
+
+
similarity index 95%
rename from test_clinet_app/nfc_client/main.c
rename to tools/nfc-client/main.c
index d5a570b..d51aa86 100644 (file)
@@ -1,18 +1,18 @@
 /*
 * 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.
 */
+ * 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 <stdio.h>
@@ -62,27 +62,27 @@ void print_test_result (char * str, net_nfc_test_result_e result);
 
 static nfcTestType nfcTestMatrix[] =
 {
-//     {"API STRESS_WRITE_READ TEST", nfcTestReadWriteMode, NET_NFC_TEST_NOT_YET}, // OK
-//     {"Remove tag while writing", nfcTestWriteMode, NET_NFC_TEST_NOT_YET}, //OK
-//     {"Remove tag while reading", nfcTestAPIBasicTest2, NET_NFC_TEST_NOT_YET}, // OK
+       //      {"API STRESS_WRITE_READ TEST", nfcTestReadWriteMode, NET_NFC_TEST_NOT_YET}, // OK
+       //      {"Remove tag while writing", nfcTestWriteMode, NET_NFC_TEST_NOT_YET}, //OK
+       //      {"Remove tag while reading", nfcTestAPIBasicTest2, NET_NFC_TEST_NOT_YET}, // OK
        //{"API BASIC TEST3", nfcTestAPIBasicTest3, NET_NFC_TEST_NOT_YET},
-//     {"API MUTIPLE REQUEST", nfcTestAPIMultipleRequest, NET_NFC_TEST_NOT_YET}, // OK
-//     {"API BASIC TEST1", nfcTestAPIBasicTest1, NET_NFC_TEST_NOT_YET}, // OK
-//     {"Check NDEF message",          nfcTestNdefParser,              NET_NFC_TEST_NOT_YET}, // OK
-//     {"write mode",                  nfcTestWriteMode,               NET_NFC_TEST_NOT_YET},
-//     {"reader mode",                 nfcTestReaderMode,              NET_NFC_TEST_NOT_YET},
-//     {"format ndef",                 nfcTestFormatNdef,              NET_NFC_TEST_NOT_YET},
-//     {"internal_se_test",            nfcTestInternalSe,              NET_NFC_TEST_NOT_YET},
-//     {"exchange mode",               nfcTestExchanger,               NET_NFC_TEST_NOT_YET},
-//     {"Transceive Test",             nfcTestTransceive,              NET_NFC_TEST_NOT_YET},
-//     {"LLCP Test",           nfcTestLLCP, NET_NFC_TEST_NOT_YET},
-//     {"connection handover msg test",                nfcConnHandover, NET_NFC_TEST_NOT_YET},
-//     {"API Exception Test",          nfcTestAPIException, NET_NFC_TEST_NOT_YET},
-//     {"API Exception Test2",         nfcTestAPIException_tagAPI, NET_NFC_TEST_NOT_YET},
-///    {"API Exception Test3",         nfcTestAPIException_targetInfo, NET_NFC_TEST_NOT_YET},
-//     {"LLCP Test",           nfcTestLLCP, NET_NFC_TEST_NOT_YET},
-//     {"LLCP Test",           nfcTestStressLLCP, NET_NFC_TEST_NOT_YET},
-//    {"Handover Message",     nfcConnHandoverMessageTest , NET_NFC_TEST_NOT_YET},
+       //      {"API MUTIPLE REQUEST", nfcTestAPIMultipleRequest, NET_NFC_TEST_NOT_YET}, // OK
+       //      {"API BASIC TEST1", nfcTestAPIBasicTest1, NET_NFC_TEST_NOT_YET}, // OK
+       //      {"Check NDEF message",          nfcTestNdefParser,              NET_NFC_TEST_NOT_YET}, // OK
+       //      {"write mode",                  nfcTestWriteMode,               NET_NFC_TEST_NOT_YET},
+       //      {"reader mode",                 nfcTestReaderMode,              NET_NFC_TEST_NOT_YET},
+       //      {"format ndef",                 nfcTestFormatNdef,              NET_NFC_TEST_NOT_YET},
+       //      {"internal_se_test",            nfcTestInternalSe,              NET_NFC_TEST_NOT_YET},
+       //      {"exchange mode",               nfcTestExchanger,               NET_NFC_TEST_NOT_YET},
+       //      {"Transceive Test",             nfcTestTransceive,              NET_NFC_TEST_NOT_YET},
+       //      {"LLCP Test",           nfcTestLLCP, NET_NFC_TEST_NOT_YET},
+       //      {"connection handover msg test",                nfcConnHandover, NET_NFC_TEST_NOT_YET},
+       //      {"API Exception Test",          nfcTestAPIException, NET_NFC_TEST_NOT_YET},
+       //      {"API Exception Test2",         nfcTestAPIException_tagAPI, NET_NFC_TEST_NOT_YET},
+       ///     {"API Exception Test3",         nfcTestAPIException_targetInfo, NET_NFC_TEST_NOT_YET},
+       //      {"LLCP Test",           nfcTestLLCP, NET_NFC_TEST_NOT_YET},
+       //      {"LLCP Test",           nfcTestStressLLCP, NET_NFC_TEST_NOT_YET},
+       //    {"Handover Message",      nfcConnHandoverMessageTest , NET_NFC_TEST_NOT_YET},
        {"snep test",           nfcTestSnep,            NET_NFC_TEST_NOT_YET},
        {NULL,                          NULL,                           NET_NFC_TEST_NOT_YET},
 };
@@ -103,33 +103,33 @@ static int test_count = 0;
 /* Below smart poster data can has problem or parser has some problem.
        Need to check */
 uint8_t  nfcTestSpHex[]= {0xD1,0x02,0x37,0x53,0x70,0x91,0x01,0x18,0x54,0x04,
-                       0x74,0x65,0x73,0x74,0x53,0x6D,0x61,0x72,0x74,0x70,
-                       0x6F,0x73,0x74,0x65,0x72,0x20,0x45,0x78,0x61,0x6D,
-                       0x70,0x6C,0x65,0x11,0x03,0x01,0x61,0x63,0x74,0x00,
-                       0x51,0x01,0x10,0x55,0x00,0x77,0x77,0x77,0x2E,0x73,
-                       0x61,0x6D,0x73,0x75,0x6E,0x67,0x2E,0x63,0x6F,0x6D};
+       0x74,0x65,0x73,0x74,0x53,0x6D,0x61,0x72,0x74,0x70,
+       0x6F,0x73,0x74,0x65,0x72,0x20,0x45,0x78,0x61,0x6D,
+       0x70,0x6C,0x65,0x11,0x03,0x01,0x61,0x63,0x74,0x00,
+       0x51,0x01,0x10,0x55,0x00,0x77,0x77,0x77,0x2E,0x73,
+       0x61,0x6D,0x73,0x75,0x6E,0x67,0x2E,0x63,0x6F,0x6D};
 
 /*
-uint8_t  nfcTestSp[]={0xD1,0x02,0x24,0x53,0x70,0x91,0x01,0x14,0x54
-                                       ,0x00,0x53,0x6D,0x61,0x72,0x74,0x70,0x6F,0x73
-                                       ,0x74,0x65,0x72,0x20,0x45,0x78,0x61,0x6D,0x70
-                                       ,0x6C,0x65,0x11,0x03,0x01,0x61,0x63,0x74,0x00
-                                       ,0x51,0x01,0x01,0x55,0x00};
-*/
+       uint8_t  nfcTestSp[]={0xD1,0x02,0x24,0x53,0x70,0x91,0x01,0x14,0x54
+       ,0x00,0x53,0x6D,0x61,0x72,0x74,0x70,0x6F,0x73
+       ,0x74,0x65,0x72,0x20,0x45,0x78,0x61,0x6D,0x70
+       ,0x6C,0x65,0x11,0x03,0x01,0x61,0x63,0x74,0x00
+       ,0x51,0x01,0x01,0x55,0x00};
+       */
 
 // test Text "Samsung Linux Platform NFC TEST"
 uint8_t nfcTestTextHex[]= {0xD1,0x01,0x20,0x54,0x00,0x53,0x61,0x6D,0x73,0x75
-                                  ,0x6E,0x67,0x20,0x4C,0x69,0x6E,0x75,0x78,0x20,0x50
-                                  ,0x6C,0x61,0x74,0x66,0x6F,0x72,0x6D,0x20,0x4E,0x46
-                                  ,0x43,0x20,0x54,0x45,0x53,0x54};
+       ,0x6E,0x67,0x20,0x4C,0x69,0x6E,0x75,0x78,0x20,0x50
+               ,0x6C,0x61,0x74,0x66,0x6F,0x72,0x6D,0x20,0x4E,0x46
+               ,0x43,0x20,0x54,0x45,0x53,0x54};
 
 
 // test URI "http://www.samsunglinuxplatform.nfctest.com"
 uint8_t nfcTestUriHex[]={0xD1,0x01,0x2C,0x55,0x00,0x68,0x74,0x74,0x70,0x3A
-                                       ,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x73,0x61,0x6D,0x73
-                                       ,0x75,0x6E,0x67,0x6C,0x69,0x6E,0x75,0x78,0x70,0x6C
-                                       ,0x61,0x74,0x66,0x6F,0x72,0x6D,0x2E,0x6E,0x66,0x63
-                                       ,0x74,0x65,0x73,0x74,0x2E,0x63,0x6F,0x6D};
+       ,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x73,0x61,0x6D,0x73
+               ,0x75,0x6E,0x67,0x6C,0x69,0x6E,0x75,0x78,0x70,0x6C
+               ,0x61,0x74,0x66,0x6F,0x72,0x6D,0x2E,0x6E,0x66,0x63
+               ,0x74,0x65,0x73,0x74,0x2E,0x63,0x6F,0x6D};
 
 uint8_t        nfcTestText[] = "payload http://www.samsunglinuxplatform.nfctest.com";
 uint8_t        nfcTestUri[] = {0xD1,0x01,0x13,0x55,0x1,0x73,0x61,0x6D,0x73,0x75,0x6E,0x67,0x6D,0x6F,0x62,0x69,0x6C,0x65,0x2E,0x63,0x6F,0x6D,0x2F};
@@ -233,7 +233,7 @@ net_nfc_exchanger_data_h net_nfc_exchanger_callback(net_nfc_exchanger_event_e ev
                        net_nfc_error_e error = NET_NFC_OK;
                        data_h payload = NULL;
 
-/*
+               /*
                        uint8_t buffer[1024] = {0};
 
                        int i = 0;
@@ -242,7 +242,7 @@ net_nfc_exchanger_data_h net_nfc_exchanger_callback(net_nfc_exchanger_event_e ev
                        }
 
                        net_nfc_create_data(&payload, buffer, 1024);
-*/
+                       */
 
                        if((error = net_nfc_create_exchanger_data(&ex_data, payload/*(uint8_t *)"http://www.samsung.com"*/)) == NET_NFC_OK)
                        //if((error = net_nfc_create_exchanger_url_type_data(&ex_data, NET_NFC_SCHEMA_FULL_URI, (uint8_t *)"file://test.txt")) == NET_NFC_OK)
@@ -283,7 +283,7 @@ static void net_nfc_test_reader_cb(net_nfc_message_e message, net_nfc_error_e re
 {
        //int user_context;
 
-       PRINT_INFO("user_param = [%p] trans_param = [%p]", user_param, trans_data);
+       PRINT_INFO("user_param = [%d] trans_param = [%d]", (int)user_param, (int)trans_data);
 
        switch(message)
        {
@@ -297,7 +297,7 @@ static void net_nfc_test_reader_cb(net_nfc_message_e message, net_nfc_error_e re
                        net_nfc_get_tag_handle(target_info, &id);
                        net_nfc_get_tag_ndef_support (target_info, &is_ndef);
                        PRINT_INFO("target type: %d\n", type);
-                       PRINT_INFO("target id: %p\n", id);
+                       PRINT_INFO("target id: %X\n", (unsigned int)id);
                        PRINT_INFO("Is NDEF supoort: %d\n", is_ndef);
 
                        if (is_ndef){
@@ -344,7 +344,7 @@ static void net_nfc_test_format_cb(net_nfc_message_e message, net_nfc_error_e re
 {
        //int user_context;
 
-       PRINT_INFO("user_param = [%p] trans_param = [%p]", user_param, trans_data);
+       PRINT_INFO("user_param = [%d] trans_param = [%d]", (int)user_param, (int)trans_data);
 
        switch(message)
        {
@@ -361,7 +361,7 @@ static void net_nfc_test_format_cb(net_nfc_message_e message, net_nfc_error_e re
                        net_nfc_get_tag_handle(target_info, &id);
                        net_nfc_get_tag_ndef_support (target_info, &is_ndef);
                        PRINT_INFO("target type: %d\n", type);
-                       PRINT_INFO("target id: %p\n", id);
+                       PRINT_INFO("target id: %X\n", (unsigned int)id);
                        PRINT_INFO("Is NDEF supoort: %d\n", is_ndef);
 
                        data_h ndef_key = NULL;
@@ -407,7 +407,7 @@ static void net_nfc_test_se_cb(net_nfc_message_e message, net_nfc_error_e result
                break;
                case NET_NFC_MESSAGE_OPEN_INTERNAL_SE :
                {
-                       PRINT_INFO("NET_NFC_MESSAGE_OPEN_INTERNAL_SE result = [%p] and handle = [%p]", result, data);
+                       PRINT_INFO("NET_NFC_MESSAGE_OPEN_INTERNAL_SE result = [%d] and handle = [0x%x]", result, (unsigned int)data);
                        data_h apdu = NULL;
                        uint8_t apdu_cmd[4] = {0x00, 0xA4, 0x00, 0x0C} ; // CLA 0-> use default channel and no secure message. 0xA4 -> select instruction
                        net_nfc_create_data(&apdu, apdu_cmd, 4);
@@ -446,7 +446,7 @@ static void net_nfc_test_se_cb(net_nfc_message_e message, net_nfc_error_e result
                        break;
        }
 
-       PRINT_INFO("user_param = [%p] trans_param = [%p]", user_param, trans_data);
+       PRINT_INFO("user_param = [%d] trans_param = [%d]", (int)user_param, (int)trans_data);
 }
 
 /*=================================================================================*/
@@ -467,7 +467,7 @@ static void net_nfc_test_static_handover_cb(net_nfc_message_e message, net_nfc_e
                        net_nfc_get_tag_handle(target_info, &id);
                        net_nfc_get_tag_ndef_support (target_info, &is_ndef);
                        PRINT_INFO("target type: %d\n", type);
-                       PRINT_INFO("target id: %p\n", id);
+                       PRINT_INFO("target id: %X\n", (unsigned int)id);
                        PRINT_INFO("Is NDEF supoort: %d\n", is_ndef);
 
                        if (is_ndef){
@@ -724,7 +724,7 @@ int nfcTestInternalSe(uint8_t testNumber,void* arg_ptr2)
 {
        PRINT_INFO("%s is start", __func__);
 
-       int user_context = 0;
+       //int user_context = 0;
        net_nfc_error_e result;
        test_case_result = NET_NFC_TEST_FAIL;
 
@@ -798,7 +798,7 @@ static void net_nfc_test_write_cb(net_nfc_message_e message, net_nfc_error_e res
                        net_nfc_get_tag_handle (target_info, &handle);
                        net_nfc_get_tag_ndef_support (target_info, &is_ndef);
                        PRINT_INFO("target type: %d\n", type);
-                       PRINT_INFO("target id: %p\n", handle);
+                       PRINT_INFO("target id: %X\n", (unsigned int)handle);
                        PRINT_INFO("Is NDEF supoort: %d\n", is_ndef);
 
                        tag_handle = handle;
@@ -1035,7 +1035,7 @@ static void net_nfc_test_transceive_cb(net_nfc_message_e message, net_nfc_error_
                        net_nfc_get_tag_handle (target_info, &id);
                        net_nfc_get_tag_ndef_support (target_info, &is_ndef);
                        PRINT_INFO("target type: %d\n", type);
-                       PRINT_INFO("target id: %p\n", id);
+                       PRINT_INFO("target id: %X\n", (unsigned int)id);
                        PRINT_INFO("Is NDEF supoort: %d\n", is_ndef);
 
                        tag_handle = id;
@@ -1462,7 +1462,7 @@ static void net_nfc_test_multiple_request_cb(net_nfc_message_e message, net_nfc_
                        net_nfc_get_tag_handle (target_info, &handle);
                        net_nfc_get_tag_ndef_support (target_info, &is_ndef);
                        PRINT_INFO("target type: %d\n", type);
-                       PRINT_INFO("target handle: %p\n", handle);
+                       PRINT_INFO("target handle: %X\n", (unsigned int)handle);
                        PRINT_INFO("Is NDEF supoort: %d\n", is_ndef);
 
                        test_case_result = NET_NFC_TEST_OK;
@@ -1547,7 +1547,7 @@ static void net_nfc_test_detected_cb(net_nfc_message_e message, net_nfc_error_e
                        net_nfc_get_tag_ndef_support (target_info, &is_ndef);
 
                        PRINT_INFO("target type: %d\n", type);
-                       PRINT_INFO("target handle: %p\n", id);
+                       PRINT_INFO("target handle: %X\n", (unsigned int)id);
                        PRINT_INFO("Is NDEF supoort: %d\n", is_ndef);
 
                        char** keys = NULL;
@@ -1674,7 +1674,7 @@ static void net_nfc_test_read_cb(net_nfc_message_e message, net_nfc_error_e resu
                        net_nfc_get_tag_handle (target_info, &handle);
                        net_nfc_get_tag_ndef_support (target_info, &is_ndef);
                        PRINT_INFO("target type: %d\n", type);
-                       PRINT_INFO("target handle: %p\n", handle);
+                       PRINT_INFO("target handle: %X\n", (unsigned int)handle);
                        PRINT_INFO("Is NDEF supoort: %d\n", is_ndef);
 
                        if(is_ndef)
@@ -1771,7 +1771,7 @@ static void net_nfc_test_read_write_cb(net_nfc_message_e message, net_nfc_error_
                        net_nfc_get_tag_handle (target_info, &handle);
                        net_nfc_get_tag_ndef_support (target_info, &is_ndef);
                        PRINT_INFO("target type: %d\n", type);
-                       PRINT_INFO("target handle: %p\n", handle);
+                       PRINT_INFO("target handle: %X\n", (unsigned int)handle);
                        PRINT_INFO("Is NDEF supoort: %d\n", is_ndef);
 
                        if(is_ndef)
@@ -2081,11 +2081,11 @@ int nfcTestAPIBasicTest3(uint8_t testNumber,void* arg_ptr2)
 
                                                                if(net_nfc_get_record_type(record, &type) == NET_NFC_OK && net_nfc_get_record_payload(record, &payload) == NET_NFC_OK)
                                                                {
-                                                                       if(strcmp((char*)net_nfc_get_data_buffer(type), "Sp") == 0)
+                                                                       if(strcmp((const char*)net_nfc_get_data_buffer(type), "Sp") == 0)
                                                                        {
 
                                                                        }
-                                                                       else if(strcmp((char*)net_nfc_get_data_buffer(type), "T") == 0)
+                                                                       else if(strcmp((const char*)net_nfc_get_data_buffer(type), "T") == 0)
                                                                        {
 
                                                                                net_nfc_encode_type_e utf;
@@ -2097,7 +2097,7 @@ int nfcTestAPIBasicTest3(uint8_t testNumber,void* arg_ptr2)
 
                                                                                if(net_nfc_get_encoding_type_from_text_record(record, &utf) == NET_NFC_OK)
                                                                                {
-                                                                                       PRINT_INFO("utf = [%d]", utf);
+                                                                                       PRINT_INFO("utf = [%X]", utf);
                                                                                }
                                                                                else
                                                                                {
@@ -2189,7 +2189,7 @@ int nfcTestAPIBasicTest3(uint8_t testNumber,void* arg_ptr2)
                                                                                test_case_result = NET_NFC_TEST_OK;
 */
                                                                        }
-                                                                       else if(strcmp((char*)net_nfc_get_data_buffer(type), "U") == 0)
+                                                                       else if(strcmp((const char*)net_nfc_get_data_buffer(type), "U") == 0)
                                                                        {
 
                                                                        }
@@ -2309,7 +2309,7 @@ int nfcTestNdefParser(uint8_t testNumber,void* arg_ptr2)
 
        //_//net_nfc_ndef_print_message (uriMsg);
 
-       result = net_nfc_create_data (&type_data ,(uint8_t*)"U", 1);
+       result = net_nfc_create_data (&type_data ,(const uint8_t*)"U", 1);
        CHECK_RESULT(result);
 
        result = net_nfc_search_record_by_type (uriMsg ,NET_NFC_RECORD_WELL_KNOWN_TYPE ,type_data ,&record);
@@ -2339,7 +2339,7 @@ int nfcTestNdefParser(uint8_t testNumber,void* arg_ptr2)
        result = net_nfc_create_rawdata_from_ndef_message (uriMsg, &raw_data);
        CHECK_RESULT(result);
 
-       result = net_nfc_create_data (&type_data, (uint8_t*)smart_poster_type, strlen (smart_poster_type));
+       result = net_nfc_create_data (&type_data, (const uint8_t*)smart_poster_type, strlen (smart_poster_type));
        if (result != NET_NFC_OK) {
                net_nfc_free_data(raw_data);
                net_nfc_free_data(type_data);
@@ -2389,7 +2389,7 @@ static void net_nfc_client_socket_cb (net_nfc_llcp_message_e message, net_nfc_er
                        PRINT_INFO ("LLCP connect is completed with error code %d", result);
                        data_h data;
                        char * str = "Client message: Hello, server!";
-                       net_nfc_create_data (&data, (uint8_t*)str ,strlen (str) + 1);
+                       net_nfc_create_data (&data, (const uint8_t*)str ,strlen (str) + 1);
                        net_nfc_send_llcp (client_socket, data, NULL);
                        net_nfc_free_data(data);
                }
@@ -2465,7 +2465,7 @@ static void net_nfc_server_socket_cb (net_nfc_llcp_message_e message, net_nfc_er
 
                        data_h data;
                        char * str = "Server message: Welcome NFC llcp world!";
-                       net_nfc_create_data (&data, (uint8_t*)str ,strlen (str) + 1);
+                       net_nfc_create_data (&data, (const uint8_t*)str ,strlen (str) + 1);
                        net_nfc_send_llcp (accepted_socket, data, NULL);
                        net_nfc_free_data(data);
                }
@@ -2658,7 +2658,7 @@ static void net_nfc_client_stress_socket_cb (net_nfc_llcp_message_e message, net
                        PRINT_INFO ("LLCP connect is completed with error code %d", result);
                        data_h data;
                        char * str = "Client message: Hello, server!";
-                       net_nfc_create_data (&data, (uint8_t*)str ,strlen (str) + 1);
+                       net_nfc_create_data (&data, (const uint8_t*)str ,strlen (str) + 1);
                        net_nfc_send_llcp (client_socket, data, NULL);
                        net_nfc_free_data(data);
                }
@@ -2732,7 +2732,7 @@ static void net_nfc_server_stress_socket_cb (net_nfc_llcp_message_e message, net
 
                        data_h data;
                        char * str = "Server message: Welcome NFC llcp world!";
-                       net_nfc_create_data (&data, (uint8_t*)str ,strlen (str) + 1);
+                       net_nfc_create_data (&data, (const uint8_t*)str ,strlen (str) + 1);
                        net_nfc_send_llcp (server_socket, data, NULL);
                        net_nfc_free_data(data);
                }
@@ -2990,7 +2990,7 @@ static void net_nfc_test_API_exception_tagAPI(net_nfc_message_e message, net_nfc
                                        net_nfc_get_tag_handle (target_info, &id);
                                        net_nfc_get_tag_ndef_support (target_info, &is_ndef);
                                        PRINT_INFO("target type: %d\n", type);
-                                       PRINT_INFO("target id: %p\n", id);
+                                       PRINT_INFO("target id: %X\n", (unsigned int)id);
                                        PRINT_INFO("Is NDEF supoort: %d\n", is_ndef);
 
                                        net_nfc_deinitialize (); // Before calling transceive
@@ -3034,7 +3034,7 @@ static void net_nfc_test_API_exception_tagAPI(net_nfc_message_e message, net_nfc
                                        net_nfc_target_handle_h id;
                                        data_h key;
                                        char data [] = {0xff,0xff,0xff,0xff,0xff,0xff};
-                                       net_nfc_create_data (&key, (uint8_t*)data, 6);
+                                       net_nfc_create_data (&key, (const uint8_t*)data, 6);
                                        net_nfc_get_tag_handle (target_info, &id);
                                        net_nfc_deinitialize();
                                        if (NET_NFC_OK == net_nfc_format_ndef(id, key, NULL)){
similarity index 98%
rename from test_clinet_app/nfc_client/nfc_api_test.h
rename to tools/nfc-client/nfc_api_test.h
index 0cf6c29..24d5b03 100644 (file)
@@ -4,7 +4,7 @@
   * 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