#ifndef __ENUMS_H__
#define __ENUMS_H__

typedef enum OBJECT_RUN_FLAGS
{
    E_OF_NONE = 0,     /**< No run flag */
    E_OF_DEBUG = 1,    /**< Enable debug call, per frame */
    E_OF_INFO = 2,     /**< Enable info print during boot */
    E_OF_LOOP = 3,     /**< Enable loop invocation on the main loop */
    E_OF_DISABLED = 4, /**< Disable component entirely */
    E_OF_SETUP = 5,    /**< Enable setup invocation during boot */
    E_OF_MAIN = 6,     /**< reserved */
    E_OF_BRIDGE = 7    /**< Component registers methods on the Bridge */
} OBJECT_RUN_FLAGS;

typedef enum OBJECT_NET_CAPS
{
    E_NCAPS_NONE = 0,
    E_NCAPS_MODBUS = 1,
    E_NCAPS_SERIAL = 2,
} OBJECT_NET_CAPS;

typedef enum MB_REGISTER_MODE
{
    E_MB_REGISTER_MODE_NONE = 0,
    E_MB_REGISTER_MODE_READ = 1,
    E_MB_REGISTER_MODE_WRITE = 2,
    E_MB_REGISTER_MODE_READ_WRITE = 3,
} MB_REGISTER_MODE;

typedef enum E_CALLS
{
    /**< Call a global registered command . */
    EC_NONE = 0x00000000,
    /**< Call a global registered command . */
    EC_COMMAND = 0x00000001,
    /**< Call component method (See Bridge::registerMemberFunction & Component::onRegisterMethods)  */
    EC_METHOD = 0x00000002,
    /**< Function call type. */
    EC_FUNC = 0x00000004,
    /**< User-defined call type. */
    EC_USER = 0x00000008
} E_CALLS;

/**
 * @brief Enumeration representing different message flags.
 *
 * This enumeration defines the possible flags that can be associated with a message.
 * Each flag represents a different state or attribute of the message.
 */
typedef enum E_MessageFlags
{
    /**<Internal: no flags */
    E_MF_NONE = 0x00000000,
    /**<Internal: flag designating an unprocessed message */
    E_MF_NEW = 0x00000001,
    /**<Internal: Processing message flag */
    E_MF_PROCESSING = 0x00000002,
    /**<Internal: Processed message flag */
    E_MF_PROCESSED = 0x00000004,
    /**<Internal: Debug message during processing */
    E_MF_DEBUG = 0x00000008,
    /**<Sender: Instruct to send a receipt - Default:On */
    E_MF_RECEIPT = 0x0000010,
    /**<Sender: Instruct to return component state */
    E_MF_STATE = 0x00000020
} E_MessageFlags;

typedef enum
{
    MB_FC_NONE = 0,                     /*!< null operator */
    MB_FC_READ_COILS = 1,               /*!< FCT=1 -> read coils or digital outputs */
    MB_FC_READ_DISCRETE_INPUT = 2,      /*!< FCT=2 -> read digital inputs */
    MB_FC_READ_REGISTERS = 3,           /*!< FCT=3 -> read registers or analog outputs */
    MB_FC_READ_INPUT_REGISTER = 4,      /*!< FCT=4 -> read analog inputs */
    MB_FC_WRITE_COIL = 5,               /*!< FCT=5 -> write single coil or output */
    MB_FC_WRITE_REGISTER = 6,           /*!< FCT=6 -> write single register */
    MB_FC_WRITE_MULTIPLE_COILS = 15,    /*!< FCT=15 -> write multiple coils or outputs */
    MB_FC_WRITE_MULTIPLE_REGISTERS = 16 /*!< FCT=16 -> write multiple registers */
} MB_FC;

typedef enum MODBUS_ERRORS
{
    MODBUS_ERROR_NONE = 0,                                    /**< No error */
    MODBUS_ERROR_ILLEGAL_FUNCTION = 1,                        /**< Illegal function error */
    MODBUS_ERROR_ILLEGAL_DATA_ADDRESS = 2,                    /**< Illegal data address error */
    MODBUS_ERROR_ILLEGAL_DATA_VALUE = 3,                      /**< Illegal data value error */
    MODBUS_ERROR_SLAVE_DEVICE_FAILURE = 4,                    /**< Slave device failure error */
    MODBUS_ERROR_ACKNOWLEDGE = 5,                             /**< Acknowledge error */
    MODBUS_ERROR_SLAVE_DEVICE_BUSY = 6,                       /**< Slave device busy error */
    MODBUS_ERROR_MEMORY_PARITY = 8,                           /**< Memory parity error */
    MODBUS_ERROR_GATEWAY_PATH_UNAVAILABLE = 10,               /**< Gateway path unavailable error */
    MODBUS_ERROR_GATEWAY_TARGET_DEVICE_FAILED_TO_RESPOND = 11 /**< Gateway target device failed to respond error */
} MODBUS_ERRORS;

#endif
