Friendly LWM2M client
wpp Namespace Reference

The WppConnection class represents a connection interface for the Wpp library. More...

Classes

class  WppClient
 Represents a client interface for Wpp library. More...
 
class  WppConnection
 
class  WppGuard
 The WppGuard class provides a linker callback class that must be implemented by the user. More...
 
class  WppPlatform
 The WppPlatform class provides a platform-specific implementation for the Wpp library. More...
 
class  Instance
 Instance is interface class that implements manipulation with derived class resources. The main target of this class is to encapsulate operations like resource write and read by core, for avoid multiple definition of this mechanism in instance implementation classes. And give generalised interface to resources for core(server). More...
 
class  InstEventObserver
 The InstEventObserver class is an abstract base class that defines the interface for observing instance events. More...
 
class  InstOpObserver
 The InstOpObserver class is an abstract base class that defines the interface for observing instance operations. More...
 
class  InstSubject
 The InstSubject class represents a subject that allows subscribers to be notified about various events related to instance resources. More...
 
class  Object
 The Object class implements manipulation with Instance interface class and its inheritors. More...
 
class  ObjectImpl
 The ObjectImpl class is a template class that represents an implementation of an object in the Wakaama library. More...
 
class  ObjOpObserver
 The ObjOpObserver class is an abstract base class that defines the interface for observing object operations. More...
 
class  ObjSubject
 The ObjSubject class represents a subject that notifies observers about object operations and actions. More...
 
class  Resource
 The Resource class in the wpp namespace is a comprehensive and flexible class designed to handle different types of data within a resource-oriented architecture. It offers a range of functionalities including storing, retrieving, and validating various data types, as well as managing multiple instances of a resource. More...
 
class  ResourceContainer
 
struct  ItemOp
 The ItemOp struct represents the operations that can be performed on a instance/resource. More...
 
struct  ObjectInfo
 The ObjectInfo struct represents information about an object in the Wakaama data model. More...
 
struct  OBJ_LINK_T
 ObjLink - (object ID):(instance ID), example: 1:3. Represent as two integers in lwm2m_data_t.value.asObjLink. More...
 
struct  Version
 
struct  ResLink
 
struct  DataLink
 
class  Lwm2mSecurity
 
class  Lwm2mServer
 
class  Device
 
class  Lwm2mAccessControl
 
class  AudioClip
 
class  ConnectivityMonitoring
 
class  FirmwareUpdate
 
interface  FwInternalDl
 
class  FwUpdater
 
class  WppRegistry
 The WppRegistry class represents a registry for managing LWM2M objects. More...
 
class  WppTaskQueue
 Represents a task queue. More...
 

Typedefs

using ID_T = uint16_t
 
using EVENT_ID_T = uint8_t
 
using BOOL_T = bool
 Wpp data types bindings. More...
 
using INT_T = int64_t
 
using UINT_T = uint64_t
 
using FLOAT_T = double
 
using TIME_T = INT_T
 
using STRING_T = std::string
 
using OPAQUE_T = std::vector< uint8_t >
 Opaque - represent buffer or string as lwm2m_data_t.value.asBuffer. More...
 
using CORE_LINK_T = std::string
 CoreLink - </3/0> or </1/0/>;ssid=101 or </5>,</4>,</55>;ver=1.9,</55/0>. Represent as string in lwm2m_data_t.value.asBuffer. More...
 
using EXECUTE_T = std::function< bool(Instance &, ID_T, const OPAQUE_T &)>
 
using VERIFY_INT_T = std::function< bool(const INT_T &)>
 Data validation function types. More...
 
using VERIFY_UINT_T = std::function< bool(const UINT_T &)>
 
using VERIFY_FLOAT_T = std::function< bool(const FLOAT_T &)>
 
using VERIFY_OPAQUE_T = std::function< bool(const OPAQUE_T &)>
 
using VERIFY_BOOL_T = std::function< bool(const BOOL_T &)>
 
using VERIFY_OBJ_LINK_T = std::function< bool(const OBJ_LINK_T &)>
 
using VERIFY_STRING_T = std::function< bool(const STRING_T &)>
 
using VERIFY_EXECUTE_T = std::function< bool(const EXECUTE_T &)>
 
using VERIFY_CORE_LINK_T = std::function< bool(const CORE_LINK_T &)>
 

Enumerations

enum class  TYPE_ID : uint8_t {
  BOOL , INT , UINT , FLOAT ,
  OBJ_LINK , TIME , OPAQUE , STRING ,
  CORE_LINK , EXECUTE , UNDEFINED
}
 Wpp data types ID. More...
 
enum class  PRIORITY : uint8_t { HIGH , MEDIUM , LOW , DEFAULT = LOW }
 
enum class  IS_SINGLE : uint8_t { SINGLE , MULTIPLE }
 
enum class  IS_MANDATORY : uint8_t { MANDATORY , OPTIONAL }
 
enum  OBJ_ID : ID_T {
  DEVICE = 3 , LWM2M_SERVER = 1 , LWM2M_SECURITY = 0 , CONNECTIVITY_MONITORING = 4 ,
  LWM2M_ACCESS_CONTROL = 2 , FIRMWARE_UPDATE = 5 , MAX_ID = ID_T_MAX_VAL
}
 Enumeration of object IDs in the Wpp library. More...
 
enum  FwUpdRes : uint8_t {
  R_INITIAL = 0 , R_FW_UPD_SUCCESS = 1 , R_NOT_ENOUGH_FLASH = 2 , R_OUT_OF_RAM = 3 ,
  R_CONN_LOST = 4 , R_INTEGRITY_CHECK_FAIL = 5 , R_UNSUPPORTED_PKG_TYPE = 6 , R_INVALID_URI = 7 ,
  R_FW_UPD_FAIL = 8 , R_UNSUPPORTED_PROTOCOL = 9 , UPD_RES_MAX
}
 
enum  FwUpdProtocol : uint8_t {
  COAP = 0 , COAPS = 1 , HTTP = 2 , HTTPS = 3 ,
  COAP_TCP = 4 , COAP_TLS = 5 , FW_UPD_PROTOCOL_MAX
}
 
enum  FwUpdState : uint8_t {
  S_IDLE = 0 , S_DOWNLOADING = 1 , S_DOWNLOADED = 2 , S_UPDATING = 3 ,
  STATE_MAX
}
 
enum  FwUpdDelivery : uint8_t { PULL = 0 , PUSH = 1 , BOTH = 2 , FW_UPD_DELIVERY_MAX }
 

Functions

void * lwm2m_connect_server (uint16_t secObjInstID, void *userData)
 
void lwm2m_close_connection (void *sessionH, void *userData)
 
uint8_t lwm2m_buffer_send (void *sessionH, uint8_t *buffer, size_t length, void *userData)
 
bool lwm2m_session_is_equal (void *session1, void *session2, void *userData)
 
template<typename T >
TYPE_ID dataTypeToID ()
 Determining type ID by real type. More...
 
bool wppBindingValidate (const STRING_T &binding)
 

Variables

const ObjectInfo LWM2M_SECURITY_OBJ_INFO
 
const ObjectInfo LWM2M_SERVER_OBJ_INFO
 
const ObjectInfo DEVICE_OBJ_INFO
 
const ObjectInfo LWM2M_ACCESS_CONTROL_OBJ_INFO
 
const ObjectInfo CONNECTIVITY_MONITORING_OBJ_INFO
 
const ObjectInfo FIRMWARE_UPDATE_OBJ_INFO
 

Detailed Description

The WppConnection class represents a connection interface for the Wpp library.

This class provides an abstract interface for establishing and managing connections in the Wpp library. It defines pure virtual methods that must be implemented by the user to establish a connection, disconnect from a connection, compare session identifiers, and send packets over the connection.

The WppConnection class also provides methods for adding packets to a queue, retrieving the size of the packet queue, clearing the packet queue, and setting/getting the COAP block size.

Note
This class is meant to be subclassed by the user to provide the implementation for the virtual methods.

Typedef Documentation

◆ BOOL_T

using wpp::BOOL_T = typedef bool

Wpp data types bindings.

Definition at line 40 of file WppTypes.h.

◆ CORE_LINK_T

using wpp::CORE_LINK_T = typedef std::string

CoreLink - </3/0> or </1/0/>;ssid=101 or </5>,</4>,</55>;ver=1.9,</55/0>. Represent as string in lwm2m_data_t.value.asBuffer.

Definition at line 62 of file WppTypes.h.

◆ EVENT_ID_T

using wpp::EVENT_ID_T = typedef uint8_t

Definition at line 18 of file WppTypes.h.

◆ EXECUTE_T

using wpp::EXECUTE_T = typedef std::function<bool(Instance&, ID_T, const OPAQUE_T&)>

Definition at line 72 of file WppTypes.h.

◆ FLOAT_T

using wpp::FLOAT_T = typedef double

Definition at line 43 of file WppTypes.h.

◆ ID_T

using wpp::ID_T = typedef uint16_t

Definition at line 15 of file WppTypes.h.

◆ INT_T

using wpp::INT_T = typedef int64_t
Examples
For.

Definition at line 41 of file WppTypes.h.

◆ OPAQUE_T

using wpp::OPAQUE_T = typedef std::vector<uint8_t>

Opaque - represent buffer or string as lwm2m_data_t.value.asBuffer.

Definition at line 49 of file WppTypes.h.

◆ STRING_T

using wpp::STRING_T = typedef std::string

Definition at line 45 of file WppTypes.h.

◆ TIME_T

using wpp::TIME_T = typedef INT_T

Definition at line 44 of file WppTypes.h.

◆ UINT_T

using wpp::UINT_T = typedef uint64_t

Definition at line 42 of file WppTypes.h.

◆ VERIFY_BOOL_T

using wpp::VERIFY_BOOL_T = typedef std::function<bool(const BOOL_T&)>

Definition at line 98 of file WppTypes.h.

◆ VERIFY_CORE_LINK_T

using wpp::VERIFY_CORE_LINK_T = typedef std::function<bool(const CORE_LINK_T &)>

Definition at line 102 of file WppTypes.h.

◆ VERIFY_EXECUTE_T

using wpp::VERIFY_EXECUTE_T = typedef std::function<bool(const EXECUTE_T &)>

Definition at line 101 of file WppTypes.h.

◆ VERIFY_FLOAT_T

using wpp::VERIFY_FLOAT_T = typedef std::function<bool(const FLOAT_T&)>

Definition at line 96 of file WppTypes.h.

◆ VERIFY_INT_T

using wpp::VERIFY_INT_T = typedef std::function<bool(const INT_T&)>

Data validation function types.

Definition at line 94 of file WppTypes.h.

◆ VERIFY_OBJ_LINK_T

using wpp::VERIFY_OBJ_LINK_T = typedef std::function<bool(const OBJ_LINK_T&)>

Definition at line 99 of file WppTypes.h.

◆ VERIFY_OPAQUE_T

using wpp::VERIFY_OPAQUE_T = typedef std::function<bool(const OPAQUE_T&)>

Definition at line 97 of file WppTypes.h.

◆ VERIFY_STRING_T

using wpp::VERIFY_STRING_T = typedef std::function<bool(const STRING_T&)>

Definition at line 100 of file WppTypes.h.

◆ VERIFY_UINT_T

using wpp::VERIFY_UINT_T = typedef std::function<bool(const UINT_T&)>

Definition at line 95 of file WppTypes.h.

Enumeration Type Documentation

◆ FwUpdDelivery

enum wpp::FwUpdDelivery : uint8_t
Enumerator
PULL 
PUSH 
BOTH 
FW_UPD_DELIVERY_MAX 

Definition at line 43 of file FwTypes.h.

◆ FwUpdProtocol

enum wpp::FwUpdProtocol : uint8_t
Enumerator
COAP 
COAPS 
HTTP 
HTTPS 
COAP_TCP 
COAP_TLS 
FW_UPD_PROTOCOL_MAX 

Definition at line 24 of file FwTypes.h.

◆ FwUpdRes

enum wpp::FwUpdRes : uint8_t
Enumerator
R_INITIAL 
R_FW_UPD_SUCCESS 
R_NOT_ENOUGH_FLASH 
R_OUT_OF_RAM 
R_CONN_LOST 
R_INTEGRITY_CHECK_FAIL 
R_UNSUPPORTED_PKG_TYPE 
R_INVALID_URI 
R_FW_UPD_FAIL 
R_UNSUPPORTED_PROTOCOL 
UPD_RES_MAX 

Definition at line 9 of file FwTypes.h.

◆ FwUpdState

enum wpp::FwUpdState : uint8_t
Enumerator
S_IDLE 
S_DOWNLOADING 
S_DOWNLOADED 
S_UPDATING 
STATE_MAX 

Definition at line 35 of file FwTypes.h.

◆ IS_MANDATORY

enum wpp::IS_MANDATORY : uint8_t
strong
Enumerator
MANDATORY 
OPTIONAL 

Definition at line 116 of file WppTypes.h.

◆ IS_SINGLE

enum wpp::IS_SINGLE : uint8_t
strong
Enumerator
SINGLE 
MULTIPLE 

Definition at line 111 of file WppTypes.h.

◆ OBJ_ID

enum wpp::OBJ_ID : ID_T

Enumeration of object IDs in the Wpp library.

This enumeration represents the object IDs used in the Wpp library. It includes both mandatory and optional object IDs.

Enumerator
DEVICE 
LWM2M_SERVER 
LWM2M_SECURITY 
CONNECTIVITY_MONITORING 
LWM2M_ACCESS_CONTROL 
FIRMWARE_UPDATE 
MAX_ID 

Definition at line 14 of file ObjectID.h.

◆ PRIORITY

enum wpp::PRIORITY : uint8_t
strong
Enumerator
HIGH 
MEDIUM 
LOW 
DEFAULT 

Definition at line 104 of file WppTypes.h.

◆ TYPE_ID

enum wpp::TYPE_ID : uint8_t
strong

Wpp data types ID.

Enumerator
BOOL 
INT 
UINT 
FLOAT 
OBJ_LINK 
TIME 
OPAQUE 
STRING 
CORE_LINK 
EXECUTE 
UNDEFINED 

Definition at line 23 of file WppTypes.h.

Function Documentation

◆ dataTypeToID()

template<typename T >
TYPE_ID wpp::dataTypeToID ( )

Determining type ID by real type.

Definition at line 78 of file WppTypes.h.

◆ lwm2m_buffer_send()

uint8_t wpp::lwm2m_buffer_send ( void *  sessionH,
uint8_t *  buffer,
size_t  length,
void *  userData 
)

Definition at line 114 of file WppConnection.cpp.

+ Here is the call graph for this function:

◆ lwm2m_close_connection()

void wpp::lwm2m_close_connection ( void *  sessionH,
void *  userData 
)

Definition at line 103 of file WppConnection.cpp.

+ Here is the call graph for this function:

◆ lwm2m_connect_server()

void* wpp::lwm2m_connect_server ( uint16_t  secObjInstID,
void *  userData 
)

Definition at line 79 of file WppConnection.cpp.

+ Here is the call graph for this function:

◆ lwm2m_session_is_equal()

bool wpp::lwm2m_session_is_equal ( void *  session1,
void *  session2,
void *  userData 
)

Definition at line 127 of file WppConnection.cpp.

+ Here is the call graph for this function:

◆ wppBindingValidate()

bool wpp::wppBindingValidate ( const STRING_T binding)

Definition at line 6 of file WppBindings.cpp.

Variable Documentation

◆ CONNECTIVITY_MONITORING_OBJ_INFO

const ObjectInfo wpp::CONNECTIVITY_MONITORING_OBJ_INFO
inline
Initial value:
= {
"Connectivity Monitoring",
"urn:oma:lwm2m:oma:4:1.3",
{1,3},
{1,1},
IS_SINGLE::SINGLE,
IS_MANDATORY::OPTIONAL,
ItemOp(ItemOp::READ|
ItemOp::WRITE|
ItemOp::DISCOVER|
ItemOp::EXECUTE),
}
@ CONNECTIVITY_MONITORING
Definition: ObjectID.h:29

Definition at line 15 of file ConnectivityMonitoringInfo.h.

◆ DEVICE_OBJ_INFO

const ObjectInfo wpp::DEVICE_OBJ_INFO
inline
Initial value:
= {
"Device",
"urn:oma:lwm2m:oma:3:1.2",
{1,2},
{1,1},
IS_SINGLE::SINGLE,
IS_MANDATORY::MANDATORY,
ItemOp(ItemOp::READ|
ItemOp::WRITE|
ItemOp::DISCOVER|
ItemOp::EXECUTE),
}
@ DEVICE
Definition: ObjectID.h:17

Definition at line 15 of file DeviceInfo.h.

◆ FIRMWARE_UPDATE_OBJ_INFO

const ObjectInfo wpp::FIRMWARE_UPDATE_OBJ_INFO
inline
Initial value:
= {
"Firmware Update",
"urn:oma:lwm2m:oma:5:1.1",
{1,1},
{1,1},
IS_SINGLE::SINGLE,
IS_MANDATORY::OPTIONAL,
ItemOp(ItemOp::READ|
ItemOp::WRITE|
ItemOp::DISCOVER|
ItemOp::EXECUTE),
}
@ FIRMWARE_UPDATE
Definition: ObjectID.h:38

Definition at line 15 of file FirmwareUpdateInfo.h.

◆ LWM2M_ACCESS_CONTROL_OBJ_INFO

const ObjectInfo wpp::LWM2M_ACCESS_CONTROL_OBJ_INFO
inline
Initial value:
= {
"LwM2M Access Control",
"urn:oma:lwm2m:oma:2:1.1",
{1,1},
{1,0},
IS_SINGLE::MULTIPLE,
IS_MANDATORY::OPTIONAL,
ItemOp(ItemOp::CREATE|
ItemOp::DELETE|
ItemOp::READ|
ItemOp::WRITE|
ItemOp::DISCOVER|
ItemOp::EXECUTE),
}
@ LWM2M_ACCESS_CONTROL
Definition: ObjectID.h:32

Definition at line 15 of file Lwm2mAccessControlInfo.h.

◆ LWM2M_SECURITY_OBJ_INFO

const ObjectInfo wpp::LWM2M_SECURITY_OBJ_INFO
inline
Initial value:
= {
"LWM2M Security",
"urn:oma:lwm2m:oma:0:1.1",
{1,1},
{1,1},
IS_SINGLE::MULTIPLE,
IS_MANDATORY::MANDATORY,
ItemOp(ItemOp::CREATE|
ItemOp::DELETE|
ItemOp::READ|
ItemOp::WRITE|
ItemOp::DISCOVER|
ItemOp::EXECUTE),
}
@ LWM2M_SECURITY
Definition: ObjectID.h:23

Definition at line 15 of file Lwm2mSecurityInfo.h.

◆ LWM2M_SERVER_OBJ_INFO

const ObjectInfo wpp::LWM2M_SERVER_OBJ_INFO
inline
Initial value:
= {
"LwM2M Server",
"urn:oma:lwm2m:oma:1:1.1",
{1,1},
{1,1},
IS_SINGLE::MULTIPLE,
IS_MANDATORY::MANDATORY,
ItemOp(ItemOp::CREATE|
ItemOp::DELETE|
ItemOp::READ|
ItemOp::WRITE|
ItemOp::DISCOVER|
ItemOp::EXECUTE),
}
@ LWM2M_SERVER
Definition: ObjectID.h:20

Definition at line 15 of file Lwm2mServerInfo.h.