/**
* @defgroup coap_async Asynchronous Messaging
* @{
* Structure for managing asynchronous state of CoAP resources. A
* coap_resource_t object holds a list of coap_async_state_t objects
* that can be used to generate a separate response in case a result
* of an operation cannot be delivered in time, or the resource has
* been explicitly subscribed to with the option @c observe.
*/
typedef struct coap_async_state_t {
unsigned char flags; /**< holds the flags to control behaviour */
/**
* Holds the internal time when the object was registered with a
* resource. This field will be updated whenever
* coap_register_async() is called for a specific resource.
*/
coap_tick_t created;
/**
* This field can be used to register opaque application data with
* the asynchronous state object. */
void *appdata;
unsigned short message_id; /**< id of last message seen */
coap_tid_t id; /**< transaction id */
struct coap_async_state_t *next; /**< internally used for linking */
coap_address_t peer; /**< the peer to notify */
size_t tokenlen; /**< length of the token */
unsigned char token[]; /**< the token to use in a response */
} coap_async_state_t;
libcoap(三) struct coap_async_state_t
最新推荐文章于 2024-07-20 13:51:49 发布