Loading...
Searching...
No Matches
coap_async.h
Go to the documentation of this file.
/*
* coap_async.h -- state management for asynchronous messages
*
* Copyright (C) 2010-2023 Olaf Bergmann <bergmann@tzi.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*
* This file is part of the CoAP library libcoap. Please see README for terms
* of use.
*/
#ifndef COAP_ASYNC_H_
#define COAP_ASYNC_H_
#include "coap_net.h"
int coap_async_is_supported(void);
coap_async_t *coap_register_async(coap_session_t *session,
const coap_pdu_t *request,
coap_tick_t delay);
void coap_async_set_delay(coap_async_t *async, coap_tick_t delay);
void coap_async_trigger(coap_async_t *async);
void coap_free_async(coap_session_t *session, coap_async_t *async);
coap_async_t *coap_find_async(coap_session_t *session, coap_bin_const_t token);
void coap_async_set_app_data(coap_async_t *async, void *app_data);
void *coap_async_get_app_data(const coap_async_t *async);
#endif /* COAP_ASYNC_H_ */
coap_async_t
struct coap_async_t coap_async_t
Async Entry information.
Definition coap_forward_decls.h:43
coap_net.h
CoAP context interface.
coap_tick_t
uint64_t coap_tick_t
This data type represents internal timer ticks with COAP_TICKS_PER_SECOND resolution.
Definition coap_time.h:144
coap_free_async
void coap_free_async(coap_session_t *session, coap_async_t *async)
Releases the memory that was allocated by coap_register_async() for the object async.
Definition coap_async.c:211
coap_async_trigger
void coap_async_trigger(coap_async_t *async)
Trigger the registered async.
coap_register_async
coap_async_t * coap_register_async(coap_session_t *session, const coap_pdu_t *request, coap_tick_t delay)
Allocates a new coap_async_t object and fills its fields according to the given request.
Definition coap_async.c:195
coap_async_set_delay
void coap_async_set_delay(coap_async_t *async, coap_tick_t delay)
Update the delay timeout, so changing when the registered async triggers.
Definition coap_async.c:205
coap_async_get_app_data
void * coap_async_get_app_data(const coap_async_t *async)
Gets the application data pointer held in async.
Definition coap_async.c:231
coap_find_async
coap_async_t * coap_find_async(coap_session_t *session, coap_bin_const_t token)
Retrieves the object identified by token from the list of asynchronous transactions that are register...
Definition coap_async.c:217
coap_async_set_app_data
void coap_async_set_app_data(coap_async_t *async, void *app_data)
Set the application data pointer held in async.
Definition coap_async.c:225
coap_async_is_supported
int coap_async_is_supported(void)
Returns 1 if libcoap was built with separate messages enabled, 0 otherwise.
Definition coap_async.c:190
coap_bin_const_t
CoAP binary data definition with const data.
Definition coap_str.h:64
coap_pdu_t
structure for CoAP PDUs
Definition coap_pdu_internal.h:119
coap_session_t
Abstraction of virtual session that can be attached to coap_context_t (client) or coap_endpoint_t (se...
Definition coap_session_internal.h:68