libcoap 4.3.1
|
API for event delivery from lower-layer library functions. More...
Typedefs | |
typedef int(* | coap_event_handler_t) (coap_session_t *session, const coap_event_t event) |
Type for event handler functions that can be registered with a CoAP context using the unction coap_set_event_handler(). More... | |
Enumerations | |
enum | coap_event_t { COAP_EVENT_DTLS_CLOSED = 0x0000 , COAP_EVENT_DTLS_CONNECTED = 0x01DE , COAP_EVENT_DTLS_RENEGOTIATE = 0x01DF , COAP_EVENT_DTLS_ERROR = 0x0200 , COAP_EVENT_TCP_CONNECTED = 0x1001 , COAP_EVENT_TCP_CLOSED = 0x1002 , COAP_EVENT_TCP_FAILED = 0x1003 , COAP_EVENT_SESSION_CONNECTED = 0x2001 , COAP_EVENT_SESSION_CLOSED = 0x2002 , COAP_EVENT_SESSION_FAILED = 0x2003 , COAP_EVENT_PARTIAL_BLOCK = 0x3001 , COAP_EVENT_XMIT_BLOCK_FAIL = 0x3002 , COAP_EVENT_SERVER_SESSION_NEW = 0x4001 , COAP_EVENT_SERVER_SESSION_DEL = 0x4002 } |
Scalar type to represent different events, e.g. More... | |
Functions | |
void | coap_register_event_handler (coap_context_t *context, coap_event_handler_t hnd) |
Registers the function hnd as callback for events from the given CoAP context context . More... | |
API for event delivery from lower-layer library functions.
typedef int(* coap_event_handler_t) (coap_session_t *session, const coap_event_t event) |
Type for event handler functions that can be registered with a CoAP context using the unction coap_set_event_handler().
When called by the library, the first argument will be the current coap_session_t object which is associated with the original CoAP context. The second parameter is the event type.
Definition at line 105 of file coap_event.h.
enum coap_event_t |
Scalar type to represent different events, e.g.
DTLS events or retransmission timeouts.
Definition at line 34 of file coap_event.h.
void coap_register_event_handler | ( | coap_context_t * | context, |
coap_event_handler_t | hnd | ||
) |
Registers the function hnd
as callback for events from the given CoAP context context
.
Any event handler that has previously been registered with context
will be overwritten by this operation.
context | The CoAP context to register the event handler with. |
hnd | The event handler to be registered. NULL if to be de-registered. |
Definition at line 24 of file coap_event.c.