Skip to content

Commit

Permalink
examples/lte_lwm2m: Enable SIGINT
Browse files Browse the repository at this point in the history
Enable SIGINT to terminate this application with CONFIG_TTY_SIGINT=y.
  • Loading branch information
SPRESENSE committed Dec 17, 2021
1 parent e6e76f7 commit 28434af
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions examples/lte_lwm2m/lwm2mclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ static void prv_quit(lwm2m_context_t * lwm2mH,
g_quit = 1;
}

//void handle_sigint(int signum)
//{
// g_quit = 2;
//}
void handle_sigint(int signum)
{
printf("signum=%d\n", signum);
g_quit = 2;
}

void handle_value_changed(lwm2m_context_t * lwm2mH,
lwm2m_uri_t * uri,
Expand Down Expand Up @@ -1210,7 +1211,7 @@ int main(int argc, char FAR *argv[])
return -1;
}

// signal(SIGINT, handle_sigint);
signal(SIGINT, handle_sigint);

/**
* Initialize value changed callback.
Expand Down

0 comments on commit 28434af

Please sign in to comment.