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_lwm2m_tlv Struct Reference

Struct that represents TLV data. More...

#include <sol-lwm2m.h>

Data Fields

uint16_t api_version
 API version. More...
 
struct sol_buffer content
 The TLV content. More...
 
uint16_t id
 The id of the object/instance/resource. More...
 
enum sol_lwm2m_tlv_type type
 The TLV type. More...
 

Detailed Description

Struct that represents TLV data.

The binary format TLV (Type-Length-Value) is used to represent an array of values or a singular value, using a compact binary representation.
It is needed by "Read" and "Write" operations on Object Instance(s) or on a Resource which supports multiple instances (Resource Instances).

The format is an array of the following byte sequence, where each array entry represents an Object Instance, Resource or Resource Instance:

Field Format and Length Description Implemented as
Type 8-bits masked field Bits 7-6: Indicates the type of identifier.
Bits 5-0: All have special meanings as well.
enum sol_lwm2m_tlv.type
Identifier 8-bit or 16-bit unsigned integer
as indicated by Bit 5 from Type
Object Instance, Resource or Resource Instance ID uint16_t sol_lwm2m_tlv.id
Length 0-24bits unsigned integer
as indicated by Bits 4-3 from Type
Length of the following field in bytes size_t sol_buffer.capacity
Value Sequence of bytes of size=Length Value of the tag.
The actual format depends on the Resource's data type
See Also
sol_lwm2m_resource_data_type
void * sol_lwm2m_tlv.content->data
See Also
sol_lwm2m_parse_tlv()
Examples:
/src/samples/coap/lwm2m-client.c, and /src/samples/coap/lwm2m-server.c.

Field Documentation

uint16_t sol_lwm2m_tlv::api_version

API version.

struct sol_buffer sol_lwm2m_tlv::content
uint16_t sol_lwm2m_tlv::id
enum sol_lwm2m_tlv_type sol_lwm2m_tlv::type

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