libcoap  4.3.0rc3
coap_event.c
Go to the documentation of this file.
1 /*
2  * coap_event.c -- libcoap Event API
3  *
4  * Copyright (C) 2016 Olaf Bergmann <bergmann@tzi.org>
5  *
6  * This file is part of the CoAP library libcoap. Please see README for terms
7  * of use.
8  */
9 
10 #include "coap3/coap_internal.h"
11 
12 /*
13  * This replaces coap_set_event_handler() so that handler registration is
14  * consistent in the naming.
15  */
16 void
19  context->handle_event = hnd;
20 }
21 
22 void
25  context->handle_event = hnd;
26 }
27 
28 void
30  context->handle_event = NULL;
31 }
void coap_clear_event_handler(coap_context_t *context)
Clears the event handler registered with context.
Definition: coap_event.c:29
void coap_set_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.
Definition: coap_event.c:23
Pulls together all the internal only header files.
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_se...
Definition: coap_event.h:61
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.
Definition: coap_event.c:17
The CoAP stack's global state is stored in a coap_context_t object.
coap_event_handler_t handle_event
Callback function that is used to signal events to the application.