sACN  HEAD (unstable)
Implementation of ANSI E1.31 (Streaming ACN)
View other versions:
Loading...
Searching...
No Matches
common.h File Reference

Common definitions for sACN. More...

#include <stdbool.h>
#include <stdint.h>
#include "etcpal/error.h"
#include "etcpal/inet.h"
#include "etcpal/log.h"
#include "etcpal/socket.h"
#include "etcpal/uuid.h"

Go to the source code of this file.

Classes

struct  SacnMcastInterface
 On input, this structure is used to indicate a network interface to use. More...
 
struct  SacnSendSocketConfig
 Configuration for send sockets (e.g. More...
 
struct  SacnNetintConfig
 Network interface configuration information to give the sACN library. More...
 
struct  SacnSocketErrorInfo
 Information about a socket error that occurred. More...
 
struct  SacnCommonCallbacks
 A set of callback functions that the library uses to notify the application about sACN events. More...
 

Macros

#define SACN_SEND_SOCKET_CONFIG_DEFAULT_VALUES   0, 0, kSacnIpV4AndIpV6
 Default values for initializing a SacnSendSocketConfig.
 
#define SACN_SEND_SOCKET_CONFIG_DEFAULT_INIT   {SACN_SEND_SOCKET_CONFIG_DEFAULT_VALUES}
 Initializes the members of a SacnSendSocketConfig to defaults.
 
#define SACN_NETINT_CONFIG_DEFAULT_INIT   {NULL, 0, false, SACN_SEND_SOCKET_CONFIG_DEFAULT_INIT}
 Initializes the members of a SacnNetintConfig to defaults.
 
sACN feature masks

Pass one or more of these to sacn_init_features() to initialize the relevant sACN feature.

Multiple features can be requested using logical OR.

Currently the DMX merger is the only feature that can be initialized individually. All other APIs can later be initialized with SACN_FEATURES_ALL, which represents all APIs regardless if they have an individual feature defined for them. Redundant initialization will ensure the same feature isn't initialized twice.

#define SACN_FEATURE_DMX_MERGER   ((sacn_features_t)(1u << 0))
 Use the sacn/dmx_merger module.
 
#define SACN_FEATURES_ALL   0xffffffffu
 Use every available module.
 

Typedefs

typedef uint16_t sacn_remote_source_t
 A source discovered on an sACN network that has a CID - used by Receiver and Merge Receiver.
 
typedef struct SacnMcastInterface SacnMcastInterface
 On input, this structure is used to indicate a network interface to use.
 
typedef struct SacnSendSocketConfig SacnSendSocketConfig
 Configuration for send sockets (e.g.
 
typedef struct SacnNetintConfig SacnNetintConfig
 Network interface configuration information to give the sACN library.
 
typedef struct SacnSocketErrorInfo SacnSocketErrorInfo
 Information about a socket error that occurred.
 
typedef void(* SacnUnicastSendErrorCallback) (const SacnSocketErrorInfo *err_info, void *context)
 Notify that an error just occurred sending unicast on a socket.
 
typedef void(* SacnMulticastSendErrorCallback) (const SacnSocketErrorInfo *err_info, void *context)
 Notify that an error just occurred sending multicast on a socket.
 
typedef struct SacnCommonCallbacks SacnCommonCallbacks
 A set of callback functions that the library uses to notify the application about sACN events.
 
typedef uint32_t sacn_features_t
 A mask of desired sACN features.
 

Enumerations

enum  {
  kSacnSourceNameMaxLen = 64 ,
  kSacnDmxAddressCount = 512 ,
  kSacnStartcodeDmx = 0x00u ,
  kSacnStartcodePriority = 0xddu ,
  kSacnMinimumUniverse = 1 ,
  kSacnMaximumUniverse = 63999
}
 
enum  sacn_ip_support_t {
  kSacnIpV4Only ,
  kSacnIpV6Only ,
  kSacnIpV4AndIpV6
}
 This enum defines how the API module will use IPv4 and IPv6 networking. More...
 

Functions

etcpal_error_t sacn_init (const EtcPalLogParams *log_params, const SacnNetintConfig *sys_netint_config)
 Initialize all features of the sACN library.
 
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.
 
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.
 
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.
 
void sacn_deinit (void)
 Deinitialize all features of the sACN library.
 
void sacn_deinit_features (sacn_features_t features)
 Deinitialize specific features of the sACN library.
 
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.
 
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.
 

Variables

static const sacn_remote_source_t kSacnRemoteSourceInvalid = 0xFFFF
 An invalid remote source handle value.
 

Detailed Description

Common definitions for sACN.