Fix building error if we moved to NTB bluetooth stack 63/30863/1
authorWu Jiangbo <jiangbox.wu@intel.com>
Wed, 26 Nov 2014 06:46:43 +0000 (14:46 +0800)
committerArron Wang <arron.wang@intel.com>
Wed, 26 Nov 2014 08:12:02 +0000 (16:12 +0800)
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 <jiangbox.wu@intel.com>
Signed-off-by: Arron Wang <arron.wang@intel.com>
common/CMakeLists.txt
common/net_nfc_util.c
daemon/CMakeLists.txt
daemon/net_nfc_server_process_handover.c
packaging/nfc-manager-neard.spec

index 52f958d..aa6c10f 100644 (file)
@@ -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}")
index c62a25b..e75e636 100644 (file)
@@ -21,8 +21,8 @@
 #include <fcntl.h>
 
 // platform header
-#include <bluetooth-api.h>
 #include <vconf.h>
+#include <bluetooth.h>
 
 // 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)
index 47477eb..7ddb3d0 100755 (executable)
@@ -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)
index 41f158e..79aabf3 100755 (executable)
@@ -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
                {
index 53ca61e..6ce7b61 100755 (executable)
@@ -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)