mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-08 02:22:54 +03:00
An application can register a callback function of type coap_event_handler_t that will be called by the library on certain events. Currently, the DTLS implementation invokes coap_handle_event() with session-specific events such as session close or renegotiation.
22 lines
457 B
C
22 lines
457 B
C
/*
|
|
* coap_event.c -- libcoap Event API
|
|
*
|
|
* Copyright (C) 2016 Olaf Bergmann <bergmann@tzi.org>
|
|
*
|
|
* This file is part of the CoAP library libcoap. Please see README for terms
|
|
* of use.
|
|
*/
|
|
|
|
#include "coap_event.h"
|
|
#include "net.h"
|
|
|
|
void
|
|
coap_set_event_handler(struct coap_context_t *context, coap_event_handler_t hnd) {
|
|
context->handle_event = hnd;
|
|
}
|
|
|
|
void
|
|
coap_clear_event_handler(struct coap_context_t *context) {
|
|
context->handle_event = NULL;
|
|
}
|