From: Wu Jiangbo Date: Wed, 26 Nov 2014 06:46:43 +0000 (+0800) Subject: Fix building error if we moved to NTB bluetooth stack X-Git-Tag: accepted/tizen/common/20141201.092411^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fconnectivity%2Fnfc-manager-neard.git;a=commitdiff_plain;h=421cf161b77a6d6999c6fddc65b2078b403871ff Fix building error if we moved to NTB bluetooth stack Use BT CAPI instead bluetooth-frwk internal API to avoid build issue during use NTB Also for BT handover nfc CAPIs call neard directly by neadal library. we can remove this part of the code Change-Id: Iad46c9df09a114767d7d9b0fd0da3db62ae03de5 Signed-off-by: Wu Jiangbo Signed-off-by: Arron Wang --- diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 52f958d..aa6c10f 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -12,8 +12,8 @@ EXEC_PROGRAM(${GDBUS_CODEGEN} ARGS 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 libtzplatform-config) +pkg_check_modules(common_pkgs REQUIRED glib-2.0 gio-2.0 gio-unix-2.0 dlog vconf + libssl libtzplatform-config capi-network-bluetooth) FOREACH(flag ${common_pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") diff --git a/common/net_nfc_util.c b/common/net_nfc_util.c index c62a25b..e75e636 100644 --- a/common/net_nfc_util.c +++ b/common/net_nfc_util.c @@ -21,8 +21,8 @@ #include // platform header -#include #include +#include // nfc-manager header #include "net_nfc_util_internal.h" @@ -179,24 +179,24 @@ net_nfc_conn_handover_carrier_state_e net_nfc_util_get_cps( net_nfc_conn_handover_carrier_type_e carrier_type) { net_nfc_conn_handover_carrier_state_e cps = NET_NFC_CONN_HANDOVER_CARRIER_INACTIVATE; + bt_adapter_state_e state = BT_ADAPTER_DISABLED; if (NET_NFC_CONN_HANDOVER_CARRIER_BT== carrier_type) { - int ret = bluetooth_check_adapter(); + bt_adapter_get_state(&state); - switch (ret) + switch (state) { - case BLUETOOTH_ADAPTER_ENABLED : + case BT_ADAPTER_ENABLED : cps = NET_NFC_CONN_HANDOVER_CARRIER_ACTIVATE; break; - - case BLUETOOTH_ADAPTER_CHANGING_ENABLE : + /* + case BT_ADAPTER_CHANGING_ENABLE : cps = NET_NFC_CONN_HANDOVER_CARRIER_ACTIVATING; break; - - case BLUETOOTH_ADAPTER_DISABLED : - case BLUETOOTH_ADAPTER_CHANGING_DISABLE : - case BLUETOOTH_ERROR_NO_RESOURCES : + */ + case BT_ADAPTER_DISABLED : + //case BT_ADAPTER_CHANGING_DISABLE : default : cps = NET_NFC_CONN_HANDOVER_CARRIER_INACTIVATE; break; @@ -272,13 +272,11 @@ uint8_t *net_nfc_util_get_local_bt_address() } else { - bluetooth_device_address_t local_address; - - memset(&local_address, 0x00, sizeof(bluetooth_device_address_t)); + char *local_address = NULL; - bluetooth_get_local_address(&local_address); + bt_adapter_get_address(&local_address); - memcpy(bt_addr, &local_address.addr, BLUETOOTH_ADDRESS_LENGTH); + memcpy(bt_addr, local_address, BLUETOOTH_ADDRESS_LENGTH); } } @@ -287,7 +285,7 @@ uint8_t *net_nfc_util_get_local_bt_address() void net_nfc_util_enable_bluetooth(void) { - bluetooth_enable_adapter(); + bt_adapter_enable(); } bool net_nfc_util_strip_string(char *buffer, int buffer_length) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 47477eb..7ddb3d0 100755 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -5,6 +5,8 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/include) SET(NFC_DAEMON "nfc-manager-daemon") FILE(GLOB DAEMON_SRCS *.c) +#LIST(REMOVE_ITEM DAEMON_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/net_nfc_server_process_handover.c) +LIST(REMOVE_ITEM DAEMON_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/net_nfc_server_handover_bt.c) IF(X11_SUPPORT) SET(WIN_PKG "ecore-x") @@ -15,12 +17,12 @@ ENDIF(WAYLAND_SUPPORT) INCLUDE(FindPkgConfig) IF(ARM_TARGET) 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 + vconf dlog tapi appsvc libcurl libssl svi capi-media-wav-player pkgmgr pkgmgr-info capi-network-wifi pmapi wifi-direct libtzplatform-config neardal ${WIN_PKG}) ELSE(ARM_TARGET) 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 + vconf dlog tapi appsvc libcurl libssl svi capi-media-wav-player pkgmgr pkgmgr-info capi-network-wifi pmapi libtzplatform-config neardal ${WIN_PKG}) ENDIF(ARM_TARGET) diff --git a/daemon/net_nfc_server_process_handover.c b/daemon/net_nfc_server_process_handover.c index 41f158e..79aabf3 100755 --- a/daemon/net_nfc_server_process_handover.c +++ b/daemon/net_nfc_server_process_handover.c @@ -14,7 +14,6 @@ * limitations under the License. */ -#include "bluetooth-api.h" #include "net_nfc_server_handover.h" #include "net_nfc_debug_internal.h" #include "net_nfc_util_internal.h" @@ -27,7 +26,7 @@ #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" +//#include "net_nfc_server_handover_bt.h" typedef void (*_net_nfc_server_handover_create_carrier_msg_cb)( net_nfc_error_e result, @@ -606,12 +605,13 @@ static int _net_nfc_server_handover_iterate_create_carrier_configs( switch (context->current_type) { +/* case NET_NFC_CONN_HANDOVER_CARRIER_BT : NFC_DBG("[NET_NFC_CONN_HANDOVER_CARRIER_BT]"); net_nfc_server_handover_bt_get_carrier_record( _net_nfc_server_handover_bt_get_carrier_record_cb, context); break; - +*/ case NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS : NFC_DBG("[NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS]"); @@ -753,11 +753,13 @@ net_nfc_error_e net_nfc_server_handover_process_carrier_record( /* process carrier record */ switch (type) { + /* case NET_NFC_CONN_HANDOVER_CARRIER_BT : NFC_DBG("[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); break; + */ case NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS : NFC_DBG("[NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS]"); @@ -1598,8 +1600,10 @@ static void _net_nfc_server_handover_client_process( /* start post process */ if (NET_NFC_CONN_HANDOVER_CARRIER_BT == context->type) { + /* net_nfc_server_handover_bt_post_process(&context->data, _net_nfc_server_handover_client_post_process_cb, context); + */ } else { diff --git a/packaging/nfc-manager-neard.spec b/packaging/nfc-manager-neard.spec index 53ca61e..6ce7b61 100755 --- a/packaging/nfc-manager-neard.spec +++ b/packaging/nfc-manager-neard.spec @@ -20,8 +20,8 @@ BuildRequires: pkgconfig(security-server) BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(tapi) -BuildRequires: pkgconfig(bluetooth-api) BuildRequires: pkgconfig(capi-network-wifi) +BuildRequires: pkgconfig(capi-network-bluetooth) BuildRequires: pkgconfig(mm-sound) BuildRequires: pkgconfig(appsvc) BuildRequires: pkgconfig(svi)