diff options
author | Andre Heider <a.heider@gmail.com> | 2022-11-22 11:41:13 +0100 |
---|---|---|
committer | Christian 'Ansuel' Marangi <ansuelsmth@gmail.com> | 2023-01-21 01:18:11 +0100 |
commit | 06ad60fbba568b0e8a42c49fce4f53942beb0ce3 (patch) | |
tree | 33c8e22d98e809ea77dc8949c070475c271985ed | |
parent | b32fd325354ea9509728b7592eaba05efb9c78d7 (diff) | |
download | rpcd-06ad60fbba568b0e8a42c49fce4f53942beb0ce3.tar.gz |
iwinfo: add "band" to the freqlist output
So that consumers don't have to fiddle around with mapping frequencies
to bands, which everyone seems to do a little differently.
Signed-off-by: Andre Heider <a.heider@gmail.com>
-rw-r--r-- | iwinfo.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -607,7 +607,7 @@ rpc_iwinfo_freqlist(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - int i, rv, len, ch; + int i, rv, len, ch, band; char res[IWINFO_BUFSIZE]; struct iwinfo_freqlist_entry *f; void *c, *d; @@ -631,6 +631,9 @@ rpc_iwinfo_freqlist(struct ubus_context *ctx, struct ubus_object *obj, f = (struct iwinfo_freqlist_entry *)&res[i]; d = blobmsg_open_table(&buf, NULL); + band = iwinfo_band2ghz(f->band); + if (band > 0) + blobmsg_add_u32(&buf, "band", band); blobmsg_add_u32(&buf, "channel", f->channel); blobmsg_add_u32(&buf, "mhz", f->mhz); blobmsg_add_u8(&buf, "restricted", f->restricted); |