Thread 中讨论的其他器件:Z-stack
工具与软件:
您好!
我目前正在使用 Z-Stack 开发一种 Zigbee 应用、并且在发送时遇到问题 Config Reporting发送到终端设备的命令。
已在 endDevice 成功接收配置。 但是、当 BDB_FINDING_BINDING_CAPABILITY_ENABLED选项禁用时、Z-Stack 无法保存配置。 帮助我们简化模型 bdb_reporting.c特别是在函数中 bdb_ProcessInConfigReportCmd我发现,它失败了,因为没有一个 endPointDescriptor. 此问题位于代码的这一部分:
// Find Ep Descriptor
endPointDesc_t* epDescriptor = bdb_FindEpDesc(pInMsg->endPoint);
if (epDescriptor == NULL)
{
return (ZInvalidParameter);
}
问题似乎源于
bdb_HeadEpDescriptorList它在时不会初始化 BDB_FINDING_BINDING_CAPABILITY_ENABLED时被禁用。 添加了新的符号 af.c、 内部的元素 afRegisterExtended我注意到了初始化 bdb_HeadEpDescriptorList受此选项制约: #if (BDB_FINDING_BINDING_CAPABILITY_ENABLED == 1)
// Make sure we add at least one application endpoint
if ((epDesc->endPoint != 0) && (epDesc->endPoint < BDB_ZIGBEE_RESERVED_ENDPOINTS_START))
{
bdb_HeadEpDescriptorList = epList;
ep->epDesc->epType = bdb_zclFindingBindingEpType(ep->epDesc);
}
#endif
为了解决此问题、我修改了代码以
bdb_HeadEpDescriptorList在BDB_FINDING_BINDING_CAPABILITY_ENABLED禁用时进行初始化。 以下是更新后的代码: // Make sure we add at least one application endpoint
if ((epDesc->endPoint != 0) && (epDesc->endPoint < BDB_ZIGBEE_RESERVED_ENDPOINTS_START))
{
bdb_HeadEpDescriptorList = epList;
#if (BDB_FINDING_BINDING_CAPABILITY_ENABLED == 1)
ep->epDesc->epType = bdb_zclFindingBindingEpType(ep->epDesc);
#endif
}
进行这种修改后、报告配置可正常工作、Z-Stack 会成功保存该配置。
我的问题是 :为什么是初始化的 bdb_HeadEpDescriptorList由调节 BDB_FINDING_BINDING_CAPABILITY_ENABLED有哪些不同的选择? 禁用此选项时、此逻辑似乎会阻止基本功能、例如报告。 此设计是否有具体的原因、或者是否存在我应注意的含义?
提前感谢您的见解!