iw dev link: print channel number as well
PATCH 1/1 iw dev link: print channel number as well
Hi,
dev <devname> link
prints the SSID and frequency, when connected.
To figure out the channel however (if you don't
know it by heart), you need to use
dev <devname> info
which will print the channel along with the
frequency (though not the current SSID).
With attached patch,
dev <devname> link
prints the channel along with the frequency, e.g. as:
freq: 2442 channel: 7
.
I find it more convenient this way.
-- madman.
From 0e167018fbc95580ba2cb94128452a18463cbde2 Mon Sep 17 00:00:00 2001
From: Recursive Madman <[email protected]>
Date: Mon, 22 Dec 2014 15:21:07 +0100
Subject: [PATCH] dev link: print channel number as well
Signed-off-by Recursive Madman <[email protected]>
--- link.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
link.c +4 -1
@@ -84,9 +84,12 @@ static int link_bss_handler(struct nl_msg *msg, void *arg)nla_len (bss[NL80211_BSS_INFORMATION_ELEMENTS ]), false, PRINT_LINK); -if (bss[NL80211_BSS_FREQUENCY ]) +if (bss[NL80211_BSS_FREQUENCY ]) {printf ("\tfreq: %d\n" ,nla_get_u32 (bss[NL80211_BSS_FREQUENCY ])); +printf ("\tchannel: %d\n" , +ieee80211_frequency_to_channel (nla_get_u32 (bss[NL80211_BSS_FREQUENCY ]))); + }if (nla_get_u32 (bss[NL80211_BSS_STATUS ]) !=NL80211_BSS_STATUS_ASSOCIATED )return NL_SKIP ;
Signature · 1 line
2.1.3