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];
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);
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;
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);
+ 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);