
#ifndef ETHERCAT_MASTER_CALLBACK_ROUTER_H
#define ETHERCAT_MASTER_CALLBACK_ROUTER_H

#pragma once

#include "../ethercat.h"

#ifdef __cplusplus
extern "C" {
#endif

#ifndef DARRA_CB_ROUTER_MAX_MASTERS
#define DARRA_CB_ROUTER_MAX_MASTERS 8
#endif

void darra_register_pdo_cyclic_sync(dll_t* dll, uint16_t master_index,
                                    pdo_cyclic_callback_t cb);

void darra_register_state_change_sync(dll_t* dll, uint16_t master_index,
                                      state_change_callback_t cb);

void darra_register_state_change_async(dll_t* dll, uint16_t master_index,
                                       state_change_callback_t cb);

void darra_register_emergency(dll_t* dll, uint16_t master_index,
                              emergency_callback_t cb);

void darra_register_discovery_sync(dll_t* dll, uint16_t master_index,
                                   discovery_callback_t cb);

void darra_register_discovery_async(dll_t* dll, uint16_t master_index,
                                    discovery_callback_t cb);

void darra_register_pdo_frame_loss(dll_t* dll, uint16_t master_index,
                                   frame_loss_callback_t cb);

void darra_register_redundancy_changed(dll_t* dll, uint16_t master_index,
                                       redundancy_changed_callback_t cb);

void darra_register_preop_reconfig(dll_t* dll, uint16_t master_index,
                                   preop_reconfig_callback_t cb);

void darra_register_dc_sync_lost(dll_t* dll, uint16_t master_index,
                                 dc_sync_lost_callback_t cb);

void darra_register_slave_identity_mismatch(dll_t* dll, uint16_t master_index,
                                            identity_mismatch_callback_t cb);

void darra_register_slave_port_link_changed(dll_t* dll, uint16_t master_index,
                                            port_link_changed_callback_t cb);

void darra_unregister_master_callbacks(uint16_t master_index);

void darra_unregister_all_callbacks(void);

#ifdef __cplusplus
}
#endif

#endif
