libcoap
4.0.3
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
async.h
Go to the documentation of this file.
1
/* async.h -- state management for asynchronous messages
2
*
3
* Copyright (C) 2010,2011 Olaf Bergmann <bergmann@tzi.org>
4
*
5
* This file is part of the CoAP library libcoap. Please see
6
* README for terms of use.
7
*/
8
15
#ifndef _COAP_ASYNC_H_
16
#define _COAP_ASYNC_H_
17
18
#include "
config.h
"
19
#include "
net.h
"
20
21
#ifndef WITHOUT_ASYNC
22
32
typedef
struct
coap_async_state_t
{
33
unsigned
char
flags
;
40
coap_tick_t
created
;
41
45
void
*
appdata
;
46
47
unsigned
short
message_id
;
48
coap_tid_t
id
;
50
struct
coap_async_state_t
*
next
;
52
coap_address_t
peer
;
53
size_t
tokenlen
;
54
unsigned
char
token
[];
55
}
coap_async_state_t
;
56
57
/* Definitions for Async Status Flags These flags can be used to
58
* control the behaviour of asynchronous response generation. */
59
#define COAP_ASYNC_CONFIRM 0x01
60
#define COAP_ASYNC_SEPARATE 0x02
61
#define COAP_ASYNC_OBSERVED 0x04
64
#define COAP_ASYNC_RELEASE_DATA 0x08
65
87
coap_async_state_t
*
88
coap_register_async
(
coap_context_t
*context,
coap_address_t
*
peer
,
89
coap_pdu_t
*request,
unsigned
char
flags
,
void
*data);
90
108
int
coap_remove_async
(
coap_context_t
*context,
coap_tid_t
id
,
109
coap_async_state_t
**s);
110
118
void
119
coap_free_async
(
coap_async_state_t
*state);
120
133
coap_async_state_t
*
coap_find_async
(
coap_context_t
*context,
coap_tid_t
id
);
134
140
static
inline
void
141
coap_touch_async
(
coap_async_state_t
*s) {
coap_ticks
(&s->
created
); }
142
145
#endif
/* WITHOUT_ASYNC */
146
147
#endif
/* _COAP_ASYNC_H_ */
Generated on Tue Sep 3 2013 14:32:33 for libcoap by
1.8.1.2