From 93b023b75ed97bf2efba5e010348c66fb1779fb7 Mon Sep 17 00:00:00 2001 From: Vivek Kumar Dutta Date: Fri, 4 Aug 2023 12:10:49 +0000 Subject: [PATCH] WiFi: Get IEEE80211hSupported from ubus dot11h_capable --- libbbfdm/dmtree/tr181/wifi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libbbfdm/dmtree/tr181/wifi.c b/libbbfdm/dmtree/tr181/wifi.c index 03f4d1b4..760c85cc 100644 --- a/libbbfdm/dmtree/tr181/wifi.c +++ b/libbbfdm/dmtree/tr181/wifi.c @@ -1098,9 +1098,16 @@ static int set_WiFiRadio_PreambleType(char *refparam, struct dmctx *ctx, void *d return 0; } +/*#Device.WiFi.Radio.{i}.IEEE80211hSupported!UBUS:wifi.radio.@Name/dot11h_capable*/ static int get_WiFiRadio_IEEE80211hSupported(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { - *value = "true"; + json_object *res = NULL; + char object[32]; + + snprintf(object, sizeof(object), "wifi.radio.%s", section_name((((struct wifi_radio_args *)data)->sections)->config_section)); + dmubus_call(object, "status", UBUS_ARGS{0}, 0, &res); + DM_ASSERT(res, *value = "0"); + *value = dmjson_get_value(res, 1, "dot11h_capable"); return 0; }