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 in lwipopts.h, then libcoap will reserve space for one response PDU when it's allocating coap_pdu_t structures. 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