WiFi: Fix PossibleChannels when radio down

(cherry picked from commit 2d30db26eb)

9e5b6f26 Fix PossibleChannels when radio down
This commit is contained in:
Vivek Kumar Dutta 2024-05-06 10:08:50 +00:00
parent 4dadf86362
commit d988764f9d

View file

@ -1352,7 +1352,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");