Hi
there is a ZED which have some attributes will be writed by other device。
I want to save some attributes data to NV flash when appropriatly,
and i need to read back when the device reset 。
first step i define a ID in ZComDef.h
#define ZONE_CIEADDRESS_AND_ENROLL_INFO 0x0401
i put those code in the App initial function to read back when the device reset:
if(osal_nv_item_init( ZONE_CIEADDRESS_AND_ENROLL_INFO, Z_EXTADDR_LEN +1, NULL) == ZSUCCESS)//测试成功
{
uint8 *buf;
uint8 i;
buf = NULL;
osal_nv_write(ZONE_CIEADDRESS_AND_ENROLL_INFO, 0, sizeof aExtendedAddress,aExtendedAddress);
if (osal_nv_read(ZONE_CIEADDRESS_AND_ENROLL_INFO, 0, sizeof buf, buf)==SUCCESS)
{
for(i=0;i<Z_EXTADDR_LEN-1;buf++)
{
zclWarningDevice_IAS_CIE_Address[i++]=*buf;
}
zclWarningDevice_ZoneState =*buf;
}
}
but when i debug ,i find that it have not success in osal_nv_item_init
what is the problem!!!