#ifndef SBGERRORCODES_H
#define SBGERRORCODES_H
namespace sbgtc
{
    /*!
     *	Generic errors definitions for SBG Systems projects.
     */
    typedef enum _SbgErrorCode
    {
        SBG_NO_ERROR = 0,						/*!< The operation was successfully executed. */
        SBG_ERROR,								/*!< We have a generic error. */
        SBG_NULL_POINTER,						/*!< A pointer is null. */
        SBG_INVALID_CRC,						/*!< The received frame has an invalid CRC. */
        SBG_INVALID_FRAME,						/*!< The received frame is invalid 
 */
                                                /*!<	We have received an unexpected frame (not the cmd we are waiting for or with an invalid data size.
 */
                                                /*!<	This could be caused by a desync between questions and answers.
 */
                                                /*!<	You should flush the serial port to fix this. */
        SBG_TIME_OUT,							/*!< We have started to receive a frame but not the end. */
        SBG_WRITE_ERROR,						/*!< All bytes hasn't been written. */
        SBG_READ_ERROR,							/*!< All bytes hasn't been read. */
        SBG_BUFFER_OVERFLOW,					/*!< A buffer is too small to contain so much data. */
        SBG_INVALID_PARAMETER,					/*!< An invalid parameter has been found. */
        SBG_NOT_READY,							/*!< A device isn't ready (Rx isn't ready for example). */
        SBG_MALLOC_FAILED,						/*!< Failed to allocate a buffer. */
        SGB_CALIB_MAG_NOT_ENOUGH_POINTS,		/*!< Not enough points were available to perform magnetometers calibration. */
        SBG_CALIB_MAG_INVALID_TAKE,				/*!< The calibration procedure could not be properly executed due to insufficient precision. */
        SBG_CALIB_MAG_SATURATION,				/*!< Saturation were detected when attempt to calibrate magnetos. */
        SBG_CALIB_MAG_POINTS_NOT_IN_A_PLANE,	/*!< 2D calibration procedure could not be performed. */
        SBG_DEVICE_NOT_FOUND,					/*!< A device couldn't be founded or opened PC only error code */
        SBG_OPERATION_CANCELLED,				/*!< An operation was canceled.  PC only error code*/
        SBG_NOT_CONTINUOUS_FRAME,				/*!< We have received a frame that isn't a continuous one. PC only error code*/
        SBG_INCOMPATIBLE_HARDWARE,				/*!< Hence valid; the command cannot be executed because of hardware incompatibility */
        SBG_INVALID_VERSION						/*!< Incompatible version */
    } SbgErrorCode;
}
#endif // SBGERRORCODES_H