Soletta™ Framework
|
Description for a CoAP resource. More...
#include <sol-coap.h>
Data Fields | |
uint16_t | api_version |
API version. More... | |
int(* | del )(void *data, struct sol_coap_server *server, const struct sol_coap_resource *resource, struct sol_coap_packet *req, const struct sol_network_link_addr *cliaddr) |
DELETE request. More... | |
enum sol_coap_flags | flags |
Bitwise OR-ed flags from sol_coap_flags, if any is necessary. More... | |
int(* | get )(void *data, struct sol_coap_server *server, const struct sol_coap_resource *resource, struct sol_coap_packet *req, const struct sol_network_link_addr *cliaddr) |
GET request. More... | |
struct sol_str_slice | path [] |
Path representing the resource. More... | |
int(* | post )(void *data, struct sol_coap_server *server, const struct sol_coap_resource *resource, struct sol_coap_packet *req, const struct sol_network_link_addr *cliaddr) |
POST request. More... | |
int(* | put )(void *data, struct sol_coap_server *server, const struct sol_coap_resource *resource, struct sol_coap_packet *req, const struct sol_network_link_addr *cliaddr) |
PUT request. More... | |
Description for a CoAP resource.
CoAP servers will want to register resources, so that clients can act on them, by fetching their state or requesting updates to them. These resources are registered using this struct and the sol_coap_server_register_resource() function.
uint16_t sol_coap_resource::api_version |
API version.
int(* sol_coap_resource::del)(void *data, struct sol_coap_server *server, const struct sol_coap_resource *resource, struct sol_coap_packet *req, const struct sol_network_link_addr *cliaddr) |
DELETE request.
data | User data pointer provided to sol_coap_server_register_resource(). |
server | The server through which the request was made. |
resource | The resource the request mas made on. |
req | Packet containing the request data. It's not safe to keep a reference to it after this function returns. |
cliaddr | The source address of the request. |
enum sol_coap_flags sol_coap_resource::flags |
Bitwise OR-ed flags from sol_coap_flags, if any is necessary.
int(* sol_coap_resource::get)(void *data, struct sol_coap_server *server, const struct sol_coap_resource *resource, struct sol_coap_packet *req, const struct sol_network_link_addr *cliaddr) |
GET request.
data | User data pointer provided to sol_coap_server_register_resource(). |
server | The server through which the request was made. |
resource | The resource the request mas made on. |
req | Packet containing the request data. It's not safe to keep a reference to it after this function returns. |
cliaddr | The source address of the request. |
struct sol_str_slice sol_coap_resource::path[] |
Path representing the resource.
An array of sol_str_slice, each being a component of the path without any separators. Last slice should be empty.
Referenced by light_resource_to_rep().
int(* sol_coap_resource::post)(void *data, struct sol_coap_server *server, const struct sol_coap_resource *resource, struct sol_coap_packet *req, const struct sol_network_link_addr *cliaddr) |
POST request.
data | User data pointer provided to sol_coap_server_register_resource(). |
server | The server through which the request was made. |
resource | The resource the request mas made on. |
req | Packet containing the request data. It's not safe to keep a reference to it after this function returns. |
cliaddr | The source address of the request. |
int(* sol_coap_resource::put)(void *data, struct sol_coap_server *server, const struct sol_coap_resource *resource, struct sol_coap_packet *req, const struct sol_network_link_addr *cliaddr) |
PUT request.
data | User data pointer provided to sol_coap_server_register_resource(). |
server | The server through which the request was made. |
resource | The resource the request mas made on. |
req | Packet containing the request data. It's not safe to keep a reference to it after this function returns. |
cliaddr | The source address of the request. |