19 #define SEARCH_PAIR(head,out,field1,val1,field2,val2) \ 20 SEARCH_PAIR2(head,out,field1,val1,field2,val2,next) 22 #define SEARCH_PAIR2(head,out,field1,val1,field2,val2,next) \ 24 LL_FOREACH2(head,out,next) { \ 25 if ((out)->field1 == (val1) && (out)->field2 == (val2)) break; \ 31 coap_pdu_t *request,
unsigned char flags,
void *data) {
41 "asynchronous state for transaction %d already registered\n",
id);
109 void does_not_exist(
void);
void * appdata
This field can be used to register opaque application data with the asynchronous state object...
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
struct coap_async_state_t * async_state
list of asynchronous transactions
coap_session_t * coap_session_reference(coap_session_t *session)
Increment reference counter on a session.
#define SEARCH_PAIR(head, out, field1, val1, field2, val2)
COAP_STATIC_INLINE void coap_touch_async(coap_async_state_t *s)
Updates the time stamp of s.
COAP_STATIC_INLINE void * coap_malloc(size_t size)
Wrapper function to coap_malloc_type() for backwards compatibility.
coap_tid_t id
transaction id
coap_session_t * session
transaction session
structure for CoAP PDUs token, if any, follows the fixed size header, then options until payload mark...
coap_async_state_t * coap_register_async(coap_context_t *context, coap_session_t *session, 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
uint8_t * token
first byte of token, if any, or options
int coap_remove_async(coap_context_t *context, coap_session_t *session, coap_tid_t id, coap_async_state_t **s)
Removes the state object identified by id from context.
COAP_STATIC_INLINE void coap_free(void *object)
Wrapper function to coap_free_type() for backwards compatibility.
#define COAP_ASYNC_RELEASE_DATA
release application data on destruction
void coap_session_release(coap_session_t *session)
Decrement reference counter on a session.
coap_async_state_t * coap_find_async(coap_context_t *context, coap_session_t *session, 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.
uint8_t token[8]
the token to use in a response
size_t tokenlen
length of the token
#define LL_DELETE(head, del)
#define coap_log(level,...)
Logging function.
uint8_t token_length
length of Token
The CoAP stack's global state is stored in a coap_context_t object.
uint16_t tid
transaction id, if any, in regular host byte order
Pulls together all the internal only header files.