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 Structures | Macros | Typedefs | Enumerations | Functions
sol-lwm2m.h File Reference

Routines that handle the LWM2M protocol. More...

#include <stdbool.h>
#include <stdint.h>
#include <stdarg.h>
#include <string.h>
#include "sol-coap.h"
#include "sol-network.h"
#include "sol-str-slice.h"
#include "sol-vector.h"
#include "sol-buffer.h"
#include "sol-types.h"

Go to the source code of this file.

Data Structures

struct  sol_lwm2m_payload
 A payload received from the network used to create a LWM2M object instance. More...
 
union  sol_lwm2m_payload::sol_lwm2m_payload_data
 
struct  sol_lwm2m_resource
 Struct that represents a LWM2M resource. More...
 
struct  sol_lwm2m_resource::sol_lwm2m_resource_data
 The resource data array. More...
 
struct  sol_lwm2m_security_psk
 Struct that represents a Pre-Shared Key (PSK). More...
 
struct  sol_lwm2m_security_rpk
 Struct that represents a Raw Public Key (RPK) pair. More...
 
struct  sol_lwm2m_tlv
 Struct that represents TLV data. More...
 

Macros

#define SOL_LWM2M_DEFAULT_SERVER_PORT_COAP   (5683)
 Macro that defines the default port for a NoSec LWM2M server. More...
 
#define SOL_LWM2M_DEFAULT_SERVER_PORT_DTLS   (5684)
 Macro that defines the default port for a DTLS-secured LWM2M server. More...
 
#define SOL_LWM2M_RESOURCE_API_VERSION   (1)
 
#define SOL_LWM2M_RESOURCE_INIT(ret_value_, resource_, id_, type_, resource_len_, data_type_,...)
 Convinent macro to initialize a LWM2M resource. More...
 
#define SOL_LWM2M_RESOURCE_SINGLE_INIT(ret_value_, resource_, id_, data_type_, value_)
 A helper macro to init SINGLE resources. More...
 
#define SOL_LWM2M_RESOURCE_SINGLE_INT_INIT(ret_value_, resource_, id_, value_)
 A helper macro to init int resources. More...
 
#define SOL_LWM2M_TLV_API_VERSION   (1)
 

Typedefs

typedef struct
sol_lwm2m_client_object 
sol_lwm2m_client_object
 A handle of a client's object. More...
 
typedef struct sol_lwm2m_payload sol_lwm2m_payload
 A payload received from the network used to create a LWM2M object instance. More...
 
typedef struct sol_lwm2m_resource sol_lwm2m_resource
 Struct that represents a LWM2M resource. More...
 
typedef struct
sol_lwm2m_security_psk 
sol_lwm2m_security_psk
 Struct that represents a Pre-Shared Key (PSK). More...
 
typedef struct
sol_lwm2m_security_rpk 
sol_lwm2m_security_rpk
 Struct that represents a Raw Public Key (RPK) pair. More...
 
typedef struct sol_lwm2m_tlv sol_lwm2m_tlv
 Struct that represents TLV data. More...
 

Enumerations

enum  sol_lwm2m_acl_rights {
  SOL_LWM2M_ACL_NONE = 0, SOL_LWM2M_ACL_READ = 1, SOL_LWM2M_ACL_WRITE = 2, SOL_LWM2M_ACL_EXECUTE = 4,
  SOL_LWM2M_ACL_DELETE = 8, SOL_LWM2M_ACL_CREATE = 16, SOL_LWM2M_ACL_ALL = 31
}
 Enum that represents the Access Control Rights. More...
 
enum  sol_lwm2m_binding_mode {
  SOL_LWM2M_BINDING_MODE_U, SOL_LWM2M_BINDING_MODE_UQ, SOL_LWM2M_BINDING_MODE_S, SOL_LWM2M_BINDING_MODE_SQ,
  SOL_LWM2M_BINDING_MODE_US, SOL_LWM2M_BINDING_MODE_UQS, SOL_LWM2M_BINDING_MODE_UNKNOWN = -1
}
 LWM2M Client binding mode. More...
 
enum  sol_lwm2m_content_type { SOL_LWM2M_CONTENT_TYPE_TEXT = 1541, SOL_LWM2M_CONTENT_TYPE_OPAQUE = 1544, SOL_LWM2M_CONTENT_TYPE_TLV = 1542, SOL_LWM2M_CONTENT_TYPE_JSON = 1543 }
 Enum that represents a LWM2M response/request content type. More...
 
enum  sol_lwm2m_resource_data_type {
  SOL_LWM2M_RESOURCE_DATA_TYPE_STRING, SOL_LWM2M_RESOURCE_DATA_TYPE_INT, SOL_LWM2M_RESOURCE_DATA_TYPE_FLOAT, SOL_LWM2M_RESOURCE_DATA_TYPE_BOOL,
  SOL_LWM2M_RESOURCE_DATA_TYPE_OPAQUE, SOL_LWM2M_RESOURCE_DATA_TYPE_TIME, SOL_LWM2M_RESOURCE_DATA_TYPE_OBJ_LINK, SOL_LWM2M_RESOURCE_DATA_TYPE_NONE = -1
}
 Enum that represents a LWM2M resource data type. More...
 
enum  sol_lwm2m_resource_type { SOL_LWM2M_RESOURCE_TYPE_SINGLE, SOL_LWM2M_RESOURCE_TYPE_MULTIPLE, SOL_LWM2M_RESOURCE_TYPE_UNKNOWN = -1 }
 Enum data represents if an sol_lwm2m_resource is an array or not. More...
 
enum  sol_lwm2m_security_mode { SOL_LWM2M_SECURITY_MODE_PRE_SHARED_KEY = 0, SOL_LWM2M_SECURITY_MODE_RAW_PUBLIC_KEY = 1, SOL_LWM2M_SECURITY_MODE_CERTIFICATE = 2, SOL_LWM2M_SECURITY_MODE_NO_SEC = 3 }
 Enum that represents the UDP Security Mode. More...
 
enum  sol_lwm2m_tlv_type { SOL_LWM2M_TLV_TYPE_OBJECT_INSTANCE = 0, SOL_LWM2M_TLV_TYPE_RESOURCE_INSTANCE = 64, SOL_LWM2M_TLV_TYPE_MULTIPLE_RESOURCES = 128, SOL_LWM2M_TLV_TYPE_RESOURCE_WITH_VALUE = 192 }
 Enum that represents the TLV type. More...
 

Functions

int sol_lwm2m_client_object_get_id (const struct sol_lwm2m_client_object *object, uint16_t *id)
 Gets the object id. More...
 
const struct sol_ptr_vectorsol_lwm2m_client_object_get_instances (const struct sol_lwm2m_client_object *object)
 Gets the instances of a given object. More...
 
int sol_lwm2m_parse_tlv (const struct sol_str_slice content, struct sol_vector *tlv_values)
 Parses a binary content into TLV. More...
 
void sol_lwm2m_resource_clear (struct sol_lwm2m_resource *resource)
 Clears a sol_lwm2m_resource. More...
 
int sol_lwm2m_resource_init (struct sol_lwm2m_resource *resource, uint16_t id, enum sol_lwm2m_resource_type type, uint16_t resource_len, enum sol_lwm2m_resource_data_type data_type,...)
 Initializes a LWM2M resource. More...
 
int sol_lwm2m_resource_init_vector (struct sol_lwm2m_resource *resource, uint16_t id, enum sol_lwm2m_resource_data_type data_type, struct sol_vector *res_instances)
 Initializes a LWM2M resource of type multiple using a sol_vector. More...
 
void sol_lwm2m_tlv_clear (struct sol_lwm2m_tlv *tlv)
 Clear a TLV. More...
 
int sol_lwm2m_tlv_get_bool (struct sol_lwm2m_tlv *tlv, bool *value)
 Converts an TLV value to boolean value. More...
 
int sol_lwm2m_tlv_get_bytes (struct sol_lwm2m_tlv *tlv, struct sol_buffer *buf)
 Get TLV content is plain bytes. More...
 
int sol_lwm2m_tlv_get_float (struct sol_lwm2m_tlv *tlv, double *value)
 Converts an TLV value to float value. More...
 
int sol_lwm2m_tlv_get_int (struct sol_lwm2m_tlv *tlv, int64_t *value)
 Converts an TLV value to int value. More...
 
int sol_lwm2m_tlv_get_obj_link (struct sol_lwm2m_tlv *tlv, uint16_t *object_id, uint16_t *instance_id)
 Converts an TLV value to object link. More...
 
void sol_lwm2m_tlv_list_clear (struct sol_vector *tlvs)
 Clears an TLV array. More...
 

Detailed Description

Routines that handle the LWM2M protocol.

Macro Definition Documentation

#define SOL_LWM2M_RESOURCE_API_VERSION   (1)
#define SOL_LWM2M_TLV_API_VERSION   (1)