RDMnet  0.3.0
Implementation of ANSI E1.33 (RDMnet)
View other versions:
Global Initialization and Destruction

The core RDMnet init and deinit functions 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 library logs messages. Optionally pass an EtcPalLogParams structure to use this functionality. This structure can be shared across different ETC library modules.

The init function by default starts a background thread for handling periodic RDMnet functionality and receiving data. The deinit function joins this thread.

// In some function called at startup...
EtcPalLogParams log_params;
// Initialize log_params...
etcpal_error_t init_result = rdmnet_init(&log_params, NULL);
// Or, to init without worrying about logs from the RDMnet library...
etcpal_error_t init_result = rdmnet_init(NULL, NULL);
// In some function called at shutdown...
etcpal_error_t
void rdmnet_deinit(void)
Deinitialize the RDMnet library.
Definition: common.c:201
etcpal_error_t rdmnet_init(const EtcPalLogParams *log_params, const RdmnetNetintConfig *netint_config)
Initialize the RDMnet library.
Definition: common.c:149

// In some function called at startup...
// Initialize and start logger...
etcpal::Error init_result = rdmnet::Init(logger);
// Or, to init without worrying about logs from the RDMnet library...
etcpal::Error init_result = rdmnet::Init();
// In some function called at shutdown...
etcpal::Error Init(const EtcPalLogParams *log_params=nullptr, const std::vector< RdmnetMcastNetintId > &mcast_netints=std::vector< RdmnetMcastNetintId >{})
Initialize the RDMnet library.
Definition: common.h:54
void Deinit()
Deinitialize the RDMnet library.
Definition: common.h:98