This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

childaging

// This is an index into table Requested Timeout Enumerated Values.
// It is used by the parent router, it indicates the default timeout value
// for any end device that does not negotiate a different timeout value
uint8 zgNwkEndDeviceTimeoutDefault = NWK_END_DEV_TIMEOUT_DEFAULT;

//==========    Child Aging END DEVICE configuration    ===============
// Values used by End Device when sending End Device Timeout Request
uint8 zgEndDeviceTimeoutValue  = END_DEV_TIMEOUT_VALUE;
uint8 zgEndDeviceConfiguration = END_DEV_CONFIGURATION;

请问zgNwkEndDeviceTimeoutDefault 所指的时间枚举表是哪个,这个变量的含义是什么,如果EndDevice没有开启childaging,而在路由开启了,路由会把zgNwkEndDeviceTimeoutDefault 时间认为是没有收到data request的超时时间吗

//timeoutValue[15]
//    10, // 0 10 seconds
//     2, // 1 2 minutes
//     4, // 2 4 minutes
//     8, // 3 8 minutes
//    16, // 4 16 minutes
//    32, // 5 32 minutes
//    64, // 6 64 minutes
//   128, // 7 128 minutes
//   256, // 8 256 minutes
//   512, // 9 512 minutes
//  1024, // 10 1024 minutes
//  2048, // 11 2048 minutes
//  4096, // 12 4096 minutes
//  8192, // 13 8192 minutes
// 16384 // 14 16384 minutes
//

是指这个表吗

  • 是的。

    如果使能了zgChildAgingEnable功能,那么End Device在入网成功以后,会通过Device Announce把Timeout相关的信息发给父设备。ZDApp_AnnounceNewAddress( void )里的NLME_SendEndDevTimeoutReq。

    这个函数中会把下面两个变量的信息发送给父设备,也就是说不同的节点可以配置不同的timeout时间,主要也是根据节点的Data request来决定的。

    uint8 zgEndDeviceTimeoutValue = END_DEV_TIMEOUT_VALUE;
    uint8 zgEndDeviceConfiguration = END_DEV_CONFIGURATION;

    在父设备上面,收到这个req以后,会调用到下面这个函数

    NLME_ProcessEndDevTimeoutReq( NLDE_FrameFormat_t *ff )

    这个函数处理的过程,主要是把收到的zgEndDeviceTimeoutValue,写到AssociateList里面去,

    typedef struct
    {
    uint16 shortAddr; // Short address of associated device
    uint16 addrIdx; // Index from the address manager
    byte nodeRelation;
    byte devStatus; // bitmap of various status values
    byte assocCnt;
    byte age;
    linkInfo_t linkInfo;
    aging_end_device_t endDev;
    uint32 timeoutCounter;
    bool keepaliveRcv;
    } associated_devices_t;

  • 为什么我的父设备使能了childagine,EndDevice也使能了childaging,设置超时时间为4m的时候,超时时间收到datarequest、却没有更新,在4分钟后仍然会丢失子设备,发送routerequest,这4分钟之内EndDevice是一直在发data request的

  • 目前也遇到这个奇怪的问题,不知道有解决了么?请问

  • 如果是希望通过Data Request来实现child aging的功能的话需要修改下面的代码

    //======= 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.
    #if ( ZG_BUILD_ENDDEVICE_TYPE )
    uint8 zgNwkParentInformation = NWK_PARENT_INFO_UNDEFINED;
    #else
    uint8 zgNwkParentInformation = NWK_PARENT_INFO_ORPHAN_NOTIFICATION;
    #endif

    在父设备上面把这个改成

    #define NWK_PARENT_INFO_MAC_DATA_POLL         0x01