Search Linux Wireless

[PATCH] iw: event: log rssi value for cqm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Markus Theil <markus.theil@xxxxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux