1 /* 2 * coap_event.c -- libcoap Event API 3 * 4 * Copyright (C) 2016 Olaf Bergmann <bergmann@tzi.org> 5 * 6 * SPDX-License-Identifier: BSD-2-Clause 7 * 8 * This file is part of the CoAP library libcoap. Please see README for terms 9 * of use. 10 */ 11 12 #include "coap3/coap_internal.h" 13 14 /* 15 * This replaces coap_set_event_handler() so that handler registration is 16 * consistent in the naming. 17 */ 18 void coap_register_event_handler(coap_context_t * context,coap_event_handler_t hnd)19coap_register_event_handler(coap_context_t *context, 20 coap_event_handler_t hnd) { 21 context->handle_event = hnd; 22 } 23 24 void coap_set_event_handler(coap_context_t * context,coap_event_handler_t hnd)25coap_set_event_handler(coap_context_t *context, 26 coap_event_handler_t hnd) { 27 context->handle_event = hnd; 28 } 29 30 void coap_clear_event_handler(coap_context_t * context)31coap_clear_event_handler(coap_context_t *context) { 32 context->handle_event = NULL; 33 } 34