libethercat icon indicating copy to clipboard operation
libethercat copied to clipboard

Idea: ec_open() with config struct

Open marcfir opened this issue 1 year ago • 2 comments

Currently, the ec_open call looks like this

int ec_open(ec_t *pec, const osal_char_t *ifname, int prio, int cpumask, int eeprom_log)

Having something like the following would enable the extension of the configuration more easily:

//! ethercat master configuration structure
typedef struct ec_config {
    const osal_char_t *ifname;  //!< Ethercat master interface name.
    int prio;                   //!< Receive thread priority
    int cpumask;                //!< Receive thread cpumask.
    int eeprom_log;             //!< Log eeprom to stdout.
} ec_config_t;

int ec_open(ec_t *pec, ec_config_t config)

Background: I need to pass the socket_priority to implement a SO_TXTIME capable device

I can provide a PR for this, but it is a breaking change to the API

marcfir avatar Jul 23 '24 15:07 marcfir

related to #12

robert-burger avatar Jul 24 '24 04:07 robert-burger

this should be also resolved if going for the feat/hw_rework branch

robert-burger avatar Jul 24 '24 04:07 robert-burger