linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Theil <markus.theil@tu-ilmenau.de>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Markus Theil <markus.theil@tu-ilmenau.de>
Subject: [PATCH] iw: event: log rssi value for cqm
Date: Mon, 30 Mar 2020 13:00:27 +0200	[thread overview]
Message-ID: <20200330110027.21541-1-markus.theil@tu-ilmenau.de> (raw)

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
---
 event.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/event.c b/event.c
index b132b17..02e4593 100644
--- a/event.c
+++ b/event.c
@@ -122,17 +122,20 @@ static void parse_cqm_event(struct nlattr **attrs)
 
 	if (cqm[NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT]) {
 		enum nl80211_cqm_rssi_threshold_event rssi_event;
+		int32_t rssi_level = -1;
 		bool found_one = false;
 
 		rssi_event = nla_get_u32(cqm[NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT]);
+		if(cqm[NL80211_ATTR_CQM_RSSI_LEVEL])
+			rssi_level = nla_get_u32(cqm[NL80211_ATTR_CQM_RSSI_LEVEL]);
 
 		switch (rssi_event) {
 		case NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH:
-			printf("RSSI went above threshold\n");
+			printf("RSSI (%i dBm) went above threshold\n", rssi_level);
 			found_one = true;
 			break;
 		case NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW:
-			printf("RSSI went below threshold\n");
+			printf("RSSI (%i dBm) went below threshold\n", rssi_level);
 			found_one = true;
 			break;
 		case NL80211_CQM_RSSI_BEACON_LOSS_EVENT:
-- 
2.26.0


                 reply	other threads:[~2020-03-30 11:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200330110027.21541-1-markus.theil@tu-ilmenau.de \
    --to=markus.theil@tu-ilmenau.de \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).