Skip to content

Commit

Permalink
Call coap_startup() to remove warning
Browse files Browse the repository at this point in the history
If coap_startup() is not called prior to any other coap_* function calls, a
warning is emitted.

```
coap_startup() should be called before any other coap_*() functions are
called
```

This proactively calls coap_startup() to ensure the library is initialized,
even though coap_new_context() will do so implicitly.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
  • Loading branch information
hasheddan committed Sep 8, 2023
1 parent 26e3b32 commit 2e96970
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/golioth_coap_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,9 @@ golioth_client_t golioth_client_create(const golioth_client_config_t* config) {
time_t t;
srand(time(&t));

// Initialize libcoap prior to any coap_* function calls.
coap_startup();

_initialized = true;
}

Expand Down

0 comments on commit 2e96970

Please sign in to comment.