36 debug(
"asynchronous state for transaction %d already registered\n",
id);
44 coap_log(LOG_CRIT,
"coap_register_async: insufficient memory\n");
57 memcpy(&s->
peer, peer,
sizeof(coap_address_t));
100 void does_not_exist();
void * appdata
This field can be used to register opaque application data with the asynchronous state object...
state management for asynchronous messages
#define LL_PREPEND(head, add)
unsigned char flags
holds the flags to control behaviour
coap_address_t peer
the peer to notify
#define coap_malloc(size)
struct coap_async_state_t * async_state
list of asynchronous transactions
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
#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.