libcoap 4.3.5-develop-379c7f4
Loading...
Searching...
No Matches
coap_async.h
Go to the documentation of this file.
1/*
2 * coap_async.h -- state management for asynchronous messages
3 *
4 * Copyright (C) 2010-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
16
17#ifndef COAP_ASYNC_H_
18#define COAP_ASYNC_H_
19
20#include "coap_net.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
35
46COAP_API void coap_context_set_async_limits(coap_context_t *context, size_t max_pending,
47 size_t max_per_session);
48
68 const coap_pdu_t *request,
69 coap_tick_t delay);
70
82
92
101
114
124COAP_DEPRECATED void coap_async_set_app_data(coap_async_t *async, void *app_data);
125
133void *coap_async_get_app_data(const coap_async_t *async);
134
152 void *data,
154
156
157#ifdef __cplusplus
158}
159#endif
160
161#endif /* COAP_ASYNC_H_ */
struct coap_async_t coap_async_t
Async Entry information.
#define COAP_API
CoAP context interface.
uint64_t coap_tick_t
This data type represents internal timer ticks with COAP_TICKS_PER_SECOND resolution.
Definition coap_time.h:149
COAP_API void * coap_async_set_app_data2(coap_async_t *async_entry, void *data, coap_app_data_free_callback_t callback)
Stores data with the given async, returning the previously stored value or NULL.
Definition coap_async.c:324
COAP_API 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:304
COAP_API 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:310
COAP_API void coap_context_set_async_limits(coap_context_t *context, size_t max_pending, size_t max_per_session)
Set the maximum number of pending asynchronous requests for the context and for each session.
Definition coap_async.c:19
void * coap_async_get_app_data(const coap_async_t *async)
Gets the application data pointer held in async.
Definition coap_async.c:333
COAP_DEPRECATED 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:318
COAP_API void coap_async_trigger(coap_async_t *async)
Trigger the registered async.
COAP_API 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:288
COAP_API 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:298
void(* coap_app_data_free_callback_t)(void *data)
Callback to free off the app data when the entry is being deleted / freed off.
#define COAP_DEPRECATED
Definition libcoap.h:66
CoAP binary data definition with const data.
Definition coap_str.h:65
The CoAP stack's global state is stored in a coap_context_t object.
structure for CoAP PDUs
Abstraction of virtual session that can be attached to coap_context_t (client) or coap_endpoint_t (se...