
#ifndef ETHERCAT_SLAVE_EOE_H
#define ETHERCAT_SLAVE_EOE_H

#include "../ethercat_types.h"
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifndef DYNAMIC_LOAD

BOOL     dx_eoe_set_ip(uint16_t master_index, uint16_t slave, uint8_t port,
                   uint32_t ip, uint32_t mask, uint32_t gateway, int timeout);
BOOL     dx_eoe_get_ip(uint16_t master_index, uint16_t slave, uint8_t port,
                   uint32_t* ip, uint32_t* mask, uint32_t* gateway, int timeout);
BOOL     dx_eoe_send_frame(uint16_t master_index, uint16_t slave, uint8_t port,
                       const uint8_t* data, int size, int timeout);

BOOL     dx_eoe_receive_frame(uint16_t master_index, uint16_t slave, uint8_t port,
                          uint8_t** data, int* size, int timeout);
BOOL     dx_eoe_set_mac(uint16_t master_index, uint16_t slave, uint8_t port,
                    const uint8_t* mac, int timeout);
BOOL     dx_eoe_get_mac(uint16_t master_index, uint16_t slave, uint8_t port,
                    uint8_t* mac, int timeout);

BOOL     dx_eoe_set_dns(uint16_t master_index, uint16_t slave, uint8_t port,
                    uint32_t dns_ip, const char* dns_name, int timeout);
BOOL     dx_eoe_get_dns(uint16_t master_index, uint16_t slave, uint8_t port,
                    uint32_t* dns_ip, char* dns_name, int timeout);

BOOL     dx_eoe_get_full_param(uint16_t master_index, uint16_t slave, uint8_t port,
                          uint32_t* ip, uint32_t* mask, uint32_t* gateway,
                          uint8_t* mac, uint32_t* dns_ip, char* dns_name, int timeout);
BOOL     dx_eoe_set_full_param(uint16_t master_index, uint16_t slave, uint8_t port,
                          uint32_t ip, uint32_t mask, uint32_t gateway,
                          const uint8_t* mac, uint32_t dns_ip, const char* dns_name, int timeout);

BOOL     dx_eoe_set_address_filter(uint16_t master_index, uint16_t slave, uint8_t port,
                              uint8_t filter_count, const uint8_t* mac_filters, int timeout);
BOOL     dx_eoe_get_address_filter(uint16_t master_index, uint16_t slave, uint8_t port,
                              uint8_t* filter_count, uint8_t* mac_filters,
                              int max_filters, int timeout);

#endif

#ifndef DLL_T_FWD_DECLARED
#define DLL_T_FWD_DECLARED
typedef struct dll dll_t;
#endif
BOOL     eoe_send_frame_with_timestamp(dll_t* dll,
                                              uint16_t master_index, uint16_t slave, uint8_t port,
                                              const uint8_t* data, int size,
                                              uint32_t timestamp, int timeout);

BOOL     eoe_set_receive_hook(dll_t* dll, uint16_t master_index,
                                     eoe_frame_cb_t cb);
BOOL     eoe_clear_receive_hook(dll_t* dll, uint16_t master_index);

#ifdef __cplusplus
}
#endif

#endif
