请选择 进入手机版 | 继续访问电脑版
楼主: kennan

Zstack中关于NV的几个问题(一)

[复制链接]
xiaoyige 发表于 2011-1-27 17:48:58 | 显示全部楼层
很好谢谢楼主
tracy 发表于 2011-3-18 10:42:39 | 显示全部楼层
谢谢楼主,对我这个新手帮助很大@@
linjun_1988 发表于 2011-3-22 14:23:50 | 显示全部楼层
学习。
song875 发表于 2011-3-22 23:16:07 | 显示全部楼层
回复 1# kennan [/b
感谢分享!!!!!!!!!!!!!!!
xiaoyou1314 发表于 2011-5-7 13:28:13 | 显示全部楼层
好详细的叙述啊,支持支持,哈哈。
whqing 发表于 2011-5-24 16:54:40 | 显示全部楼层
厉害,写的非常不错
fanding0512 发表于 2011-5-31 09:23:48 | 显示全部楼层
写得很好,收藏了。
57447856 发表于 2011-6-12 21:31:45 | 显示全部楼层
写得太好了 MARK一下
henhaode 发表于 2011-6-30 17:08:44 | 显示全部楼层
在自己的应用里正好需要用到数据保存,结合这个实例做了验证,发现有问题,求解。
在ZComDef.h加入要保存参数的ID号
// NV Items Reserved for applications (user applications)
// 0x0401 ?0x0FFF
#define ZCD_NV_AUTOPOLL_INTERVAL_SEC     0x0202

以下在SensorDemo---SensorEB-PRO中
  1. void zb_BindConfirm( uint16 commandId, uint8 status )
  2. {
  3.   static uint8 status1 = FALSE;
  4.   static uint16 testint = 0x8b5a;
  5.   static uint16 testint1 =0;
  6. //  myReportPeriod
  7.   
  8.   if( status == ZB_SUCCESS )
  9.   {   
  10.     appState = APP_REPORT;
  11.     HalLedSet( HAL_LED_2, HAL_LED_MODE_ON );

  12.     devResetInd();
  13.    
  14.     status1 = osal_nv_item_init( ZCD_NV_AUTOPOLL_INTERVAL_SEC, sizeof(testint), NULL );
  15.     status1 = [color=SandyBrown]osal_nv_write[/color]( ZCD_NV_AUTOPOLL_INTERVAL_SEC,0, sizeof(testint), &testint );
  16.     status1 = osal_nv_read( ZCD_NV_AUTOPOLL_INTERVAL_SEC,0, sizeof(testint1), &testint1 );
  17.    
  18. 在osal_nv_read设断点查看testint1的值确实可以得到0x8b5a。
  19. 但是,注释掉osal_nv_write这行编译后再运行testint1得到0xffff,这样的话参数保存并没有成功。为什么?
  20.    ...
  21. ...
  22. }
  23.    
复制代码
dong_2010 发表于 2011-7-9 18:54:55 | 显示全部楼层
支持之后,研究
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表