/*
 * Copyright (c) 2023 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @addtogroup thermal
 * @{
 *
 * @brief Provides APIs for managing, controlling, and subscribing to the device temperature.
 * 
 * After obtaining an object or proxy of this module, the thermal service can invoke related APIs to manage, control,
 * and subscribe to the device temperature.
 *
 * @since 3.1
 * @version 1.1
 */

/**
 * @file IThermalInterface.idl
 *
 * @brief Provides APIs for managing, controlling, and subscribing to the device temperature.
 *
 * 
 *
 * @since 3.1
 * @version 1.1
 */

package ohos.hdi.thermal.v1_1;

import ohos.hdi.thermal.v1_1.ThermalTypes;
import ohos.hdi.thermal.v1_1.IThermalCallback;
import ohos.hdi.thermal.v1_1.IFanCallback;

/**
 * @brief Represents APIs for managing, controlling, and subscribing to the device temperature.
 *
 * 
 *
 * @since 3.1
 */
interface IThermalInterface {
    /**
     * @brief Sets the CPU frequency.
     *
     * @param freq CPU frequency to set.
     *
     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
     *
     * @since 3.1
     */
    SetCpuFreq([in] int freq);

    /**
     * @brief Sets the GPU frequency.
     *
     * @param freq GPU frequency to set.
     *
     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
     *
     * @since 3.1
     */
    SetGpuFreq([in] int freq);

    /**
     * @brief Sets the charging current.
     *
     * @param current Charging current, in mA.
     *
     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
     *
     * @since 3.1
     */
    SetBatteryCurrent([in] int current);

    /**
     * @brief Obtains the thermal information of the device.
     *
     * @param event Thermal information of the device, including the device type and temperature.
     *
     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
     * @see HdfThermalCallbackInfo
     *
     * @since 3.1
     */
    GetThermalZoneInfo([out] struct HdfThermalCallbackInfo event);

    /**
     * @brief Isolate the CPU core.
     *
     * @param num CPU core number.
     *
     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
     *
     * @since 4.0
     */
    IsolateCpu([in] int num);

    /**
     * @brief Registers the callback of the device thermal status.
     *
     * @param callbackObj Callback to register.
     *
     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
     * @see IThermalCallback
     *
     * @since 3.1
     */
    Register([in] IThermalCallback callbackObj);

    /**
     * @brief Registers the callback of the device thermal status.
     *
     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
     *
     * @since 3.1
     */
    Unregister();

    /**
     * @brief Register the callback of fan fault detect.
     *
     * @param callbackObj Callback to register.
     *
     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
     * @see IFanCallback
     *
     * @since 4.0
     */
    RegisterFanCallback([in] IFanCallback callbackObj);

    /**
     * @brief Unregister the callback of the fan fault detect.
     *
     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
     *
     * @since 4.0
     */
    UnregisterFanCallback();
}
/** @} */