sACN  2.0.2
Implementation of ANSI E1.31 (Streaming ACN)
View other versions:
Loading...
Searching...
No Matches
Global Initialization and Destruction

The sACN library has overall init and deinit functions that should be called once each at application startup and shutdown time. These functions interface with the EtcPal log (Logging) API to configure what happens when the sACN library logs messages. Optionally pass an EtcPalLogParams structure to use this functionality. This structure can be shared across different ETC library modules.

// During startup:
// Initialize log_params...
sacn_init(&log_params, NULL);
// Or, to init without worrying about logs from the sACN library...
sacn_init(NULL, NULL);
// During shutdown:
#define ETCPAL_LOG_PARAMS_INIT
etcpal_error_t sacn_init(const EtcPalLogParams *log_params, const SacnNetintConfig *sys_netint_config)
Initialize the sACN library.
Definition common.c:68
void sacn_deinit(void)
Deinitialize the sACN library.
Definition common.c:234

// During startup:
// Initialize logger...
sacn::Init(logger);
// Or, to init without worrying about logs from the sACN library...
// During shutdown:
void Deinit()
Deinitialize the sACN library.
Definition common.h:162
etcpal::Error Init(const EtcPalLogParams *log_params=nullptr)
Initialize the sACN library.
Definition common.h:70