Skip to content

Commit

Permalink
examples/lte_lwm2m: Reboot when network is disconnected
Browse files Browse the repository at this point in the history
System reboot when network is disconnected for recovery.
  • Loading branch information
SPRESENSE committed Dec 17, 2021
1 parent fc66159 commit f1674f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/lte_lwm2m/lwm2mclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -1387,6 +1387,10 @@ int main(int argc, char FAR *argv[])
if (0 > numBytes)
{
fprintf(stderr, "Error in recvfrom(): %d %s\r\n", errno, strerror(errno));
if (errno == EPIPE)
{
g_reboot = 1;
}
}
else if (numBytes >= MAX_PACKET_SIZE)
{
Expand Down

0 comments on commit f1674f2

Please sign in to comment.