diff options
author | Andre Heider <a.heider@gmail.com> | 2022-11-24 18:16:51 +0100 |
---|---|---|
committer | Christian 'Ansuel' Marangi <ansuelsmth@gmail.com> | 2023-01-21 01:18:12 +0100 |
commit | c0df2a7af7d6284f4a446de15d0dab17124d9448 (patch) | |
tree | e64c5379a4a34ca4a9734040f951c4a942d02780 | |
parent | 06ad60fbba568b0e8a42c49fce4f53942beb0ce3 (diff) | |
download | rpcd-c0df2a7af7d6284f4a446de15d0dab17124d9448.tar.gz |
iwinfo: add "band" and "mhz" to the scan output
Providing the channel alone isn't clear as there're overlapping channels
on e.g. band 2 and 6.
Signed-off-by: Andre Heider <a.heider@gmail.com>
-rw-r--r-- | iwinfo.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -366,7 +366,7 @@ rpc_iwinfo_scan(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - int i, rv, len; + int i, rv, len, band; void *c, *d, *t; char mac[18]; char res[IWINFO_BUFSIZE]; @@ -399,7 +399,11 @@ rpc_iwinfo_scan(struct ubus_context *ctx, struct ubus_object *obj, blobmsg_add_string(&buf, "mode", IWINFO_OPMODE_NAMES[e->mode]); + band = iwinfo_band2ghz(e->band); + if (band > 0) + blobmsg_add_u32(&buf, "band", band); blobmsg_add_u32(&buf, "channel", e->channel); + blobmsg_add_u32(&buf, "mhz", e->mhz); blobmsg_add_u32(&buf, "signal", (uint32_t)(e->signal - 0x100)); blobmsg_add_u32(&buf, "quality", e->quality); |