67#ifndef TR_NVRAM_ATTR_H
68#define TR_NVRAM_ATTR_H
73#define TR_NVRAM_STORAGE_VER_1 (1)
74#define TR_NVRAM_STORAGE_VER_2 (2)
78#define TR_NVRAM_WRITE_DELAY_MS (2000)
81#define TR_NVRAM_ATTR_STORAGE_VER_1 (1)
82#define TR_NVRAM_ATTR_STORAGE_CUR_VER (TR_NVRAM_ATTR_STORAGE_VER_1)
84#define TR_NVRAM_SECTION_ID_ZIGBEE_ATTRS 0x8001
93#ifdef TR_NVRAM_PRINT_ENABLE
94#define tr_nvram_printf(...) tr_core_printf(__VA_ARGS__)
96#define tr_nvram_printf(...)
102#ifdef TR_NVRAM_VERBOSE_PRINT_ENABLE
103#define tr_nvram_verbose_printf(...) tr_core_printf(__VA_ARGS__)
105#define tr_nvram_verbose_printf(...)
141#ifdef TR_SCENES_SERVER_PLUGIN_ENABLE
142 #define TR_NVRAM_SCENES_SLOTS 1
144 #define TR_NVRAM_SCENES_SLOTS 0
147#ifdef TR_DOOR_LOCK_SERVER_PLUGIN_ENABLE
148 #define TR_NVRAM_DOOR_LOCK_SLOTS 1
150 #define TR_NVRAM_DOOR_LOCK_SLOTS 0
153#ifndef TR_NVRAM_NUM_APP_SECTIONS
154 #define TR_NVRAM_NUM_APP_SECTIONS 1
158#define TR_NVRAM_NUM_TABLE_SLOTS (TR_NVRAM_NUM_APP_SECTIONS + TR_NVRAM_DOOR_LOCK_SLOTS + TR_NVRAM_SCENES_SLOTS)
174typedef ZB_PACKED_PRE
struct
228 zb_uint16_t payload_length);
268 zb_uint16_t delay_time_ms);
279 zb_uint8_t data_entry_size,
280 zb_uint8_t data_num_entries);
void tr_check_for_attr_nvram_update_delay(zb_uint8_t ep, zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint16_t attr_id, zb_uint16_t manuf_code, zb_uint16_t delay_time_ms)
check if a changed attr is supposed to be saved in NV and if so, save it
void tr_check_for_attr_nvram_update(zb_uint8_t ep, zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint16_t attr_id, zb_uint16_t manuf_code)
check if a changed attr is supposed to be saved in NV and if so, save it
zb_bool_t(* tr_nvram_err_handler_t)(zb_uint8_t *saved_data_ptr, zb_uint8_t data_entry_size, zb_uint8_t data_num_entries)
function pointer type for handling size or version errors or NULL to abort data read in this casee
Definition tr_nvram_attr.h:278
void tr_nvram_read_app_data_cb(zb_uint8_t page, zb_uint32_t pos, zb_uint16_t payload_length)
read API: do not change this without reading below
zb_bool_t(* tr_nvram_clear_data_t)(void)
function pointer type for clearing the callback data or NULL to use default behavior (set to 0)
Definition tr_nvram_attr.h:273
void tr_nvram_register(tr_nvram_data_info_t *register_data)
this API is called by a plugin to register to have its data saved
void tr_nvram_save(zb_uint16_t delay_time_ms)
this API is called by a plugin when plugin data has changed
ZB_PACKED_PRE struct @242232173312214114246275277065327230101147147264 tr_nvram_attr_storage_v1_t
structure for storing information about zigbee attributes in NV
tr_nvram_section_id_t
standard section IDs used by Trident plugins and reserved for use by the application
Definition tr_nvram_attr.h:124
zb_uint16_t tr_get_nvram_data_size(void)
there are 3 API functions needed by ZBOSS and passed by the apps
zb_ret_t tr_nvram_write_app_data_cb(zb_uint8_t page, zb_uint32_t pos)
write API: do not change this without reading below
@ TR_NVRAM_SECTION_TSTAT_SCHEDULE_TABLE
Definition tr_nvram_attr.h:128
@ TR_NVRAM_SECTION_ZIGBEE_ATTRIBUTES
Definition tr_nvram_attr.h:125
@ TR_NVRAM_SECTION_SCENES_TABLE
Definition tr_nvram_attr.h:126
@ TR_NVRAM_SECTION_APP_DATA_1
Definition tr_nvram_attr.h:129
@ TR_NVRAM_SECTION_DOOR_LOCK_USER_TABLE
Definition tr_nvram_attr.h:127
struct that a plugin fills in to have its plugin data saved
Definition tr_nvram_attr.h:286
tr_nvram_err_handler_t err_hndl_fx
Definition tr_nvram_attr.h:293
tr_nvram_section_id_t section_id
Definition tr_nvram_attr.h:287
zb_uint8_t * plugin_data_ptr
Definition tr_nvram_attr.h:291
zb_uint8_t entry_size_len
Definition tr_nvram_attr.h:289
zb_uint8_t data_version
Definition tr_nvram_attr.h:288
zb_uint8_t num_entries
Definition tr_nvram_attr.h:290
tr_nvram_clear_data_t clear_data_fx
Definition tr_nvram_attr.h:292
Trident application framework include.
zb_uint8_t endpoint
Definition tr_nvram_attr.h:176
zb_uint16_t cluster_id
Definition tr_nvram_attr.h:177
zb_uint8_t cluster_role
Definition tr_nvram_attr.h:179
zb_uint16_t manuf_code
Definition tr_nvram_attr.h:180
zb_uint16_t attr_id
Definition tr_nvram_attr.h:178
zb_uint8_t data_type
Definition tr_nvram_attr.h:181