Skip to content

Commit 36da03a

Browse files
rany2robimarko
authored andcommitted
wifi-scripts: ucode: improve formatting of expected throughput
Convert to MBit/s like all other fields and specify the unit. Most users probably aren't aware that this is in kilobits/s. Signed-off-by: Rany Hany <[email protected]> Link: openwrt/openwrt#20567 Signed-off-by: Robert Marko <[email protected]>
1 parent 1ead4e6 commit 36da03a

File tree

2 files changed

+7
-2
lines changed
  • package/network/config/wifi-scripts/files-ucode/usr

2 files changed

+7
-2
lines changed

package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ function print_assoclist(stations) {
2525
printf(', %s', flags);
2626
printf('%10d Pkts.\n', bitrate.packets);
2727
}
28-
printf(`\texpected throughput: ${station.expected_throughput}\n\n`);
28+
let expected_throughput = station.expected_throughput;
29+
printf(`\texpected throughput: ${expected_throughput == 'unknown' ? 'unknown' : expected_throughput + ' MBit/s'}\n\n`);
2930
}
3031
}
3132

package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ function format_rate(rate) {
169169
return rate ? sprintf('%.01f', rate / 10.0) : 'unknown';
170170
}
171171

172+
function format_expected_throughput(rate) {
173+
return rate ? sprintf('%.01f', rate / 1000.0) : 'unknown';
174+
}
175+
172176
function format_mgmt_key(key) {
173177
switch(+key) {
174178
case 1:
@@ -352,7 +356,7 @@ export function assoclist(dev) {
352356
packets: station.sta_info.tx_packets ?? 0,
353357
flags: assoc_flags(station.sta_info.tx_bitrate ?? {}),
354358
},
355-
expected_throughput: station.sta_info.expected_throughput ?? 'unknown',
359+
expected_throughput: format_expected_throughput(station.sta_info.expected_throughput ?? 0),
356360
};
357361
ret[sta.mac] = sta;
358362
}

0 commit comments

Comments
 (0)