30#include "etcpal/error.h"
31#include "etcpal/inet.h"
32#include "etcpal/log.h"
33#include "etcpal/socket.h"
34#include "etcpal/uuid.h"
177#define SACN_SEND_SOCKET_CONFIG_DEFAULT_VALUES 0, 0, kSacnIpV4AndIpV6
182#define SACN_SEND_SOCKET_CONFIG_DEFAULT_INIT {SACN_SEND_SOCKET_CONFIG_DEFAULT_VALUES}
187#define SACN_NETINT_CONFIG_DEFAULT_INIT {NULL, 0, false, SACN_SEND_SOCKET_CONFIG_DEFAULT_INIT}
205#define SACN_FEATURE_DMX_MERGER ((sacn_features_t)(1u << 0))
208#define SACN_FEATURES_ALL 0xffffffffu
PLATFORM_DEFINED etcpal_socket_t
sacn_ip_support_t
This enum defines how the API module will use IPv4 and IPv6 networking.
Definition common.h:75
void(* SacnUnicastSendErrorCallback)(const SacnSocketErrorInfo *err_info, void *context)
Notify that an error just occurred sending unicast on a socket.
Definition common.h:154
struct SacnSendSocketConfig SacnSendSocketConfig
Configuration for send sockets (e.g.
struct SacnSocketErrorInfo SacnSocketErrorInfo
Information about a socket error that occurred.
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
struct SacnNetintConfig SacnNetintConfig
Network interface configuration information to give the sACN library.
etcpal_error_t sacn_init_features_with_cb(const EtcPalLogParams *log_params, const SacnNetintConfig *sys_netint_config, sacn_features_t features, const SacnCommonCallbacks *callbacks)
Initialize specific features of the sACN library.
Definition common.c:153
etcpal_error_t sacn_init(const EtcPalLogParams *log_params, const SacnNetintConfig *sys_netint_config)
Initialize all features of the sACN library.
Definition common.c:75
sacn_remote_source_t sacn_get_remote_source_handle(const EtcPalUuid *source_cid)
Converts a remote source CID to the corresponding handle, or kSacnRemoteSourceInvalid if not found.
Definition common.c:580
void sacn_deinit_features(sacn_features_t features)
Deinitialize specific features of the sACN library.
Definition common.c:496
void sacn_deinit(void)
Deinitialize all features of the sACN library.
Definition common.c:479
etcpal_error_t sacn_get_remote_source_cid(sacn_remote_source_t source_handle, EtcPalUuid *source_cid)
Converts a remote source handle to the corresponding source CID.
Definition common.c:605
etcpal_error_t sacn_init_with_cb(const EtcPalLogParams *log_params, const SacnNetintConfig *sys_netint_config, const SacnCommonCallbacks *callbacks)
Initialize all features of the sACN library.
Definition common.c:99
struct SacnMcastInterface SacnMcastInterface
On input, this structure is used to indicate a network interface to use.
uint32_t sacn_features_t
A mask of desired sACN features.
Definition common.h:190
struct SacnCommonCallbacks SacnCommonCallbacks
A set of callback functions that the library uses to notify the application about sACN events.
void(* SacnMulticastSendErrorCallback)(const SacnSocketErrorInfo *err_info, void *context)
Notify that an error just occurred sending multicast on a socket.
Definition common.h:164
etcpal_error_t sacn_init_features(const EtcPalLogParams *log_params, const SacnNetintConfig *sys_netint_config, sacn_features_t features)
Initialize specific features of the sACN library.
Definition common.c:124
static const sacn_remote_source_t kSacnRemoteSourceInvalid
An invalid remote source handle value.
Definition common.h:49
@ kSacnIpV4Only
Use IPv4 only.
Definition common.h:77
@ kSacnIpV4AndIpV6
Use both IPv4 and IPv6.
Definition common.h:81
@ kSacnIpV6Only
Use IPv6 only.
Definition common.h:79
@ kSacnMinimumUniverse
The lowest sACN universe number supported.
Definition common.h:66
@ kSacnStartcodePriority
The per-address priority start code.
Definition common.h:64
@ kSacnSourceNameMaxLen
The maximum length of an sACN source name, including the null-terminator.
Definition common.h:58
@ kSacnMaximumUniverse
The highest sACN universe number supported.
Definition common.h:68
@ kSacnDmxAddressCount
The number of addresses in a DMX universe.
Definition common.h:60
@ kSacnStartcodeDmx
The DMX start code.
Definition common.h:62
A set of callback functions that the library uses to notify the application about sACN events.
Definition common.h:168
SacnUnicastSendErrorCallback unicast_send_error
Optional.
Definition common.h:169
SacnMulticastSendErrorCallback multicast_send_error
Optional.
Definition common.h:170
void * context
(optional) Pointer to opaque data passed back with each callback.
Definition common.h:171
On input, this structure is used to indicate a network interface to use.
Definition common.h:89
EtcPalMcastNetintId iface
The multicast interface to use.
Definition common.h:93
etcpal_error_t status
The status of the multicast interface.
Definition common.h:98
Network interface configuration information to give the sACN library.
Definition common.h:114
SacnMcastInterface * netints
An array of network interface IDs to which to restrict multicast traffic.
Definition common.h:117
size_t num_netints
Size of netints array.
Definition common.h:119
bool no_netints
If this is true, no network interfaces will be used for multicast.
Definition common.h:122
SacnSendSocketConfig send_socket_config
Configuration for send sockets (e.g.
Definition common.h:126
Configuration for send sockets (e.g.
Definition common.h:103
int multicast_sndtimeo_ms
Multicast send socket timeout in milliseconds (0 if disabled).
Definition common.h:105
sacn_ip_support_t unicast_ip_support
Whether to create unicast send sockets for IPv4, IPv6, or both.
Definition common.h:106
int unicast_sndtimeo_ms
Unicast send socket timeout in milliseconds (0 if disabled).
Definition common.h:104
Information about a socket error that occurred.
Definition common.h:131
int flags
Flags used in the send operation.
Definition common.h:141
etcpal_socket_t socket
The socket the error occurred on.
Definition common.h:135
size_t length
The length of the message.
Definition common.h:139
const EtcPalSockAddr * dest_addr
The destination address the message was being sent to.
Definition common.h:143
etcpal_error_t error
The EtcPal error returned by etcpal_sendto().
Definition common.h:133
const void * message
The message that was being sent when the error occurred.
Definition common.h:137