sACN  2.0.2
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 2022 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
146#define SACN_SOURCE_DETECTOR_INFINITE 0
147
167 const char* name, const uint16_t* sourced_universes,
168 size_t num_sourced_universes, void* context);
169
179 const char* name, void* context);
180
197typedef void (*SacnSourceDetectorLimitExceededCallback)(void* context);
198
207
229
231#define SACN_SOURCE_DETECTOR_CONFIG_DEFAULT_INIT \
232 { \
233 {NULL, NULL, NULL, NULL}, SACN_SOURCE_DETECTOR_INFINITE, SACN_SOURCE_DETECTOR_INFINITE, kSacnIpV4AndIpV6 \
234 }
235
237
239 const SacnNetintConfig* netint_config);
241
243
244size_t sacn_source_detector_get_network_interfaces(EtcPalMcastNetintId* netints, size_t netints_size);
245
246#ifdef __cplusplus
247}
248#endif
249
254#endif /* SACN_SOURCE_DETECTOR_H_ */
Common definitions for sACN.
etcpal_error_t
sacn_ip_support_t
Definition common.h:71
uint16_t sacn_remote_source_t
Definition common.h:58
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:178
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:166
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
struct SacnSourceDetectorCallbacks SacnSourceDetectorCallbacks
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
void(* SacnSourceDetectorLimitExceededCallback)(void *context)
Notify that the module has run out of memory to track universes or sources.
Definition source_detector.h:197
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
Definition common.h:102
Definition source_detector.h:201
SacnSourceDetectorLimitExceededCallback limit_exceeded
Definition source_detector.h:204
SacnSourceDetectorSourceExpiredCallback source_expired
Definition source_detector.h:203
void * context
Definition source_detector.h:205
SacnSourceDetectorSourceUpdatedCallback source_updated
Definition source_detector.h:202
Definition source_detector.h:210
int universes_per_source_max
Definition source_detector.h:224
int source_count_max
Definition source_detector.h:219
sacn_ip_support_t ip_supported
Definition source_detector.h:227
SacnSourceDetectorCallbacks callbacks
Definition source_detector.h:212