1COAP_LWIP(3)                    libcoap Manual                    COAP_LWIP(3)
2
3
4

NAME

6       coap_lwip, coap_lwip_dump_memory_pools,
7       coap_lwip_set_input_wait_handler - Work with CoAP lwip specific API
8       handler
9

SYNOPSIS

11       #include <coap3/coap.h>
12
13       void coap_lwip_set_input_wait_handler(coap_context_t *context,
14       coap_lwip_input_wait_handler_t handler, void *input_arg);
15
16       void coap_lwip_dump_memory_pools(coap_log_t log_level);
17

DESCRIPTION

19       This man page describes the additional libcoap functions that are
20       available for working with LwIP implementations.
21
22       NOTE: If the following line is defined in lwipopts.h, then libcoap will
23       reserve space for one response PDU when allocating coap_pdu_t
24       structures.
25
26           #define MEMP_STATS 1
27

CALLBACK HANDLER

29       Callback Type: coap_lwip_input_wait_handler_t
30
31           /**
32            * LwIP callback handler that can be used to wait / timeout for the
33            * next input packet.
34            *
35            * @param arg The argument passed to the coap_lwip_set_input_wait_handler()
36            *            function.
37            * @param milli_secs Suggested number of milli secs to wait before returning
38            *                   if no input.
39            *
40            * @return @c 1 if packet received, @c 0 for timeout, else @c -1 on error.
41            */
42           typedef int (*coap_lwip_input_wait_handler_t)(void* arg, uint32_t milli_secs);
43

FUNCTIONS

45       Function: coap_lwip_set_input_wait_handler()
46
47       The coap_lwip_set_input_wait_handler() function is used to define a
48       callback handler that is invoked by coap_io_process(3) which passes in
49       the input_arg parameter along with a suggested milli-sec wait time
50       parameter in case there is no input. This callback handler is used to
51       wait for (and probably times out) the next input packet. This allows
52       the application to define whatever mechanism it wants use for this
53       process.
54
55       Function: coap_lwip_dump_memory_pools()
56
57       The coap_lwip_dump_memory_pools() function is used to dump out the
58       current state of the LwIP memory pools at logging level log_level.
59
60       This function is always invoked by coap_free_context(3) with a
61       log_level of COAP_LOG_DEBUG.
62
63       NOTE: For information to be printed out, you need the following two
64       lines in lwipopts.h
65
66           #define MEMP_STATS         1
67           #define LWIP_STATS_DISPLAY 1
68

SEE ALSO

70       coap_context(3) and coap_io(3)
71

FURTHER INFORMATION

73       See
74
75       "RFC7252: The Constrained Application Protocol (CoAP)"
76
77       for further information.
78

BUGS

80       Please report bugs on the mailing list for libcoap:
81       libcoap-developers@lists.sourceforge.net or raise an issue on GitHub at
82       https://github.com/obgm/libcoap/issues
83

AUTHORS

85       The libcoap project <libcoap-developers@lists.sourceforge.net>
86
87
88
89coap_lwip 4.3.4                   10/09/2023                      COAP_LWIP(3)
Impressum