sACN  2.0.2
Implementation of ANSI E1.31 (Streaming ACN)
View other versions:
Loading...
Searching...
No Matches
dmx_merger.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_DMX_MERGER_H_
29#define SACN_DMX_MERGER_H_
30
31#include <stdbool.h>
32#include <stdint.h>
33#include "etcpal/error.h"
34#include "sacn/common.h"
35#include "sacn/receiver.h"
36
60#ifdef __cplusplus
61extern "C" {
62#endif
63
66
68#define SACN_DMX_MERGER_INVALID -1
69
72typedef uint16_t sacn_dmx_merger_source_t;
73
75#define SACN_DMX_MERGER_SOURCE_INVALID ((sacn_dmx_merger_source_t)-1)
76
78typedef struct SacnDmxMergerConfig
79{
80 /********* Required values **********/
81
86 uint8_t* levels;
87
88 /********* Optional values **********/
89
96
101
105
113
118
120
132#define SACN_DMX_MERGER_CONFIG_INIT \
133 { \
134 NULL, NULL, NULL, NULL, NULL, SACN_RECEIVER_INFINITE_SOURCES \
135 }
136
143#define SACN_DMX_MERGER_SOURCE_IS_VALID(owners_array, slot_index) \
144 (owners_array[slot_index] != SACN_DMX_MERGER_SOURCE_INVALID)
145
171
174
178
180 const uint8_t* new_levels, size_t new_levels_count);
182 size_t pap_count);
184 uint8_t universe_priority);
186
187#ifdef __cplusplus
188}
189#endif
190
195#endif /* SACN_DMX_MERGER_H_ */
Common definitions for sACN.
etcpal_error_t
#define DMX_ADDRESS_COUNT
Definition common.h:55
const SacnDmxMergerSource * sacn_dmx_merger_get_source(sacn_dmx_merger_t merger, sacn_dmx_merger_source_t source)
Gets a read-only view of the source data.
Definition dmx_merger.c:344
etcpal_error_t sacn_dmx_merger_destroy(sacn_dmx_merger_t handle)
Destroy a merger instance.
Definition dmx_merger.c:212
struct SacnDmxMergerSource SacnDmxMergerSource
uint16_t sacn_dmx_merger_source_t
Definition dmx_merger.h:72
etcpal_error_t sacn_dmx_merger_update_levels(sacn_dmx_merger_t merger, sacn_dmx_merger_source_t source, const uint8_t *new_levels, size_t new_levels_count)
Updates a source's levels and recalculates outputs.
Definition dmx_merger.c:385
etcpal_error_t sacn_dmx_merger_create(const SacnDmxMergerConfig *config, sacn_dmx_merger_t *handle)
Create a new merger instance.
Definition dmx_merger.c:170
struct SacnDmxMergerConfig SacnDmxMergerConfig
etcpal_error_t sacn_dmx_merger_update_universe_priority(sacn_dmx_merger_t merger, sacn_dmx_merger_source_t source, uint8_t universe_priority)
Updates a source's universe priority and recalculates outputs.
Definition dmx_merger.c:500
int sacn_dmx_merger_t
Definition dmx_merger.h:65
etcpal_error_t sacn_dmx_merger_update_pap(sacn_dmx_merger_t merger, sacn_dmx_merger_source_t source, const uint8_t *pap, size_t pap_count)
Updates a source's per-address priorities (PAP) and recalculates outputs.
Definition dmx_merger.c:441
etcpal_error_t sacn_dmx_merger_remove_source(sacn_dmx_merger_t merger, sacn_dmx_merger_source_t source)
Removes a source from the merger.
Definition dmx_merger.c:302
etcpal_error_t sacn_dmx_merger_remove_pap(sacn_dmx_merger_t merger, sacn_dmx_merger_source_t source)
Removes the per-address priority (PAP) data from the source and recalculate outputs.
Definition dmx_merger.c:544
etcpal_error_t sacn_dmx_merger_add_source(sacn_dmx_merger_t merger, sacn_dmx_merger_source_t *source_id)
Adds a new source to the merger.
Definition dmx_merger.c:260
sACN Receiver API definitions
Definition dmx_merger.h:79
uint8_t * levels
Definition dmx_merger.h:86
uint8_t * per_address_priorities
Definition dmx_merger.h:95
int source_count_max
Definition dmx_merger.h:117
bool * per_address_priorities_active
Definition dmx_merger.h:100
uint8_t * universe_priority
Definition dmx_merger.h:104
sacn_dmx_merger_source_t * owners
Definition dmx_merger.h:112
Definition dmx_merger.h:148
size_t valid_level_count
Definition dmx_merger.h:156
sacn_dmx_merger_source_t id
Definition dmx_merger.h:150
bool using_universe_priority
Definition dmx_merger.h:168
uint8_t levels[DMX_ADDRESS_COUNT]
Definition dmx_merger.h:153
uint8_t address_priority[DMX_ADDRESS_COUNT]
Definition dmx_merger.h:165
uint8_t universe_priority
Definition dmx_merger.h:159