18 #define BAT_LVL_MAX 100
55 if (!inst)
return NULL;
56 return static_cast<Device*
>(inst);
61 if (!inst)
return NULL;
62 return static_cast<Device*
>(inst);
86 void Device::resourcesCreate() {
155 void Device::resourcesInit() {
static Device * instance(WppClient &ctx, ID_T instId=ID_T_MAX_VAL)
Gets an instance of the object.
static bool removeInst(WppClient &ctx, ID_T instId)
Removes an instance of the object.
void userOperationNotifier(ItemOp::TYPE type, const ResLink &resLink) override
This method must be implemented by the derived class, and handle information about resource operation...
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...
@ SUPPORTED_BINDING_AND_MODES_16
static Object & object(WppClient &ctx)
Gets the Object reference.
static Device * createInst(WppClient &ctx, ID_T instId=ID_T_MAX_VAL)
Creates an instance of the object.
Device(lwm2m_context_t &context, const OBJ_LINK_T &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....
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)
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 clear()
Remove all instances.
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.
Represents a client interface for Wpp library.
WppRegistry & registry()
Gets the WppRegistry associated with the WppClient.
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)
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::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....