An asynchronous RDM Discovery algorithm.
This implements the binary search algorithm from the E1.20 standard. The implementation is asynchronous and relies on callbacks to indicate when each step completes.
To use the DiscoveryAgent, one should write a class that implements the DiscoveryTargetInterface interface and then pass a pointer to that object to the DiscoveryAgent.
The discovery process goes something like this:
- if incremental, copy all previously discovered UIDs to the mute list
- push (0, 0xffffffffffff) onto the resolution stack
- unmute all
- mute all previously discovered UIDs, for any that fail to mute remove them from the UIDSet.
- Send a discovery unique branch message
- If we get a valid response, mute, and send the same branch again
- If we get a collision, split the UID range, and try each branch separately.
We also track responders that fail to ack a mute request (we attempt to mute MAX_MUTE_ATTEMPTS times) and branches that contain responders which continue to respond once muted. The latter causes a branch to be marked as corrupt, which prevents us from looping forever.