cli: print the band on the frequency list

Provide band info on frequency list dump.

Signed-off-by: Andre Heider <a.heider@gmail.com>
This commit is contained in:
Andre Heider 2022-11-22 09:55:06 +01:00 committed by Christian Marangi
parent afa147c45a
commit bbe424f394
No known key found for this signature in database
GPG key ID: AC001D09ADBFEAD7

View file

@ -44,6 +44,17 @@ static char * format_ssid(char *ssid)
return buf;
}
static const char *format_band(int band)
{
const char *name;
name = iwinfo_band_name(band);
if (name)
return name;
return "unknown";
}
static char * format_channel(int ch)
{
static char buf[16];
@ -729,9 +740,10 @@ static void print_freqlist(const struct iwinfo_ops *iw, const char *ifname)
{
e = (struct iwinfo_freqlist_entry *) &buf[i];
printf("%s %s (Channel %s)%s\n",
printf("%s %s (Band: %s, Channel %s)%s\n",
(freq == e->mhz) ? "*" : " ",
format_frequency(e->mhz),
format_band(e->band),
format_channel(e->channel),
e->restricted ? " [restricted]" : "");
}