From 9e7ef97e14283aded05dfca69152c4cfc3efe716 Mon Sep 17 00:00:00 2001 From: Amin Ben Romdhane Date: Fri, 17 Jan 2025 11:05:46 +0100 Subject: [PATCH] wifidmd: Config option to select DataElements and/or legacy WiFi --- wifidmd/Config.in | 8 +++-- wifidmd/Makefile | 29 ++++++++++++------- wifidmd/{ => files}/bbfdm_service.json | 0 wifidmd/files/bbfdm_service_dataelements.json | 16 ++++++++++ 4 files changed, 41 insertions(+), 12 deletions(-) rename wifidmd/{ => files}/bbfdm_service.json (100%) create mode 100644 wifidmd/files/bbfdm_service_dataelements.json diff --git a/wifidmd/Config.in b/wifidmd/Config.in index 0d2934354..75c205b00 100644 --- a/wifidmd/Config.in +++ b/wifidmd/Config.in @@ -1,7 +1,11 @@ if PACKAGE_wifidmd -config ENABLE_WIFI_DATAELEMENTS - bool "Enable WiFi Data Elements Object" +config WIFIDMD_DISABLE_LEGACY_WIFI + bool "Disable legacy Wireless Objects like WiFi.Radio., WiFi.SSID., WiFi.AccessPoint. etc" + default n + +config WIFIDMD_WIFI_DATAELEMENTS + bool "Enable Device.WiFi.DataElements. Object" default y endif diff --git a/wifidmd/Makefile b/wifidmd/Makefile index fa6e1e0b8..85d3b25be 100644 --- a/wifidmd/Makefile +++ b/wifidmd/Makefile @@ -1,11 +1,11 @@ # -# Copyright (C) 2020-2024 iopsys +# Copyright (C) 2020-2025 iopsys # include $(TOPDIR)/rules.mk PKG_NAME:=wifidmd -PKG_VERSION:=1.0.21 +PKG_VERSION:=1.0.22 LOCAL_DEV:=0 ifneq ($(LOCAL_DEV),1) @@ -39,18 +39,27 @@ endef MAKE_PATH:=src -define Package/wifidmd/install - $(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME) - $(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libwifi.so $(1) $(PKG_NAME) -ifeq ($(CONFIG_ENABLE_WIFI_DATAELEMENTS),y) - $(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/libdataelements.so $(1) $(PKG_NAME) -endif -endef - ifeq ($(LOCAL_DEV),1) define Build/Prepare $(CP) ~/git/wifidmd/* $(PKG_BUILD_DIR)/ endef endif + +define Package/wifidmd/install + $(INSTALL_DIR) $(1)/etc/bbfdm/services + $(INSTALL_DIR) $(1)/usr/share/bbfdm/micro_services + +ifneq ($(CONFIG_WIFIDMD_DISABLE_LEGACY_WIFI),y) + $(BBFDM_REGISTER_SERVICES) ./files/bbfdm_service.json $(1) $(PKG_NAME) + $(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libwifi.so $(1) $(PKG_NAME) +endif + +ifeq ($(CONFIG_WIFIDMD_WIFI_DATAELEMENTS),y) + $(BBFDM_REGISTER_SERVICES) ./files/bbfdm_service_dataelements.json $(1) $(PKG_NAME).dataelements + $(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libdataelements.so $(1) $(PKG_NAME).dataelements +endif +endef + + $(eval $(call BuildPackage,wifidmd)) diff --git a/wifidmd/bbfdm_service.json b/wifidmd/files/bbfdm_service.json similarity index 100% rename from wifidmd/bbfdm_service.json rename to wifidmd/files/bbfdm_service.json diff --git a/wifidmd/files/bbfdm_service_dataelements.json b/wifidmd/files/bbfdm_service_dataelements.json new file mode 100644 index 000000000..be254700b --- /dev/null +++ b/wifidmd/files/bbfdm_service_dataelements.json @@ -0,0 +1,16 @@ +{ + "daemon": { + "enable": "1", + "service_name": "wifidmd.dataelements", + "unified_daemon": false, + "services": [ + { + "parent_dm": "Device.", + "object": "WiFi" + } + ], + "config": { + "loglevel": "3" + } + } +}