21 #include <sol-common-buildopts.h>
56 #ifndef SOL_NO_API_VERSION
57 #define SOL_OIC_PLATFORM_INFO_API_VERSION (1)
176 #ifndef SOL_NO_API_VERSION
177 #define SOL_OIC_DEVICE_INFO_API_VERSION (1)
282 #define SOL_OIC_REPR_FIELD(key_, type_, ...) \
283 (struct sol_oic_repr_field){.type = (type_), .key = (key_), { __VA_ARGS__ } }
291 #define SOL_OIC_REPR_UINT(key_, value_) \
292 SOL_OIC_REPR_FIELD(key_, SOL_OIC_REPR_TYPE_UINT, .v_uint = (value_))
300 #define SOL_OIC_REPR_INT(key_, value_) \
301 SOL_OIC_REPR_FIELD(key_, SOL_OIC_REPR_TYPE_INT, .v_int = (value_))
309 #define SOL_OIC_REPR_BOOL(key_, value_) \
310 SOL_OIC_REPR_FIELD(key_, SOL_OIC_REPR_TYPE_BOOL, .v_boolean = !!(value_))
318 #define SOL_OIC_REPR_SIMPLE(key_, value_) \
319 SOL_OIC_REPR_FIELD(key_, SOL_OIC_REPR_TYPE_SIMPLE, .v_simple = (value_))
329 #define SOL_OIC_REPR_TEXT_STRING(key_, value_, len_) \
330 SOL_OIC_REPR_FIELD(key_, SOL_OIC_REPR_TYPE_TEXT_STRING, .v_slice = SOL_STR_SLICE_STR((value_), (len_)))
340 #define SOL_OIC_REPR_BYTE_STRING(key_, value_, len_) \
341 SOL_OIC_REPR_FIELD(key_, SOL_OIC_REPR_TYPE_BYTE_STRING, .v_slice = SOL_STR_SLICE_STR((value_), (len_)))
350 #define SOL_OIC_REPR_HALF_FLOAT(key_, value_) \
351 SOL_OIC_REPR_FIELD(key_, SOL_OIC_REPR_TYPE_HALF_FLOAT, .v_voidptr = (void *)(value_))
360 #define SOL_OIC_REPR_FLOAT(key_, value_) \
361 SOL_OIC_REPR_FIELD(key_, SOL_OIC_REPR_TYPE_FLOAT, .v_float = (value_))
369 #define SOL_OIC_REPR_DOUBLE(key_, value_) \
370 SOL_OIC_REPR_FIELD(key_, SOL_OIC_REPR_TYPE_DOUBLE, .v_double = (value_))
600 #define SOL_OIC_MAP_LOOP(map_, current_, iterator_, end_reason_) \
601 for (end_reason_ = sol_oic_map_loop_init(map_, iterator_, current_); \
602 end_reason_ == SOL_OIC_MAP_LOOP_OK && \
603 sol_oic_map_loop_next(current_, iterator_, &end_reason_);)
615 #ifdef SOL_LOG_ENABLED
Double-precision float number type.
Definition: sol-oic.h:211
int sol_oic_map_get_type(struct sol_oic_map_writer *oic_map_writer, enum sol_oic_map_type *type)
get current oic_map_writer type.
uint64_t v_uint
Field's data if type is SOL_OIC_REPR_TYPE_UINT.
Definition: sol-oic.h:242
struct sol_oic_map_reader sol_oic_map_reader
Handler for an OIC packet map reader.
Definition: sol-oic.h:203
struct sol_oic_response sol_oic_response
Information about a server response.
Definition: sol-oic.h:458
const uint16_t extra
Definition: sol-oic.h:435
struct sol_str_slice v_slice
Field's data if type is SOL_OIC_REPR_TYPE_TEXT_STRING or SOL_OIC_REPR_TYPE_BYTE_STRING.
Definition: sol-oic.h:255
Structure containing all fields that are retrieved by sol_oic_client_get_server_info() and sol_oic_cl...
Definition: sol-oic.h:175
Structure to keep a single oic-map's field.
Definition: sol-oic.h:225
void * v_voidptr
Field's data if type is SOL_OIC_REPR_TYPE_HALF_FLOAT.
Definition: sol-oic.h:267
Map with no content.
Definition: sol-oic.h:400
int sol_oic_map_set_type(struct sol_oic_map_writer *oic_map_writer, enum sol_oic_map_type type)
set current oic_map_writer type.
enum sol_oic_map_loop_reason sol_oic_map_loop_init(const struct sol_oic_map_reader *map, struct sol_oic_map_reader *iterator, struct sol_oic_repr_field *repr)
Initialize an iterator to loop through elements of map.
struct sol_oic_platform_info sol_oic_platform_info
Structure containing all fields that are retrieved by sol_oic_client_get_platform_info() and sol_oic_...
const void * ptr
Definition: sol-oic.h:433
Map with content.
Definition: sol-oic.h:409
String with bytes type.
Definition: sol-oic.h:208
const uint8_t type
Definition: sol-oic.h:436
int64_t v_int
Field's data if type is SOL_OIC_REPR_TYPE_INT.
Definition: sol-oic.h:246
String slice type.
Definition: sol-str-slice.h:84
uint16_t api_version
API version.
Definition: sol-oic.h:178
The resource is slow.
Definition: sol-oic.h:153
double v_double
Field's data if type is SOL_OIC_REPR_TYPE_DOUBLE.
Definition: sol-oic.h:263
Success termination.
Definition: sol-oic.h:467
uint8_t v_simple
Field's data if type is SOL_OIC_REPR_TYPE_SIMPLE.
Definition: sol-oic.h:250
Signed int type.
Definition: sol-oic.h:205
Loop was terminated because an error occurred.
Definition: sol-oic.h:472
struct sol_coap_packet sol_coap_packet
Opaque handler for a CoAP packet.
Definition: sol-coap.h:250
struct sol_oic_request sol_oic_request
Information about a client request.
Definition: sol-oic.h:448
bool sol_oic_map_loop_next(struct sol_oic_repr_field *repr, struct sol_oic_map_reader *iterator, enum sol_oic_map_loop_reason *reason)
Get the next element from iterator.
The resource is secure.
Definition: sol-oic.h:159
enum sol_oic_repr_type type
type of the data of this field.
Definition: sol-oic.h:229
const uint8_t flags
Definition: sol-oic.h:437
sol_oic_resource_flag
Flags to set when adding a new resource to a server.
Definition: sol-oic.h:122
struct sol_oic_device_info sol_oic_device_info
Structure containing all fields that are retrieved by sol_oic_client_get_server_info() and sol_oic_cl...
struct sol_str_slice device_name
Device name.
Definition: sol-oic.h:184
static void sol_oic_payload_debug(struct sol_coap_packet *pkt)
Print the decoded cbor content of pkt.
Definition: sol-oic.h:619
struct sol_str_slice data_model_version
Spec version of data model.
Definition: sol-oic.h:196
Half-precision float number type.
Definition: sol-oic.h:209
Unsigned 8-bit integer type.
Definition: sol-oic.h:206
Single-precision float number type.
Definition: sol-oic.h:210
Unsigned int type.
Definition: sol-oic.h:204
struct sol_str_slice spec_version
Spec version of the core specification implemented by this device.
Definition: sol-oic.h:188
struct sol_oic_map_writer sol_oic_map_writer
Opaque handler for an OIC packet map writer.
Definition: sol-oic.h:384
Boolean precision type.
Definition: sol-oic.h:212
int sol_oic_map_append(struct sol_oic_map_writer *oic_map_writer, struct sol_oic_repr_field *repr)
Append an element to oic_map_writer.
The resource is active.
Definition: sol-oic.h:146
bool v_boolean
Field's data if type is SOL_OIC_REPR_TYPE_BOOL.
Definition: sol-oic.h:271
No flag is set.
Definition: sol-oic.h:128
These are routines that Soletta provides for its string slice implementation.
void sol_oic_repr_field_clear(struct sol_oic_repr_field *field)
Release memory from field.
The resource is discoverable by clients only if request contains an explicity query.
Definition: sol-oic.h:164
sol_oic_map_loop_reason
Possible reasons a SOL_OIC_MAP_LOOP was terminated.
Definition: sol-oic.h:463
String with text type.
Definition: sol-oic.h:207
sol_oic_map_type
Used in sol_oic_map_writer to state if the map has a content or not.
Definition: sol-oic.h:392
Routines to handle CoAP protocol.
These are routines that Soletta provides for its vector implementation.
The resource is discoverable by clients.
Definition: sol-oic.h:132
const uint32_t remaining
Definition: sol-oic.h:434
Handler for an OIC packet map reader.
Definition: sol-oic.h:431
struct sol_oic_repr_field sol_oic_repr_field
Structure to keep a single oic-map's field.
float v_float
Field's data if type is SOL_OIC_REPR_TYPE_FLOAT.
Definition: sol-oic.h:259
The resource is observable.
Definition: sol-oic.h:139
struct sol_str_slice device_id
Unique device identifier.
Definition: sol-oic.h:192
sol_oic_repr_type
field type of sol_oic_repr_field structure.
Definition: sol-oic.h:202
const void * parser
Definition: sol-oic.h:432
const char * key
Field's key as a string.
Definition: sol-oic.h:233