Disable mesh functionality to remove ell dependency in movable project 54/318554/2 accepted/tizen_9.0_unified accepted/tizen_unified_toolchain tizen_9.0 accepted/tizen/9.0/unified/20241030.232630 accepted/tizen/unified/20241013.144702 accepted/tizen/unified/toolchain/20241022.122325 accepted/tizen/unified/toolchain/20241022.122814 accepted/tizen/unified/x/20241014.022516 accepted/tizen/unified/x/asan/20241022.113305 tizen_9.0_m2_release
authorWootak Jung <wootak.jung@samsung.com>
Wed, 2 Oct 2024 07:03:27 +0000 (16:03 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Mon, 7 Oct 2024 02:55:00 +0000 (11:55 +0900)
Change-Id: I6fc0d44910683c29cacee54d967ca007e29421a9
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
14 files changed:
bt-oal/bluez_hal/CMakeLists.txt
bt-oal/bluez_hal/src/bt-hal-bluetooth.c
bt-service/CMakeLists.txt
bt-service/services/adapter/bt-service-core-adapter-le.c
bt-service/services/bt-request-handler.c
bt-service/services/bt-service-main.c
bt-service/services/include/bt-service-mesh-cdb.h
bt-service/services/include/bt-service-mesh-common.h
bt-service/services/include/bt-service-mesh-config-client.h
bt-service/services/include/bt-service-mesh-main.h
bt-service/services/include/bt-service-mesh-model.h
bt-service/services/include/bt-service-mesh-network.h
bt-service/services/include/bt-service-mesh-util.h
packaging/bluetooth-frwk.spec

index dd35af64a7eb6b6682a85a33976e7797daae1c12..a1cffd3459cdfec6cc195b8ba091b67874dc91b7 100644 (file)
@@ -35,14 +35,17 @@ SET(SRCS
 ./src/bt-hal-gatt-client.c
 ./src/bt-hal-hf-client.c
 ./src/bt-hal-hf-client-dbus-handler.c
-./src/bt-hal-mesh.c
-./src/bt-hal-mesh-dbus-handler.c
 ./src/bt-hal-tds.c
 ./src/bt-hal-tds-dbus-handler.c
 ./src/bt-hal-l2cap-le-dbus-handler.c
 ./src/bt-hal-socket-common.c
 )
 
+IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_MESH_SUPPORT")
+LIST(APPEND SRCS ./src/bt-hal-mesh.c)
+LIST(APPEND SRCS ./src/bt-hal-mesh-dbus-handler.c)
+ENDIF()
+
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(EXEC_PREFIX "\${prefix}")
 SET(LIBDIR ${CMAKE_LIB_DIR})
@@ -62,7 +65,6 @@ SET(PKG_MODULES
        gio-2.0
        syspopup-caller
        dbus-1
-       ell
        dlog
        gobject-2.0
        bundle
@@ -70,6 +72,10 @@ SET(PKG_MODULES
        capi-system-info
 )
 
+IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_MESH_SUPPORT")
+LIST(APPEND PKG_MODULES ell)
+ENDIF()
+
 INCLUDE(FindPkgConfig)
 pkg_check_modules(bluez_hal_pkgs REQUIRED ${PKG_MODULES})
 
index 81abc333dbaaab797e21782ff7ddaff2952759cd..d28ac119a3faa7ac123d151d748265d7d4232e2d 100644 (file)
@@ -316,10 +316,12 @@ static const void *get_profile_interface(const char *profile_id)
        if (!strcmp(profile_id, BT_PROFILE_ADVANCED_AUDIO_SINK_ID))
                return bt_get_a2dp_sink_interface();
 
+#ifdef TIZEN_FEATURE_MESH_SUPPORT
        if (!strcmp(profile_id, BT_PROFILE_MESH_ID)) {
                INFO("Mesh: Get MESH Stack Interface");
                return bt_get_mesh_interface();
        }
+#endif
 
        if (!strcmp(profile_id, BT_PROFILE_TDS_ID))
                return bt_get_tds_interface();
index 519a03bf4766e530d5bf7a9be99d831203abef85..504d1929a7573fbc8fdaf4a48aec6f09a170a0c6 100644 (file)
@@ -32,14 +32,6 @@ SET(SRCS
 ./services/audio/bt-service-absolute-volume.c
 ./services/gatt/bt-service-gatt.c
 ./services/audio/hf/bt-service-hf-client.c
-./services/mesh/bt-service-mesh-util.c
-./services/mesh/bt-service-mesh-keys.c
-./services/mesh/bt-service-mesh-cdb.c
-./services/mesh/bt-service-mesh-nodes.c
-./services/mesh/bt-service-mesh-network.c
-./services/mesh/bt-service-mesh-main.c
-./services/mesh/bt-service-mesh-config-client.c
-./services/mesh/bt-service-mesh-model.c
 ./services/tds/bt-service-tds.c
 ./services/l2cap_le/bt-service-l2cap-le.c
 )
@@ -64,6 +56,17 @@ LIST(APPEND SRCS ./services/ipsp/bt-service-ipsp.c)
 LIST(APPEND SRCS ./services/ipsp/bt-service-ipsp-event-receiver.c)
 ENDIF()
 
+IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_MESH_SUPPORT")
+LIST(APPEND SRCS ./services/mesh/bt-service-mesh-util.c)
+LIST(APPEND SRCS ./services/mesh/bt-service-mesh-keys.c)
+LIST(APPEND SRCS ./services/mesh/bt-service-mesh-cdb.c)
+LIST(APPEND SRCS ./services/mesh/bt-service-mesh-nodes.c)
+LIST(APPEND SRCS ./services/mesh/bt-service-mesh-network.c)
+LIST(APPEND SRCS ./services/mesh/bt-service-mesh-main.c)
+LIST(APPEND SRCS ./services/mesh/bt-service-mesh-config-client.c)
+LIST(APPEND SRCS ./services/mesh/bt-service-mesh-model.c)
+ENDIF()
+
 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
         SET(CMAKE_BUILD_TYPE "Release")
 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
@@ -84,7 +87,6 @@ ENDIF()
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../bt-oal/include)
 LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../bt-oal)
 
-IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_FACTORY_MODE")
 SET(PKG_MODULES
         vconf
         dbus-1
@@ -95,34 +97,19 @@ SET(PKG_MODULES
         cynara-client
         cynara-creds-gdbus
         aul
-       json-c
-       ell
-        eventsystem
-        storage
-        capi-system-info
-        libsystemd
-        bincfg
-        libactd
-)
-ELSE()
-SET(PKG_MODULES
-        vconf
-        dbus-1
-        gio-2.0
-        gio-unix-2.0
-        alarm-service
-        capi-network-connection
-        cynara-client
-        cynara-creds-gdbus
-        aul
-       json-c
-       ell
         eventsystem
         storage
         capi-system-info
         libsystemd
         libactd
 )
+
+IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_FACTORY_MODE")
+LIST(APPEND PKG_MODULES bincfg)
+ENDIF()
+
+IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_MESH_SUPPORT")
+LIST(APPEND PKG_MODULES json-c ell)
 ENDIF()
 
 INCLUDE(FindPkgConfig)
index 0965029716c9c8b6b5f3dd3b7941f6698812545c..d559b96b75a75bdb694b17c94877f61065815539 100644 (file)
@@ -2367,6 +2367,7 @@ int _bt_stop_le_scan(const char *sender)
                        is_le_scan_hold = FALSE;
                        scanner->is_scanning = TRUE;
                        return BLUETOOTH_ERROR_DEVICE_BUSY;
+#ifdef TIZEN_FEATURE_MESH_SUPPORT
                } else if (_bt_is_mesh_initialized()) {
                        /* Do not stop LE scan if BLE mesh running */
                        int value = 0;
@@ -2376,6 +2377,7 @@ int _bt_stop_le_scan(const char *sender)
                        _bt_set_le_scan_stop_requested(FALSE);
                        is_mesh_le_scan_stop_hold = true;
                        result = BLUETOOTH_ERROR_NONE;
+#endif
                } else {
                        BT_INFO("Just stop LE scan");
                        ret = gattc_stop_le_discovery(g_gatt_client_id);
index fd07afa9def6da40c1f66720e00aca0fe5541a0d..b827b360772f56922ad270e019db0218de0dcb13 100644 (file)
@@ -3650,6 +3650,7 @@ normal:
                break;
        }
 
+#ifdef TIZEN_FEATURE_MESH_SUPPORT
        case BT_MESH_INIT:
                sender = (char*)g_dbus_method_invocation_get_sender(context);
                BT_INFO("Mesh: Init by [%s]", sender);
@@ -4560,6 +4561,7 @@ normal:
                                requester_unique_creds, sender, &network, out_param1);
                break;
        }
+#endif
        case BT_L2CAP_LE_CLIENT_CONNECT: {
                bluetooth_device_address_t address = { {0} };
                int psm;
@@ -6010,8 +6012,10 @@ static void __name_owner_changed(GDBusConnection *connection,
        /* Check if RFCOMM app is terminated */
        _bt_rfcomm_check_termination(name);
 
+#ifdef TIZEN_FEATURE_MESH_SUPPORT
        /* Mesh App Termination */
        _bt_check_mesh_app_termination(name);
+#endif
 
        /* Stop the Transport Discovery service */
        _bt_tds_stop_by_terminated_process(name);
index e72304be11488ad7e3fddd705d7596083531ed67..8e92e61c964588555d3866b0950c0abbe81a15e9 100644 (file)
@@ -27,7 +27,9 @@
 #include <sys/socket.h>
 #include <bundle.h>
 #include <eventsystem.h>
+#ifdef TIZEN_FEATURE_MESH_SUPPORT
 #include <ell/ell.h>
+#endif
 
 #include "bt-internal-types.h"
 #include "bt-service-common.h"
@@ -49,7 +51,7 @@
 #include <oal-event.h>
 #include <oal-manager.h>
 
-/* ELL Start */
+#ifdef TIZEN_FEATURE_MESH_SUPPORT
 struct ell_event_source {
        GSource source;
        GPollFD pollfd;
@@ -73,7 +75,7 @@ static GSourceFuncs event_funcs = {
         .prepare = event_prepare,
         .check = event_check,
 };
-/* ELL End */
+#endif
 
 static GMainLoop *main_loop;
 static gboolean terminated = FALSE;
@@ -387,9 +389,9 @@ int _bt_service_initialize(void)
 int main(void)
 {
        struct sigaction sa;
-       /* ELL Start */
+#ifdef TIZEN_FEATURE_MESH_SUPPORT
        struct ell_event_source *source;
-       /* ELL End */
+#endif
        BT_INFO_C("### Starting the bt-service daemon");
 
        if (!TIZEN_FEATURE_BT_SUPPORTED) {
@@ -415,10 +417,10 @@ int main(void)
                return 0;
        }
 
-       /* ELL Start */
+#ifdef TIZEN_FEATURE_MESH_SUPPORT
        BT_INFO("ELL Main init");
        l_main_init();
-       /* ELL End */
+#endif
 
        bluetooth_plugin_init();
 
@@ -426,7 +428,7 @@ int main(void)
 
        main_loop = g_main_loop_new(NULL, FALSE);
 
-       /* ELL Start */
+#ifdef TIZEN_FEATURE_MESH_SUPPORT
        source = (struct ell_event_source *) g_source_new(&event_funcs,
                        sizeof(struct ell_event_source));
 
@@ -436,8 +438,8 @@ int main(void)
        g_source_add_poll((GSource *)source, &source->pollfd);
        g_source_attach((GSource *) source,
                        g_main_loop_get_context(main_loop));
+#endif
 
-       /* ELL End */
        g_main_loop_run(main_loop);
        BT_DBG("g_main_loop_quit called!");
 
@@ -445,9 +447,9 @@ int main(void)
 
        _bt_service_unref_connection();
 
-       /* ELL Start */
+#ifdef TIZEN_FEATURE_MESH_SUPPORT
        g_source_destroy((GSource *) source);
-       /* ELL End */
+#endif
 
        if (main_loop != NULL)
                g_main_loop_unref(main_loop);
@@ -455,9 +457,9 @@ int main(void)
        if (terminated == FALSE)
                __bt_release_service();
 
-       /* ELL Start */
+#ifdef TIZEN_FEATURE_MESH_SUPPORT
        l_main_exit();
-       /* ELL End */
+#endif
 
        return 0;
 }
index 5d8821206cf5520a79f4ccf4107d4eba955db881..3200940d74215e50136b0c906f5320aadba7dd21 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef BT_SERVICE_MESH_CDB_H_
 #define BT_SERVICE_MESH_CDB_H_
 
+#ifdef TIZEN_FEATURE_MESH_SUPPORT
 #include <glib.h>
 #include <sys/types.h>
 #include "bluetooth-api.h"
@@ -178,4 +179,5 @@ const char * _bt_mesh_conf_get_network_friendly_name(_bt_mesh_cdb_t *cfg);
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
+#endif /* TIZEN_FEATURE_MESH_SUPPORT */
 #endif /* BT_SERVICE_MESH_CDB_H_ */
index 92471d8c50360b2c8733425155e18667952853b7..b22b96f112af10a712fb57303ecb0c9fac1786ab 100644 (file)
@@ -26,7 +26,6 @@
 #include <sys/types.h>
 #include "bluetooth-api.h"
 #include "bluetooth-mesh-api.h"
-#include <json-c/json.h>
 #include "oal-mesh.h"
 
 #ifdef __cplusplus
index e534ba22bb3676278a57a406d8e9b7c9a8ed65d7..994b4b5b3355b40258e3b291647dd2ff82284401 100644 (file)
@@ -26,7 +26,6 @@
 #include <sys/types.h>
 #include "bluetooth-api.h"
 #include "bluetooth-mesh-api.h"
-#include <json-c/json.h>
 #include "oal-mesh.h"
 
 #ifdef __cplusplus
index ef6b9da1e54c4bd6b6e8463752088e659acc9d22..d183d72f581f051fa47d0305e58adc6290eb8c41 100644 (file)
@@ -26,7 +26,6 @@
 #include <sys/types.h>
 #include "bluetooth-api.h"
 #include "bluetooth-mesh-api.h"
-#include <json-c/json.h>
 
 #ifdef __cplusplus
 extern "C" {
index 66aba5106d515e97d578d2bd058392c1e5461248..5ba360f6042350c80ed376a308c8e3178094c990 100644 (file)
@@ -26,7 +26,6 @@
 #include <sys/types.h>
 #include "bluetooth-api.h"
 #include "bluetooth-mesh-api.h"
-#include <json-c/json.h>
 #include "oal-mesh.h"
 
 #ifdef __cplusplus
index e7a7d613c66e86f5d916cadb1a0e91cd95a5f3c7..b51da33bcc0a1002299c5f66d219c23b4d84241f 100644 (file)
@@ -44,7 +44,9 @@ void _bt_check_mesh_app_termination(const char *name);
 
 int _bt_mesh_network_remove_net_configuration(bluetooth_mesh_network_t *net);
 
+#ifdef TIZEN_FEATURE_MESH_SUPPORT
 void _bt_mesh_network_unload_net_configuration(_bt_mesh_cdb_t *cdb_cfg);
+#endif
 
 int _bt_mesh_network_remove_node_configuration(bluetooth_mesh_node_info_t *node);
 
index 655d31b53004e252587609b002cde0e36ca753db..7bf6af99593ca12cf4439434937a73c87a14b370 100644 (file)
@@ -26,7 +26,6 @@
 #include <sys/types.h>
 #include "bluetooth-api.h"
 #include "bluetooth-mesh-api.h"
-#include <json-c/json.h>
 
 #ifdef __cplusplus
 extern "C" {
index 973488d365500403e6670b982f56a27c36603045..3e0390bd05af78e31894ee1dc7f8929e6dd24147 100644 (file)
@@ -22,6 +22,11 @@ Source1001: bluetooth-frwk.manifest
 %define bt_http_proxy DISABLED
 %define bt_factory_mode DISABLED
 %define bt_vendor_operation DISABLED
+%if "%{mv_prj}" == "1"
+%define bt_mesh_support DISABLED
+%else
+%define bt_mesh_support ENABLED
+%endif
 
 BuildRequires:  pkgconfig(aul)
 %if %{bt_factory_mode} == ENABLED
@@ -46,8 +51,10 @@ BuildRequires:  cmake
 BuildRequires:  pkgconfig(cynara-client)
 BuildRequires:  pkgconfig(cynara-creds-gdbus)
 BuildRequires:  pkgconfig(libtzplatform-config)
+%if %{bt_mesh_support} == ENABLED
 BuildRequires:  pkgconfig(json-c)
 BuildRequires:  pkgconfig(ell)
+%endif
 BuildRequires:  pkgconfig(storage)
 BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  pkgconfig(capi-appfw-app-control)
@@ -287,6 +294,10 @@ export CFLAGS="$CFLAGS -DTIZEN_BT_INCLUDE_OAL_BLUEZ"
 export BT_INCLUDE_OAL_BLUEZ=DISABLED
 %endif
 
+%if %{bt_mesh_support} == ENABLED
+export CFLAGS="$CFLAGS -DTIZEN_FEATURE_MESH_SUPPORT"
+%endif
+
 export CFLAGS_DEFAULT="$CFLAGS"
 export CXXFLAGS_DEFAULT="$CXXFLAGS"
 export FFLAGS_DEFAULT="$FFLAGS"