/*
 * Copyright (c) 2025 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#include "i_fans.h"
#include <cstring>
#include <mc/engine.h>
#include <mc/log.h>
#include <sstream>

namespace dev {

void IFans::start()
{
    ilog("IFans started");
}

void IFans::stop()
{
    ilog("IFans stopped");
}

void IFans::init()
{}

void IFans::set_pwm_callback(SetFansPWMCallback callback)
{
    m_pwm_callback = callback;
}

uint8_t IFans::SetPWM(const std::vector<double>& pwm_list)
{
    if (m_pwm_callback) {
        return m_pwm_callback(pwm_list);
    }
    wlog("IFans SetPWM: no callback handler set");
    return 1;
}

} // namespace dev

MC_REFLECT(dev::IFans)