robert-burger/libethercat

[bug]: Ambiguous error codes

Closed this issue · 1 comments

The error codes in

#define EC_ERROR_MAILBOX_NOT_SUPPORTED_AOE (EC_ERROR_MAILBOX_MASK | EC_MBX_AOE) //!< \brief Mailbox AoE not supported.
#define EC_ERROR_MAILBOX_NOT_SUPPORTED_EOE (EC_ERROR_MAILBOX_MASK | EC_MBX_EOE) //!< \brief Mailbox EoE not supported.
#define EC_ERROR_MAILBOX_NOT_SUPPORTED_COE (EC_ERROR_MAILBOX_MASK | EC_MBX_FOE) //!< \brief Mailbox CoE not supported.

point to the same numbers here.
#define EC_ERROR_MAILBOX_OUT_OF_SEND_BUFFERS (EC_ERROR_MAILBOX_MASK | 0x00000001) //!< \brief Mailbox ran out of read buffers. See LEC_MAX_MBX_ENTRIES.
#define EC_ERROR_MAILBOX_OUT_OF_WRITE_BUFFERS (EC_ERROR_MAILBOX_MASK | 0x00000002) //!< \brief Mailbox ran out of write buffers. See LEC_MAX_MBX_ENTRIES.
#define EC_ERROR_MAILBOX_BUFFER_TOO_SMALL (EC_ERROR_MAILBOX_MASK | 0x00000004) //!< \brief Mailbox buffer is too small.

Suggestion to change the numbers to:

#define EC_ERROR_MAILBOX_OUT_OF_SEND_BUFFERS    (EC_ERROR_MAILBOX_MASK | 0x00010000)        //!< \brief Mailbox ran out of read buffers. See LEC_MAX_MBX_ENTRIES.
#define EC_ERROR_MAILBOX_OUT_OF_WRITE_BUFFERS   (EC_ERROR_MAILBOX_MASK | 0x00020000)        //!< \brief Mailbox ran out of write buffers. See LEC_MAX_MBX_ENTRIES.
#define EC_ERROR_MAILBOX_BUFFER_TOO_SMALL       (EC_ERROR_MAILBOX_MASK | 0x00040000)        //!< \brief Mailbox buffer is too small.

thanks, fixed in 91d4b21