20#ifndef SACN_CPP_SOURCE_DETECTOR_H_
21#define SACN_CPP_SOURCE_DETECTOR_H_
230 const char* name,
const uint16_t* sourced_universes,
231 size_t num_sourced_universes,
void* context)
233 if (context && cid && name)
236 if (sourced_universes && (num_sourced_universes > 0))
237 sourced_vec.
assign(sourced_universes, sourced_universes + num_sourced_universes);
243 const char* name,
void* context)
245 if (context && cid && name)
247 static_cast<SourceDetector::NotifyHandler*
>(context)->HandleSourceExpired(handle, *cid, name);
251extern "C" inline void SourceDetectorCbMemoryLimitExceeded(
void* context)
255 static_cast<SourceDetector::NotifyHandler*
>(context)->HandleMemoryLimitExceeded();
331 return Startup(settings, notify_handler, netints);
431 if (sys_netints.
empty())
451 size_t size_guess = 4u;
452 size_t num_netints = 0u;
456 netints.
resize(size_guess);
458 size_guess = num_netints + 4u;
459 }
while (num_netints > netints.
size());
461 netints.
resize(num_netints);
465inline SacnSourceDetectorConfig SourceDetector::TranslateConfig(
const Settings& settings, NotifyHandler& notify_handler)
470 internal::SourceDetectorCbSourceUpdated,
471 internal::SourceDetectorCbSourceExpired,
472 internal::SourceDetectorCbMemoryLimitExceeded,
476 settings.universes_per_source_max,
477 settings.ip_supported
A base class for a class that receives notification callbacks from a sACN Source Detector.
Definition source_detector.h:129
virtual void HandleSourceExpired(RemoteSourceHandle handle, const etcpal::Uuid &cid, const std::string &name)=0
Notify that a source is no longer transmitting Universe Discovery messages.
virtual void HandleMemoryLimitExceeded()
Notify that the module has run out of memory to track universes or sources.
Definition source_detector.h:177
virtual void HandleSourceUpdated(RemoteSourceHandle handle, const etcpal::Uuid &cid, const std::string &name, const std::vector< uint16_t > &sourced_universes)=0
Notify that a source is new or has changed.
An instance of sACN Source Detector functionality.
Definition source_detector.h:122
static etcpal::Error ResetNetworking()
Resets the underlying network sockets and packet receipt state for the sACN Source Detector.
Definition source_detector.h:399
static std::vector< EtcPalMcastNetintId > GetNetworkInterfaces()
Obtain the source detector's network interfaces.
Definition source_detector.h:447
static void Shutdown()
Destroy the sACN Source Detector.
Definition source_detector.h:371
static etcpal::Error Startup(NotifyHandler ¬ify_handler)
Start the sACN Source Detector with default settings.
Definition source_detector.h:281
C++ wrapper for the sACN init/deinit functions.
sacn_ip_support_t
Definition common.h:71
uint16_t sacn_remote_source_t
Definition common.h:58
@ kSacnIpV4AndIpV6
Definition common.h:77
#define SACN_SOURCE_DETECTOR_INFINITE
Constant for "infinite" when listening for sources or universes on a source.
Definition source_detector.h:146
void sacn_source_detector_destroy()
Destroy the sACN Source Detector.
Definition source_detector.c:126
etcpal_error_t sacn_source_detector_reset_networking(const SacnNetintConfig *sys_netint_config)
Updates the source detector system network interfaces. Also resets the underlying network sockets for...
Definition source_detector.c:167
etcpal_error_t sacn_source_detector_create(const SacnSourceDetectorConfig *config, const SacnNetintConfig *netint_config)
Create the sACN Source Detector.
Definition source_detector.c:85
size_t sacn_source_detector_get_network_interfaces(EtcPalMcastNetintId *netints, size_t netints_size)
Obtain the source detector's network interfaces.
Definition source_detector.c:214
A namespace which contains all C++ language definitions in the sACN library.
Definition common.h:50
sacn_remote_source_t RemoteSourceHandle
Definition common.h:52
sACN Source Detector API definitions
Definition source_detector.h:210
int source_count_max
Definition source_detector.h:219
A set of configuration settings that a source detector needs to initialize.
Definition source_detector.h:185
int universes_per_source_max
Definition source_detector.h:198
int source_count_max
Definition source_detector.h:193
sacn_ip_support_t ip_supported
Definition source_detector.h:201