iwinfo: add "hwmodes_text" to the info output
authorAndre Heider <a.heider@gmail.com>
Wed, 23 Nov 2022 10:32:26 +0000 (11:32 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 15 Dec 2022 23:26:00 +0000 (00:26 +0100)
This is a preformatted string like "ac/ax/b/g/n" for presentation.

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

index cdbb8706f34eb8488e965966fc8742c3217f2e6d..c93982f273e51f3220b389dfb922145a1c7eca16 100644 (file)
--- a/iwinfo.c
+++ b/iwinfo.c
@@ -258,10 +258,14 @@ rpc_iwinfo_call_hwmodes(const char *name)
 
 static void rpc_iwinfo_call_hw_ht_mode(int hwmodelist)
 {
+       char text[32];
        const char *hwmode_str;
        const char *htmode_str;
        int htmode;
 
+       if (iwinfo_format_hwmodes(hwmodelist, text, sizeof(text)) > 0)
+               blobmsg_add_string(&buf, "hwmodes_text", text);
+
        if (hwmodelist == IWINFO_80211_AD)
        {
                blobmsg_add_string(&buf, "hwmode", "ad");