简体   繁体   中英

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 ? 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.

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.

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.

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.

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. The Zigbee Walker sample shows how to use ZDO/ZDP queries to enumerate endpoints, and then ZCL queries to enumerate clusters and attributes. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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