Skip to content

Commit

Permalink
wifi: shell: Move defaults to beginning
Browse files Browse the repository at this point in the history
This sets defaults first and then overrides if configured, easier to
read.

Signed-off-by: Chaitanya Tata <[email protected]>
  • Loading branch information
krish2718 authored and carlescufi committed Nov 7, 2023
1 parent 8c17987 commit d12627e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions subsys/net/l2/wifi/wifi_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,10 @@ static int __wifi_args_to_params(size_t argc, char *argv[],
return -EINVAL;
}

/* Defaults */
params->band = WIFI_FREQ_BAND_UNKNOWN;
params->channel = WIFI_CHANNEL_ANY;
params->security = WIFI_SECURITY_TYPE_NONE;

/* SSID */
params->ssid = argv[0];
Expand All @@ -362,8 +365,6 @@ static int __wifi_args_to_params(size_t argc, char *argv[],
}

idx++;
} else {
params->channel = WIFI_CHANNEL_ANY;
}

/* PSK (optional) */
Expand Down Expand Up @@ -402,8 +403,6 @@ static int __wifi_args_to_params(size_t argc, char *argv[],
params->psk_length > WIFI_SAE_PSWD_MAX_LEN)) {
return -EINVAL;
}
} else {
params->security = WIFI_SECURITY_TYPE_NONE;
}


Expand Down

0 comments on commit d12627e

Please sign in to comment.