cli: print the band on the frequency list
authorAndre Heider <a.heider@gmail.com>
Tue, 22 Nov 2022 08:55:06 +0000 (09:55 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Fri, 20 Jan 2023 16:26:58 +0000 (17:26 +0100)
Provide band info on frequency list dump.

Signed-off-by: Andre Heider <a.heider@gmail.com>
iwinfo_cli.c

index 3bce96e5536fc3d30aca5b0ced1b9c29673f5e30..02296acd1b1a6a4e0a51ca76bfcb1b28656aca50 100644 (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]" : "");
        }