29 #ifndef INCLUDE_OLA_RDM_DISCOVERYAGENT_H_
30 #define INCLUDE_OLA_RDM_DISCOVERYAGENT_H_
175 UIDRange(
const UID &lower,
const UID &upper, UIDRange *parent)
182 branch_corrupt(
false) {
187 unsigned int attempt;
188 unsigned int failures;
189 unsigned int uids_discovered;
193 typedef std::stack<UIDRange*> UIDRanges;
201 std::queue<UID> m_uids_to_mute;
203 std::auto_ptr<DiscoveryTargetInterface::UnMuteDeviceCallback>
205 std::auto_ptr<DiscoveryTargetInterface::MuteDeviceCallback>
206 m_incremental_mute_callback;
207 std::auto_ptr<DiscoveryTargetInterface::MuteDeviceCallback>
208 m_branch_mute_callback;
209 std::auto_ptr<DiscoveryTargetInterface::BranchCallback> m_branch_callback;
212 UIDRanges m_uid_ranges;
214 unsigned int m_unmute_count;
215 unsigned int m_mute_attempts;
221 void UnMuteComplete();
222 void MaybeMuteNextDevice();
223 void IncrementalMuteComplete(
bool status);
224 void SendDiscovery();
226 void BranchComplete(
const uint8_t *data,
unsigned int length);
227 void BranchMuteComplete(
bool status);
228 void HandleCollision();
229 void FreeCurrentRange();
231 static const unsigned int PREAMBLE_SIZE = 8;
232 static const unsigned int EUID_SIZE = 12;
233 static const unsigned int CHECKSUM_SIZE = 4;
239 static const unsigned int MAX_EMPTY_BRANCH_ATTEMPTS = 5;
244 static const unsigned int MAX_BRANCH_FAILURES = 5;
247 static const unsigned int MAX_MUTE_ATTEMPTS = 5;
250 static const unsigned int BROADCAST_UNMUTE_REPEATS = 3;
252 static const uint8_t PREAMBLE = 0xfe;
253 static const uint8_t PREAMBLE_SEPARATOR = 0xaa;
257 #endif // INCLUDE_OLA_RDM_DISCOVERYAGENT_H_