-
Notifications
You must be signed in to change notification settings - Fork 0
/
sleepy-node-resources.h
33 lines (28 loc) · 1.09 KB
/
sleepy-node-resources.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* \file
* Sleepy node resources interface.
* Wrapper for standard CoAP resources in order to add value buffers
* for the resources and a LIST functionality in order to organize all
* the sleepy-node resource in a list of delegated resources.
*
* \authors
* Francesco Paolo Culcasi <[email protected]> <br>
* Alessandro Martinelli <[email protected]> <br>
* Nicola Messina <[email protected]> <br>
*/
#include "rest-engine.h"
#include <string.h>
#define MAX_DELEGATED_RESOURCES 8
/**
* Data structure representing a sleepy-node resource
*/
struct sleepy_node_resource_t {
/*@{*/
struct sleepy_node_resource_t* next; /**< pointer to the next resource for LIST */
resource_t* resource; /**< pointer to the standard CoAP resource */
char *value; /**< pointer the the buffer that stores the resource value */
int value_len; /**< the length of the value field */
/*@}*/
};
struct sleepy_node_resource_t* initialize_sleepy_node_resource(resource_t* resource, char* value, int value_len);
struct sleepy_node_resource_t* search_sleepy_node_resource_by_path(char* path);