'\" t .\" Title: coap_lwip .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 10/28/2023 .\" Manual: libcoap Manual .\" Source: coap_lwip 4.3.4 .\" Language: English .\" .TH "COAP_LWIP" "3" "10/28/2023" "coap_lwip 4\&.3\&.4" "libcoap Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" coap_lwip, coap_lwip_dump_memory_pools, coap_lwip_set_input_wait_handler \- Work with CoAP lwip specific API handler .SH "SYNOPSIS" .sp \fB#include \fR .sp \fBvoid coap_lwip_set_input_wait_handler(coap_context_t *\fR\fB\fIcontext\fR\fR\fB, coap_lwip_input_wait_handler_t \fR\fB\fIhandler\fR\fR\fB, void *\fR\fB\fIinput_arg\fR\fR\fB);\fR .sp \fBvoid coap_lwip_dump_memory_pools(coap_log_t \fR\fB\fIlog_level\fR\fR\fB);\fR .SH "DESCRIPTION" .sp This man page describes the additional libcoap functions that are available for working with LwIP implementations\&. .sp \fBNOTE:\fR If the following line is defined in lwipopts\&.h, then libcoap will reserve space for one response PDU when allocating coap_pdu_t structures\&. .sp .if n \{\ .RS 4 .\} .nf #define MEMP_STATS 1 .fi .if n \{\ .RE .\} .SH "CALLBACK HANDLER" .sp \fBCallback Type: coap_lwip_input_wait_handler_t\fR .sp .if n \{\ .RS 4 .\} .nf /** * 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); .fi .if n \{\ .RE .\} .SH "FUNCTIONS" .sp \fBFunction: coap_lwip_set_input_wait_handler()\fR .sp The \fBcoap_lwip_set_input_wait_handler\fR() function is used to define a callback \fIhandler\fR that is invoked by \fBcoap_io_process\fR(3) which passes in the \fIinput_arg\fR parameter along with a suggested milli\-sec wait time parameter in case there is no input\&. This callback \fIhandler\fR is used to wait for (and probably times out) the next input packet\&. This allows the application to define whatever mechanism it wants use for this process\&. .sp \fBFunction: coap_lwip_dump_memory_pools()\fR .sp The \fBcoap_lwip_dump_memory_pools\fR() function is used to dump out the current state of the LwIP memory pools at logging level \fIlog_level\fR\&. .sp This function is always invoked by \fBcoap_free_context\fR(3) with a \fIlog_level\fR of COAP_LOG_DEBUG\&. .sp \fBNOTE:\fR For information to be printed out, you need the following two lines in lwipopts\&.h .sp .if n \{\ .RS 4 .\} .nf #define MEMP_STATS 1 #define LWIP_STATS_DISPLAY 1 .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBcoap_context\fR(3) and \fBcoap_io\fR(3) .SH "FURTHER INFORMATION" .sp See .sp "RFC7252: The Constrained Application Protocol (CoAP)" .sp for further information\&. .SH "BUGS" .sp Please report bugs on the mailing list for libcoap: libcoap\-developers@lists\&.sourceforge\&.net or raise an issue on GitHub at https://github\&.com/obgm/libcoap/issues .SH "AUTHORS" .sp The libcoap project