Orphan notification poll 机制

z-satck的协议栈提供了两种aging 的方法,一种是发orphan 一种是发data request。 取决于父节点上zgNwkParentInformation 的取值

zgNwkParentInformation = NWK_PARENT_INFO_MAC_DATA_POLL   使用 data request

zgNwkParentInformation = NWK_PARENT_INFO_ORPHAN_NOTIFICATION; 使用 orphan notification

默认使用orphan notification

在ZGlobals.c 中 有一段代码 注释,上面讲得很详细:

//=======    Child Aging PARENT ROUTER (ZR/ZC) configuration   ========
// You can setup a router to support Child Table Aging in 1 of 2 modes of
// operation.  The first mode is NWK_PARENT_INFO_ORPHAN_NOTIFICATION and it
// expects end devices to use orphan scan periodically as a means of a keep-alive
// notification to the parent.  The other mode is NWK_PARENT_INFO_MAC_DATA_POLL
// which uses the end device's MAC POLL request as the keep-alive notification.
// The first method is preferred for new devices, where the end devices provide
// support for it (which will be manditory in future Zigbee Home Automation
// Specifications).
// The second method is compatible with older end devices without the need for
// specific child aging support.
//
// The method supported by the router (or coordinator) is determined at build time
// by setting zgNwkParentInformation to either NWK_PARENT_INFO_ORPHAN_NOTIFICATION
// or NWK_PARENT_INFO_MAC_DATA_POLL.
//
// End device built with Child Table Aging support both methods, the method is
// determined by the parent and communicated at run-time.

在终端设备里面的几个POLL RATE


/* The number of milliseconds to wait between data request polls to the coordinator. */
-DPOLL_RATE=1000


/* This is used after receiving a data indication to poll immediately
 * for queued messages...in milliseconds.
 */
-DQUEUED_POLL_RATE=100


/* This is used after receiving a data confirmation to poll immediately
 * for response messages...in milliseconds
 */
-DRESPONSE_POLL_RATE=100


/* This is used as an alternate response poll rate only for rejoin request.
 * This rate is determined by the response time of the parent that the device
 * is trying to join.
 */
-DREJOIN_POLL_RATE=440


/* Rejoin retry backoff silent period timer duration in milliseconds - default 15 minutes according to HA test spec */
-DREJOIN_BACKOFF=900000


/* Rejoin retry backoff scan timer duration in milliseconds - default 15 minutes according to HA test spec */
-DREJOIN_SCAN=900000

当节点POLL不到父节点时会变成孤儿节点从而执行下面的程序

if( events & ZDO_REJOIN_BACKOFF )
  {
    if( devState == DEV_NWK_BACKOFF )
    {
      ZDApp_ChangeState(DEV_NWK_DISC);
      // Restart scan for rejoin
      ZDApp_StartJoiningCycle();
      osal_start_timerEx( ZDAppTaskID, ZDO_REJOIN_BACKOFF, zgDefaultRejoinScan );
    }
    else
    {
      // Rejoin backoff, silent period
      ZDApp_ChangeState(DEV_NWK_BACKOFF);
      ZDApp_StopJoiningCycle();
      osal_start_timerEx( ZDAppTaskID, ZDO_REJOIN_BACKOFF, zgDefaultRejoinBackoff );
    }

    return ( events ^ ZDO_REJOIN_BACKOFF);
  }


  

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值