Design of async Zigbee device discovery in discovery actor
⚓ Rust 📅 2026-06-13 👤 surdeus 👁️ 1I need a second opinion on the design of async discovery of Zigbee devices.
I have a discovery::Actor, which implements the actor model and receives messages, amongst others, those of Events.
If such an event is Event::DeviceJoined(address) the actor shall start the discovery of that device.
This involves several steps:
- Discovery of endpoints on the node.
- Discovery of descriptors for each of the endpoints.
- Discovery of a pre-dermined set of attributes for each endpoint.
Now, due to Zigbee being a fallible radio mesh networking protocol, each of these steps can fail.
So I want to have an option to retry each of the steps above until all properties are discovered.
I am facing several challenges while implementing this:
- The discovery of each device shall be non-blocking in the
discovery::Actor's main loop. - Steps 2 and 3 depend on step 1 having completed successfully.
- Steps 2 and 3 are independent and may be parallellized.
- Once any device discovery is completed, it shall forward the completely discovered device data to another actor.
Here's my current (WIP) approach:
Do you have some established patterns or tips on how I can achieve my set goals?
3 posts - 2 participants
🏷️ Rust_feed