/*
 * Copyright (c) 2020 Great Master Wu. All rights reserved.
 * Author    Date          ChangeLog
 * Master    2021-03-25    Initialize version
 */

#include "sensor_error.h"

const char *sensor_error_str(int error)
{
    switch(error) 
    {
    case SENSOR_SUCCESS:            return "Success";
    case SENSOR_ERROR:              return "Unspecified error";
    case SENSOR_ERROR_NIMPL:        return "Not implemented";
    case SENSOR_ERROR_ARGS:         return "Given arguments is not in range or error type";
    case SENSOR_ERROR_IO:           return "Serial interface error";
    case SENSOR_ERROR_CHECK_ID:     return "ID or WHO AM I check error";
    case SENSOR_INIT_FAILURE:       return "Sensor initialize failure";
    case SENSOR_VAR_NOT_INIT:       return "Variable not initialize";
    case SENSOR_ERROR_FIFO_FULL:    return "FIFO IS FULL";
    case SENSOR_FIFO_COUNT_INVALID: return "Request FIFO count is invalid";
    default:                        return "Serial interface error";
    }
}

