diff mbox

Extend STATUS command with frequency information

Message ID 1410504360-24985-1-git-send-email-bojan.prtvar@rt-rk.com
State Superseded
Headers show

Commit Message

Bojan Prtvar Sept. 12, 2014, 6:46 a.m. UTC
This makes 'wpa_cli status' command more versatile.

Signed-off-by: Bojan Prtvar <bojan.prtvar@rt-rk.com>
---
 wpa_supplicant/ctrl_iface.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Jouni Malinen Sept. 13, 2014, 2:08 p.m. UTC | #1
On Fri, Sep 12, 2014 at 08:46:00AM +0200, Bojan Prtvar wrote:
> This makes 'wpa_cli status' command more versatile.

> diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
> @@ -1539,6 +1539,11 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s,
> +		ret = os_snprintf(pos, end - pos, "frequency=%d MHz\n",
> +				wpa_s->assoc_freq);

It would sound fine making the current operating frequency available.
However, I'd rather follow the simpler style in STATUS and make this
"freq=%d\n" rather than including the " MHz" postfix.
diff mbox

Patch

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index f612b49..bd54676 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -1539,6 +1539,11 @@  static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s,
 		if (ret < 0 || ret >= end - pos)
 			return pos - buf;
 		pos += ret;
+		ret = os_snprintf(pos, end - pos, "frequency=%d MHz\n",
+				wpa_s->assoc_freq);
+		if (ret < 0 || ret >= end - pos)
+			return pos - buf;
+		pos += ret;
 		if (ssid) {
 			u8 *_ssid = ssid->ssid;
 			size_t ssid_len = ssid->ssid_len;