libcoap
4.3.0
|
API functions for Async "separate" messages. More...
Functions | |
int | coap_async_is_supported (void) |
Returns 1 if libcoap was built with separate messages enabled, 0 otherwise. More... | |
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 . More... | |
void | coap_async_set_delay (coap_async_t *async, coap_tick_t delay) |
Update the delay timeout, so changing when the registered async triggers. More... | |
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 . More... | |
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 registered with context . More... | |
void | coap_async_set_app_data (coap_async_t *async, void *app_data) |
Set the application data pointer held in async . More... | |
void * | coap_async_get_app_data (const coap_async_t *async) |
Gets the application data pointer held in async . More... | |
API functions for Async "separate" messages.
A coap_context_t object holds a list of coap_async_t objects that can be used to generate a separate response in the case a result of a request cannot be delivered immediately.
void* coap_async_get_app_data | ( | const coap_async_t * | async | ) |
int coap_async_is_supported | ( | void | ) |
void coap_async_set_app_data | ( | coap_async_t * | async, |
void * | app_data | ||
) |
void coap_async_set_delay | ( | coap_async_t * | async, |
coap_tick_t | delay | ||
) |
Update the delay timeout, so changing when the registered async
triggers.
When the new delay expires, a copy of the original request will get sent to the appropriate request handler.
async | The object to update. |
delay | The amount of time to delay before sending response, 0 means wait forever. |
Definition at line 91 of file async.c.
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 registered with context
.
This function returns a pointer to that object or NULL
if not found.
session | The session that is used for asynchronous transmissions. |
token | The PDU's token of the object to retrieve. |
token
or NULL
if not found. Definition at line 109 of file async.c.
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
.
session | The session to use. |
async | The object to delete. |
Definition at line 134 of file async.c.
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
.
This function returns a pointer to the registered coap_async_t object or NULL
on error. Note that this function will return NULL
in case that an object with the same identifier is already registered.
When the delay expires, a copy of the request
will get sent to the appropriate request handler.
session | The session that is used for asynchronous transmissions. |
request | The request that is handled asynchronously. |
delay | The amount of time to delay before sending response, 0 means wait forever. |
NULL
in case of an error. Definition at line 38 of file async.c.