Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
sol_oic_resource_type Struct Reference

structure defining the type of a resource. More...

#include <sol-oic-server.h>

Data Fields

uint16_t api_version
 API version. More...
 
struct {
   int(*   handle )(void *data, struct
      sol_oic_request *request)
 
del
 Callback handle to DELETE requests. More...
 
struct {
   int(*   handle )(void *data, struct
      sol_oic_request *request)
 
get
 Callback handle to GET requests. More...
 
struct sol_str_slice interface
 String representation of the interface implemeneted by this resource. More...
 
struct sol_str_slice path
 String representation of the path of this resource. More...
 
struct {
   int(*   handle )(void *data, struct
      sol_oic_request *request)
 
post
 Callback handle to POST requests. More...
 
struct {
   int(*   handle )(void *data, struct
      sol_oic_request *request)
 
put
 Callback handle to PUT requests. More...
 
struct sol_str_slice resource_type
 String representation of the resource type. More...
 

Detailed Description

structure defining the type of a resource.

See Also
sol_oic_server_register_resource
Examples:
/src/samples/coap/oic-server.c.

Field Documentation

uint16_t sol_oic_resource_type::api_version

API version.

Examples:
/src/samples/coap/oic-server.c.

Referenced by register_light_resource_type().

struct { ... } sol_oic_resource_type::del

Callback handle to DELETE requests.

Parameters
dataThe user's data pointer.
requestInformation about this request. Use sol_oic_server_request_get_reader() to get the request data reader, sol_oic_server_response_new() to create a response and sol_oic_server_send_response() to reply this request with the response created.
Returns
0 on success or a negative number on errors.
See Also
sol_oic_server_request_get_reader
sol_oic_server_response_new
sol_oic_server_send_response
struct { ... } sol_oic_resource_type::get

Callback handle to GET requests.

Parameters
dataThe user's data pointer.
requestInformation about this request. Use sol_oic_server_request_get_reader() to get the request data reader, sol_oic_server_response_new() to create a response and sol_oic_server_send_response() to reply this request with the response created.
Returns
0 on success or a negative number on errors.
See Also
sol_oic_server_request_get_reader
sol_oic_server_response_new
sol_oic_server_send_response
int(* sol_oic_resource_type::handle)(void *data, struct sol_oic_request *request)
struct sol_str_slice sol_oic_resource_type::interface

String representation of the interface implemeneted by this resource.

struct sol_str_slice sol_oic_resource_type::path

String representation of the path of this resource.

If path.data == NULL or path.len == 0, a path will be generated automatically for this resource.

struct { ... } sol_oic_resource_type::post

Callback handle to POST requests.

Parameters
dataThe user's data pointer.
requestInformation about this request. Use sol_oic_server_request_get_reader() to get the request data reader, sol_oic_server_response_new() to create a response and sol_oic_server_send_response() to reply this request with the response created.
Returns
0 on success or a negative number on errors.
See Also
sol_oic_server_request_get_reader
sol_oic_server_response_new
sol_oic_server_send_response
struct { ... } sol_oic_resource_type::put

Callback handle to PUT requests.

Parameters
dataThe user's data pointer.
requestInformation about this request. Use sol_oic_server_request_get_reader() to get the request data reader, sol_oic_server_response_new() to create a response and sol_oic_server_send_response() to reply this request with the response created.
Returns
0 on success or a negative number on errors.
See Also
sol_oic_server_request_get_reader
sol_oic_server_response_new
sol_oic_server_send_response
struct sol_str_slice sol_oic_resource_type::resource_type

String representation of the resource type.

The string may have namespace segments, separated by a dot ('.').


The documentation for this struct was generated from the following file: