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);
#define SEARCH_PAIR(head, out, field1, val1, field2, val2)
Pulls together all the internal only header files.
coap_session_t * coap_session_reference(coap_session_t *session)
Increment reference counter on a session.
void coap_session_release(coap_session_t *session)
Decrement reference counter on a session.
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.
void coap_free_async(coap_async_state_t *s)
Releases the memory that was allocated by coap_async_state_init() for the object s.
COAP_STATIC_INLINE void coap_touch_async(coap_async_state_t *s)
Updates the time stamp of s.
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 ...
#define COAP_ASYNC_RELEASE_DATA
release application data on destruction
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.
#define COAP_ASYNC_CONFIRM
send confirmable response
#define coap_log(level,...)
Logging function.
COAP_STATIC_INLINE void * coap_malloc(size_t size)
Wrapper function to coap_malloc_type() for backwards compatibility.
COAP_STATIC_INLINE void coap_free(void *object)
Wrapper function to coap_free_type() for backwards compatibility.
int coap_tid_t
coap_tid_t is used to store CoAP transaction id, i.e.
unsigned char flags
holds the flags to control behaviour
void * appdata
This field can be used to register opaque application data with the asynchronous state object.
size_t tokenlen
length of the token
coap_session_t * session
transaction session
uint8_t token[8]
the token to use in a response
coap_tid_t id
transaction id
The CoAP stack's global state is stored in a coap_context_t object.
struct coap_async_state_t * async_state
list of asynchronous transactions
structure for CoAP PDUs token, if any, follows the fixed size header, then options until payload mark...
uint8_t * token
first byte of token, if any, or options
uint16_t tid
transaction id, if any, in regular host byte order
uint8_t token_length
length of Token
#define LL_DELETE(head, del)
#define LL_PREPEND(head, add)