Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
[nrf noup] zephyr: Fix failure processing of no-response commands
Browse files Browse the repository at this point in the history
fixup! [nrf noup] zephyr: Add support for WPA CLI zephyr

For commands without any response, the failures are ignored.

Fixes SHEL-2740.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
  • Loading branch information
krish2718 committed May 3, 2024
1 parent 62d2ace commit b33e82e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wpa_supplicant/wpa_cli_zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,19 @@ static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd, int print,
/* Remove the LF */
os_memcpy(resp, buf, len - 1);
resp[len - 1] = '\0';
if (strncmp(resp, "FAIL", 4) == 0)
return -3;
}

if (print) {
buf[len] = '\0';
if (buf[0] != '\0')
printf("%s", buf);
}

if (len > 1 && (strncmp(resp, "FAIL", 4) == 0)) {
wpa_printf(MSG_ERROR, "Command failed: %s", resp);
return -3;
}

return 0;
}

Expand Down

0 comments on commit b33e82e

Please sign in to comment.