Skip to content

Commit

Permalink
Info Screen: update rx/tx bitrate information (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit Renker committed Jan 5, 2021
1 parent 092fcfc commit 70e968e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion iw_nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ void parse_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen)
rate = nla_get_u16(rinfo[NL80211_RATE_INFO_BITRATE]);
if (rate > 0)
pos += snprintf(pos, buflen - (pos - buf),
"%d.%d Mbit/s", rate / 10, rate % 10);
"%d.%d MBit/s", rate / 10, rate % 10);
else
pos += snprintf(pos, buflen - (pos - buf), "(unknown)");

if (rinfo[NL80211_RATE_INFO_MCS])
pos += snprintf(pos, buflen - (pos - buf),
Expand All @@ -148,6 +150,21 @@ void parse_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen)
if (rinfo[NL80211_RATE_INFO_VHT_NSS])
pos += snprintf(pos, buflen - (pos - buf),
" VHT-NSS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_VHT_NSS]));
if (rinfo[NL80211_RATE_INFO_HE_MCS])
pos += snprintf(pos, buflen - (pos - buf),
" HE-MCS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_HE_MCS]));
if (rinfo[NL80211_RATE_INFO_HE_NSS])
pos += snprintf(pos, buflen - (pos - buf),
" HE-NSS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_HE_NSS]));
if (rinfo[NL80211_RATE_INFO_HE_GI])
pos += snprintf(pos, buflen - (pos - buf),
" HE-GI %d", nla_get_u8(rinfo[NL80211_RATE_INFO_HE_GI]));
if (rinfo[NL80211_RATE_INFO_HE_DCM])
pos += snprintf(pos, buflen - (pos - buf),
" HE-DCM %d", nla_get_u8(rinfo[NL80211_RATE_INFO_HE_DCM]));
if (rinfo[NL80211_RATE_INFO_HE_RU_ALLOC])
pos += snprintf(pos, buflen - (pos - buf),
" HE-RU-ALLOC %d", nla_get_u8(rinfo[NL80211_RATE_INFO_HE_RU_ALLOC]));
}

/*
Expand Down

0 comments on commit 70e968e

Please sign in to comment.