Friendly LWM2M client
FirmwareUpdate.cpp
Go to the documentation of this file.
1 /*
2  * FirmwareUpdate
3  * Generated on: 2024-04-03 15:26:42
4  * Created by: Sinai RnD
5  */
6 
8 
9 #include "Resource.h"
10 #include "ItemOp.h"
11 #include "WppTypes.h"
12 #include "WppLogs.h"
13 #include "WppClient.h"
14 
15 /* --------------- Code_cpp block 0 start --------------- */
16 #include <cstring>
17 #include "WppPlatform.h"
18 
19 #define SCHEME_DIVIDER "://"
20 #define COAP_SCHEME "coap"
21 #define COAPS_SCHEME "coaps"
22 #define HTTP_SCHEME "http"
23 #define HTTPS_SCHEME "https"
24 #define COAP_TCP_SCHEME "coap+tcp"
25 #define COAP_TLS_SCHEME "coaps+tcp"
26 /* --------------- Code_cpp block 0 end --------------- */
27 
28 #define TAG "FirmwareUpdate"
29 
30 namespace wpp {
31 
32 FirmwareUpdate::FirmwareUpdate(lwm2m_context_t &context, const OBJ_LINK_T &id): Instance(context, id) {
33 
34  /* --------------- Code_cpp block 1 start --------------- */
35  _pkgUpdater = NULL;
36  _internalDownloader = NULL;
37  #if RES_5_8
38  _externalDownloader = NULL;
39  _externalDownloaderTaskId = WPP_ERR_TASK_ID;
40  #endif
41  _internalDownloaderTaskId = WPP_ERR_TASK_ID;
42  _updaterTaskId = WPP_ERR_TASK_ID;
43  /* --------------- Code_cpp block 1 end --------------- */
44 
45  resourcesCreate();
46  resourcesInit();
47 
48  /* --------------- Code_cpp block 2 start --------------- */
49  /* --------------- Code_cpp block 2 end --------------- */
50 }
51 
53  /* --------------- Code_cpp block 3 start --------------- */
54  #if RES_5_8
55  WppTaskQueue::requestToRemoveTask(_externalDownloaderTaskId);
56  #endif
57  WppTaskQueue::requestToRemoveTask(_internalDownloaderTaskId);
58  WppTaskQueue::requestToRemoveTask(_updaterTaskId);
59  /* --------------- Code_cpp block 3 end --------------- */
60 }
61 
63  return ctx.registry().firmwareUpdate();
64 }
65 
67  Instance *inst = ctx.registry().firmwareUpdate().instance(instId);
68  if (!inst) return NULL;
69  return static_cast<FirmwareUpdate*>(inst);
70 }
71 
73  Instance *inst = ctx.registry().firmwareUpdate().createInstance(instId);
74  if (!inst) return NULL;
75  return static_cast<FirmwareUpdate*>(inst);
76 }
77 
79  return ctx.registry().firmwareUpdate().remove(instId);
80 }
81 
82 void FirmwareUpdate::serverOperationNotifier(Instance *securityInst, ItemOp::TYPE type, const ResLink &resLink) {
83  /* --------------- Code_cpp block 4 start --------------- */
84  WPP_LOGD(TAG, "Server operation -> type: %d, resId: %d, resInstId: %d", type, resLink.resId, resLink.resInstId);
85  switch (type) {
86  case ItemOp::WRITE: {
87  if (resLink.resId == PACKAGE_0 && _internalDownloader) internalDownloaderHandler();
88  #if RES_5_8
89  if (resLink.resId == PACKAGE_URI_1 && _externalDownloader) externalDownloaderHandler(securityInst);
90  #endif
91  break;
92  }
93  default: break;
94  }
95  /* --------------- Code_cpp block 4 end --------------- */
96 
97  operationNotify(*this, resLink, type);
98 
99  /* --------------- Code_cpp block 5 start --------------- */
100  /* --------------- Code_cpp block 5 end --------------- */
101 }
102 
104  if (type == ItemOp::WRITE || type == ItemOp::DELETE) notifyResChanged(resLink.resId, resLink.resInstId);
105 
106  /* --------------- Code_cpp block 6 start --------------- */
107  WPP_LOGD(TAG, "User operation -> type: %d, resId: %d, resInstId: %d", type, resLink.resId, resLink.resInstId);
108  /* --------------- Code_cpp block 6 end --------------- */
109 }
110 
111 void FirmwareUpdate::resourcesCreate() {
112  std::vector<Resource> resources = {
118  #if RES_5_6
120  #endif
121  #if RES_5_7
123  #endif
124  #if RES_5_8
126  #endif
128  #if RES_5_10
130  #endif
131  #if RES_5_11
133  #endif
134  #if RES_5_12
135  {LAST_STATE_CHANGE_TIME_12, ItemOp(ItemOp::READ), IS_SINGLE::SINGLE, IS_MANDATORY::OPTIONAL, TYPE_ID::TIME },
136  #endif
137  #if RES_5_13
138  {MAXIMUM_DEFER_PERIOD_13, ItemOp(ItemOp::READ|ItemOp::WRITE), IS_SINGLE::SINGLE, IS_MANDATORY::OPTIONAL, TYPE_ID::UINT },
139  #endif
140  };
141  setupResources(std::move(resources));
142 }
143 
144 void FirmwareUpdate::resourcesInit() {
145  /* --------------- Code_cpp block 7 start --------------- */
147  resource(PACKAGE_0)->setDataVerifier((VERIFY_OPAQUE_T)[this](const OPAQUE_T& value) {
148  if (value.empty() || isDeliveryTypeSupported(PUSH)) return true;
149  return false;
150  });
152  resource(PACKAGE_URI_1)->setDataVerifier((VERIFY_STRING_T)[this](const STRING_T& value) { return isUriValid(value); });
153  resource(UPDATE_2)->set<EXECUTE_T>([](Instance& inst, ID_T resId, const OPAQUE_T& data) { return true; });
155  resource(STATE_3)->setDataVerifier((VERIFY_INT_T)[](const INT_T& value) {
156  if (S_IDLE > value || value >= STATE_MAX) return false;
157  return true;
158  });
161  if (R_INITIAL > value || value >= UPD_RES_MAX) return false;
162  return true;
163  });
164  #if RES_5_6
166  #endif
167  #if RES_5_7
169  #endif
170  #if RES_5_8
171  resource(FIRMWARE_UPDATE_PROTOCOL_SUPPORT_8)->setDataVerifier((VERIFY_INT_T)[](const INT_T& value) { return COAP <= value && value < FW_UPD_PROTOCOL_MAX; });
172  #endif
174  resource(FIRMWARE_UPDATE_DELIVERY_METHOD_9)->setDataVerifier((VERIFY_INT_T)[](const INT_T& value) { return PULL <= value && value < FW_UPD_DELIVERY_MAX; });
175  /* --------------- Code_cpp block 7 end --------------- */
176 }
177 
178 /* --------------- Code_cpp block 8 start --------------- */
181  if (!fw) return false;
182 
183  fw->resetStateMachine();
184  fw->clearArtifacts();
185 
186  fw->_pkgUpdater = &updater;
187  // Set the update method
188  fw->resource(UPDATE_2)->set<EXECUTE_T>([fw](Instance& inst, ID_T resId, const OPAQUE_T& data) { return fw->pkgUpdaterHandler(); });
189  // Set last update result
192  // Set the package name and version
193  #if RES_5_6
194  fw->resource(PKGNAME_6)->set<STRING_T>(updater.pkgName());
196  #endif
197  #if RES_5_7
198  fw->resource(PKGVERSION_7)->set<STRING_T>(updater.pkgVersion());
200  #endif
201 
202  return true;
203 }
204 
205 #if RES_5_8
206 std::vector<FwUpdProtocol> FirmwareUpdate::supportedProtocols(WppClient &ctx) {
208  if (!fw) return {};
209 
210  std::vector<FwUpdProtocol> supportedProtocols;
211  for (auto id : fw->resource(FIRMWARE_UPDATE_PROTOCOL_SUPPORT_8)->instIds()) {
213  supportedProtocols.push_back(FwUpdProtocol(protocol));
214  }
215  return supportedProtocols;
216 }
217 
218 bool FirmwareUpdate::setFwExternalDownloader(WppClient &ctx, FwExternalDl &downloader) {
220  if (!fw) return false;
221 
222  fw->resetStateMachine();
223  fw->clearArtifacts();
224 
225  fw->_externalDownloader = &downloader;
226 
227  std::vector<FwUpdProtocol> dlSupportedProtocols = fw->_externalDownloader->supportedProtocols();
228  if (dlSupportedProtocols.empty()) {
229  fw->_externalDownloader = NULL;
230  return false;
231  }
232 
233  // Setup delivery type
234  if (fw->_internalDownloader) fw->resource(FIRMWARE_UPDATE_DELIVERY_METHOD_9)->set<INT_T>(BOTH);
235  else fw->resource(FIRMWARE_UPDATE_DELIVERY_METHOD_9)->set<INT_T>(PULL);
236  fw->notifyResChanged(FIRMWARE_UPDATE_DELIVERY_METHOD_9);
237 
238  // Setup supported protocols
239  ID_T instId = 0;
240  fw->resource(FIRMWARE_UPDATE_PROTOCOL_SUPPORT_8)->clear();
241  for (auto prot : dlSupportedProtocols) {
242  fw->resource(FIRMWARE_UPDATE_PROTOCOL_SUPPORT_8)->set<INT_T>(prot, instId);
243  instId++;
244  }
245  fw->notifyResChanged(FIRMWARE_UPDATE_PROTOCOL_SUPPORT_8);
246 
247  return true;
248 }
249 #endif
250 
253  if (!fw) return false;
254 
255  // TODO: Update the implementation of this method after creating an
256  // interface for downloading firmware via uri using the wpp library.
257  // Currently, FwInternalDl only supports loading through the PACKAGE_0 resource.
258  fw->resetStateMachine();
259  fw->clearArtifacts();
260 
261  fw->_internalDownloader = &downloader;
262 
263  // Setup delivery type
264  #if RES_5_8
265  if (fw->_externalDownloader) fw->resource(FIRMWARE_UPDATE_DELIVERY_METHOD_9)->set<INT_T>(BOTH);
267  #else
269  #endif
271 
272  return true;
273 }
274 
275 bool FirmwareUpdate::pkgUpdaterHandler() {
276  INT_T state = resource(STATE_3)->get<INT_T>();
277  if (state != S_DOWNLOADED) return false;
278 
279  _pkgUpdater->startUpdating();
280  changeState(S_UPDATING);
281 
282  _updaterTaskId = WppTaskQueue::addTask(WPP_TASK_MIN_DELAY_S, [this](WppClient &client, void *ctx) -> bool {
283  if (!_pkgUpdater->isUpdated()) return false;
284 
285  FwUpdRes res = _pkgUpdater->lastUpdateResult();
286  changeState(S_IDLE);
287  changeUpdRes(res);
288 
289  if (res == R_FW_UPD_SUCCESS) {
290  #if RES_5_6
291  resource(PKGNAME_6)->set<STRING_T>(_pkgUpdater->pkgName());
293  #endif
294  #if RES_5_7
295  resource(PKGVERSION_7)->set<STRING_T>(_pkgUpdater->pkgVersion());
297  #endif
298  #if RES_3_3
299  Device::instance(client)->set<STRING_T>(Device::FIRMWARE_VERSION_3, _pkgUpdater->pkgVersion());
300  #endif
301  }
302 
303  return true;
304  });
305 
306  return true;
307 }
308 
309 #if RES_5_8
310 void FirmwareUpdate::externalDownloaderHandler(Instance *securityInst) {
311  if (!securityInst) {
312  WPP_LOGE(TAG, "Security object instance is not set");
313  return;
314  }
315 
316  resetStateMachine();
318  if (pkgUri.empty()) {
319  clearArtifacts();
320  WPP_LOGD(TAG, "Server reset state machine through PACKAGE_URI_1");
321  return;
322  }
323 
324  _externalDownloader->startDownloading(pkgUri, *static_cast<Lwm2mSecurity*>(securityInst));
325  changeState(S_DOWNLOADING);
326 
327  _externalDownloaderTaskId = WppTaskQueue::addTask(WPP_TASK_MIN_DELAY_S, [this](WppClient &client, void *ctx) -> bool {
328  if (!_externalDownloader->isDownloaded()) return false;
329 
330  FwUpdRes res = _externalDownloader->downloadResult();
331  if (res != R_INITIAL) changeState(S_IDLE);
332  else changeState(S_DOWNLOADED);
333 
334  changeUpdRes(res);
335 
336  return true;
337  });
338 }
339 #endif
340 
341 void FirmwareUpdate::internalDownloaderHandler() {
342  // TODO: Update the implementation of this method after creating an
343  // interface for downloading firmware via uri using the wpp library.
344  // Currently, FwInternalDl only supports loading through the PACKAGE_0 resource.
345  resetStateMachine();
346  const OPAQUE_T &pkg = resource(PACKAGE_0)->get<OPAQUE_T>();
347  if (pkg.empty()) {
348  clearArtifacts();
349  WPP_LOGD(TAG, "Server reset state machine through PACKAGE_0");
350  return;
351  }
352 
353  _internalDownloader->downloadIsStarted();
354  changeState(S_DOWNLOADING);
355 
356  _internalDownloaderTaskId = WppTaskQueue::addTask(WPP_TASK_MIN_DELAY_S, [this](WppClient &client, void *ctx) -> bool {
357  const OPAQUE_T &pkg = resource(PACKAGE_0)->get<OPAQUE_T>();
358 
359  _internalDownloader->saveDownloadedBlock(pkg);
360  _internalDownloader->downloadIsCompleted();
361  if (_internalDownloader->downloadResult() != R_INITIAL) changeState(S_IDLE);
362  else changeState(S_DOWNLOADED);
363 
364  changeUpdRes(_internalDownloader->downloadResult());
365 
366  return true;
367  });
368 }
369 
370 void FirmwareUpdate::changeUpdRes(FwUpdRes res) {
373 }
374 
375 void FirmwareUpdate::changeState(FwUpdState state) {
376  resource(STATE_3)->set<INT_T>(state);
378 }
379 
380 void FirmwareUpdate::resetStateMachine() {
381  #if RES_5_8
382  WppTaskQueue::requestToRemoveTask(_externalDownloaderTaskId);
383  _externalDownloaderTaskId = WPP_ERR_TASK_ID;
384  #endif
385  WppTaskQueue::requestToRemoveTask(_internalDownloaderTaskId);
386  _internalDownloaderTaskId = WPP_ERR_TASK_ID;
387  WppTaskQueue::requestToRemoveTask(_updaterTaskId);
388  _updaterTaskId = WPP_ERR_TASK_ID;
389 
390  if (_internalDownloader) _internalDownloader->reset();
391  #if RES_5_8
392  if (_externalDownloader) _externalDownloader->reset();
393  #endif
394  if (_pkgUpdater) _pkgUpdater->reset();
395 
396  changeState(S_IDLE);
397  changeUpdRes(R_INITIAL);
398 }
399 
400 void FirmwareUpdate::clearArtifacts() {
405 }
406 
407 bool FirmwareUpdate::isUriValid(STRING_T uri) {
408  if (uri.empty()) return true;
409  if (!isDeliveryTypeSupported(PULL)) return false;
410 
411  STRING_T scheme = extractSchemeFromUri(uri);
412  if (!isSchemeValid(scheme)) {
413  changeUpdRes(R_INVALID_URI);
414  return false;
415  }
416 
417  #if RES_5_8
418  if (!isSchemeSupported(scheme)) {
419  changeUpdRes(R_UNSUPPORTED_PROTOCOL);
420  return false;
421  }
422  #endif
423 
424  return true;
425 }
426 
427 STRING_T FirmwareUpdate::extractSchemeFromUri(STRING_T uri) {
428  size_t startsAt = uri.find(SCHEME_DIVIDER);
429  if (startsAt == std::string::npos) return STRING_T("");
430  return uri.substr(0, startsAt);
431 }
432 
433 bool FirmwareUpdate::isSchemeValid(STRING_T scheme) {
434  if (scheme.empty()) return false;
435 
437  for (auto s : validSchemes) {
438  if (!std::strcmp(scheme.c_str(), s)) return true;
439  }
440  return false;
441 }
442 
443 #if RES_5_8
444 bool FirmwareUpdate::isSchemeSupported(STRING_T scheme) {
445  FwUpdProtocol requiredProt = schemeToProtId(scheme);
448  if (requiredProt == suppProt) return true;
449  }
450  return false;
451 }
452 
453 FwUpdProtocol FirmwareUpdate::schemeToProtId(STRING_T scheme) {
454  if (!std::strcmp(scheme.c_str(), COAP_SCHEME)) return COAP;
455  else if (!std::strcmp(scheme.c_str(), COAPS_SCHEME)) return COAPS;
456  else if (!std::strcmp(scheme.c_str(), HTTP_SCHEME)) return HTTP;
457  else if (!std::strcmp(scheme.c_str(), HTTPS_SCHEME)) return HTTPS;
458  else if (!std::strcmp(scheme.c_str(), COAP_TCP_SCHEME)) return COAP_TCP;
459  else if (!std::strcmp(scheme.c_str(), COAP_TLS_SCHEME)) return COAP_TLS;
460  else return FW_UPD_PROTOCOL_MAX;
461 }
462 #endif
463 
464 bool FirmwareUpdate::isDeliveryTypeSupported(FwUpdDelivery type) {
466  if (deliveryType == type || deliveryType == BOTH) return true;
467  return false;
468 }
469 /* --------------- Code_cpp block 8 end --------------- */
470 
471 } /* namespace wpp */
#define HTTP_SCHEME
#define HTTPS_SCHEME
#define COAP_TCP_SCHEME
#define COAP_TLS_SCHEME
#define COAPS_SCHEME
#define SCHEME_DIVIDER
#define COAP_SCHEME
#define TAG
#define WPP_LOGE(TAG, FMT,...)
Definition: WppLogs.h:49
#define WPP_LOGD(TAG, FMT,...)
Definition: WppLogs.h:31
#define WPP_TASK_MIN_DELAY_S
Definition: WppTaskQueue.h:17
#define WPP_ERR_TASK_ID
Definition: WppTaskQueue.h:22
static Device * instance(WppClient &ctx, ID_T instId=ID_T_MAX_VAL)
Gets an instance of the object.
Definition: Device.cpp:53
@ FIRMWARE_VERSION_3
Definition: Device.h:41
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...
static bool setFwExternalDownloader(WppClient &ctx, FwExternalDl &downloader)
Set the FwExternalDl object for downloading the firmware package from the specified URI.
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 bool setFwInternalDownloader(WppClient &ctx, FwInternalDl &downloader)
Set the FwInternalDl object for auto downloading firmware.
static std::vector< FwUpdProtocol > supportedProtocols(WppClient &ctx)
Return the list of supported protocols for downloading the firmware through uri.
static bool setFwUpdater(WppClient &ctx, FwUpdater &updater)
Set the FwUpdater object for updating the firmware package.
FirmwareUpdate(lwm2m_context_t &context, const OBJ_LINK_T &id)
static FirmwareUpdate * 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.
static Object & object(WppClient &ctx)
Gets the Object reference.
static FirmwareUpdate * createInst(WppClient &ctx, ID_T instId=ID_T_MAX_VAL)
Creates an instance of the object.
virtual bool saveDownloadedBlock(const OPAQUE_T &dataBlock)=0
Request to save downloaded block of the firmware package.
virtual void reset()=0
Reset the download process. When this method is called, the download process is reset and the downloa...
virtual void downloadIsCompleted()=0
Notify about dwnloading process completion. Regardless of the reason for the termination,...
virtual FwUpdRes downloadResult()=0
Contains the result of the download process. Possible results when download is successful: R_INITIAL ...
virtual void downloadIsStarted()=0
Notify about dwnloading process start.
virtual void startUpdating()=0
Request to start updating the firmware. For notify that the update is completed, isUpdated() method s...
virtual FwUpdRes lastUpdateResult()=0
Contains the result of the last update process. This method is called whenever the FwExternalDl is re...
virtual void reset()=0
Returns the name and version of the last installed firmware package. These methods return the value o...
virtual bool isUpdated()=0
Returns true if the update process is completed. For notify update result, lastUpdateResult() method ...
void operationNotify(Instance &inst, const ResLink &resLink, ItemOp::TYPE type)
Notifies the observers about an operation on an instance resource.
Definition: InstSubject.h:78
Instance is interface class that implements manipulation with derived class resources....
Definition: Instance.h:40
void notifyResChanged(ID_T resId, ID_T resInstId=ID_T_MAX_VAL)
Notify server about resource value change.
Definition: Instance.cpp:17
Instance(lwm2m_context_t &context, const OBJ_LINK_T &id)
Definition: Instance.h:42
The Object class implements manipulation with Instance interface class and its inheritors.
Definition: Object.h:32
Instance * instance(ID_T instanceID=ID_T_MAX_VAL)
Gets an instance of the object.
Definition: Object.cpp:102
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.
Definition: Object.cpp:82
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< ID_T > instIds(ID_T resId)
Returns vector with available ids of resource instances.
std::vector< Resource > & resources()
This method return list with all resources that has been defined.
bool set(ID_T resId, const T &value)
Set data value by copy for the resource.
bool set(const T &value, ID_T resInstId=SINGLE_INSTANCE_ID)
Set data value by copy for the resource (instance)
Definition: Resource.h:253
std::vector< ID_T > instIds() const
Returns vector with available ids of resource instances.
Definition: Resource.cpp:127
bool setDataVerifier(const DATA_VERIFIER_T &verifier)
Set data verifier for the resource.
Definition: Resource.cpp:164
const T & get(ID_T resInstId=SINGLE_INSTANCE_ID)
Definition: Resource.h:290
Represents a client interface for Wpp library.
Definition: WppClient.h:37
WppRegistry & registry()
Gets the WppRegistry associated with the WppClient.
Definition: WppClient.cpp:93
Object & firmwareUpdate()
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.
Definition: WppClient.cpp:14
FwUpdState
Definition: FwTypes.h:35
@ S_DOWNLOADED
Definition: FwTypes.h:38
@ S_DOWNLOADING
Definition: FwTypes.h:37
@ STATE_MAX
Definition: FwTypes.h:40
@ S_IDLE
Definition: FwTypes.h:36
@ S_UPDATING
Definition: FwTypes.h:39
FwUpdDelivery
Definition: FwTypes.h:43
@ FW_UPD_DELIVERY_MAX
Definition: FwTypes.h:47
@ PUSH
Definition: FwTypes.h:45
@ BOTH
Definition: FwTypes.h:46
@ PULL
Definition: FwTypes.h:44
FwUpdProtocol
Definition: FwTypes.h:24
@ HTTP
Definition: FwTypes.h:27
@ COAP_TLS
Definition: FwTypes.h:30
@ COAPS
Definition: FwTypes.h:26
@ HTTPS
Definition: FwTypes.h:28
@ FW_UPD_PROTOCOL_MAX
Definition: FwTypes.h:31
@ COAP
Definition: FwTypes.h:25
@ COAP_TCP
Definition: FwTypes.h:29
std::function< bool(Instance &, ID_T, const OPAQUE_T &)> EXECUTE_T
Definition: WppTypes.h:72
int64_t INT_T
Definition: WppTypes.h:41
uint16_t ID_T
Definition: WppTypes.h:15
std::function< bool(const STRING_T &)> VERIFY_STRING_T
Definition: WppTypes.h:100
std::function< bool(const INT_T &)> VERIFY_INT_T
Data validation function types.
Definition: WppTypes.h:94
FwUpdRes
Definition: FwTypes.h:9
@ R_FW_UPD_SUCCESS
Definition: FwTypes.h:11
@ R_UNSUPPORTED_PROTOCOL
Definition: FwTypes.h:19
@ UPD_RES_MAX
Definition: FwTypes.h:20
@ R_INITIAL
Definition: FwTypes.h:10
@ R_INVALID_URI
Definition: FwTypes.h:17
std::string STRING_T
Definition: WppTypes.h:45
std::vector< uint8_t > OPAQUE_T
Opaque - represent buffer or string as lwm2m_data_t.value.asBuffer.
Definition: WppTypes.h:49
std::function< bool(const OPAQUE_T &)> VERIFY_OPAQUE_T
Definition: WppTypes.h:97
The ItemOp struct represents the operations that can be performed on a instance/resource.
Definition: ItemOp.h:24
TYPE
Enum representing the different types of operations.
Definition: ItemOp.h:29
@ DELETE
Definition: ItemOp.h:36
@ EXECUTE
Definition: ItemOp.h:33