Open Lighting Architecture: ola::rdm::DiscoveryAgent Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
ola::rdm::DiscoveryAgent Class Reference

## Detailed Description

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.

## Public Types
typedef ola::SingleUseCallback2< void, bool, const UIDSet & > | DiscoveryCompleteCallback

## Public Member Functions
| DiscoveryAgent (DiscoveryTargetInterface *target)
| Create a new DiscoveryAgent.
| ~DiscoveryAgent ()
| Destructor.
void | Abort ()
| Cancel any in-progress discovery operation. If a discovery operation is running, this will result in the callback being run.
void | StartFullDiscovery (DiscoveryCompleteCallback *on_complete)
| Initiate a full discovery operation.
void | StartIncrementalDiscovery (DiscoveryCompleteCallback *on_complete)
| Initiate an incremental discovery operation.

## Constructor & Destructor Documentation

## ◆ DiscoveryAgent()

ola::rdm::DiscoveryAgent::DiscoveryAgent | ( | DiscoveryTargetInterface * | target | ) |
| explicit

Create a new DiscoveryAgent.

Parameters

  target | the DiscoveryTargetInterface to use for sending commands.

## Member Function Documentation

## ◆ StartFullDiscovery()

void ola::rdm::DiscoveryAgent::StartFullDiscovery | ( | DiscoveryCompleteCallback * | on_complete | ) |

Initiate a full discovery operation.

Parameters

  on_complete | the callback to run once discovery completes.

## ◆ StartIncrementalDiscovery()

void ola::rdm::DiscoveryAgent::StartIncrementalDiscovery | ( | DiscoveryCompleteCallback * | on_complete | ) |

Initiate an incremental discovery operation.

Parameters

  on_complete | the callback to run once discovery completes.

The documentation for this class was generated from the following files:

- include/ola/rdm/DiscoveryAgent.h
- common/rdm/DiscoveryAgent.cpp