From ca077447c23fee10032fe37ce5a5fc0930dca629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 2 Jun 2022 22:25:53 +0200 Subject: [PATCH] module/network: tx/rx-bitrate is now in bits/s instead of Mb/s --- CHANGELOG.md | 3 +++ doc/yambar-modules-network.5.scd | 4 ++-- modules/network.c | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc20e43..87d0d2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,9 @@ * Float tags are now treated as floats instead of integers when formatted with the `kb`/`kib`/`mb`/`mib`/`gb`/`gib` string particle 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 specifying a `tag` and then an array of `values`, you must now simply use an array of `conditions`, that consist of: diff --git a/doc/yambar-modules-network.5.scd b/doc/yambar-modules-network.5.scd index 8ac46a1..6b5e835 100644 --- a/doc/yambar-modules-network.5.scd +++ b/doc/yambar-modules-network.5.scd @@ -47,10 +47,10 @@ address. : Signal strength, in dBm (Wi-Fi only) | rx-bitrate : int -: RX bitrate, in Mbit/s +: RX bitrate, in bits/s | tx-bitrate : int -: TX bitrate in Mbit/s +: TX bitrate in bits/s # CONFIGURATION diff --git a/modules/network.c b/modules/network.c index 34980fa..da3324d 100644 --- a/modules/network.c +++ b/modules/network.c @@ -143,8 +143,8 @@ content(struct module *mod) tag_new_string(mod, "ipv6", ipv6_str), tag_new_string(mod, "ssid", m->ssid), tag_new_int(mod, "signal", m->signal_strength_dbm), - tag_new_int(mod, "rx-bitrate", m->rx_bitrate / 1000 / 1000), - tag_new_int(mod, "tx-bitrate", m->tx_bitrate / 1000 / 1000), + tag_new_int(mod, "rx-bitrate", m->rx_bitrate), + tag_new_int(mod, "tx-bitrate", m->tx_bitrate), }, .count = 11, };