diff --git a/dmtree/vendor/iopsys/tr181/vendor.c b/dmtree/vendor/iopsys/tr181/vendor.c index c1de2518..71bebed2 100644 --- a/dmtree/vendor/iopsys/tr181/vendor.c +++ b/dmtree/vendor/iopsys/tr181/vendor.c @@ -15,6 +15,7 @@ #include "ethernet.h" #include "ip.h" #include "times.h" +#include "wifi.h" #include "../tr104/servicesvoiceservicecallcontrol.h" #include "../tr104/servicesvoiceservicecalllog.h" #include "../tr104/servicesvoiceservicedect.h" @@ -32,5 +33,6 @@ DM_MAP_OBJ tVendorExtensionIOPSYS[] = { {"Device.Services.VoiceService.{i}.CallLog.{i}.Session.{i}.Destination.RTP.", NULL, tIOPSYS_VoiceServiceCallLogSessionDestinationRTPParams}, {"Device.Services.VoiceService.{i}.DECT.Portable.{i}.", NULL, tIOPSYS_VoiceServiceDECTPortableParams}, {"Device.Services.VoiceService.{i}.CallControl.Extension.{i}.", NULL, tIOPSYS_VoiceServiceCallControlExtensionParams}, +{"Device.WiFi.AccessPoint.{i}.", NULL, tIOPSYS_WiFiAccessPointParams}, {0} }; diff --git a/dmtree/vendor/iopsys/tr181/wifi.c b/dmtree/vendor/iopsys/tr181/wifi.c new file mode 100644 index 00000000..833f557c --- /dev/null +++ b/dmtree/vendor/iopsys/tr181/wifi.c @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2023 iopsys Software Solutions AB + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 2.1 + * as published by the Free Software Foundation + * + * Author Amin Ben Romdhane + * + */ + +#include "wifi.h" + +struct wifi_acp_args +{ + struct dmmap_dup *sections; + char *ifname; +}; + +static int get_multi_ap_mode(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) +{ + char *multi_ap = NULL; + + dmuci_get_value_by_section_string((((struct wifi_acp_args *)data)->sections)->config_section, "multi_ap", &multi_ap); + + if (DM_STRCMP(multi_ap, "1") == 0) + *value = "Backhaul"; + else if (DM_STRCMP(multi_ap, "2") == 0) + *value = "Fronthaul"; + else if (DM_STRCMP(multi_ap, "3") == 0) + *value = "Combined"; + else + *value = "None"; + + return 0; +} + +/********************************************************************************************************************************** +* OBJ & PARAM DEFINITION +***********************************************************************************************************************************/ +DMLEAF tIOPSYS_WiFiAccessPointParams[] = { +/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/ +{BBF_VENDOR_PREFIX"MultiAPMode", &DMREAD, DMT_STRING, get_multi_ap_mode, NULL, BBFDM_BOTH}, +{0} +}; diff --git a/dmtree/vendor/iopsys/tr181/wifi.h b/dmtree/vendor/iopsys/tr181/wifi.h new file mode 100644 index 00000000..f4c62053 --- /dev/null +++ b/dmtree/vendor/iopsys/tr181/wifi.h @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2023 iopsys Software Solutions AB + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 2.1 + * as published by the Free Software Foundation + * + * Author Amin Ben Romdhane + * + */ + +#ifndef __IOPSYS_WIFI_H +#define __IOPSYS_WIFI_H + +#include "libbbf_api/dmcommon.h" + +extern DMLEAF tIOPSYS_WiFiAccessPointParams[]; + +#endif //__IOPSYS_WIFI_H