wifi: Fix current PHY rate handling

Fix the name to include TX and also add units to the shell display.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
This commit is contained in:
Chaitanya Tata 2024-11-09 01:23:29 +05:30 committed by Benjamin Cabé
commit 619cdb64f4
3 changed files with 6 additions and 4 deletions

View file

@ -671,8 +671,8 @@ struct wifi_iface_status {
unsigned short beacon_interval;
/** is TWT capable? */
bool twt_capable;
/** The current 802.11 PHY data rate */
int current_phy_rate;
/** The current 802.11 PHY TX data rate (in Kbps) */
int current_phy_tx_rate;
};
/** @brief Wi-Fi power save parameters */

View file

@ -1538,7 +1538,7 @@ int supplicant_status(const struct device *dev, struct wifi_iface_status *status
ret = z_wpa_ctrl_signal_poll(&signal_poll);
if (!ret) {
status->rssi = signal_poll.rssi;
status->current_phy_rate = signal_poll.current_txrate;
status->current_phy_tx_rate = signal_poll.current_txrate;
} else {
wpa_printf(MSG_WARNING, "%s: Failed to read signal poll info",
__func__);

View file

@ -1113,7 +1113,9 @@ static int cmd_wifi_status(const struct shell *sh, size_t argc, char *argv[])
PR("DTIM: %d\n", status.dtim_period);
PR("TWT: %s\n",
status.twt_capable ? "Supported" : "Not supported");
PR("Current PHY rate : %d\n", status.current_phy_rate);
PR("Current PHY TX rate (Mbps) : %d.%03d\n",
status.current_phy_tx_rate / 1000,
status.current_phy_tx_rate % 1000);
}
return 0;