#include <anj/init.h>
#include <anj/core.h>
#include <anj/dm/core.h>
Go to the source code of this file.
◆ ANJ_DM_DEVICE_ERR_CODE_RES_INST_MAX_COUNT
#define ANJ_DM_DEVICE_ERR_CODE_RES_INST_MAX_COUNT 1 |
◆ anj_dm_reboot_callback_t
typedef void anj_dm_reboot_callback_t(void *arg, anj_t *anj) |
Callback function type for handling the LwM2M Reboot resource (/3/0/4).
This function is invoked when the Reboot resource is executed by the LwM2M server. The user is expected to perform a system reboot after this callback returns.
- Note
- The Execute operation may be sent as a Confirmable message, so it is recommended to delay the reboot until the response is successfully sent.
- Parameters
-
arg | Opaque argument passed to the callback. |
anj | Anjay object reporting the status change. |
◆ anj_dm_device_obj_install()
Installs device object (/3) in DM.
Example usage:
static int reboot_cb(
void *arg,
anj_t *anj) {
}
...
anj_dm_device_obj_t dev_obj;
.model_number = "model_number",
.serial_number = "serial_number",
.firmware_version = "firmware_version",
.reboot_handler = reboot_cb
};
struct anj_struct anj_t
Definition defs.h:133
int anj_dm_device_obj_install(anj_t *anj, anj_dm_device_obj_t *device_obj, anj_dm_device_object_init_t *obj_init)
Definition device_object.h:59
const char * manufacturer
Definition device_object.h:61
- Parameters
-
anj | Anjay object to operate on. |
device_obj | Pointer to a device object structure. Must be non-NULL. |
obj_init | Pointer to a device object's initialization structure. Must be non-NULL. |
- Returns
- non-zero value on error (i.e. object is already installed), 0 otherwise.