简体   繁体   English

xbee ansi C 库端点示例

[英]xbee ansi C library endpoint example

Wondering if anyone has a full working example of how to make a ZCL endpoint using Digi's Xbee ANSI C Library ?想知道是否有人有完整的工作示例,说明如何使用 Digi 的Xbee ANSI C 库制作 ZCL 端点? The samples directory in that repo has some things, the commission server sample is helpful but I'd love to see an example of the library actually being used for something real.该存储库中的示例目录有一些东西,佣金服务器示例很有帮助,但我很想看到一个实际用于实际用途的库示例。

What I'm trying to make here is a simple sensor to interface with an existing Zigbee network (the coordinator being zigbee2mqtt with a cc2531 in my case) to report readings to home assistant.我在这里要做的是一个简单的传感器,可以与现有的 Zigbee 网络(在我的例子中协调器是 zigbee2mqtt 和 cc2531)连接,以向家庭助理报告读数。

I've seen mentions of a "xbee custom endpoint" example on the Digi forum, but I couldn't find that example, it sounds like that'd be exactly what I need.我在 Digi 论坛上看到过提到“xbee 自定义端点”示例,但我找不到那个示例,听起来这正是我所需要的。

Thanks谢谢

The Commissioning Client and Server samples are overkill for just getting started, but they are used for "something real".调试客户端和服务器示例对于刚开始来说是多余的,但它们用于“真实的东西”。 The Commissioning Cluster is a part of the Zigbee spec.调试集群是 Zigbee 规范的一部分。

You might want to look at zcl_comm_startup_attributes and zcl_comm_startup_attribute_tree in src/zigbee/zcl_commissioning.c to see how you can set up an attribute tree for your cluster.您可能想查看src/zigbee/zcl_commissioning.c中的zcl_comm_startup_attributeszcl_comm_startup_attribute_tree以了解如何为集群设置属性树。

Perhaps look at include/zigbee/zcl_basic_attributes.h and samples/common/_zigbee_walker.c on how to set up the endpoint table with a Basic cluster and its attributes.也许看看include/zigbee/zcl_basic_attributes.hsamples/common/_zigbee_walker.c了解如何使用基本集群及其属性设置端点表。 The Zigbee Walker sample shows how to use ZDO/ZDP queries to enumerate endpoints, and then ZCL queries to enumerate clusters and attributes. Zigbee Walker 示例展示了如何使用 ZDO/ZDP 查询来枚举端点,然后使用 ZCL 查询来枚举集群和属性。 You can use that sample to validate the endpoint/cluster/attribute table that you've set up in a particular program.您可以使用该示例来验证您在特定程序中设置的端点/集群/属性表。

You might want to spend some time reading through the Zigbee Cluster Library specification to understand the concept of endpoints, clusters and attributes, which may help you to understand the tables you need to set up in your program to implement them.您可能需要花一些时间阅读 Zigbee 集群库规范以了解端点、集群和属性的概念,这可能有助于您了解需要在程序中设置以实现它们的表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM