1// -*- mode:doc; -*- 2// vim: set syntax=asciidoc tw=0 3 4coap_init(3) 5============ 6:doctype: manpage 7:man source: coap_init 8:man version: @PACKAGE_VERSION@ 9:man manual: libcoap Manual 10 11NAME 12---- 13coap_init, 14coap_startup, 15coap_cleanup 16- Work with CoAP initialization 17 18SYNOPSIS 19-------- 20*#include <coap@LIBCOAP_API_VERSION@/coap.h>* 21 22*void coap_startup(void);* 23 24*void coap_cleanup(void);* 25 26For specific (D)TLS library support, link with 27*-lcoap-@LIBCOAP_API_VERSION@-notls*, *-lcoap-@LIBCOAP_API_VERSION@-gnutls*, 28*-lcoap-@LIBCOAP_API_VERSION@-openssl*, *-lcoap-@LIBCOAP_API_VERSION@-mbedtls* 29or *-lcoap-@LIBCOAP_API_VERSION@-tinydtls*. Otherwise, link with 30*-lcoap-@LIBCOAP_API_VERSION@* to get the default (D)TLS library support. 31 32DESCRIPTION 33----------- 34 35The CoAP libcoap logic needs to be initialized before there is any use of the 36libcoap public API. This is done by calling *coap_startup*(). 37 38FUNCTIONS 39--------- 40 41*Function: coap_startup()* 42 43The *coap_startup*() function must be called before any other *coap_**() 44functions are called. It is used to initialize things like mutexes, 45random number gererators, clocks, TLS libraries etc. 46 47*NOTE:* This should be called after any other lower layer is initialized. 48For example, for LwIP, lwip_init() must be called before *coap_startup*(). 49 50*NOTE:* After the inital call to *coap_startup*(), subsequent calls are ignored 51until *coap_cleanup*() is called. 52 53*Function: coap_cleanup()* 54 55The *coap_cleanup*() function is used to cleanup / free any information set 56up by the *coap_startup*() function and should be the last *coap_**() function 57called. It is possible to call *coap_startup*() after *coap_cleanup*() to 58re-initialize the libcoap logic. 59 60*NOTE:* All other libcoap cleanups should called prior to *coap_cleanup*(), e.g. 61*coap_free_context*(3). 62 63FURTHER INFORMATION 64------------------- 65See 66 67"https://rfc-editor.org/rfc/rfc7252[RFC7252: The Constrained Application Protocol (CoAP)]" 68 69for further information. 70 71BUGS 72---- 73Please report bugs on the mailing list for libcoap: 74libcoap-developers@lists.sourceforge.net or raise an issue on GitHub at 75https://github.com/obgm/libcoap/issues 76 77AUTHORS 78------- 79The libcoap project <libcoap-developers@lists.sourceforge.net> 80