Skip to content

Commit

Permalink
samples: dect: dect_phy: dect_shell: fix rx command
Browse files Browse the repository at this point in the history
dect rx -command didn't work due to wrong initial optind index
for getopt().

Signed-off-by: Jani Hirsimäki <[email protected]>
  • Loading branch information
jhirsi authored and nordicjm committed Oct 18, 2024
1 parent 7f1428f commit dece2a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions samples/dect/dect_phy/dect_shell/src/dect/dect_phy_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,8 +1139,8 @@ static const char dect_rx_usage_str[] =
" [-e <dbm>]\n"
" [-i <secs] [--free_th <dbm_value>] [--busy_th <dbm_value>]\n"
"Subcommands:\n"
" start, Start RX.\n"
" stop, Stop RX.\n"
" start, Start RX.\n"
" stop, Stop RX.\n"
"Starting options:\n"
" -c <ch_nbr>, --c_ch, Channel number. Default: 1665\n"
" -t, --c_scan_time <int>, Scanning duration in seconds\n"
Expand Down Expand Up @@ -1201,7 +1201,7 @@ static int dect_phy_rx_cmd(const struct shell *shell, size_t argc, char **argv)
}

optreset = 1;
optind = 1;
optind = 2;
if (argv[1] != NULL && !strcmp(argv[1], "stop")) {
dect_phy_ctrl_rx_stop();
} else if (argv[1] != NULL && !strcmp(argv[1], "start")) {
Expand Down

0 comments on commit dece2a7

Please sign in to comment.