-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
coap_startup: Make coap_startup() first function call in examples
This then makes sure that all things libcoap are properly initialized before use, and coders realize they need to do this. Note: coap_new_context() continues to make sure that coap_startup() is invoked if not done previously, but this may be too late.
- Loading branch information
Showing
21 changed files
with
179 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// -*- mode:doc; -*- | ||
// vim: set syntax=asciidoc tw=0 | ||
|
||
coap_init(3) | ||
============ | ||
:doctype: manpage | ||
:man source: coap_init | ||
:man version: @PACKAGE_VERSION@ | ||
:man manual: libcoap Manual | ||
|
||
NAME | ||
---- | ||
coap_init, | ||
coap_startup, | ||
coap_cleanup | ||
- Work with CoAP initialization | ||
|
||
SYNOPSIS | ||
-------- | ||
*#include <coap@LIBCOAP_API_VERSION@/coap.h>* | ||
|
||
*void coap_startup(void);* | ||
|
||
*void coap_cleanup(void);* | ||
|
||
For specific (D)TLS library support, link with | ||
*-lcoap-@LIBCOAP_API_VERSION@-notls*, *-lcoap-@LIBCOAP_API_VERSION@-gnutls*, | ||
*-lcoap-@LIBCOAP_API_VERSION@-openssl*, *-lcoap-@LIBCOAP_API_VERSION@-mbedtls* | ||
or *-lcoap-@LIBCOAP_API_VERSION@-tinydtls*. Otherwise, link with | ||
*-lcoap-@LIBCOAP_API_VERSION@* to get the default (D)TLS library support. | ||
|
||
DESCRIPTION | ||
----------- | ||
|
||
The CoAP libcoap logic needs to be initialized before there is any use of the | ||
libcoap public API. This is done by calling *coap_startup*(). | ||
|
||
FUNCTIONS | ||
--------- | ||
|
||
*Function: coap_startup()* | ||
|
||
The *coap_startup*() function must be called before any other *coap_**() | ||
functions are called. It is used to initialize things like mutexes, | ||
random number gererators, clocks, TLS libraries etc. | ||
|
||
*NOTE:* This should be called after any other lower layer is initialized. | ||
For example, for LwIP, lwip_init() must be called before *coap_startup*(). | ||
|
||
*Function: coap_cleanup()* | ||
|
||
The *coap_cleanup*() function is used to cleanup / free any information set | ||
up by the *coap_startup*() function and should be the last *coap_**() function | ||
called. | ||
|
||
FURTHER INFORMATION | ||
------------------- | ||
See | ||
|
||
"https://rfc-editor.org/rfc/rfc7252[RFC7252: The Constrained Application Protocol (CoAP)]" | ||
|
||
for further information. | ||
|
||
BUGS | ||
---- | ||
Please report bugs on the mailing list for libcoap: | ||
[email protected] or raise an issue on GitHub at | ||
https://github.com/obgm/libcoap/issues | ||
|
||
AUTHORS | ||
------- | ||
The libcoap project <[email protected]> |
Oops, something went wrong.