net: lwm2m: remove deprecated functions & definition
These functions have been deprecated for more than 2 releases,
remove them:
- lwm2m_engine_update_observer_min_period
- lwm2m_engine_update_observer_max_period
- lwm2m_engine_create_obj_inst
- lwm2m_engine_delete_obj_inst
- lwm2m_engine_set_opaque
- lwm2m_engine_set_string
- lwm2m_engine_set_u8
- lwm2m_engine_set_u16
- lwm2m_engine_set_u32
- lwm2m_engine_set_u64
- lwm2m_engine_set_s8
- lwm2m_engine_set_s16
- lwm2m_engine_set_s32
- lwm2m_engine_set_s64
- lwm2m_engine_set_bool
- lwm2m_engine_set_float
- lwm2m_engine_set_objlnk
- lwm2m_engine_set_time
- lwm2m_engine_get_opaque
- lwm2m_engine_get_string
- lwm2m_engine_get_u8
- lwm2m_engine_get_u16
- lwm2m_engine_get_u32
- lwm2m_engine_get_u64
- lwm2m_engine_get_s8
- lwm2m_engine_get_s16
- lwm2m_engine_get_s32
- lwm2m_engine_get_s64
- lwm2m_engine_get_bool
- lwm2m_engine_get_float
- lwm2m_engine_get_objlnk
- lwm2m_engine_get_time
- lwm2m_engine_register_read_callback
- lwm2m_engine_register_pre_write_callback
- lwm2m_engine_register_validate_callback
- lwm2m_engine_register_post_write_callback
- lwm2m_engine_register_exec_callback
- lwm2m_engine_register_create_callback
- lwm2m_engine_register_delete_callback
- lwm2m_engine_set_res_buf
- lwm2m_engine_set_res_data
- lwm2m_engine_set_res_data_len
- lwm2m_engine_get_res_buf
- lwm2m_engine_get_res_data
- lwm2m_engine_create_res_inst
- lwm2m_engine_delete_res_inst
- lwm2m_engine_path_is_observed
- lwm2m_engine_send
- lwm2m_send
- lwm2m_engine_enable_cache
And additionally, the following definition:
- LWM2M_RD_CLIENT_EVENT_REG_UPDATE_FAILURE
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
diff --git a/include/zephyr/net/lwm2m.h b/include/zephyr/net/lwm2m.h
index 0ae5314..8fb5a1e 100644
--- a/include/zephyr/net/lwm2m.h
+++ b/include/zephyr/net/lwm2m.h
@@ -310,8 +310,8 @@
* of using the resource's data buffer.
*
* The client or LwM2M objects can register a function of this type via:
- * lwm2m_engine_register_read_callback()
- * lwm2m_engine_register_pre_write_callback()
+ * lwm2m_register_read_callback()
+ * lwm2m_register_pre_write_callback()
*
* @param[in] obj_inst_id Object instance ID generating the callback.
* @param[in] res_id Resource ID generating the callback.
@@ -338,8 +338,8 @@
* Beginning of the block transfer has the offset set to 0.
*
* A function of this type can be registered via:
- * lwm2m_engine_register_validate_callback()
- * lwm2m_engine_register_post_write_callback()
+ * lwm2m_register_validate_callback()
+ * lwm2m_register_post_write_callback()
*
* @param[in] obj_inst_id Object instance ID generating the callback.
* @param[in] res_id Resource ID generating the callback.
@@ -370,8 +370,8 @@
* and object instance delete.
*
* Register a function of this type via:
- * lwm2m_engine_register_create_callback()
- * lwm2m_engine_register_delete_callback()
+ * lwm2m_register_create_callback()
+ * lwm2m_register_delete_callback()
*
* @param[in] obj_inst_id Object instance ID generating the callback.
*
@@ -386,7 +386,7 @@
* Resource executes trigger a callback of this type.
*
* Register a function of this type via:
- * lwm2m_engine_register_exec_callback()
+ * lwm2m_register_exec_callback()
*
* @param[in] obj_inst_id Object instance ID generating the callback.
* @param[in] args Pointer to execute arguments payload. (This can be
@@ -438,7 +438,7 @@
* @name Battery status codes used for the "Battery Status" resource (3/0/20)
* of the LwM2M Device object. As the battery status changes, an LwM2M
* client can set one of the following codes via:
- * lwm2m_engine_set_u8("3/0/20", [battery status])
+ * lwm2m_set_u8("3/0/20", [battery status])
* @{
*/
#define LWM2M_DEVICE_BATTERY_STATUS_NORMAL 0 /**< The battery is operating normally and not on
@@ -496,7 +496,7 @@
* @name LWM2M Firmware Update object result codes
*
* After processing a firmware update, the client sets the result via one of
- * the following codes via lwm2m_engine_set_u8("5/0/5", [result code])
+ * the following codes via lwm2m_set_u8("5/0/5", [result code])
* @{
*/
@@ -747,26 +747,6 @@
/**
* @brief Change an observer's pmin value.
*
- * @deprecated Use lwm2m_update_observer_min_period() instead.
- *
- * LwM2M clients use this function to modify the pmin attribute
- * for an observation being made.
- * Example to update the pmin of a temperature sensor value being observed:
- * lwm2m_engine_update_observer_min_period("client_ctx, 3303/0/5700", 5);
- *
- * @param[in] client_ctx LwM2M context
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res"
- * @param[in] period_s Value of pmin to be given (in seconds).
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_update_observer_min_period(struct lwm2m_ctx *client_ctx, const char *pathstr,
- uint32_t period_s);
-
-/**
- * @brief Change an observer's pmin value.
- *
* LwM2M clients use this function to modify the pmin attribute
* for an observation being made.
* Example to update the pmin of a temperature sensor value being observed:
@@ -784,26 +764,6 @@
/**
* @brief Change an observer's pmax value.
*
- * @deprecated Use lwm2m_update_observer_max_period() instead.
- *
- * LwM2M clients use this function to modify the pmax attribute
- * for an observation being made.
- * Example to update the pmax of a temperature sensor value being observed:
- * lwm2m_engine_update_observer_max_period("client_ctx, 3303/0/5700", 5);
- *
- * @param[in] client_ctx LwM2M context
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res"
- * @param[in] period_s Value of pmax to be given (in seconds).
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_update_observer_max_period(struct lwm2m_ctx *client_ctx, const char *pathstr,
- uint32_t period_s);
-
-/**
- * @brief Change an observer's pmax value.
- *
* LwM2M clients use this function to modify the pmax attribute
* for an observation being made.
* Example to update the pmax of a temperature sensor value being observed:
@@ -821,22 +781,6 @@
/**
* @brief Create an LwM2M object instance.
*
- * @deprecated Use lwm2m_create_obj_inst() instead.
- *
- * LwM2M clients use this function to create non-default LwM2M objects:
- * Example to create first temperature sensor object:
- * lwm2m_engine_create_obj_inst("3303/0");
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst"
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_create_obj_inst(const char *pathstr);
-
-/**
- * @brief Create an LwM2M object instance.
- *
* LwM2M clients use this function to create non-default LwM2M objects:
* Example to create first temperature sensor object:
* lwm2m_create_obj_inst(&LWM2M_OBJ(3303, 0));
@@ -850,20 +794,6 @@
/**
* @brief Delete an LwM2M object instance.
*
- * @deprecated Use lwm2m_delete_obj_inst() instead.
- *
- * LwM2M clients use this function to delete LwM2M objects.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst"
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_delete_obj_inst(const char *pathstr);
-
-/**
- * @brief Delete an LwM2M object instance.
- *
* LwM2M clients use this function to delete LwM2M objects.
*
* @param[in] path LwM2M path as a struct
@@ -890,20 +820,6 @@
/**
* @brief Set resource (instance) value (opaque buffer)
*
- * @deprecated Use lwm2m_set_opaque() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] data_ptr Data buffer
- * @param[in] data_len Length of buffer
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_opaque(const char *pathstr, const char *data_ptr, uint16_t data_len);
-
-/**
- * @brief Set resource (instance) value (opaque buffer)
- *
* @param[in] path LwM2M path as a struct
* @param[in] data_ptr Data buffer
* @param[in] data_len Length of buffer
@@ -915,19 +831,6 @@
/**
* @brief Set resource (instance) value (string)
*
- * @deprecated Use lwm2m_set_string() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] data_ptr NULL terminated char buffer
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_string(const char *pathstr, const char *data_ptr);
-
-/**
- * @brief Set resource (instance) value (string)
- *
* @param[in] path LwM2M path as a struct
* @param[in] data_ptr NULL terminated char buffer
*
@@ -938,19 +841,6 @@
/**
* @brief Set resource (instance) value (u8)
*
- * @deprecated Use lwm2m_set_u8() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] value u8 value
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_u8(const char *pathstr, uint8_t value);
-
-/**
- * @brief Set resource (instance) value (u8)
- *
* @param[in] path LwM2M path as a struct
* @param[in] value u8 value
*
@@ -961,19 +851,6 @@
/**
* @brief Set resource (instance) value (u16)
*
- * @deprecated Use lwm2m_set_u16() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] value u16 value
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_u16(const char *pathstr, uint16_t value);
-
-/**
- * @brief Set resource (instance) value (u16)
- *
* @param[in] path LwM2M path as a struct
* @param[in] value u16 value
*
@@ -984,19 +861,6 @@
/**
* @brief Set resource (instance) value (u32)
*
- * @deprecated Use lwm2m_set_u32() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] value u32 value
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_u32(const char *pathstr, uint32_t value);
-
-/**
- * @brief Set resource (instance) value (u32)
- *
* @param[in] path LwM2M path as a struct
* @param[in] value u32 value
*
@@ -1007,19 +871,6 @@
/**
* @brief Set resource (instance) value (u64)
*
- * @deprecated Use lwm2m_set_u64() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] value u64 value
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_u64(const char *pathstr, uint64_t value);
-
-/**
- * @brief Set resource (instance) value (u64)
- *
* @deprecated Unsigned 64bit value type does not exits.
* This is internally handled as a int64_t.
* Use lwm2m_set_s64() instead.
@@ -1035,19 +886,6 @@
/**
* @brief Set resource (instance) value (s8)
*
- * @deprecated Use lwm2m_set_s8() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] value s8 value
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_s8(const char *pathstr, int8_t value);
-
-/**
- * @brief Set resource (instance) value (s8)
- *
* @param[in] path LwM2M path as a struct
* @param[in] value s8 value
*
@@ -1058,19 +896,6 @@
/**
* @brief Set resource (instance) value (s16)
*
- * @deprecated Use lwm2m_set_s16() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] value s16 value
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_s16(const char *pathstr, int16_t value);
-
-/**
- * @brief Set resource (instance) value (s16)
- *
* @param[in] path LwM2M path as a struct
* @param[in] value s16 value
*
@@ -1081,19 +906,6 @@
/**
* @brief Set resource (instance) value (s32)
*
- * @deprecated Use lwm2m_set_s32() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] value s32 value
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_s32(const char *pathstr, int32_t value);
-
-/**
- * @brief Set resource (instance) value (s32)
- *
* @param[in] path LwM2M path as a struct
* @param[in] value s32 value
*
@@ -1104,19 +916,6 @@
/**
* @brief Set resource (instance) value (s64)
*
- * @deprecated Use lwm2m_set_s64() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] value s64 value
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_s64(const char *pathstr, int64_t value);
-
-/**
- * @brief Set resource (instance) value (s64)
- *
* @param[in] path LwM2M path as a struct
* @param[in] value s64 value
*
@@ -1127,19 +926,6 @@
/**
* @brief Set resource (instance) value (bool)
*
- * @deprecated Use lwm2m_set_bool() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] value bool value
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_bool(const char *pathstr, bool value);
-
-/**
- * @brief Set resource (instance) value (bool)
- *
* @param[in] path LwM2M path as a struct
* @param[in] value bool value
*
@@ -1150,19 +936,6 @@
/**
* @brief Set resource (instance) value (double)
*
- * @deprecated Use lwm2m_set_f64() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] value double value
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_float(const char *pathstr, const double *value);
-
-/**
- * @brief Set resource (instance) value (double)
- *
* @param[in] path LwM2M path as a struct
* @param[in] value double value
*
@@ -1173,19 +946,6 @@
/**
* @brief Set resource (instance) value (Objlnk)
*
- * @deprecated Use lwm2m_set_objlnk() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] value pointer to the lwm2m_objlnk structure
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_objlnk(const char *pathstr, const struct lwm2m_objlnk *value);
-
-/**
- * @brief Set resource (instance) value (Objlnk)
- *
* @param[in] path LwM2M path as a struct
* @param[in] value pointer to the lwm2m_objlnk structure
*
@@ -1196,19 +956,6 @@
/**
* @brief Set resource (instance) value (Time)
*
- * @deprecated Use lwm2m_set_time() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] value Epoch timestamp
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_time(const char *pathstr, time_t value);
-
-/**
- * @brief Set resource (instance) value (Time)
- *
* @param[in] path LwM2M path as a struct
* @param[in] value Epoch timestamp
*
@@ -1265,20 +1012,6 @@
/**
* @brief Get resource (instance) value (opaque buffer)
*
- * @deprecated Use lwm2m_get_opaque() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] buf Data buffer to copy data into
- * @param[in] buflen Length of buffer
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_opaque(const char *pathstr, void *buf, uint16_t buflen);
-
-/**
- * @brief Get resource (instance) value (opaque buffer)
- *
* @param[in] path LwM2M path as a struct
* @param[out] buf Data buffer to copy data into
* @param[in] buflen Length of buffer
@@ -1290,20 +1023,6 @@
/**
* @brief Get resource (instance) value (string)
*
- * @deprecated Use lwm2m_get_string() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] str String buffer to copy data into
- * @param[in] buflen Length of buffer
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_string(const char *pathstr, void *str, uint16_t buflen);
-
-/**
- * @brief Get resource (instance) value (string)
- *
* @param[in] path LwM2M path as a struct
* @param[out] str String buffer to copy data into
* @param[in] buflen Length of buffer
@@ -1315,19 +1034,6 @@
/**
* @brief Get resource (instance) value (u8)
*
- * @deprecated Use lwm2m_get_u8() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] value u8 buffer to copy data into
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_u8(const char *pathstr, uint8_t *value);
-
-/**
- * @brief Get resource (instance) value (u8)
- *
* @param[in] path LwM2M path as a struct
* @param[out] value u8 buffer to copy data into
*
@@ -1338,19 +1044,6 @@
/**
* @brief Get resource (instance) value (u16)
*
- * @deprecated Use lwm2m_get_u16() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] value u16 buffer to copy data into
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_u16(const char *pathstr, uint16_t *value);
-
-/**
- * @brief Get resource (instance) value (u16)
- *
* @param[in] path LwM2M path as a struct
* @param[out] value u16 buffer to copy data into
*
@@ -1361,19 +1054,6 @@
/**
* @brief Get resource (instance) value (u32)
*
- * @deprecated Use lwm2m_get_u32() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] value u32 buffer to copy data into
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_u32(const char *pathstr, uint32_t *value);
-
-/**
- * @brief Get resource (instance) value (u32)
- *
* @param[in] path LwM2M path as a struct
* @param[out] value u32 buffer to copy data into
*
@@ -1384,19 +1064,6 @@
/**
* @brief Get resource (instance) value (u64)
*
- * @deprecated Use lwm2m_get_u64() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] value u64 buffer to copy data into
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_u64(const char *pathstr, uint64_t *value);
-
-/**
- * @brief Get resource (instance) value (u64)
- *
* @deprecated Unsigned 64bit value type does not exits.
* This is internally handled as a int64_t.
* Use lwm2m_get_s64() instead.
@@ -1412,19 +1079,6 @@
/**
* @brief Get resource (instance) value (s8)
*
- * @deprecated Use lwm2m_get_s8() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] value s8 buffer to copy data into
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_s8(const char *pathstr, int8_t *value);
-
-/**
- * @brief Get resource (instance) value (s8)
- *
* @param[in] path LwM2M path as a struct
* @param[out] value s8 buffer to copy data into
*
@@ -1435,19 +1089,6 @@
/**
* @brief Get resource (instance) value (s16)
*
- * @deprecated Use lwm2m_get_s16() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] value s16 buffer to copy data into
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_s16(const char *pathstr, int16_t *value);
-
-/**
- * @brief Get resource (instance) value (s16)
- *
* @param[in] path LwM2M path as a struct
* @param[out] value s16 buffer to copy data into
*
@@ -1458,19 +1099,6 @@
/**
* @brief Get resource (instance) value (s32)
*
- * @deprecated Use lwm2m_get_s32() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] value s32 buffer to copy data into
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_s32(const char *pathstr, int32_t *value);
-
-/**
- * @brief Get resource (instance) value (s32)
- *
* @param[in] path LwM2M path as a struct
* @param[out] value s32 buffer to copy data into
*
@@ -1481,19 +1109,6 @@
/**
* @brief Get resource (instance) value (s64)
*
- * @deprecated Use lwm2m_get_s64() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] value s64 buffer to copy data into
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_s64(const char *pathstr, int64_t *value);
-
-/**
- * @brief Get resource (instance) value (s64)
- *
* @param[in] path LwM2M path as a struct
* @param[out] value s64 buffer to copy data into
*
@@ -1504,19 +1119,6 @@
/**
* @brief Get resource (instance) value (bool)
*
- * @deprecated Use lwm2m_get_bool() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] value bool buffer to copy data into
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_bool(const char *pathstr, bool *value);
-
-/**
- * @brief Get resource (instance) value (bool)
- *
* @param[in] path LwM2M path as a struct
* @param[out] value bool buffer to copy data into
*
@@ -1527,19 +1129,6 @@
/**
* @brief Get resource (instance) value (double)
*
- * @deprecated Use lwm2m_get_f64() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] buf double buffer to copy data into
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_float(const char *pathstr, double *buf);
-
-/**
- * @brief Get resource (instance) value (double)
- *
* @param[in] path LwM2M path as a struct
* @param[out] value double buffer to copy data into
*
@@ -1550,19 +1139,6 @@
/**
* @brief Get resource (instance) value (Objlnk)
*
- * @deprecated Use lwm2m_get_objlnk() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] buf lwm2m_objlnk buffer to copy data into
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_objlnk(const char *pathstr, struct lwm2m_objlnk *buf);
-
-/**
- * @brief Get resource (instance) value (Objlnk)
- *
* @param[in] path LwM2M path as a struct
* @param[out] buf lwm2m_objlnk buffer to copy data into
*
@@ -1573,19 +1149,6 @@
/**
* @brief Get resource (instance) value (Time)
*
- * @deprecated Use lwm2m_get_time() instead.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] buf time_t pointer to copy data
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_time(const char *pathstr, time_t *buf);
-
-/**
- * @brief Get resource (instance) value (Time)
- *
* @param[in] path LwM2M path as a struct
* @param[out] buf time_t pointer to copy data
*
@@ -1596,8 +1159,6 @@
/**
* @brief Set resource (instance) read callback
*
- * @deprecated Use lwm2m_register_read_callback() instead.
- *
* LwM2M clients can use this to set the callback function for resource reads when data
* handling in the LwM2M engine needs to be bypassed.
* For example reading back opaque binary data from external storage.
@@ -1605,29 +1166,7 @@
* This callback should not generally be used for any data that might be observed as
* engine does not have any knowledge of data changes.
*
- * When separate buffer for data should be used, use lwm2m_engine_set_res_buf() instead
- * to set the storage.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] cb Read resource callback
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_register_read_callback(const char *pathstr,
- lwm2m_engine_get_data_cb_t cb);
-
-/**
- * @brief Set resource (instance) read callback
- *
- * LwM2M clients can use this to set the callback function for resource reads when data
- * handling in the LwM2M engine needs to be bypassed.
- * For example reading back opaque binary data from external storage.
- *
- * This callback should not generally be used for any data that might be observed as
- * engine does not have any knowledge of data changes.
- *
- * When separate buffer for data should be used, use lwm2m_engine_set_res_buf() instead
+ * When separate buffer for data should be used, use lwm2m_set_res_buf() instead
* to set the storage.
*
* @param[in] path LwM2M path as a struct
@@ -1640,24 +1179,6 @@
/**
* @brief Set resource (instance) pre-write callback
*
- * @deprecated Use lwm2m_register_pre_write_callback() instead.
- *
- * This callback is triggered before setting the value of a resource. It
- * can pass a special data buffer to the engine so that the actual resource
- * value can be calculated later, etc.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] cb Pre-write resource callback
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_register_pre_write_callback(const char *pathstr,
- lwm2m_engine_get_data_cb_t cb);
-
-/**
- * @brief Set resource (instance) pre-write callback
- *
* This callback is triggered before setting the value of a resource. It
* can pass a special data buffer to the engine so that the actual resource
* value can be calculated later, etc.
@@ -1673,32 +1194,6 @@
/**
* @brief Set resource (instance) validation callback
*
- * @deprecated Use lwm2m_register_validate_callback() instead.
- *
- * This callback is triggered before setting the value of a resource to the
- * resource data buffer.
- *
- * The callback allows an LwM2M client or object to validate the data before
- * writing and notify an error if the data should be discarded for any reason
- * (by returning a negative error code).
- *
- * @note All resources that have a validation callback registered are initially
- * decoded into a temporary validation buffer. Make sure that
- * ``CONFIG_LWM2M_ENGINE_VALIDATION_BUFFER_SIZE`` is large enough to
- * store each of the validated resources (individually).
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] cb Validate resource data callback
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_register_validate_callback(const char *pathstr,
- lwm2m_engine_set_data_cb_t cb);
-
-/**
- * @brief Set resource (instance) validation callback
- *
* This callback is triggered before setting the value of a resource to the
* resource data buffer.
*
@@ -1722,26 +1217,6 @@
/**
* @brief Set resource (instance) post-write callback
*
- * @deprecated Use lwm2m_register_post_write_callback() instead.
- *
- * This callback is triggered after setting the value of a resource to the
- * resource data buffer.
- *
- * It allows an LwM2M client or object to post-process the value of a resource
- * or trigger other related resource calculations.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] cb Post-write resource callback
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_register_post_write_callback(const char *pathstr,
- lwm2m_engine_set_data_cb_t cb);
-
-/**
- * @brief Set resource (instance) post-write callback
- *
* This callback is triggered after setting the value of a resource to the
* resource data buffer.
*
@@ -1759,22 +1234,6 @@
/**
* @brief Set resource execute event callback
*
- * @deprecated Use lwm2m_register_exec_callback() instead.
- *
- * This event is triggered when the execute method of a resource is enabled.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res"
- * @param[in] cb Execute resource callback
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_register_exec_callback(const char *pathstr,
- lwm2m_engine_execute_cb_t cb);
-
-/**
- * @brief Set resource execute event callback
- *
* This event is triggered when the execute method of a resource is enabled.
*
* @param[in] path LwM2M path as a struct
@@ -1787,22 +1246,6 @@
/**
* @brief Set object instance create event callback
*
- * @deprecated Use lwm2m_register_create_callback instead.
- *
- * This event is triggered when an object instance is created.
- *
- * @param[in] obj_id LwM2M object id
- * @param[in] cb Create object instance callback
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_register_create_callback(uint16_t obj_id,
- lwm2m_engine_user_cb_t cb);
-
-/**
- * @brief Set object instance create event callback
- *
* This event is triggered when an object instance is created.
*
* @param[in] obj_id LwM2M object id
@@ -1816,22 +1259,6 @@
/**
* @brief Set object instance delete event callback
*
- * @deprecated Use lwm2m_register_delete_callback instead
- *
- * This event is triggered when an object instance is deleted.
- *
- * @param[in] obj_id LwM2M object id
- * @param[in] cb Delete object instance callback
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_register_delete_callback(uint16_t obj_id,
- lwm2m_engine_user_cb_t cb);
-
-/**
- * @brief Set object instance delete event callback
- *
* This event is triggered when an object instance is deleted.
*
* @param[in] obj_id LwM2M object id
@@ -1860,26 +1287,6 @@
/**
* @brief Set data buffer for a resource
*
- * @deprecated Use lwm2m_set_res_buf() instead.
- *
- * Use this function to set the data buffer and flags for the specified LwM2M
- * resource.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] buffer_ptr Data buffer pointer
- * @param[in] buffer_len Length of buffer
- * @param[in] data_len Length of existing data in the buffer
- * @param[in] data_flags Data buffer flags (such as read-only, etc)
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_res_buf(const char *pathstr, void *buffer_ptr, uint16_t buffer_len,
- uint16_t data_len, uint8_t data_flags);
-
-/**
- * @brief Set data buffer for a resource
- *
* Use this function to set the data buffer and flags for the specified LwM2M
* resource.
*
@@ -1895,45 +1302,10 @@
uint16_t data_len, uint8_t data_flags);
/**
- * @brief Set data buffer for a resource
- *
- * Use this function to set the data buffer and flags for the specified LwM2M
- * resource.
- *
- * @deprecated Use lwm2m_set_res_buf() instead, so you can define buffer size and data size
- * separately.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] data_ptr Data buffer pointer
- * @param[in] data_len Length of buffer
- * @param[in] data_flags Data buffer flags (such as read-only, etc)
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_res_data(const char *pathstr, void *data_ptr, uint16_t data_len,
- uint8_t data_flags);
-
-/**
- * @brief Update data size for a resource
- *
- * @deprecated Use lwm2m_set_res_data_len() instead.
- *
- * Use this function to set the new size of data in the buffer if you write
- * to a buffer received by lwm2m_engine_get_res_buf().
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[in] data_len Length of data
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_set_res_data_len(const char *pathstr, uint16_t data_len);
-
-/**
* @brief Update data size for a resource
*
* Use this function to set the new size of data in the buffer if you write
- * to a buffer received by lwm2m_engine_get_res_buf().
+ * to a buffer received by lwm2m_get_res_buf().
*
* @param[in] path LwM2M path as a struct
* @param[in] data_len Length of data
@@ -1944,31 +1316,6 @@
/**
* @brief Get data buffer for a resource
*
- * @deprecated Use lwm2m_get_res_buf() instead.
- *
- * Use this function to get the data buffer information for the specified LwM2M
- * resource.
- *
- * If you directly write into the buffer, you must use lwm2m_engine_set_res_data_len()
- * function to update the new size of the written data.
- *
- * All parameters except pathstr can NULL if you don't want to read those values.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] buffer_ptr Data buffer pointer
- * @param[out] buffer_len Length of buffer
- * @param[out] data_len Length of existing data in the buffer
- * @param[out] data_flags Data buffer flags (such as read-only, etc)
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_res_buf(const char *pathstr, void **buffer_ptr, uint16_t *buffer_len,
- uint16_t *data_len, uint8_t *data_flags);
-
-/**
- * @brief Get data buffer for a resource
- *
* Use this function to get the data buffer information for the specified LwM2M
* resource.
*
@@ -1989,41 +1336,6 @@
uint16_t *data_len, uint8_t *data_flags);
/**
- * @brief Get data buffer for a resource
- *
- * Use this function to get the data buffer information for the specified LwM2M
- * resource.
- *
- * @deprecated Use lwm2m_get_res_buf() as it can tell you the size of the buffer as well.
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res(/res-inst)"
- * @param[out] data_ptr Data buffer pointer
- * @param[out] data_len Length of existing data in the buffer
- * @param[out] data_flags Data buffer flags (such as read-only, etc)
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_get_res_data(const char *pathstr, void **data_ptr, uint16_t *data_len,
- uint8_t *data_flags);
-
-/**
- * @brief Create a resource instance
- *
- * @deprecated Use lwm2m_create_res_inst() instead.
- *
- * LwM2M clients use this function to create multi-resource instances:
- * Example to create 0 instance of device available power sources:
- * lwm2m_engine_create_res_inst("3/0/6/0");
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res/res-inst"
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_create_res_inst(const char *pathstr);
-
-/**
* @brief Create a resource instance
*
* LwM2M clients use this function to create multi-resource instances:
@@ -2039,20 +1351,6 @@
/**
* @brief Delete a resource instance
*
- * @deprecated Use lwm2m_delete_res_inst() instead.
- *
- * Use this function to remove an existing resource instance
- *
- * @param[in] pathstr LwM2M path string "obj/obj-inst/res/res-inst"
- *
- * @return 0 for success or negative in case of error.
- */
-__deprecated
-int lwm2m_engine_delete_res_inst(const char *pathstr);
-
-/**
- * @brief Delete a resource instance
- *
* Use this function to remove an existing resource instance
*
* @param[in] path LwM2M path as a struct
@@ -2076,22 +1374,6 @@
/**
* @brief Check whether a path is observed
*
- * @deprecated Use lwm2m_path_is_observed() instead.
- *
- * @param[in] pathstr LwM2M path string to check, e.g. "3/0/1"
- *
- * @return true when there exists an observation of the same level
- * or lower as the given path, false if it doesn't or path is not a
- * valid LwM2M-path.
- * E.g. true if path refers to a resource and the parent object has an
- * observation, false for the inverse.
- */
-__deprecated
-bool lwm2m_engine_path_is_observed(const char *pathstr);
-
-/**
- * @brief Check whether a path is observed
- *
* @param[in] path LwM2M path as a struct to check
*
* @return true when there exists an observation of the same level
@@ -2182,12 +1464,6 @@
LWM2M_RD_CLIENT_EVENT_SERVER_DISABLED,
};
-/**
- * Define for old event name keeping backward compatibility.
- */
-#define LWM2M_RD_CLIENT_EVENT_REG_UPDATE_FAILURE \
- LWM2M_RD_CLIENT_EVENT_REG_TIMEOUT __DEPRECATED_MACRO
-
/*
* LwM2M RD client flags, used to configure LwM2M session.
*/
@@ -2302,40 +1578,6 @@
typedef void (*lwm2m_send_cb_t)(enum lwm2m_send_status status);
/**
- * @brief LwM2M SEND operation to given path list
- *
- * @deprecated Use lwm2m_send_cb() instead.
- *
- * @param ctx LwM2M context
- * @param path_list LwM2M Path string list
- * @param path_list_size Length of path list. Max size is CONFIG_LWM2M_COMPOSITE_PATH_LIST_SIZE
- * @param confirmation_request True request confirmation for operation.
- *
- * @return 0 for success or negative in case of error.
- *
- */
-__deprecated
-int lwm2m_engine_send(struct lwm2m_ctx *ctx, char const *path_list[], uint8_t path_list_size,
- bool confirmation_request);
-
-/**
- * @brief LwM2M SEND operation to given path list
- *
- * @deprecated Use lwm2m_send_cb() instead.
- *
- * @param ctx LwM2M context
- * @param path_list LwM2M path struct list
- * @param path_list_size Length of path list. Max size is CONFIG_LWM2M_COMPOSITE_PATH_LIST_SIZE
- * @param confirmation_request True request confirmation for operation.
- *
- * @return 0 for success or negative in case of error.
- *
- */
-__deprecated
-int lwm2m_send(struct lwm2m_ctx *ctx, const struct lwm2m_obj_path path_list[],
- uint8_t path_list_size, bool confirmation_request);
-
-/**
* @brief LwM2M SEND operation to given path list asynchronously with confirmation callback
*
* @param ctx LwM2M context
@@ -2360,25 +1602,6 @@
/**
* @brief Enable data cache for a resource.
*
- * @deprecated Use lwm2m_enable_cache instead
- *
- * Application may enable caching of resource data by allocating buffer for LwM2M engine to use.
- * Buffer must be size of struct @ref lwm2m_time_series_elem times cache_len
- *
- * @param resource_path LwM2M resourcepath string "obj/obj-inst/res(/res-inst)"
- * @param data_cache Pointer to Data cache array
- * @param cache_len number of cached entries
- *
- * @return 0 for success or negative in case of error.
- *
- */
-__deprecated
-int lwm2m_engine_enable_cache(char const *resource_path, struct lwm2m_time_series_elem *data_cache,
- size_t cache_len);
-
-/**
- * @brief Enable data cache for a resource.
- *
* Application may enable caching of resource data by allocating buffer for LwM2M engine to use.
* Buffer must be size of struct @ref lwm2m_time_series_elem times cache_len
*
diff --git a/subsys/net/lib/lwm2m/lwm2m_message_handling.c b/subsys/net/lib/lwm2m/lwm2m_message_handling.c
index b1d3261..3051126 100644
--- a/subsys/net/lib/lwm2m/lwm2m_message_handling.c
+++ b/subsys/net/lib/lwm2m/lwm2m_message_handling.c
@@ -3602,34 +3602,3 @@
return -ENOTSUP;
#endif
}
-
-int lwm2m_send(struct lwm2m_ctx *ctx, const struct lwm2m_obj_path path_list[],
- uint8_t path_list_size, bool confirmation_request)
-{
- if (!confirmation_request) {
- return -EINVAL;
- }
-
- return lwm2m_send_cb(ctx, path_list, path_list_size, NULL);
-}
-
-int lwm2m_engine_send(struct lwm2m_ctx *ctx, char const *path_list[], uint8_t path_list_size,
- bool confirmation_request)
-{
- int ret;
- struct lwm2m_obj_path lwm2m_path_list[CONFIG_LWM2M_COMPOSITE_PATH_LIST_SIZE];
-
- if (path_list_size > CONFIG_LWM2M_COMPOSITE_PATH_LIST_SIZE) {
- return -E2BIG;
- }
-
- for (int i = 0; i < path_list_size; i++) {
- /* translate path -> path_obj */
- ret = lwm2m_string_to_path(path_list[i], &lwm2m_path_list[i], '/');
- if (ret < 0) {
- return ret;
- }
- }
-
- return lwm2m_send_cb(ctx, lwm2m_path_list, path_list_size, NULL);
-}
diff --git a/subsys/net/lib/lwm2m/lwm2m_observation.c b/subsys/net/lib/lwm2m/lwm2m_observation.c
index 1c8034e..1f3cf5d 100644
--- a/subsys/net/lib/lwm2m/lwm2m_observation.c
+++ b/subsys/net/lib/lwm2m/lwm2m_observation.c
@@ -1047,20 +1047,6 @@
return lwm2m_update_or_allocate_attribute(ref, LWM2M_ATTR_PMIN, &period_s);
}
-int lwm2m_engine_update_observer_min_period(struct lwm2m_ctx *client_ctx, const char *pathstr,
- uint32_t period_s)
-{
- int ret;
- struct lwm2m_obj_path path;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_update_observer_min_period(client_ctx, &path, period_s);
-}
-
int lwm2m_update_observer_max_period(struct lwm2m_ctx *client_ctx,
const struct lwm2m_obj_path *path, uint32_t period_s)
{
@@ -1107,20 +1093,6 @@
client_ctx->srv_obj_inst);
}
-int lwm2m_engine_update_observer_max_period(struct lwm2m_ctx *client_ctx, const char *pathstr,
- uint32_t period_s)
-{
- int ret;
- struct lwm2m_obj_path path;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_update_observer_max_period(client_ctx, &path, period_s);
-}
-
struct lwm2m_attr *lwm2m_engine_get_next_attr(const void *ref, struct lwm2m_attr *prev)
{
struct lwm2m_attr *iter = (prev == NULL) ? write_attr_pool : prev + 1;
@@ -1393,19 +1365,6 @@
return false;
}
-bool lwm2m_engine_path_is_observed(const char *pathstr)
-{
- int ret;
- struct lwm2m_obj_path path;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return false;
- }
-
- return lwm2m_path_is_observed(&path);
-}
-
int lwm2m_engine_observation_handler(struct lwm2m_message *msg, int observe, uint16_t accept,
bool composite)
{
diff --git a/subsys/net/lib/lwm2m/lwm2m_registry.c b/subsys/net/lib/lwm2m/lwm2m_registry.c
index 54bda0a..5409840 100644
--- a/subsys/net/lib/lwm2m/lwm2m_registry.c
+++ b/subsys/net/lib/lwm2m/lwm2m_registry.c
@@ -336,22 +336,6 @@
return 0;
}
-int lwm2m_engine_create_obj_inst(const char *pathstr)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- LOG_DBG("path:%s", pathstr);
-
- /* translate path -> path_obj */
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_create_object_inst(&path);
-}
-
int lwm2m_delete_object_inst(const struct lwm2m_obj_path *path)
{
int ret = 0;
@@ -371,22 +355,6 @@
return 0;
}
-int lwm2m_engine_delete_obj_inst(const char *pathstr)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- LOG_DBG("path: %s", pathstr);
-
- /* translate path -> path_obj */
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_delete_object_inst(&path);
-}
-
struct lwm2m_engine_obj_inst *lwm2m_engine_get_obj_inst(const struct lwm2m_obj_path *path)
{
if (path->level < LWM2M_PATH_LEVEL_OBJECT_INST) {
@@ -524,36 +492,6 @@
return ret;
}
-int lwm2m_engine_set_res_buf(const char *pathstr, void *buffer_ptr, uint16_t buffer_len,
- uint16_t data_len, uint8_t data_flags)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- /* translate path -> path_obj */
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_set_res_buf(&path, buffer_ptr, buffer_len, data_len, data_flags);
-}
-
-int lwm2m_engine_set_res_data(const char *pathstr, void *data_ptr, uint16_t data_len,
- uint8_t data_flags)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- /* translate path -> path_obj */
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_set_res_buf(&path, data_ptr, data_len, data_len, data_flags);
-}
-
static bool lwm2m_validate_time_resource_lenghts(uint16_t resource_length, uint16_t buf_length)
{
if (resource_length != sizeof(time_t) && resource_length != sizeof(uint32_t)) {
@@ -789,18 +727,6 @@
return lwm2m_engine_set(path, data_ptr, data_len);
}
-int lwm2m_engine_set_opaque(const char *pathstr, const char *data_ptr, uint16_t data_len)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_set_opaque(&path, data_ptr, data_len);
-}
-
int lwm2m_set_string(const struct lwm2m_obj_path *path, const char *data_ptr)
{
uint16_t len = strlen(data_ptr);
@@ -813,155 +739,47 @@
return lwm2m_engine_set(path, data_ptr, len);
}
-int lwm2m_engine_set_string(const char *pathstr, const char *data_ptr)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_set_string(&path, data_ptr);
-}
-
int lwm2m_set_u8(const struct lwm2m_obj_path *path, uint8_t value)
{
return lwm2m_engine_set(path, &value, 1);
}
-int lwm2m_engine_set_u8(const char *pathstr, uint8_t value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_set_u8(&path, value);
-}
-
int lwm2m_set_u16(const struct lwm2m_obj_path *path, uint16_t value)
{
return lwm2m_engine_set(path, &value, 2);
}
-int lwm2m_engine_set_u16(const char *pathstr, uint16_t value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_set_u16(&path, value);
-}
-
int lwm2m_set_u32(const struct lwm2m_obj_path *path, uint32_t value)
{
return lwm2m_engine_set(path, &value, 4);
}
-int lwm2m_engine_set_u32(const char *pathstr, uint32_t value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_set_u32(&path, value);
-}
-
int lwm2m_set_u64(const struct lwm2m_obj_path *path, uint64_t value)
{
return lwm2m_engine_set(path, &value, 8);
}
-int lwm2m_engine_set_u64(const char *pathstr, uint64_t value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_set_s64(&path, (int64_t) value);
-}
-
int lwm2m_set_s8(const struct lwm2m_obj_path *path, int8_t value)
{
return lwm2m_engine_set(path, &value, 1);
}
-int lwm2m_engine_set_s8(const char *pathstr, int8_t value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_set_s8(&path, value);
-}
-
int lwm2m_set_s16(const struct lwm2m_obj_path *path, int16_t value)
{
return lwm2m_engine_set(path, &value, 2);
}
-int lwm2m_engine_set_s16(const char *pathstr, int16_t value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_set_s16(&path, value);
-}
-
int lwm2m_set_s32(const struct lwm2m_obj_path *path, int32_t value)
{
return lwm2m_engine_set(path, &value, 4);
}
-int lwm2m_engine_set_s32(const char *pathstr, int32_t value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_set_s32(&path, value);
-}
-
int lwm2m_set_s64(const struct lwm2m_obj_path *path, int64_t value)
{
return lwm2m_engine_set(path, &value, 8);
}
-int lwm2m_engine_set_s64(const char *pathstr, int64_t value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_set_s64(&path, value);
-}
-
int lwm2m_set_bool(const struct lwm2m_obj_path *path, bool value)
{
uint8_t temp = (value != 0 ? 1 : 0);
@@ -969,69 +787,21 @@
return lwm2m_engine_set(path, &temp, 1);
}
-int lwm2m_engine_set_bool(const char *pathstr, bool value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_set_bool(&path, value);
-}
-
int lwm2m_set_f64(const struct lwm2m_obj_path *path, const double value)
{
return lwm2m_engine_set(path, &value, sizeof(double));
}
-int lwm2m_engine_set_float(const char *pathstr, const double *value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_set_f64(&path, *value);
-}
-
int lwm2m_set_objlnk(const struct lwm2m_obj_path *path, const struct lwm2m_objlnk *value)
{
return lwm2m_engine_set(path, value, sizeof(struct lwm2m_objlnk));
}
-int lwm2m_engine_set_objlnk(const char *pathstr, const struct lwm2m_objlnk *value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_set_objlnk(&path, value);
-}
-
int lwm2m_set_time(const struct lwm2m_obj_path *path, time_t value)
{
return lwm2m_engine_set(path, &value, sizeof(time_t));
}
-int lwm2m_engine_set_time(const char *pathstr, time_t value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_set_time(&path, value);
-}
-
int lwm2m_set_res_data_len(const struct lwm2m_obj_path *path, uint16_t data_len)
{
int ret;
@@ -1046,20 +816,6 @@
}
return lwm2m_set_res_buf(path, buffer_ptr, buffer_len, data_len, data_flags);
}
-
-int lwm2m_engine_set_res_data_len(const char *pathstr, uint16_t data_len)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- /* translate path -> path_obj */
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_set_res_data_len(&path, data_len);
-}
/* User data getter functions */
int lwm2m_get_res_buf(const struct lwm2m_obj_path *path, void **buffer_ptr, uint16_t *buffer_len,
@@ -1104,36 +860,6 @@
return 0;
}
-int lwm2m_engine_get_res_buf(const char *pathstr, void **buffer_ptr, uint16_t *buffer_len,
- uint16_t *data_len, uint8_t *data_flags)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- /* translate path -> path_obj */
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_get_res_buf(&path, buffer_ptr, buffer_len, data_len, data_flags);
-}
-
-int lwm2m_engine_get_res_data(const char *pathstr, void **data_ptr, uint16_t *data_len,
- uint8_t *data_flags)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- /* translate path -> path_obj */
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_get_res_buf(&path, data_ptr, NULL, data_len, data_flags);
-}
-
static int lwm2m_engine_get(const struct lwm2m_obj_path *path, void *buf, uint16_t buflen)
{
int ret = 0;
@@ -1278,18 +1004,6 @@
return lwm2m_engine_get(path, buf, buflen);
}
-int lwm2m_engine_get_opaque(const char *pathstr, void *buf, uint16_t buflen)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_get_opaque(&path, buf, buflen);
-}
-
int lwm2m_get_string(const struct lwm2m_obj_path *path, void *str, uint16_t buflen)
{
/* Ensure termination, in case resource is not a string type */
@@ -1301,154 +1015,46 @@
return lwm2m_engine_get(path, str, buflen);
}
-int lwm2m_engine_get_string(const char *pathstr, void *str, uint16_t buflen)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_get_string(&path, str, buflen);
-}
-
int lwm2m_get_u8(const struct lwm2m_obj_path *path, uint8_t *value)
{
return lwm2m_engine_get(path, value, 1);
}
-int lwm2m_engine_get_u8(const char *pathstr, uint8_t *value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_get_u8(&path, value);
-}
-
int lwm2m_get_u16(const struct lwm2m_obj_path *path, uint16_t *value)
{
return lwm2m_engine_get(path, value, 2);
}
-int lwm2m_engine_get_u16(const char *pathstr, uint16_t *value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_get_u16(&path, value);
-}
-
int lwm2m_get_u32(const struct lwm2m_obj_path *path, uint32_t *value)
{
return lwm2m_engine_get(path, value, 4);
}
-int lwm2m_engine_get_u32(const char *pathstr, uint32_t *value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_get_u32(&path, value);
-}
-
int lwm2m_get_u64(const struct lwm2m_obj_path *path, uint64_t *value)
{
return lwm2m_engine_get(path, value, 8);
}
-int lwm2m_engine_get_u64(const char *pathstr, uint64_t *value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_get_s64(&path, (int64_t *) value);
-}
-
int lwm2m_get_s8(const struct lwm2m_obj_path *path, int8_t *value)
{
return lwm2m_engine_get(path, value, 1);
}
-int lwm2m_engine_get_s8(const char *pathstr, int8_t *value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_get_s8(&path, value);
-}
-
int lwm2m_get_s16(const struct lwm2m_obj_path *path, int16_t *value)
{
return lwm2m_engine_get(path, value, 2);
}
-int lwm2m_engine_get_s16(const char *pathstr, int16_t *value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_get_s16(&path, value);
-}
-
int lwm2m_get_s32(const struct lwm2m_obj_path *path, int32_t *value)
{
return lwm2m_engine_get(path, value, 4);
}
-int lwm2m_engine_get_s32(const char *pathstr, int32_t *value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_get_s32(&path, value);
-}
-
int lwm2m_get_s64(const struct lwm2m_obj_path *path, int64_t *value)
{
return lwm2m_engine_get(path, value, 8);
}
-int lwm2m_engine_get_s64(const char *pathstr, int64_t *value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_get_s64(&path, value);
-}
-
int lwm2m_get_bool(const struct lwm2m_obj_path *path, bool *value)
{
int ret = 0;
@@ -1462,69 +1068,21 @@
return ret;
}
-int lwm2m_engine_get_bool(const char *pathstr, bool *value)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_get_bool(&path, value);
-}
-
int lwm2m_get_f64(const struct lwm2m_obj_path *path, double *value)
{
return lwm2m_engine_get(path, value, sizeof(double));
}
-int lwm2m_engine_get_float(const char *pathstr, double *buf)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_get_f64(&path, buf);
-}
-
int lwm2m_get_objlnk(const struct lwm2m_obj_path *path, struct lwm2m_objlnk *buf)
{
return lwm2m_engine_get(path, buf, sizeof(struct lwm2m_objlnk));
}
-int lwm2m_engine_get_objlnk(const char *pathstr, struct lwm2m_objlnk *buf)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_get_objlnk(&path, buf);
-}
-
int lwm2m_get_time(const struct lwm2m_obj_path *path, time_t *buf)
{
return lwm2m_engine_get(path, buf, sizeof(time_t));
}
-int lwm2m_engine_get_time(const char *pathstr, time_t *buf)
-{
- struct lwm2m_obj_path path;
- int ret = 0;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
- return lwm2m_get_time(&path, buf);
-}
-
int lwm2m_get_resource(const struct lwm2m_obj_path *path, struct lwm2m_engine_res **res)
{
if (path->level < LWM2M_PATH_LEVEL_RESOURCE) {
@@ -1691,19 +1249,6 @@
return lwm2m_engine_allocate_resource_instance(res, &res_inst, path->res_inst_id);
}
-int lwm2m_engine_create_res_inst(const char *pathstr)
-{
- int ret;
- struct lwm2m_obj_path path;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_create_res_inst(&path);
-}
-
int lwm2m_delete_res_inst(const struct lwm2m_obj_path *path)
{
int ret;
@@ -1733,19 +1278,6 @@
k_mutex_unlock(®istry_lock);
return 0;
}
-
-int lwm2m_engine_delete_res_inst(const char *pathstr)
-{
- int ret;
- struct lwm2m_obj_path path;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_delete_res_inst(&path);
-}
/* Register callbacks */
int lwm2m_register_read_callback(const struct lwm2m_obj_path *path, lwm2m_engine_get_data_cb_t cb)
@@ -1762,19 +1294,6 @@
return 0;
}
-int lwm2m_engine_register_read_callback(const char *pathstr, lwm2m_engine_get_data_cb_t cb)
-{
- int ret;
- struct lwm2m_obj_path path;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_register_read_callback(&path, cb);
-}
-
int lwm2m_register_pre_write_callback(const struct lwm2m_obj_path *path,
lwm2m_engine_get_data_cb_t cb)
{
@@ -1790,19 +1309,6 @@
return 0;
}
-int lwm2m_engine_register_pre_write_callback(const char *pathstr, lwm2m_engine_get_data_cb_t cb)
-{
- int ret;
- struct lwm2m_obj_path path;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_register_pre_write_callback(&path, cb);
-}
-
int lwm2m_register_validate_callback(const struct lwm2m_obj_path *path,
lwm2m_engine_set_data_cb_t cb)
{
@@ -1828,29 +1334,6 @@
#endif /* CONFIG_LWM2M_ENGINE_VALIDATION_BUFFER_SIZE > 0 */
}
-int lwm2m_engine_register_validate_callback(const char *pathstr, lwm2m_engine_set_data_cb_t cb)
-{
-#if CONFIG_LWM2M_ENGINE_VALIDATION_BUFFER_SIZE > 0
- int ret;
- struct lwm2m_obj_path path;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_register_validate_callback(&path, cb);
-#else
- ARG_UNUSED(pathstr);
- ARG_UNUSED(cb);
-
- LOG_ERR("Validation disabled. Set "
- "CONFIG_LWM2M_ENGINE_VALIDATION_BUFFER_SIZE > 0 to "
- "enable validation support.");
- return -ENOTSUP;
-#endif /* CONFIG_LWM2M_ENGINE_VALIDATION_BUFFER_SIZE > 0 */
-}
-
int lwm2m_register_post_write_callback(const struct lwm2m_obj_path *path,
lwm2m_engine_set_data_cb_t cb)
{
@@ -1866,19 +1349,6 @@
return 0;
}
-int lwm2m_engine_register_post_write_callback(const char *pathstr, lwm2m_engine_set_data_cb_t cb)
-{
- int ret;
- struct lwm2m_obj_path path;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_register_post_write_callback(&path, cb);
-}
-
int lwm2m_register_exec_callback(const struct lwm2m_obj_path *path, lwm2m_engine_execute_cb_t cb)
{
int ret;
@@ -1893,19 +1363,6 @@
return 0;
}
-int lwm2m_engine_register_exec_callback(const char *pathstr, lwm2m_engine_execute_cb_t cb)
-{
- int ret;
- struct lwm2m_obj_path path;
-
- ret = lwm2m_string_to_path(pathstr, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- return lwm2m_register_exec_callback(&path, cb);
-}
-
int lwm2m_register_create_callback(uint16_t obj_id, lwm2m_engine_user_cb_t cb)
{
struct lwm2m_engine_obj *obj = NULL;
@@ -1920,11 +1377,6 @@
return 0;
}
-int lwm2m_engine_register_create_callback(uint16_t obj_id, lwm2m_engine_user_cb_t cb)
-{
- return lwm2m_register_create_callback(obj_id, cb);
-}
-
int lwm2m_register_delete_callback(uint16_t obj_id, lwm2m_engine_user_cb_t cb)
{
struct lwm2m_engine_obj *obj = NULL;
@@ -1938,11 +1390,6 @@
obj->user_delete_cb = cb;
return 0;
}
-
-int lwm2m_engine_register_delete_callback(uint16_t obj_id, lwm2m_engine_user_cb_t cb)
-{
- return lwm2m_register_delete_callback(obj_id, cb);
-}
/* Generic data handlers */
int lwm2m_get_or_create_engine_obj(struct lwm2m_message *msg,
@@ -2212,32 +1659,6 @@
#endif /* CONFIG_LWM2M_RESOURCE_DATA_CACHE_SUPPORT */
}
-int lwm2m_engine_enable_cache(const char *resource_path, struct lwm2m_time_series_elem *data_cache,
- size_t cache_len)
-{
-#if defined(CONFIG_LWM2M_RESOURCE_DATA_CACHE_SUPPORT)
- struct lwm2m_obj_path path;
- int ret;
-
- /* translate path -> path_obj */
- ret = lwm2m_string_to_path(resource_path, &path, '/');
- if (ret < 0) {
- return ret;
- }
-
- if (path.level < LWM2M_PATH_LEVEL_RESOURCE) {
- LOG_ERR("path must have at least 3 parts");
- return -EINVAL;
- }
-
- return lwm2m_enable_cache(&path, data_cache, cache_len);
-#else
- LOG_ERR("LwM2M resource cache is only supported for "
- "CONFIG_LWM2M_RESOURCE_DATA_CACHE_SUPPORT");
- return -ENOTSUP;
-#endif /* CONFIG_LWM2M_RESOURCE_DATA_CACHE_SUPPORT */
-}
-
#if defined(CONFIG_LWM2M_RESOURCE_DATA_CACHE_SUPPORT)
static int lwm2m_engine_data_cache_init(void)
{
diff --git a/tests/net/lib/lwm2m/lwm2m_registry/src/lwm2m_registry.c b/tests/net/lib/lwm2m/lwm2m_registry/src/lwm2m_registry.c
index d5b0c11..49ca837 100644
--- a/tests/net/lib/lwm2m/lwm2m_registry/src/lwm2m_registry.c
+++ b/tests/net/lib/lwm2m/lwm2m_registry/src/lwm2m_registry.c
@@ -410,110 +410,6 @@
zassert_equal(ret, -ENOMEM);
}
-#if CONFIG_TEST_DEPRECATED
-/* Don't test deprecated functions on Twister builds */
-ZTEST(lwm2m_registry, test_deprecated_functions)
-{
- bool b = true;
- uint8_t opaque[] = {0xde, 0xad, 0xbe, 0xff, 0, 0};
- char string[] = "Hello";
- uint8_t u8 = 8;
- int8_t s8 = -8;
- uint16_t u16 = 16;
- int16_t s16 = -16;
- uint32_t u32 = 32;
- int32_t s32 = -32;
- int64_t s64 = -64;
- time_t t = 1687949519;
- double d = 3.1415;
- double d2;
- struct lwm2m_objlnk objl = {.obj_id = 1, .obj_inst = 2};
- uint16_t l = sizeof(opaque);
-
- zassert_equal(lwm2m_engine_set_bool("32768/0/" STRINGIFY(LWM2M_RES_TYPE_BOOL), b), 0);
- zassert_equal(
- lwm2m_engine_set_opaque("32768/0/" STRINGIFY(LWM2M_RES_TYPE_OPAQUE), opaque, l), 0);
- zassert_equal(lwm2m_engine_set_string("32768/0/" STRINGIFY(LWM2M_RES_TYPE_STRING), string),
- 0);
- zassert_equal(lwm2m_engine_set_u8("32768/0/" STRINGIFY(LWM2M_RES_TYPE_U8), u8), 0);
- zassert_equal(lwm2m_engine_set_s8("32768/0/" STRINGIFY(LWM2M_RES_TYPE_S8), s8), 0);
- zassert_equal(lwm2m_engine_set_u16("32768/0/" STRINGIFY(LWM2M_RES_TYPE_U16), u16), 0);
- zassert_equal(lwm2m_engine_set_s16("32768/0/" STRINGIFY(LWM2M_RES_TYPE_S16), s16), 0);
- zassert_equal(lwm2m_engine_set_u32("32768/0/" STRINGIFY(LWM2M_RES_TYPE_U32), u32), 0);
- zassert_equal(lwm2m_engine_set_s32("32768/0/" STRINGIFY(LWM2M_RES_TYPE_S32), s32), 0);
- zassert_equal(lwm2m_engine_set_s64("32768/0/" STRINGIFY(LWM2M_RES_TYPE_S64), s64), 0);
- zassert_equal(lwm2m_engine_set_time("32768/0/" STRINGIFY(LWM2M_RES_TYPE_TIME), t), 0);
- zassert_equal(lwm2m_engine_set_float("32768/0/" STRINGIFY(LWM2M_RES_TYPE_FLOAT), &d), 0);
- zassert_equal(lwm2m_engine_set_objlnk("32768/0/" STRINGIFY(LWM2M_RES_TYPE_OBJLNK), &objl),
- 0);
- zassert_equal(lwm2m_engine_get_bool("32768/0/" STRINGIFY(LWM2M_RES_TYPE_BOOL), &b), 0);
- zassert_equal(lwm2m_engine_get_opaque(
- "32768/0/" STRINGIFY(LWM2M_RES_TYPE_OPAQUE), &opaque, l), 0);
- zassert_equal(lwm2m_engine_get_string(
- "32768/0/" STRINGIFY(LWM2M_RES_TYPE_STRING), &string, l), 0);
- zassert_equal(lwm2m_engine_get_u8("32768/0/" STRINGIFY(LWM2M_RES_TYPE_U8), &u8), 0);
- zassert_equal(lwm2m_engine_get_s8("32768/0/" STRINGIFY(LWM2M_RES_TYPE_S8), &s8), 0);
- zassert_equal(lwm2m_engine_get_u16("32768/0/" STRINGIFY(LWM2M_RES_TYPE_U16), &u16), 0);
- zassert_equal(lwm2m_engine_get_s16("32768/0/" STRINGIFY(LWM2M_RES_TYPE_S16), &s16), 0);
- zassert_equal(lwm2m_engine_get_u32("32768/0/" STRINGIFY(LWM2M_RES_TYPE_U32), &u32), 0);
- zassert_equal(lwm2m_engine_get_s32("32768/0/" STRINGIFY(LWM2M_RES_TYPE_S32), &s32), 0);
- zassert_equal(lwm2m_engine_get_s64("32768/0/" STRINGIFY(LWM2M_RES_TYPE_S64), &s64), 0);
- zassert_equal(lwm2m_engine_get_time("32768/0/" STRINGIFY(LWM2M_RES_TYPE_TIME), &t), 0);
- zassert_equal(lwm2m_engine_get_float("32768/0/" STRINGIFY(LWM2M_RES_TYPE_FLOAT), &d2), 0);
- zassert_equal(lwm2m_engine_get_objlnk("32768/0/" STRINGIFY(LWM2M_RES_TYPE_OBJLNK), &objl),
- 0);
-
- zassert_equal(b, true);
- zassert_equal(memcmp(opaque, &(uint8_t[6]) {0xde, 0xad, 0xbe, 0xff, 0, 0}, l), 0);
- zassert_str_equal(string, "Hello");
- zassert_equal(u8, 8);
- zassert_equal(s8, -8);
- zassert_equal(u16, 16);
- zassert_equal(s16, -16);
- zassert_equal(u32, 32);
- zassert_equal(s32, -32);
- zassert_equal(s64, -64);
- zassert_equal(t, 1687949519);
- zassert_equal(d, d2);
- zassert_equal(
- memcmp(&objl, &(struct lwm2m_objlnk){.obj_id = 1, .obj_inst = 2}, sizeof(objl)), 0);
-
- uint64_t u64 = 0xc0ffee;
-
- zassert_equal(lwm2m_engine_set_u64("32768/0/" STRINGIFY(LWM2M_RES_TYPE_S64), u64), 0);
- zassert_equal(lwm2m_engine_get_u64("32768/0/" STRINGIFY(LWM2M_RES_TYPE_S64), &u64), 0);
- zassert_equal(u64, 0xc0ffee);
-
- zassert_equal(lwm2m_engine_create_obj_inst("32768/1"), -ENOMEM);
- zassert_equal(lwm2m_engine_delete_obj_inst("32768/1"), -ENOENT);
-
- void *o_ptr;
- uint16_t o_len;
-
- lwm2m_get_res_buf(&LWM2M_OBJ(32768, 0, LWM2M_RES_TYPE_OPAQUE), &o_ptr, &o_len, NULL, NULL);
-
- zassert_equal(lwm2m_engine_set_res_buf(
- "32768/0/" STRINGIFY(LWM2M_RES_TYPE_OPAQUE), opaque, sizeof(opaque), 6, 0), 0);
- void *p;
- uint16_t len;
-
- zassert_equal(lwm2m_engine_get_res_buf(
- "32768/0/" STRINGIFY(LWM2M_RES_TYPE_OPAQUE), &p, NULL, &len, NULL), 0);
- zassert_true(p == opaque);
- zassert_equal(len, 6);
-
- zassert_equal(lwm2m_engine_set_res_data(
- "32768/0/" STRINGIFY(LWM2M_RES_TYPE_OPAQUE), string, sizeof(string), 0), 0);
- lwm2m_engine_get_res_data("32768/0/" STRINGIFY(LWM2M_RES_TYPE_OPAQUE), &p, &len, NULL);
- zassert_true(p == string);
- zassert_equal(len, sizeof(string));
- zassert_equal(lwm2m_engine_set_res_data_len("32768/0/" STRINGIFY(LWM2M_RES_TYPE_OPAQUE), 0),
- 0);
-
- lwm2m_set_res_buf(&LWM2M_OBJ(32768, 0, LWM2M_RES_TYPE_OPAQUE), o_ptr, o_len, 0, 0);
-}
-#endif
-
ZTEST(lwm2m_registry, test_lock_unlock)
{
/* Should be recursive mutex and should not block */
@@ -619,8 +515,6 @@
/* Resource cache is turned off */
zassert_is_null(lwm2m_cache_entry_get_by_object(&path));
zassert_equal(lwm2m_enable_cache(&path, &e, 1), -ENOTSUP);
- /* deprecated */
- /* zassert_equal(lwm2m_engine_enable_cache("32768/0/1", &e, 1), -ENOTSUP); */
zassert_false(lwm2m_cache_write(NULL, NULL));
zassert_false(lwm2m_cache_read(NULL, NULL));
zassert_equal(lwm2m_cache_size(NULL), 0);