client code: Make sure static variables are re-initialized if needed

For embedded applications that can call the 'main()' function multiple
times, they  need to have any statically (globally) defined variables
reset to their default values.
This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2025-03-21 10:14:03 +00:00
1 parent 0de22aae0b
commit d0bfbb7ac8
3 files changed
+23 -14

No files matched your search

@@ -260,6 +260,8 @@ client_coap_init(int argc, char **argv)
fail:
/* Clean up library usage so client can be run again */
quit = 0;
is_mcast = 0;
wait_seconds = DEFAULT_WAIT_TIME; /* default timeout in seconds */
coap_delete_optlist(optlist);
optlist = NULL;
coap_session_release(session);