wifi: shell: Use case insensitive comparison

The help text uses the capital case as its an acronym, but passing
capital case fails. Also extend that to others as well.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
This commit is contained in:
Chaitanya Tata 2024-01-03 13:13:13 +05:30 committed by Anas Nashif
parent 66f63455ea
commit 9e6542b0cc

View file

@ -15,6 +15,7 @@ LOG_MODULE_REGISTER(net_wifi_shell, LOG_LEVEL_INF);
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <zephyr/shell/shell.h>
#include <zephyr/sys/printk.h>
#include <zephyr/init.h>
@ -782,9 +783,9 @@ static int cmd_wifi_ps(const struct shell *sh, size_t argc, char *argv[])
return 0;
}
if (!strncmp(argv[1], "on", 2)) {
if (!strncasecmp(argv[1], "on", 2)) {
params.enabled = WIFI_PS_ENABLED;
} else if (!strncmp(argv[1], "off", 3)) {
} else if (!strncasecmp(argv[1], "off", 3)) {
params.enabled = WIFI_PS_DISABLED;
} else {
shell_fprintf(sh, SHELL_WARNING, "Invalid argument\n");
@ -813,9 +814,9 @@ static int cmd_wifi_ps_mode(const struct shell *sh, size_t argc, char *argv[])
context.sh = sh;
if (!strncmp(argv[1], "legacy", 6)) {
if (!strncasecmp(argv[1], "legacy", 6)) {
params.mode = WIFI_PS_MODE_LEGACY;
} else if (!strncmp(argv[1], "wmm", 3)) {
} else if (!strncasecmp(argv[1], "WMM", 4)) {
params.mode = WIFI_PS_MODE_WMM;
} else {
shell_fprintf(sh, SHELL_WARNING, "Invalid PS mode\n");
@ -1243,9 +1244,9 @@ static int cmd_wifi_ps_wakeup_mode(const struct shell *sh, size_t argc, char *ar
context.sh = sh;
if (!strncmp(argv[1], "dtim", 4)) {
if (!strncasecmp(argv[1], "dtim", 4)) {
params.wakeup_mode = WIFI_PS_WAKEUP_MODE_DTIM;
} else if (!strncmp(argv[1], "listen_interval", 15)) {
} else if (!strncasecmp(argv[1], "listen_interval", 15)) {
params.wakeup_mode = WIFI_PS_WAKEUP_MODE_LISTEN_INTERVAL;
} else {
shell_fprintf(sh, SHELL_WARNING, "Invalid argument\n");