diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2018-03-28 10:30:07 +0200 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2018-04-09 07:30:37 +0200 |
commit | 77c32f0eb637524f7f300d8cf24d455ccec5c2bb (patch) | |
tree | eae01f11c55d5a2e3dc235a1cf5e481a4347ff70 /iwinfo_nl80211.h | |
parent | 223e09bf3f180797aeea0f6dc1721e5a55215e66 (diff) | |
download | iwinfo-77c32f0eb637524f7f300d8cf24d455ccec5c2bb.tar.gz |
nl80211: fix code calculating average signal and rate
Using average of previous average and the next value is highly
imprecise. E.g. for values 20, 20, 20, 180 it would result in /average/
of 100 (instead of 60). Fix it by storing & using an info of how many
samples were used for the previous calculation.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'iwinfo_nl80211.h')
-rw-r--r-- | iwinfo_nl80211.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/iwinfo_nl80211.h b/iwinfo_nl80211.h index 566ffce..2dff08b 100644 --- a/iwinfo_nl80211.h +++ b/iwinfo_nl80211.h @@ -59,7 +59,9 @@ struct nl80211_group_conveyor { struct nl80211_rssi_rate { int16_t rate; + int rate_samples; int8_t rssi; + int rssi_samples; }; struct nl80211_array_buf { |