• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "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
coap_register_event_handler(struct coap_context_t * context,coap_event_handler_t hnd)17 coap_register_event_handler(struct coap_context_t *context,
18                             coap_event_handler_t hnd) {
19   context->handle_event = hnd;
20 }
21 
22 void
coap_set_event_handler(struct coap_context_t * context,coap_event_handler_t hnd)23 coap_set_event_handler(struct coap_context_t *context,
24                        coap_event_handler_t hnd) {
25   context->handle_event = hnd;
26 }
27 
28 void
coap_clear_event_handler(struct coap_context_t * context)29 coap_clear_event_handler(struct coap_context_t *context) {
30   context->handle_event = NULL;
31 }
32