Function anj_dm_device_obj_install
Defined in File device_object.h
Function Documentation
-
int anj_dm_device_obj_install(anj_t *anj, anj_dm_device_obj_t *device_obj, const anj_dm_device_object_init_t *obj_init)
Installs Device Object (/3) in data model.
Example usage:
static int reboot_cb(void *arg, anj_t *anj) { // perform reboot } // ... anj_dm_device_obj_t dev_obj; static const anj_dm_device_object_init_t dev_obj_init = { .manufacturer = "manufacturer", .model_number = "model_number", .serial_number = "serial_number", .firmware_version = "firmware_version", .software_version = "software_version", .reboot_handler = reboot_cb }; anj_dm_device_obj_install(&anj, &dev_obj, &dev_obj_init);
- Parameters:
anj – Anjay object.
device_obj – Pointer to a variable that will hold the state of the Object.
obj_init – Pointer to Object’s initialization structure.
- Returns:
0 on success, a non-zero value in case of an error.