|
Anjay Lite
|
Default implementation of the LwM2M Server Object (/1). More...
#include <anj/init.h>#include <stddef.h>#include <stdint.h>#include <anj/core.h>#include <anj/defs.h>#include <anj/dm/core.h>#include <anj/persistence.h>Go to the source code of this file.
Data Structures | |
| struct | anj_dm_server_instance_t |
| struct | anj_dm_server_instance_init_t |
| struct | anj_dm_server_obj_t |
Functions | |
| void | anj_dm_server_obj_init (anj_dm_server_obj_t *server_obj_ctx) |
| int | anj_dm_server_obj_add_instance (anj_dm_server_obj_t *server_obj_ctx, const anj_dm_server_instance_init_t *instance) |
| int | anj_dm_server_obj_install (anj_t *anj, anj_dm_server_obj_t *server_obj_ctx) |
| int | anj_dm_server_obj_store (anj_dm_server_obj_t *server_obj_ctx, const anj_persistence_context_t *ctx) |
| int | anj_dm_server_obj_restore (anj_dm_server_obj_t *server_obj_ctx, const anj_persistence_context_t *ctx) |
Default implementation of the LwM2M Server Object (/1).
Provides initialization, instance management, and optional persistence of Server Object state.
| int anj_dm_server_obj_add_instance | ( | anj_dm_server_obj_t * | server_obj_ctx, |
| const anj_dm_server_instance_init_t * | instance | ||
| ) |
Adds new Instance of Server Object.
| server_obj_ctx | Server Object state. |
| instance | Instance to insert. |
| void anj_dm_server_obj_init | ( | anj_dm_server_obj_t * | server_obj_ctx | ) |
Initializes Server Object internal state variable.
This function must be called once, before adding any Instances.
| server_obj_ctx | Pointer to a variable that will hold the state of the Object. |
| int anj_dm_server_obj_install | ( | anj_t * | anj, |
| anj_dm_server_obj_t * | server_obj_ctx | ||
| ) |
Installs Server Object in data model.
Call this function after adding all Instances using anj_dm_server_obj_add_instance. After calling this function, new Instances can be added only by LwM2M Bootstrap Server.
| anj | Anjay object. |
| server_obj_ctx | Server Object state. |
| int anj_dm_server_obj_restore | ( | anj_dm_server_obj_t * | server_obj_ctx, |
| const anj_persistence_context_t * | ctx | ||
| ) |
Deserializes the LwM2M Server Object from the persistence stream.
Reads Server Object instance and its resources from the underlying medium via ctx->read.
| server_obj_ctx | Server Object context to fill. |
| ctx | Persistence context; must have anj_persistence_context_t::direction set to ANJ_PERSISTENCE_RESTORE. |
| int anj_dm_server_obj_store | ( | anj_dm_server_obj_t * | server_obj_ctx, |
| const anj_persistence_context_t * | ctx | ||
| ) |
Serializes the current LwM2M Server Object into the persistence stream.
Writes Server Object instance and its resources to the underlying medium via ctx->write.
| server_obj_ctx | Server Object context to serialize. |
| ctx | Persistence context; must have anj_persistence_context_t::direction set to ANJ_PERSISTENCE_STORE. |