Skip to content

Commit 2f42066

Browse files
committed
Stop stack: accept to lose the stop confirm
In case stack stop confirm is no received, still try to obtain the stack status. In fact, it can happen that the node reboot too quickly and the response is not flushed to the uart line. Relax a bit the requirement and accept to lose the confirm.
1 parent 7e565c9 commit 2f42066

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/wpc/wpc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -570,11 +570,11 @@ app_res_e WPC_stop_stack(void)
570570

571571
res = msap_stack_stop_request();
572572

573-
if (res < 0)
574-
{
575-
f_res = APP_RES_INTERNAL_ERROR;
576-
}
577-
else if (res == 1)
573+
// res < 0 can happen if node reboot too early and doesn't
574+
// have time to flush its buffer contatining stop request
575+
// handle it as a normal case an try to obtain status after
576+
// reboot
577+
if (res == 1)
578578
{
579579
f_res = APP_RES_STACK_ALREADY_STOPPED;
580580
}

0 commit comments

Comments
 (0)