COAP_LWIP(3)
π NAME π
okay so this page is all about coap_lwip, coap_lwip_dump_memory_pools, and coap_lwip_set_input_wait_handler β they're your little besties for working with the CoAP lwip-specific API handler β¨ (yes that's the whole vibe, we're doing LwIP stuff today π§)
πΈ SYNOPSIS πΈ
#include <coap3/coap.h>
void coap_lwip_set_input_wait_handler(coap_context_t *context,
coap_lwip_input_wait_handler_t handler, void *input_arg);
void coap_lwip_dump_memory_pools(coap_log_t log_level);
π¦ DESCRIPTION π¦
So this man page is literally the rundown on the extra libcoap functions you get when you're working with LwIP implementations π
NOTE: if this line is defined inlwipopts.h, then libcoap will reserve space for one response PDU when it's allocatingcoap_pdu_tstructures. lowkey important π
#define MEMP_STATS 1
π CALLBACK HANDLER π
Callback Type: coap_lwip_input_wait_handler_t β main character energy tbh π
/**
* LwIP callback handler that can be used to wait / timeout for the
* next input packet.
*
* @param arg The argument passed to the coap_lwip_set_input_wait_handler()
* function.
* @param milli_secs Suggested number of milli secs to wait before returning
* if no input.
*
* @return @c 1 if packet received, @c 0 for timeout, else @c -1 on error.
*/
typedef int (*coap_lwip_input_wait_handler_t)(void* arg, uint32_t milli_secs);
β¨ FUNCTIONS β¨
π Function: coap_lwip_set_input_wait_handler()
The coap_lwip_set_input_wait_handler() function is how you define a callback handler that gets invoked by coap_io_process(3) β it passes in the input_arg parameter plus a suggested milli-sec wait time parameter, just in case there's no input π«Ά This callback handler is what waits for (and, let's be honest, probably times out on π) the next input packet. The whole point is that it lets the application define whatever mechanism it wants to use for this process. your app, your rules, periodt π
π Function: coap_lwip_dump_memory_pools()
The coap_lwip_dump_memory_pools() function dumps out the current state of the LwIP memory pools, at logging level log_level π
This function is always invoked by coap_free_context(3) with a log_level of COAP_LOG_DEBUG π
NOTE: for information to actually get printed out, you need these two lines in lwipopts.h β no cap, both of them:
#define MEMP_STATS 1
#define LWIP_STATS_DISPLAY 1
β SEE ALSO β
coap_context(3) and coap_io(3) β go read those too bestie, iykyk π
π FURTHER INFORMATION π
See
"RFC7252: The Constrained Application Protocol (CoAP)"
for further information. iconic spec fr fr π₯
π BUGS π
Please raise an issue on GitHub at https://github.com/obgm/libcoap/issues to report any bugs π
Please raise a Pull Request at https://github.com/obgm/libcoap/pulls for any fixes π οΈ
π AUTHORS π
The libcoap project <libcoap-developers@lists.sourceforge.net> π
okay that's the whole page, ily, go build something cute πβ¨ this was coap_lwip version 4.3.5, dated 08/24/2026 β mwah, see u in the next man page ππ¦πΈ
π¦ where this page comes from
- ubuntu stonking: libcoap3t64 4.3.5-4ubuntu1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms