#pragma once

namespace xavia::sdk
{
  /**
   * \brief the possible sensor errors that the SDK can communicate.
   */
  enum class SensorError
  {
    UNABLE_TO_CONNECT,                      ///< The SDK was not able to connect to the sensor. Check IP address, network setup and connectors.
    SENSOR_DISCONNECTED,                    ///< The connection to the sensor was lost, or it was never established. Check network setup and connectors.
    ACTION_ILLEGAL_SENSOR_RUNNING,          ///< The command you gave is not possible in this state because the sensor is running.
    ACTION_ILLEGAL_SENSOR_NOT_INITIALISED,  ///< The command you gave is not possible in this state because the sensor is idle.
    UNABLE_TO_INITIALISE,                   ///< The sensor failed to initialise. Try to reboot the sensor.
    UNABLE_TO_START,                        ///< The sensor failed to start. Try again, or try to reboot.
    UNABLE_TO_STOP,                         ///< The sensor failed to stop. Try again, or continue to power down.
    UNABLE_TO_CLOSE,                        ///< The sensor failed to close.
    SENSOR_ALREADY_INITIALIZED,             ///< The sensor was already initialized and cannot be initialized twice.
    ACTION_ILLEGAL_NOT_RUNNING,             ///< The command you gave is not possible because the sensor is not running.
    UNKNOWN_MESSAGE_ID,                     ///< The sensor reported that the provided TCP command was not recognized by this sensor.
    COMMAND_BUFFER_FULL,                    ///< The previous command was rejected by the sensor because its command queue is full.
    UNSUPPORTED_COMMAND,                    ///< This sensor does not support this command.
    INCORRECT_PAYLOAD,                      ///< The TCP command message did not have the correct payload.
    INVALID_DATA,                           ///< Indicates that the function could not execute because the provided input arguments were invalid.
    INVALID_FRAME,                          ///< The sensor reports that the underlying system gave errors and it failed to acquire the next data.
    DISK_FULL,                              ///< The command cannot be executed because the local disk is full.
    INVALID_TEMPERATURE,                    ///< The temperature readouts gave illegal values. Could indicate a broken temperature probe in the sensor.
    HARDWARE_CRITICAL,                      ///< The hardware is in a critical state. The sensor will protect itself and will not operate for the duration of this state.
    POWER_CRITICAL,                         ///< Critical power issue. One of the power probes is out of the acceptable range.
    TEMPERATURE_CRITICAL,                   ///< Critical temperature. The temperature readout is out of the acceptable range.
    EYE_SAFETY_ALERT,                       ///< The eye safety protection mechanism indicated a potential incorrect laser output and decided to intervene.
    HUMIDITY_ALERT,                         ///< The internal humidity is out of bounds.
    VOLTAGE_ALERT,                          ///< Power issue. One of the power probes is out of the acceptable range.
    HOUSING_REMOVED,                        ///< The housing has been removed. To protect users, the system will not operate.
    ENGINEERING_BYPASS_PRESENT,             ///< The engineering bypass is present in the system, overriding certain safety precautions.
    PAST_ERROR,                             ///< A sticky error bit indicating that the sensor experienced a critical event during this uptime, even if there is no error right now.
    UNKNOWN_ERROR,                          ///< An error occurred that is not specified in the list above. Check log files or the `what()` function for more information.
    UNKNOWN_TCP_ERROR,                      ///< An error occurred in the TCP communication layer that does not fit in the other categories. Check log files or the `what()` function for more information.
    TIMEOUT,                                ///< A command, function or request timed out. This can have various causes, such as a temporary communication issue.
    LOGICAL_ERROR,                          ///< An error in the SDK logic was detected. This can be caused by incorrect usage of the SDK, but can also indicate a bug in the SDK. Please report this to XenomatiX if you encounter it.
    WIDE_CHAR_CONVERSION_ERROR,             ///< An error occurred during conversion between wide and ordinary strings.
  };
}

