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:
parent
afa147c45a
commit
bbe424f394
1 changed files with 13 additions and 1 deletions
14
iwinfo_cli.c
14
iwinfo_cli.c
|
@ -44,6 +44,17 @@ static char * format_ssid(char *ssid)
|
||||||
return buf;
|
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 * format_channel(int ch)
|
||||||
{
|
{
|
||||||
static char buf[16];
|
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];
|
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) ? "*" : " ",
|
(freq == e->mhz) ? "*" : " ",
|
||||||
format_frequency(e->mhz),
|
format_frequency(e->mhz),
|
||||||
|
format_band(e->band),
|
||||||
format_channel(e->channel),
|
format_channel(e->channel),
|
||||||
e->restricted ? " [restricted]" : "");
|
e->restricted ? " [restricted]" : "");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue