diff --git a/resourceschedule/qos_manager/c/qos.h b/resourceschedule/qos_manager/c/qos.h index c92ab5b8622578b0b086fb042b15bda961c48c97..bdcc00b294e0f6f3f2b83b11d514be00b8e49541 100644 --- a/resourceschedule/qos_manager/c/qos.h +++ b/resourceschedule/qos_manager/c/qos.h @@ -79,11 +79,31 @@ typedef enum QoS_Level { QOS_USER_INTERACTIVE, } QoS_Level; +/** + *@brief Enum of qos error code. + * + *@since 12 +*/ +typedef enum QoS_ErrCode { + /** @error Operation sucess*/ + QOS_SUCCESS = 0, + /** @error Operation failde*/ + QOS_FAILURE = -1, + /** @error Invalid parameter */ + QOS_INVALID_PARAMETER = -2, + /** @error Operation not allowed*/ + QOS_NOT_ALLOWED = -3, + /** @error Operation not supported*/ + QOS_NO_SUPPORT = -4 +} QoS_ErrCode; + /** * @brief Set the QoS level of the current thread. * * @param level Indicates the level to set. Specific level can be referenced {@link QoS_Level}. - * @return Returns int32_t, return value == 0, success, otherwise value == -1, failed. + * @return {@link QOS_SUCCESS} the operation is successful. + * {@link QOS_FAILURE} permission check failed or internal error failed. + * {@link QOS_INVALID_PARAMETR} level is out of range. * @see QoS_Level * @since 12 */ @@ -92,7 +112,8 @@ int OH_QoS_SetThreadQoS(QoS_Level level); /** * @brief Cancel the QoS level of the current thread. * - * @return Returns int32_t, return value == 0, success, otherwise value == -1, failed. + * @return {@link QOS_SUCCESS} the operation is successful. + * {@link QOS_FAILURE} permission check failed or internal error failed. * @see QoS_Level * @since 12 */ @@ -103,7 +124,9 @@ int OH_QoS_ResetThreadQoS(); * * @param level This parameter is the output parameter, * and the QoS level of the thread as a {@link QoS_Level} is written to this variable. - * @return Returns int32_t, return value == 0, success, otherwise value == -1, failed. + * @return {@link QOS_SUCCESS} the operation is successful. + * {@link QOS_FAILURE} permission check failed or internal error failed. + * {@link QOS_INVALID_PARAMETR} level is null. * @see QoS_Level * @since 12 */