Design of async Zigbee device discovery in discovery actor

⚓ Rust    📅 2026-06-13    👤 surdeus    👁️ 1      

surdeus

I 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:

  1. Discovery of endpoints on the node.
  2. Discovery of descriptors for each of the endpoints.
  3. 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:

  1. The discovery of each device shall be non-blocking in the discovery::Actor's main loop.
  2. Steps 2 and 3 depend on step 1 having completed successfully.
  3. Steps 2 and 3 are independent and may be parallellized.
  4. 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

Read full topic

🏷️ Rust_feed