Skip to content

Commit

Permalink
drivers: wifi: Display current temperature
Browse files Browse the repository at this point in the history
Add command in wifi_util shell to get current tempearature.

Signed-off-by: Ajay Parida <[email protected]>
  • Loading branch information
ajayparida committed Oct 24, 2024
1 parent 38f72b8 commit 564c752
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions drivers/wifi/nrf700x/src/wifi_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,34 @@ static int nrf_wifi_util_trigger_rpu_recovery(const struct shell *shell,
}
#endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */


static int nrf_wifi_util_show_temp(const struct shell *shell,
size_t argc,
const char *argv[])
{
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL;
int temp;

fmac_dev_ctx = ctx->rpu_ctx;

status = nrf_wifi_fmac_temp_get(fmac_dev_ctx, &temp);

if (status != NRF_WIFI_STATUS_SUCCESS) {
shell_fprintf(shell,
SHELL_INFO,
"Failed to get current temperature\n");
return -ENOEXEC;
}

shell_fprintf(shell,
SHELL_INFO,
"Temperature: %d\n",
temp);

return status;
}

SHELL_STATIC_SUBCMD_SET_CREATE(
nrf_wifi_util_subcmds,
SHELL_CMD_ARG(he_ltf,
Expand Down Expand Up @@ -981,6 +1009,12 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
1,
0),
#endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */
SHELL_CMD_ARG(show_temp,
NULL,
"Displays current temperature\n",
nrf_wifi_util_show_temp,
1,
0),
SHELL_SUBCMD_SET_END);


Expand Down

0 comments on commit 564c752

Please sign in to comment.