28#ifndef SACN_RECEIVER_H_
29#define SACN_RECEIVER_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"
60#define SACN_RECEIVER_INVALID -1
68#define SACN_RECEIVER_INFINITE_SOURCES 0
76#define SACN_DEFAULT_EXPIRED_WAIT_MS 1000u
153#define SACN_RECEIVER_OPTS_FILTER_PREVIEW_DATA 0x1
203 size_t num_lost_sources,
void* context);
301#define SACN_RECEIVER_CONFIG_DEFAULT_INIT \
303 0, {NULL, NULL, NULL, NULL, NULL, NULL}, {1, DMX_ADDRESS_COUNT}, SACN_RECEIVER_INFINITE_SOURCES, 0, \
334 size_t num_per_receiver_netint_lists);
Common definitions for sACN.
sacn_ip_support_t
Definition common.h:71
#define SACN_SOURCE_NAME_MAX_LEN
The maximum length of an sACN source name, including the null-terminator.
Definition common.h:50
uint16_t sacn_remote_source_t
Definition common.h:58
struct SacnReceiverCallbacks SacnReceiverCallbacks
void(* SacnUniverseDataCallback)(sacn_receiver_t receiver_handle, const EtcPalSockAddr *source_addr, const SacnRemoteSource *source_info, const SacnRecvUniverseData *universe_data, void *context)
Notify that new universe data within the configured footprint has been received.
Definition receiver.h:185
etcpal_error_t sacn_receiver_reset_networking_per_receiver(const SacnNetintConfig *sys_netint_config, const SacnReceiverNetintList *per_receiver_netint_lists, size_t num_per_receiver_netint_lists)
Resets underlying network sockets and packet receipt state, determines network interfaces for each re...
Definition receiver.c:418
etcpal_error_t sacn_receiver_get_footprint(sacn_receiver_t handle, SacnRecvUniverseSubrange *footprint)
Get the footprint within the universe on which a sACN receiver is currently listening.
Definition receiver.c:216
struct SacnRemoteSource SacnRemoteSource
etcpal_error_t sacn_receiver_destroy(sacn_receiver_t handle)
Destroy a sACN receiver instance.
Definition receiver.c:139
struct SacnReceiverNetintList SacnReceiverNetintList
etcpal_error_t sacn_receiver_reset_networking(const SacnNetintConfig *sys_netint_config)
Resets underlying network sockets and packet receipt state, determines network interfaces for all rec...
Definition receiver.c:345
void(* SacnSamplingPeriodStartedCallback)(sacn_receiver_t handle, uint16_t universe, void *context)
Notify that a receiver's sampling period has begun.
Definition receiver.h:212
void(* SacnSourceLimitExceededCallback)(sacn_receiver_t handle, uint16_t universe, void *context)
Notify that more than the configured maximum number of sources are currently sending on the universe ...
Definition receiver.h:260
size_t sacn_receiver_get_network_interfaces(sacn_receiver_t handle, EtcPalMcastNetintId *netints, size_t netints_size)
Obtain a list of a receiver's network interfaces.
Definition receiver.c:505
void(* SacnSourcePapLostCallback)(sacn_receiver_t handle, uint16_t universe, const SacnRemoteSource *source, void *context)
Notify that a source has stopped transmission of per-address priority packets.
Definition receiver.h:238
struct SacnLostSource SacnLostSource
void(* SacnSourcesLostCallback)(sacn_receiver_t handle, uint16_t universe, const SacnLostSource *lost_sources, size_t num_lost_sources, void *context)
Notify that one or more sources have entered a source loss state.
Definition receiver.h:202
void sacn_receiver_config_init(SacnReceiverConfig *config)
Initialize an sACN Receiver Config struct to default values.
Definition receiver.c:55
etcpal_error_t sacn_receiver_change_footprint(sacn_receiver_t handle, const SacnRecvUniverseSubrange *new_footprint)
Change the footprint within the universe on which an sACN receiver is listening. TODO: Not yet implem...
Definition receiver.c:291
etcpal_error_t sacn_receiver_change_universe(sacn_receiver_t handle, uint16_t new_universe_id)
Change the universe on which an sACN receiver is listening.
Definition receiver.c:255
uint32_t sacn_receiver_get_expired_wait()
Get the current value of the expired notification wait time.
Definition receiver.c:551
void sacn_receiver_set_expired_wait(uint32_t wait_ms)
Set the expired notification wait time.
Definition receiver.c:530
struct SacnRecvUniverseData SacnRecvUniverseData
struct SacnReceiverConfig SacnReceiverConfig
void(* SacnSamplingPeriodEndedCallback)(sacn_receiver_t handle, uint16_t universe, void *context)
Notify that a receiver's sampling period has ended.
Definition receiver.h:221
etcpal_error_t sacn_receiver_create(const SacnReceiverConfig *config, sacn_receiver_t *handle, const SacnNetintConfig *netint_config)
Create a new sACN receiver to listen for sACN data on a universe.
Definition receiver.c:92
struct SacnRecvUniverseSubrange SacnRecvUniverseSubrange
etcpal_error_t sacn_receiver_get_universe(sacn_receiver_t handle, uint16_t *universe_id)
Get the universe on which a sACN receiver is currently listening.
Definition receiver.c:173
etcpal_error_t sacn_receiver_change_universe_and_footprint(sacn_receiver_t handle, uint16_t new_universe_id, const SacnRecvUniverseSubrange *new_footprint)
Change the universe and footprint on which an sACN receiver is listening. TODO: Not yet implemented.
Definition receiver.c:311
int sacn_receiver_t
Definition receiver.h:58
Definition receiver.h:135
EtcPalUuid cid
Definition receiver.h:139
char name[SACN_SOURCE_NAME_MAX_LEN]
Definition receiver.h:141
sacn_remote_source_t handle
Definition receiver.h:137
bool terminated
Definition receiver.h:144
Definition receiver.h:264
SacnSamplingPeriodEndedCallback sampling_period_ended
Definition receiver.h:268
SacnSamplingPeriodStartedCallback sampling_period_started
Definition receiver.h:267
SacnSourcesLostCallback sources_lost
Definition receiver.h:266
SacnUniverseDataCallback universe_data
Definition receiver.h:265
SacnSourceLimitExceededCallback source_limit_exceeded
Definition receiver.h:270
void * context
Definition receiver.h:271
SacnSourcePapLostCallback source_pap_lost
Definition receiver.h:269
Definition receiver.h:276
SacnRecvUniverseSubrange footprint
Definition receiver.h:287
SacnReceiverCallbacks callbacks
Definition receiver.h:282
uint16_t universe_id
Definition receiver.h:280
int source_count_max
Definition receiver.h:292
sacn_ip_support_t ip_supported
Definition receiver.h:297
unsigned int flags
Definition receiver.h:294
Definition receiver.h:309
sacn_receiver_t handle
Definition receiver.h:311
size_t num_netints
Definition receiver.h:317
SacnMcastInterface * netints
Definition receiver.h:315
uint8_t start_code
Definition receiver.h:111
uint8_t priority
Definition receiver.h:97
bool preview
Definition receiver.h:103
bool is_sampling
Definition receiver.h:107
uint16_t universe_id
Definition receiver.h:93
const uint8_t * values
Definition receiver.h:119
SacnRecvUniverseSubrange slot_range
Definition receiver.h:115
int address_count
Definition receiver.h:82
int start_address
Definition receiver.h:81
Definition receiver.h:124
EtcPalUuid cid
Definition receiver.h:128
char name[SACN_SOURCE_NAME_MAX_LEN]
Definition receiver.h:130
sacn_remote_source_t handle
Definition receiver.h:126