1c87c5fbaSopenharmony_ci// -*- mode:doc; -*-
2c87c5fbaSopenharmony_ci// vim: set syntax=asciidoc tw=0
3c87c5fbaSopenharmony_ci
4c87c5fbaSopenharmony_cicoap_lwip(3)
5c87c5fbaSopenharmony_ci============
6c87c5fbaSopenharmony_ci:doctype: manpage
7c87c5fbaSopenharmony_ci:man source:   coap_lwip
8c87c5fbaSopenharmony_ci:man version:  @PACKAGE_VERSION@
9c87c5fbaSopenharmony_ci:man manual:   libcoap Manual
10c87c5fbaSopenharmony_ci
11c87c5fbaSopenharmony_ciNAME
12c87c5fbaSopenharmony_ci----
13c87c5fbaSopenharmony_cicoap_lwip,
14c87c5fbaSopenharmony_cicoap_lwip_dump_memory_pools,
15c87c5fbaSopenharmony_cicoap_lwip_set_input_wait_handler
16c87c5fbaSopenharmony_ci- Work with CoAP lwip specific API handler
17c87c5fbaSopenharmony_ci
18c87c5fbaSopenharmony_ciSYNOPSIS
19c87c5fbaSopenharmony_ci--------
20c87c5fbaSopenharmony_ci*#include <coap@LIBCOAP_API_VERSION@/coap.h>*
21c87c5fbaSopenharmony_ci
22c87c5fbaSopenharmony_ci*void coap_lwip_set_input_wait_handler(coap_context_t *_context_,
23c87c5fbaSopenharmony_cicoap_lwip_input_wait_handler_t _handler_, void *_input_arg_);*
24c87c5fbaSopenharmony_ci
25c87c5fbaSopenharmony_ci*void coap_lwip_dump_memory_pools(coap_log_t _log_level_);*
26c87c5fbaSopenharmony_ci
27c87c5fbaSopenharmony_ciDESCRIPTION
28c87c5fbaSopenharmony_ci-----------
29c87c5fbaSopenharmony_ciThis man page describes the additional libcoap functions that are available
30c87c5fbaSopenharmony_cifor working with LwIP implementations.
31c87c5fbaSopenharmony_ci
32c87c5fbaSopenharmony_ci*NOTE:* If the following line is defined in lwipopts.h, then libcoap will
33c87c5fbaSopenharmony_cireserve space for one response PDU when allocating coap_pdu_t structures.
34c87c5fbaSopenharmony_ci
35c87c5fbaSopenharmony_ci[source, c]
36c87c5fbaSopenharmony_ci----
37c87c5fbaSopenharmony_ci#define MEMP_STATS 1
38c87c5fbaSopenharmony_ci----
39c87c5fbaSopenharmony_ci
40c87c5fbaSopenharmony_ciCALLBACK HANDLER
41c87c5fbaSopenharmony_ci----------------
42c87c5fbaSopenharmony_ci
43c87c5fbaSopenharmony_ci*Callback Type: coap_lwip_input_wait_handler_t*
44c87c5fbaSopenharmony_ci
45c87c5fbaSopenharmony_ci[source, c]
46c87c5fbaSopenharmony_ci----
47c87c5fbaSopenharmony_ci/**
48c87c5fbaSopenharmony_ci * LwIP callback handler that can be used to wait / timeout for the
49c87c5fbaSopenharmony_ci * next input packet.
50c87c5fbaSopenharmony_ci *
51c87c5fbaSopenharmony_ci * @param arg The argument passed to the coap_lwip_set_input_wait_handler()
52c87c5fbaSopenharmony_ci *            function.
53c87c5fbaSopenharmony_ci * @param milli_secs Suggested number of milli secs to wait before returning
54c87c5fbaSopenharmony_ci *                   if no input.
55c87c5fbaSopenharmony_ci *
56c87c5fbaSopenharmony_ci * @return @c 1 if packet received, @c 0 for timeout, else @c -1 on error.
57c87c5fbaSopenharmony_ci */
58c87c5fbaSopenharmony_citypedef int (*coap_lwip_input_wait_handler_t)(void* arg, uint32_t milli_secs);
59c87c5fbaSopenharmony_ci----
60c87c5fbaSopenharmony_ci
61c87c5fbaSopenharmony_ciFUNCTIONS
62c87c5fbaSopenharmony_ci---------
63c87c5fbaSopenharmony_ci
64c87c5fbaSopenharmony_ci*Function: coap_lwip_set_input_wait_handler()*
65c87c5fbaSopenharmony_ci
66c87c5fbaSopenharmony_ciThe *coap_lwip_set_input_wait_handler*() function is used to define a callback
67c87c5fbaSopenharmony_ci_handler_ that is invoked by *coap_io_process*(3) which passes in the
68c87c5fbaSopenharmony_ci_input_arg_ parameter along with a suggested milli-sec wait time parameter
69c87c5fbaSopenharmony_ciin case there is no input.  This callback _handler_ is used to wait for
70c87c5fbaSopenharmony_ci(and probably times out) the next input packet.  This allows the application
71c87c5fbaSopenharmony_cito define whatever mechanism it wants use for this process.
72c87c5fbaSopenharmony_ci
73c87c5fbaSopenharmony_ci*Function: coap_lwip_dump_memory_pools()*
74c87c5fbaSopenharmony_ci
75c87c5fbaSopenharmony_ciThe *coap_lwip_dump_memory_pools*() function is used to dump out the current
76c87c5fbaSopenharmony_cistate of the LwIP memory pools at logging level _log_level_.
77c87c5fbaSopenharmony_ci
78c87c5fbaSopenharmony_ciThis function is always invoked by *coap_free_context*(3) with a _log_level_ of
79c87c5fbaSopenharmony_ciCOAP_LOG_DEBUG.
80c87c5fbaSopenharmony_ci
81c87c5fbaSopenharmony_ci*NOTE:* For information to be printed out, you need the following two lines in
82c87c5fbaSopenharmony_cilwipopts.h
83c87c5fbaSopenharmony_ci
84c87c5fbaSopenharmony_ci[source, c]
85c87c5fbaSopenharmony_ci----
86c87c5fbaSopenharmony_ci#define MEMP_STATS         1
87c87c5fbaSopenharmony_ci#define LWIP_STATS_DISPLAY 1
88c87c5fbaSopenharmony_ci----
89c87c5fbaSopenharmony_ci
90c87c5fbaSopenharmony_ciSEE ALSO
91c87c5fbaSopenharmony_ci--------
92c87c5fbaSopenharmony_ci*coap_context*(3) and *coap_io*(3)
93c87c5fbaSopenharmony_ci
94c87c5fbaSopenharmony_ciFURTHER INFORMATION
95c87c5fbaSopenharmony_ci-------------------
96c87c5fbaSopenharmony_ciSee
97c87c5fbaSopenharmony_ci
98c87c5fbaSopenharmony_ci"https://rfc-editor.org/rfc/rfc7252[RFC7252: The Constrained Application Protocol (CoAP)]"
99c87c5fbaSopenharmony_ci
100c87c5fbaSopenharmony_cifor further information.
101c87c5fbaSopenharmony_ci
102c87c5fbaSopenharmony_ciBUGS
103c87c5fbaSopenharmony_ci----
104c87c5fbaSopenharmony_ciPlease report bugs on the mailing list for libcoap:
105c87c5fbaSopenharmony_cilibcoap-developers@lists.sourceforge.net or raise an issue on GitHub at
106c87c5fbaSopenharmony_cihttps://github.com/obgm/libcoap/issues
107c87c5fbaSopenharmony_ci
108c87c5fbaSopenharmony_ciAUTHORS
109c87c5fbaSopenharmony_ci-------
110c87c5fbaSopenharmony_ciThe libcoap project <libcoap-developers@lists.sourceforge.net>
111