Is there any code example for storing application data using the zboss stack? I have only found this:
There are two predefined dataset IDs for a user application: ZB_NVRAM_APP_DATA1 and ZB_NVRAM_APP_DATA2. It's up to the application to decide what data to store in NVRAM. However, the total data size (all datasets) stored in the NVRAM storage should be less than one virtual page size. To start using NVRAM in the application, the following steps should be done in the application:
@li Define an application specific data structure to be stored in the NVRAM.
@li Register callbacks to write, read data and get size of data to store.
@li Once write application data callback is called, it gets a flash page number and a page offset value to store data. The callback must write data using an API zb_osif_nvram_write(). The data size must be the same as returned by a get data size callback.
@li Once get data size callback is called, it must return the size of the data being stored.
@li Once the read application data callback is called, it gets a flash page number, a page offset value, and a payload size of data to read. The callback reads the data using an API zb_osif_nvram_read() with the provided addressing information as input parameters.
@li At runtime trigger storing data to NVRAM with a call to zb_nvram_write_dataset().
I have not been able to successfully store data. Any code snippet? Could you help me with this?
thx