Disable mesh functionality to remove ell dependency in movable project 54/318554/2 accepted/tizen_unified accepted/tizen_unified_x tizen accepted/tizen/unified/20241013.144702 accepted/tizen/unified/x/20241014.022516
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 dd35af6..a1cffd3 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 81abc33..d28ac11 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 519a03b..504d192 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 0965029..d559b96 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 fd07afa..b827b36 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 e72304b..8e92e61 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 5d88212..3200940 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 92471d8..b22b96f 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 e534ba2..994b4b5 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 ef6b9da..d183d72 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 66aba51..5ba360f 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 e7a7d61..b51da33 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 655d31b..7bf6af9 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 973488d..3e0390b 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"