robert-burger / libethercat

EtherCAT master library. This library is used to build a deterministic fieldbus network with EtherCAT components.
https://www.dlr.de/rm
Other
20 stars 4 forks source link

Idea: ec_open() with config struct #11

Closed marcfir closed 5 days ago

marcfir commented 1 month ago

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

robert-burger commented 1 month ago

related to #12

robert-burger commented 1 month ago

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