diff --git a/app/nano_shell_command.c b/app/nano_shell_command.c index 937d902..1eaf71b 100644 --- a/app/nano_shell_command.c +++ b/app/nano_shell_command.c @@ -116,7 +116,9 @@ int _soft_ap(const shell_cmd_t *pcmd, int argc, char *const argv[]) } else if(strcmp(argv[1], "destroy") == 0) { - tls_wifi_softap_destroy(); + //tls_wifi_softap_destroy(); + tls_wifi_softap_client_event_register(NULL); + tls_wifi_disconnect(); shell_printf("Stopping SOFT AP\n"); } else @@ -181,6 +183,41 @@ int _station(const shell_cmd_t *pcmd, int argc, char *const argv[]) return 0; } +int _cpu_temp(const shell_cmd_t *pcmd, int argc, char *const argv[]) +{ + int temperature = adc_temp(); + + shell_printf("CPU temp is %d.%03d\n", temperature/1000, temperature%1000); + return 0; +} + +int _wifi_sleep(const shell_cmd_t *pcmd, int argc, char *const argv[]) +{ + if(argc > 1) + { + if(strcmp(argv[1], "query") == 0) + { + shell_printf("power saving : 0x%X, psm chip sleep : 0x%X\n", + tls_wifi_get_psflag(), + tls_wifi_get_psm_chipsleep_flag()); + } + else if(strcmp(argv[1], "set") == 0) + { + + } + else + { + shell_printf("Unknown wifi_sleep action\n"); + } + + } + else + { + shell_printf("List of wifi_sleep actions :\nquery\nset\n"); + } + return 0; +} + NANO_SHELL_ADD_CMD(task_list, _task_list, @@ -198,3 +235,11 @@ NANO_SHELL_ADD_CMD(station, _station, "Command to control STATION mode", " Use this command to connect to a WiFi access point\r\n"); +NANO_SHELL_ADD_CMD(cpu_temp, + _cpu_temp, + "Command to read the CPU temperature", + " Use this command to read the CPU temperature\r\n"); +NANO_SHELL_ADD_CMD(wifi_sleep, + _wifi_sleep, + "Command to control WiFi sleep", + " Use this command to control WiFi sleep feature\r\n"); diff --git a/include/wm_include.h b/include/wm_include.h index 8fb31a8..a8baf81 100644 --- a/include/wm_include.h +++ b/include/wm_include.h @@ -82,6 +82,7 @@ #include "wm_mem.h" #include "wm_regs.h" #include "wm_watchdog.h" +#include "wm_adc.h" #endif