sACN  HEAD (unstable)
Implementation of ANSI E1.31 (Streaming ACN)
View other versions:
Loading...
Searching...
No Matches
source_detector.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright 2024 ETC Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 ******************************************************************************
16 * This file is a part of sACN. For more information, go to:
17 * https://github.com/ETCLabs/sACN
18 *****************************************************************************/
19
28#ifndef SACN_SOURCE_DETECTOR_H_
29#define SACN_SOURCE_DETECTOR_H_
30
31#include <stdbool.h>
32#include <stdint.h>
33#include "etcpal/error.h"
34#include "etcpal/inet.h"
35#include "etcpal/log.h"
36#include "etcpal/netint.h"
37#include "etcpal/uuid.h"
38#include "sacn/common.h"
39
136#ifdef __cplusplus
137extern "C" {
138#endif
139
140enum
141{
150
170 const EtcPalUuid* cid,
171 const char* name,
172 const uint16_t* sourced_universes,
173 size_t num_sourced_universes,
174 void* context);
175
185 const EtcPalUuid* cid,
186 const char* name,
187 void* context);
188
205typedef void (*SacnSourceDetectorLimitExceededCallback)(void* context);
206
215
237
239#define SACN_SOURCE_DETECTOR_CONFIG_DEFAULT_INIT \
240 {{NULL, NULL, NULL, NULL}, kSacnSourceDetectorInfinite, kSacnSourceDetectorInfinite, kSacnIpV4AndIpV6}
241
243
245 const SacnNetintConfig* netint_config);
247
249
250size_t sacn_source_detector_get_network_interfaces(EtcPalMcastNetintId* netints, size_t netints_size);
251
252#ifdef __cplusplus
253}
254#endif
255
260#endif /* SACN_SOURCE_DETECTOR_H_ */
Common definitions for sACN.
etcpal_error_t
sacn_ip_support_t
This enum defines how the API module will use IPv4 and IPv6 networking.
Definition common.h:75
uint16_t sacn_remote_source_t
A source discovered on an sACN network that has a CID - used by Receiver and Merge Receiver.
Definition common.h:47
void(* SacnSourceDetectorSourceExpiredCallback)(sacn_remote_source_t handle, const EtcPalUuid *cid, const char *name, void *context)
Notify that a source is no longer transmitting Universe Discovery messages.
Definition source_detector.h:184
void(* SacnSourceDetectorSourceUpdatedCallback)(sacn_remote_source_t handle, const EtcPalUuid *cid, const char *name, const uint16_t *sourced_universes, size_t num_sourced_universes, void *context)
Notify that a source is new or has changed.
Definition source_detector.h:169
void sacn_source_detector_destroy()
Destroy the sACN Source Detector.
Definition source_detector.c:129
etcpal_error_t sacn_source_detector_reset_networking(const SacnNetintConfig *sys_netint_config)
Updates the source detector system network interfaces.
Definition source_detector.c:178
struct SacnSourceDetectorCallbacks SacnSourceDetectorCallbacks
A set of callback functions that the library uses to notify the application about source detector eve...
etcpal_error_t sacn_source_detector_create(const SacnSourceDetectorConfig *config, const SacnNetintConfig *netint_config)
Create the sACN Source Detector.
Definition source_detector.c:85
void sacn_source_detector_config_init(SacnSourceDetectorConfig *config)
Initialize an sACN Source Detector Config struct to default values.
Definition source_detector.c:61
struct SacnSourceDetectorConfig SacnSourceDetectorConfig
A set of configuration information for the sACN Source Detector.
void(* SacnSourceDetectorLimitExceededCallback)(void *context)
Notify that the module has run out of memory to track universes or sources.
Definition source_detector.h:205
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:225
@ kSacnSourceDetectorInfinite
Constant for "infinite" when listening for sources or universes on a source.
Definition source_detector.h:148
Network interface configuration information to give the sACN library.
Definition common.h:114
A set of callback functions that the library uses to notify the application about source detector eve...
Definition source_detector.h:209
SacnSourceDetectorSourceExpiredCallback source_expired
Required.
Definition source_detector.h:211
SacnSourceDetectorSourceUpdatedCallback source_updated
Required.
Definition source_detector.h:210
SacnSourceDetectorLimitExceededCallback limit_exceeded
Optional.
Definition source_detector.h:212
void * context
(optional) Pointer to opaque data passed back with each callback.
Definition source_detector.h:213
A set of configuration information for the sACN Source Detector.
Definition source_detector.h:218
SacnSourceDetectorCallbacks callbacks
The callbacks the detector will use to notify the application of events.
Definition source_detector.h:220
int source_count_max
The maximum number of sources the detector will record.
Definition source_detector.h:227
sacn_ip_support_t ip_supported
What IP networking the source detector will support.
Definition source_detector.h:235
int universes_per_source_max
The maximum number of universes the detector will record for a source.
Definition source_detector.h:232