From 2d30db26eb84a4700f65714ff6e6f4f17b8a7993 Mon Sep 17 00:00:00 2001 From: Vivek Kumar Dutta Date: Mon, 6 May 2024 10:08:50 +0000 Subject: [PATCH] WiFi: Fix PossibleChannels when radio down --- libbbfdm/dmtree/tr181/wifi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libbbfdm/dmtree/tr181/wifi.c b/libbbfdm/dmtree/tr181/wifi.c index 74f475ac..2dc8ff97 100644 --- a/libbbfdm/dmtree/tr181/wifi.c +++ b/libbbfdm/dmtree/tr181/wifi.c @@ -1300,7 +1300,12 @@ static int get_radio_possible_channels(char *refparam, struct dmctx *ctx, void * DM_ASSERT(res, *value = ""); bandwidth = dmjson_get_value(res, 1, "bandwidth"); - dmubus_call(object, "channels", UBUS_ARGS{{"bandwidth", bandwidth, Integer}}, 1, &res); + + if (DM_STRTOL(bandwidth) == 0) { + dmubus_call(object, "channels", UBUS_ARGS{0}, 0, &res); + } else { + dmubus_call(object, "channels", UBUS_ARGS{{"bandwidth", bandwidth, Integer}}, 1, &res); + } DM_ASSERT(res, *value = ""); *value = dmjson_get_value_array_all(res, ",", 1, "channels");