17 #define TLS_DTLS_ALERT_CODE_MIN 0
18 #define TLS_DTLS_ALERT_CODE_MAX 255
22 #define TAG "Lwm2mServer"
54 if (!inst)
return NULL;
60 if (!inst)
return NULL;
72 lwm2m_update_registration(&
getContext(), serverId,
true,
false);
89 lwm2m_update_server_lifetime(&
getContext(), serverId, lifetime);
91 #if defined(LWM2M_SUPPORT_SENML_JSON) && RES_1_23
95 lwm2m_update_server_mute(&
getContext(), serverId, mute);
102 lwm2m_update_server_disable_timeout(&
getContext(), serverId, timeout);
108 void Lwm2mServer::resourcesCreate() {
176 void Lwm2mServer::resourcesInit() {
201 #ifdef LWM2M_BOOTSTRAP
203 WPP_LOGI(
TAG,
"Deregistration Request Trigger: Deregistration is started");
209 WPP_LOGI(
TAG,
"Deregistration Request Trigger: Deregistration is already in the progress");
231 WPP_LOGI(
TAG,
"Registration Update Trigger: serverId -> %d", serverId);
232 lwm2m_update_registration(&
getContext(), serverId,
false,
true);
240 WPP_LOGI(
TAG,
"Bootstrap Request Trigger: Bootstrap request is started");
242 getContext().state = STATE_BOOTSTRAP_REQUIRED;
246 WPP_LOGI(
TAG,
"Bootstrap Request Trigger: Bootstrap request is already in progress");
#define WPP_LOGI(TAG, FMT,...)
#define WPP_TASK_MIN_DELAY_S
#define SINGLE_INSTANCE_ID
void operationNotify(Instance &inst, const ResLink &resLink, ItemOp::TYPE type)
Notifies the observers about an operation on an instance resource.
Instance is interface class that implements manipulation with derived class resources....
lwm2m_context_t & getContext()
Return context that can be used by derived class.
void notifyResChanged(ID_T resId, ID_T resInstId=ID_T_MAX_VAL)
Notify server about resource value change.
Instance(lwm2m_context_t &context, const OBJ_LINK_T &id)
static bool removeInst(WppClient &ctx, ID_T instId)
Removes an instance of the object.
void serverOperationNotifier(Instance *securityInst, ItemOp::TYPE type, const ResLink &resLink) override
This method must be implemented by the derived class, and handle information about resource operation...
Lwm2mServer(lwm2m_context_t &context, const OBJ_LINK_T &id)
void userOperationNotifier(ItemOp::TYPE type, const ResLink &resLink) override
This method must be implemented by the derived class, and handle information about resource operation...
static Object & object(WppClient &ctx)
Gets the Object reference.
static Lwm2mServer * instance(WppClient &ctx, ID_T instId=ID_T_MAX_VAL)
Gets an instance of the object.
@ NOTIFICATION_STORING_WHEN_DISABLED_OR_OFFLINE_6
@ REGISTRATION_UPDATE_TRIGGER_8
@ BOOTSTRAP_REQUEST_TRIGGER_9
static Lwm2mServer * createInst(WppClient &ctx, ID_T instId=ID_T_MAX_VAL)
Creates an instance of the object.
The Object class implements manipulation with Instance interface class and its inheritors.
Instance * instance(ID_T instanceID=ID_T_MAX_VAL)
Gets an instance of the object.
virtual Instance * createInstance(ID_T instanceID=ID_T_MAX_VAL)=0
Creates an instance of the object.
bool remove(ID_T instanceID)
Removes an instance of the object.
void setupResources(const std::vector< Resource > &resources)
This methods setup resources list.
Resource * resource(ID_T resId)
This method return resource ptr if it exists. If resources does not exist then return NULL.
std::vector< Resource > & resources()
This method return list with all resources that has been defined.
bool set(const T &value, ID_T resInstId=SINGLE_INSTANCE_ID)
Set data value by copy for the resource (instance)
bool setDataVerifier(const DATA_VERIFIER_T &verifier)
Set data verifier for the resource.
const T & get(ID_T resInstId=SINGLE_INSTANCE_ID)
Represents a client interface for Wpp library.
WppRegistry & registry()
Gets the WppRegistry associated with the WppClient.
static bool isTaskExist(task_id_t id)
Returns true if task exists in the queue.
static task_id_t addTask(time_t delaySec, task_t task)
Add task to queue, ctx that passed to task equals to NULL.
static void requestToRemoveTask(task_id_t id)
This function does not immediately delete the task, it only marks it as one that should be deleted at...
The WppConnection class represents a connection interface for the Wpp library.
bool wppBindingValidate(const STRING_T &binding)
bool BOOL_T
Wpp data types bindings.
std::function< bool(Instance &, ID_T, const OPAQUE_T &)> EXECUTE_T
std::function< bool(const STRING_T &)> VERIFY_STRING_T
std::function< bool(const INT_T &)> VERIFY_INT_T
Data validation function types.
std::function< bool(const UINT_T &)> VERIFY_UINT_T
std::vector< uint8_t > OPAQUE_T
Opaque - represent buffer or string as lwm2m_data_t.value.asBuffer.
The ItemOp struct represents the operations that can be performed on a instance/resource.
TYPE
Enum representing the different types of operations.
ObjLink - (object ID):(instance ID), example: 1:3. Represent as two integers in lwm2m_data_t....