libcoap  4.3.0rc2
async.h
Go to the documentation of this file.
1 /*
2  * async.h -- state management for asynchronous messages
3  *
4  * Copyright (C) 2010-2011 Olaf Bergmann <bergmann@tzi.org>
5  *
6  * This file is part of the CoAP library libcoap. Please see README for terms
7  * of use.
8  */
9 
15 #ifndef COAP_ASYNC_H_
16 #define COAP_ASYNC_H_
17 
18 #include "net.h"
19 
33 int coap_async_is_supported(void);
34 
56  coap_session_t *session,
57  coap_pdu_t *request,
58  coap_tick_t delay);
59 
70 void
72 
80 void
82 
97  coap_session_t *session, coap_binary_t token);
98 
106 void coap_async_set_app_data(coap_async_t *async, void *app_data);
107 
115 void *coap_async_get_app_data(const coap_async_t *async);
116 
119 #endif /* COAP_ASYNC_H_ */
uint64_t coap_tick_t
This data type represents internal timer ticks with COAP_TICKS_PER_SECOND resolution.
Definition: coap_time.h:120
coap_async_t * coap_find_async(coap_context_t *context, coap_session_t *session, coap_binary_t token)
Retrieves the object identified by token from the list of asynchronous transactions that are register...
Definition: async.c:107
void coap_free_async(coap_context_t *context, coap_async_t *async)
Releases the memory that was allocated by coap_async_state_init() for the object async.
Definition: async.c:118
void * coap_async_get_app_data(const coap_async_t *async)
Gets the application data pointer held in async.
Definition: async.c:148
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: async.c:89
coap_async_t * coap_register_async(coap_context_t *context, coap_session_t *session, 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: async.c:36
void coap_async_set_app_data(coap_async_t *async, void *app_data)
Set the application data pointer held in async.
Definition: async.c:143
int coap_async_is_supported(void)
Returns 1 if libcoap was built with separate messages enabled, 0 otherwise.
Definition: async.c:31
CoAP binary data definition.
Definition: str.h:48
The CoAP stack's global state is stored in a coap_context_t object.
structure for CoAP PDUs token, if any, follows the fixed size header, then options until payload mark...
Abstraction of virtual session that can be attached to coap_context_t (client) or coap_endpoint_t (se...