doc: net: lwm2m: Update code snippet to use latest API
Documentation was not updated after the deprecated API was removed in
94e12d59
.
Signed-off-by: Etienne de Maricourt <edmecomemail@gmail.com>
This commit is contained in:
parent
1bfbd9262e
commit
1d356abc5b
1 changed files with 2 additions and 2 deletions
|
@ -504,7 +504,7 @@ Enabling and configuring
|
|||
|
||||
Enable data cache by selecting :kconfig:option:`CONFIG_LWM2M_RESOURCE_DATA_CACHE_SUPPORT`.
|
||||
Application needs to allocate an array of :c:struct:`lwm2m_time_series_elem` structures and then
|
||||
enable the cache by calling :c:func:`lwm2m_engine_enable_cache` for a given resource. Each resource
|
||||
enable the cache by calling :c:func:`lwm2m_enable_cache` for a given resource. Each resource
|
||||
must be enabled separately and each resource needs their own storage.
|
||||
|
||||
.. code-block:: c
|
||||
|
@ -512,7 +512,7 @@ must be enabled separately and each resource needs their own storage.
|
|||
/* Allocate data cache storage */
|
||||
static struct lwm2m_time_series_elem temperature_cache[10];
|
||||
/* Enable data cache */
|
||||
lwm2m_engine_enable_cache(LWM2M_PATH(IPSO_OBJECT_TEMP_SENSOR_ID, 0, SENSOR_VALUE_RID),
|
||||
lwm2m_enable_cache(LWM2M_OBJ(IPSO_OBJECT_TEMP_SENSOR_ID, 0, SENSOR_VALUE_RID),
|
||||
temperature_cache, ARRAY_SIZE(temperature_cache));
|
||||
|
||||
LwM2M engine have room for four resources that have cache enabled. Limit can be increased by
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue