module/network: tx/rx-bitrate is now in bits/s instead of Mb/s

This commit is contained in:
Daniel Eklöf 2022-06-02 22:25:53 +02:00
parent d9d5671e04
commit ca077447c2
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 7 additions and 4 deletions

View file

@ -34,6 +34,9 @@
* Float tags are now treated as floats instead of integers when * Float tags are now treated as floats instead of integers when
formatted with the `kb`/`kib`/`mb`/`mib`/`gb`/`gib` string particle formatted with the `kb`/`kib`/`mb`/`mib`/`gb`/`gib` string particle
formatters. formatters.
* network: `tx-bitrate` and `rx-bitrate` are now in bits/s instead of
Mb/s. Use the `mb` string formatter to render these tags as before
(e.g. `string: {text: "{tx-bitrate:mb}"}`).
* **BREAKING CHANGE**: overhaul of the `map` particle. Instead of * **BREAKING CHANGE**: overhaul of the `map` particle. Instead of
specifying a `tag` and then an array of `values`, you must now specifying a `tag` and then an array of `values`, you must now
simply use an array of `conditions`, that consist of: simply use an array of `conditions`, that consist of:

View file

@ -47,10 +47,10 @@ address.
: Signal strength, in dBm (Wi-Fi only) : Signal strength, in dBm (Wi-Fi only)
| rx-bitrate | rx-bitrate
: int : int
: RX bitrate, in Mbit/s : RX bitrate, in bits/s
| tx-bitrate | tx-bitrate
: int : int
: TX bitrate in Mbit/s : TX bitrate in bits/s
# CONFIGURATION # CONFIGURATION

View file

@ -143,8 +143,8 @@ content(struct module *mod)
tag_new_string(mod, "ipv6", ipv6_str), tag_new_string(mod, "ipv6", ipv6_str),
tag_new_string(mod, "ssid", m->ssid), tag_new_string(mod, "ssid", m->ssid),
tag_new_int(mod, "signal", m->signal_strength_dbm), tag_new_int(mod, "signal", m->signal_strength_dbm),
tag_new_int(mod, "rx-bitrate", m->rx_bitrate / 1000 / 1000), tag_new_int(mod, "rx-bitrate", m->rx_bitrate),
tag_new_int(mod, "tx-bitrate", m->tx_bitrate / 1000 / 1000), tag_new_int(mod, "tx-bitrate", m->tx_bitrate),
}, },
.count = 11, .count = 11,
}; };