34#include "etcpal/error.h"
35#include "etcpal/inet.h"
36#include "etcpal/uuid.h"
58#define SACN_SOURCE_INVALID -1
66#define SACN_SOURCE_INFINITE_UNIVERSES 0
69#define SACN_SOURCE_KEEP_ALIVE_INTERVAL_DEFAULT 800
72#define SACN_SOURCE_PAP_KEEP_ALIVE_INTERVAL_DEFAULT 1000
121#define SACN_SOURCE_CONFIG_DEFAULT_INIT \
123 kEtcPalNullUuid, NULL, SACN_SOURCE_INFINITE_UNIVERSES, false, kSacnIpV4AndIpV6, \
124 SACN_SOURCE_KEEP_ALIVE_INTERVAL_DEFAULT, SACN_SOURCE_PAP_KEEP_ALIVE_INTERVAL_DEFAULT \
163#define SACN_SOURCE_UNIVERSE_CONFIG_DEFAULT_INIT \
165 0, 100, false, false, NULL, 0, 0 \
200 size_t destinations_size);
205 uint16_t new_sync_universe);
212 size_t new_levels_size);
214 size_t new_levels_size,
const uint8_t* new_priorities,
215 size_t new_priorities_size);
217 size_t new_levels_size);
219 const uint8_t* new_levels,
size_t new_levels_size,
220 const uint8_t* new_priorities,
size_t new_priorities_size);
227 size_t num_per_universe_netint_lists);
230 size_t netints_size);
Common definitions for sACN.
sacn_ip_support_t
Definition common.h:71
etcpal_error_t sacn_source_change_name(sacn_source_t handle, const char *new_name)
Change the name of an sACN source.
Definition source.c:170
etcpal_error_t sacn_source_send_synchronization(sacn_source_t handle, uint16_t universe)
Indicate that a new synchronization packet should be sent on the given synchronization universe.
Definition source.c:788
etcpal_error_t sacn_source_change_priority(sacn_source_t handle, uint16_t universe, uint8_t new_priority)
Change the priority of a universe on a sACN source.
Definition source.c:556
struct SacnSourceUniverseNetintList SacnSourceUniverseNetintList
size_t sacn_source_get_unicast_destinations(sacn_source_t handle, uint16_t universe, EtcPalIpAddr *destinations, size_t destinations_size)
Obtain a list of a universe's unicast destinations.
Definition source.c:518
etcpal_error_t sacn_source_add_universe(sacn_source_t handle, const SacnSourceUniverseConfig *config, const SacnNetintConfig *netint_config)
Add a universe to an sACN source.
Definition source.c:263
void sacn_source_update_levels(sacn_source_t handle, uint16_t universe, const uint8_t *new_levels, size_t new_levels_size)
Copies the universe's DMX levels into the packet to be sent on the next threaded or manual update.
Definition source.c:812
etcpal_error_t sacn_source_add_unicast_destination(sacn_source_t handle, uint16_t universe, const EtcPalIpAddr *dest)
Add a unicast destination for a source's universe.
Definition source.c:408
etcpal_error_t sacn_source_reset_networking(const SacnNetintConfig *sys_netint_config)
Resets the underlying network sockets for all universes of all sources.
Definition source.c:1029
etcpal_error_t sacn_source_create(const SacnSourceConfig *config, sacn_source_t *handle)
Create a new sACN source to send sACN data.
Definition source.c:104
struct SacnSourceUniverseConfig SacnSourceUniverseConfig
void sacn_source_config_init(SacnSourceConfig *config)
Initialize an sACN Source Config struct to default values.
Definition source.c:53
void sacn_source_remove_unicast_destination(sacn_source_t handle, uint16_t universe, const EtcPalIpAddr *dest)
Remove a unicast destination on a source's universe.
Definition source.c:483
void sacn_source_update_levels_and_force_sync(sacn_source_t handle, uint16_t universe, const uint8_t *new_levels, size_t new_levels_size)
Like sacn_source_update_levels(), but also sets the force_sync flag on the packet.
Definition source.c:903
void sacn_source_update_levels_and_pap(sacn_source_t handle, uint16_t universe, const uint8_t *new_levels, size_t new_levels_size, const uint8_t *new_priorities, size_t new_priorities_size)
Copies the universe's DMX levels and per-address priorities into packets that are sent on the next th...
Definition source.c:860
etcpal_error_t sacn_source_send_now(sacn_source_t handle, uint16_t universe, uint8_t start_code, const uint8_t *buffer, size_t buflen)
Immediately sends the provided sACN start code & data.
Definition source.c:710
void sacn_source_universe_config_init(SacnSourceUniverseConfig *config)
Initialize an sACN Source Universe Config struct to default values.
Definition source.c:72
void sacn_source_remove_universe(sacn_source_t handle, uint16_t universe)
Remove a universe from a source.
Definition source.c:351
size_t sacn_source_get_universes(sacn_source_t handle, uint16_t *universes, size_t universes_size)
Obtain a list of a source's universes (sorted lowest to highest).
Definition source.c:375
etcpal_error_t sacn_source_change_preview_flag(sacn_source_t handle, uint16_t universe, bool new_preview_flag)
Change the send_preview option on a universe of a sACN source.
Definition source.c:617
int sacn_source_process_manual(sacn_source_tick_mode_t tick_mode)
Trigger the transmission of sACN packets for all universes of sources that were created with manually...
Definition source.c:999
sacn_source_tick_mode_t
Definition source.h:76
void sacn_source_update_levels_and_pap_and_force_sync(sacn_source_t handle, uint16_t universe, const uint8_t *new_levels, size_t new_levels_size, const uint8_t *new_priorities, size_t new_priorities_size)
Like sacn_source_update_levels_and_pap(), but also sets the force_sync flag on the packet.
Definition source.c:956
etcpal_error_t sacn_source_change_synchronization_universe(sacn_source_t handle, uint16_t universe, uint16_t new_sync_universe)
Changes the synchronization universe for a universe of a sACN source.
Definition source.c:679
etcpal_error_t sacn_source_reset_networking_per_universe(const SacnNetintConfig *sys_netint_config, const SacnSourceUniverseNetintList *per_universe_netint_lists, size_t num_per_universe_netint_lists)
Resets the underlying network sockets and determines network interfaces for each universe of each sou...
Definition source.c:1100
int sacn_source_t
Definition source.h:56
size_t sacn_source_get_network_interfaces(sacn_source_t handle, uint16_t universe, EtcPalMcastNetintId *netints, size_t netints_size)
Obtain a list of a universe's network interfaces.
Definition source.c:1208
void sacn_source_destroy(sacn_source_t handle)
Destroy an sACN source instance.
Definition source.c:220
struct SacnSourceConfig SacnSourceConfig
@ kSacnSourceTickModeProcessLevelsAndPap
Definition source.h:82
@ kSacnSourceTickModeProcessPapOnly
Definition source.h:80
@ kSacnSourceTickModeProcessLevelsOnly
Definition source.h:78
bool manually_process_source
Definition source.h:106
EtcPalUuid cid
Definition source.h:91
const char * name
Definition source.h:93
int keep_alive_interval
Definition source.h:113
int pap_keep_alive_interval
Definition source.h:117
sacn_ip_support_t ip_supported
Definition source.h:109
size_t universe_count_max
Definition source.h:100
uint8_t priority
Definition source.h:142
uint16_t universe
Definition source.h:136
const EtcPalIpAddr * unicast_destinations
Definition source.h:152
bool send_preview
Definition source.h:145
uint16_t sync_universe
Definition source.h:158
size_t num_unicast_destinations
Definition source.h:154
bool send_unicast_only
Definition source.h:148
uint16_t universe
Definition source.h:176
bool no_netints
Definition source.h:184
size_t num_netints
Definition source.h:182
SacnMcastInterface * netints
Definition source.h:180
sacn_source_t handle
Definition source.h:174