Skip to contentSkip to conversation

doc: document new AverageRSSI diagnostics key

PATCH In review James Prestwood 2 participants 5 messages Mar 16, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 doc: document new AverageRSSI diagnostics key

---
 doc/station-diagnostic-api.txt | 2 ++
 1 file changed, 2 insertions(+)
doc/station-diagnostic-api.txt +2 -0
index af82229b..b5a73b5d 100644
@@ -25,6 +25,8 @@ Methods		dict GetDiagnostics()
 
 			RSSI [optional] - The RSSI of the currently connected BSS.
 
+			AverageRSSI [optional] - Average RSSI of currently connected BSS.
+
 			RxMode [optional] -	The phy technology being used
 						(802.11n, 802.11ac or 802.11ax).
 
Signature · 1 line
2.26.2
#1 lore raw

PATCH 2/4 diagnostic: include AverageRSSI in GetDiagnostics

---
 src/diagnostic.c | 4 ++++
 src/diagnostic.h | 2 ++
 2 files changed, 6 insertions(+)
src/diagnostic.c +4 -0
index 034229a7..d690cf3a 100644
@@ -39,10 +39,14 @@ bool diagnostic_info_to_dict(const struct diagnostic_station_info *info,
 				struct l_dbus_message_builder *builder)
 {
 	int16_t rssi = (int16_t)info->cur_rssi;
+	int16_t avg_rssi = (int16_t)info->avg_rssi;
 
 	if (info->have_cur_rssi)
 		dbus_append_dict_basic(builder, "RSSI", 'n', &rssi);
 
+	if (info->have_avg_rssi)
+		dbus_append_dict_basic(builder, "AverageRSSI", 'n', &avg_rssi);
+
 	if (info->have_rx_mcs) {
 		switch (info->rx_mcs_type) {
 		case DIAGNOSTIC_MCS_TYPE_HT:
src/diagnostic.h +2 -0
index cd23bb61..dab45c0b 100644
@@ -30,6 +30,7 @@ enum diagnostic_mcs_type {
 struct diagnostic_station_info {
 	uint8_t addr[6];
 	int8_t cur_rssi;
+	int8_t avg_rssi;
 
 	enum diagnostic_mcs_type rx_mcs_type;
 	uint32_t rx_bitrate;
@@ -41,6 +42,7 @@ struct diagnostic_station_info {
 	uint32_t expected_throughput;
 
 	bool have_cur_rssi : 1;
+	bool have_avg_rssi : 1;
 	bool have_rx_mcs : 1;
 	bool have_tx_mcs : 1;
 	bool have_rx_bitrate : 1;
Signature · 1 line
2.26.2
#2 lore raw

PATCH 3/4 netdev: parse SIGNAL_AVG when building diagnostics object

In reply to James Prestwood
---
 src/netdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)
src/netdev.c +8 -0
index 0a603fc1..66a781bc 100644
@@ -452,6 +452,14 @@ static bool netdev_parse_sta_info(struct l_genl_attr *attr,
 			info->cur_rssi = *(const int8_t *) data;
 			info->have_cur_rssi = true;
 
+			break;
+		case NL80211_STA_INFO_SIGNAL_AVG:
+			if (len != 1)
+				return false;
+
+			info->avg_rssi = *(const int8_t *) data;
+			info->have_avg_rssi = true;
+
 			break;
 		case NL80211_STA_INFO_RX_BITRATE:
 			if (!l_genl_attr_recurse(attr, &nested))
Signature · 1 line
2.26.2
#3 lore raw

PATCH 4/4 client: add AverageRSSI to list of diagnostic values

In reply to James Prestwood
---
 client/diagnostic.c | 1 +
 1 file changed, 1 insertion(+)
client/diagnostic.c +1 -0
index 153598ed..58c646d7 100644
@@ -88,6 +88,7 @@ static const struct diagnostic_dict_mapping diagnostic_mapping[] = {
 	{ "TxBitrate", 0, NULL, display_bitrate_100kbps },
 	{ "ExpectedThroughput", 'u', "Kbit/s" },
 	{ "RSSI", 'n', "dBm" },
+	{ "AverageRSSI", 'n', "dBm" },
 	{ "RxMCS", 'y' },
 	{ "TxMCS", 'y' },
 	{ "Frequency", 'u' },
Signature · 1 line
2.26.2