From: Christian Marangi Date: Fri, 21 Jan 2022 00:07:51 +0000 (+0100) Subject: iwinfo: add flags to freqlist output X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=b32fd325354ea9509728b7592eaba05efb9c78d7;p=project%2Frpcd.git iwinfo: add flags to freqlist output A channel can declare restriction where it should be used only indoors or should not be used at all. Expose these restriction in the channel data as additional info with the restricted info. Signed-off-by: Christian Marangi --- diff --git a/iwinfo.c b/iwinfo.c index c93982f..e088ea6 100644 --- a/iwinfo.c +++ b/iwinfo.c @@ -635,6 +635,11 @@ rpc_iwinfo_freqlist(struct ubus_context *ctx, struct ubus_object *obj, blobmsg_add_u32(&buf, "mhz", f->mhz); blobmsg_add_u8(&buf, "restricted", f->restricted); + rpc_iwinfo_add_bit_array("flags", f->flags, + IWINFO_FREQ_FLAG_NAMES, + IWINFO_FREQ_FLAG_COUNT, + true, 0); + if (ch > -1) blobmsg_add_u8(&buf, "active", f->channel == ch);