Coverage Report

Created: 2026-05-12 06:18

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libcoap/src/coap_event.c
Line
Count
Source
1
/*
2
 * coap_event.c -- libcoap Event API
3
 *
4
 * Copyright (C) 2016-2026 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
/**
13
 * @file coap_event.c
14
 * @brief Event handling
15
 */
16
17
#include "coap3/coap_libcoap_build.h"
18
19
/*
20
 * This replaces coap_set_event_handler() so that handler registration is
21
 * consistent in the naming.
22
 */
23
void
24
coap_register_event_handler(coap_context_t *context,
25
32
                            coap_event_handler_t hnd) {
26
32
  context->event_cb = hnd;
27
32
}
28
29
void
30
coap_set_event_handler(coap_context_t *context,
31
0
                       coap_event_handler_t hnd) {
32
0
  context->event_cb = hnd;
33
0
}
34
35
void
36
0
coap_clear_event_handler(coap_context_t *context) {
37
  context->event_cb = NULL;
38
0
}