aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Uher <jason.uher@jhuapl.edu>2017-10-04 11:46:00 -0400
committerMichael Mann <mmann78@netscape.net>2017-10-11 11:28:27 +0000
commit95c50e3dd766e919953def30f65ba5496226a660 (patch)
tree64b58a396ffe3b9d8d0dda4b3cf4e709b31e7df0
parent6ef693dec1fd189d0995d8ad6a06c29c05823ce8 (diff)
Decode SNR in Compressed MIMO Beamforming report per ieee80211at_2013 sections 8.4.1.{29,48}
Change-Id: I4f3af7e06169461a15507ed8ecce8f15075b9667 Reviewed-on: https://code.wireshark.org/review/23835 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/packet-ieee80211.c38
1 files changed, 30 insertions, 8 deletions
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index 37fbb2aac0..47c665b551 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -5625,11 +5625,21 @@ add_mimo_compressed_beamforming_feedback_report(proto_tree *tree, tvbuff_t *tvb,
for (i = 1; i <= mimo_cntrl.nc; i++)
{
- guint8 snr;
+ gint8 snr;
+ char edge_sign;
- snr = tvb_get_guint8(tvb, offset);
+ snr = (gint8) tvb_get_guint8(tvb, offset);
+
+ switch(snr) {
+ case -128:
+ edge_sign = '<';
+ case 127:
+ edge_sign = '>';
+ default:
+ edge_sign = ' ';
+ }
proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
- snr, "Stream %d - Signal to Noise Ratio: 0x%02X", i, snr);
+ snr, "Stream %d - Signal to Noise Ratio: %c%3.2fdB", i, edge_sign,snr/4.0+22.0);
offset += 1;
}
@@ -9484,11 +9494,23 @@ add_ff_vht_compressed_beamforming_report(proto_tree *tree, tvbuff_t *tvb, packet
for (i = 1; i <= nc; i++)
{
- guint8 snr;
+ gint8 snr;
+ char edge_sign;
+
+ snr = (gint8) tvb_get_guint8(tvb, offset);
+
+ switch(snr) {
+ case -128:
+ edge_sign = '<';
+ case 127:
+ edge_sign = '>';
+ default:
+ edge_sign = ' ';
+ }
+
+ proto_tree_add_int_format(subtree, hf_ieee80211_vht_compressed_beamforming_report_snr, tvb, offset, 1,
+ snr, "Stream %d - Signal to Noise Ratio: %c%3.2fdB", i, edge_sign,snr/4.0+22.0);
- snr = tvb_get_guint8(tvb, offset);
- proto_tree_add_uint_format(subtree, hf_ieee80211_vht_compressed_beamforming_report_snr, tvb, offset, 1,
- snr, "Stream %d - Signal to Noise Ratio: 0x%02X", i, snr);
offset += 1;
}
@@ -21715,7 +21737,7 @@ proto_register_ieee80211(void)
{&hf_ieee80211_vht_compressed_beamforming_report_snr,
{"Signal to Noise Ratio (SNR)", "wlan.vht.compressed_beamforming_report.snr",
- FT_UINT8, BASE_HEX, NULL, 0,
+ FT_INT8, BASE_DEC, NULL, 0,
NULL, HFILL }},
{&hf_ieee80211_vht_compressed_beamforming_phi_angle,