16 #include "coap_config.h" 25 coap_pdu_t *request,
unsigned char flags,
void *data) {
35 debug(
"asynchronous state for transaction %d already registered\n",
id);
99 void does_not_exist();
void * appdata
This field can be used to register opaque application data with the asynchronous state object...
static void * coap_malloc(size_t size)
Wrapper function to coap_malloc_type() for backwards compatibility.
multi-purpose address abstraction
State management for asynchronous messages.
int coap_tid_t
coap_tid_t is used to store CoAP transaction id, i.e.
#define LL_PREPEND(head, add)
unsigned char flags
holds the flags to control behaviour
coap_address_t peer
the peer to notify
struct coap_async_state_t * async_state
list of asynchronous transactions
coap_hdr_t * hdr
Address of the first byte of the CoAP message.
void coap_transaction_id(const coap_address_t *peer, const coap_pdu_t *pdu, coap_tid_t *id)
Calculates a unique transaction id from given arguments peer and pdu.
coap_tid_t id
transaction id
Header structure for CoAP PDUs.
coap_async_state_t * coap_register_async(coap_context_t *context, coap_address_t *peer, coap_pdu_t *request, unsigned char flags, void *data)
Allocates a new coap_async_state_t object and fills its fields according to the given request...
#define COAP_ASYNC_CONFIRM
send confirmable response
#define COAP_ASYNC_RELEASE_DATA
release application data on destruction
static void coap_touch_async(coap_async_state_t *s)
Updates the time stamp of s.
int coap_remove_async(coap_context_t *context, coap_tid_t id, coap_async_state_t **s)
Removes the state object identified by id from context.
coap_async_state_t * coap_find_async(coap_context_t *context, coap_tid_t id)
Retrieves the object identified by id from the list of asynchronous transactions that are registered ...
void coap_free_async(coap_async_state_t *s)
Releases the memory that was allocated by coap_async_state_init() for the object s.
size_t tokenlen
length of the token
unsigned int token_length
static void coap_free(void *object)
Wrapper function to coap_free_type() for backwards compatibility.
#define LL_DELETE(head, del)
unsigned char token[]
the token to use in a response
#define LL_SEARCH_SCALAR(head, out, field, val)
The CoAP stack's global state is stored in a coap_context_t object.