1/*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef OHOS_HDI_THERMAL_V1_1_THERMALINTERFACESTUB_H
17#define OHOS_HDI_THERMAL_V1_1_THERMALINTERFACESTUB_H
18
19#include <ipc_object_stub.h>
20#include <message_option.h>
21#include <message_parcel.h>
22#include <object_collector.h>
23#include <refbase.h>
24#include "v1_1/ithermal_interface.h"
25
26namespace OHOS {
27namespace HDI {
28namespace Thermal {
29namespace V1_1 {
30
31using namespace OHOS;
32class ThermalInterfaceStub : public IPCObjectStub {
33public:
34    explicit ThermalInterfaceStub(const sptr<IThermalInterface> &impl);
35    virtual ~ThermalInterfaceStub();
36
37    int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
38
39    static int32_t ThermalInterfaceStubSetCpuFreq_(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption, sptr<OHOS::HDI::Thermal::V1_1::IThermalInterface> impl);
40
41    static int32_t ThermalInterfaceStubSetGpuFreq_(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption, sptr<OHOS::HDI::Thermal::V1_1::IThermalInterface> impl);
42
43    static int32_t ThermalInterfaceStubSetBatteryCurrent_(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption, sptr<OHOS::HDI::Thermal::V1_1::IThermalInterface> impl);
44
45    static int32_t ThermalInterfaceStubGetThermalZoneInfo_(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption, sptr<OHOS::HDI::Thermal::V1_1::IThermalInterface> impl);
46
47    static int32_t ThermalInterfaceStubIsolateCpu_(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption, sptr<OHOS::HDI::Thermal::V1_1::IThermalInterface> impl);
48
49    static int32_t ThermalInterfaceStubRegister_(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption, sptr<OHOS::HDI::Thermal::V1_1::IThermalInterface> impl);
50
51    static int32_t ThermalInterfaceStubUnregister_(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption, sptr<OHOS::HDI::Thermal::V1_1::IThermalInterface> impl);
52
53    static int32_t ThermalInterfaceStubRegisterFanCallback_(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption, sptr<OHOS::HDI::Thermal::V1_1::IThermalInterface> impl);
54
55    static int32_t ThermalInterfaceStubUnregisterFanCallback_(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption, sptr<OHOS::HDI::Thermal::V1_1::IThermalInterface> impl);
56
57    static int32_t ThermalInterfaceStubGetVersion_(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption, sptr<OHOS::HDI::Thermal::V1_1::IThermalInterface> impl);
58
59private:
60    int32_t ThermalInterfaceStubSetCpuFreq(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption);
61
62    int32_t ThermalInterfaceStubSetGpuFreq(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption);
63
64    int32_t ThermalInterfaceStubSetBatteryCurrent(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption);
65
66    int32_t ThermalInterfaceStubGetThermalZoneInfo(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption);
67
68    int32_t ThermalInterfaceStubIsolateCpu(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption);
69
70    int32_t ThermalInterfaceStubRegister(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption);
71
72    int32_t ThermalInterfaceStubUnregister(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption);
73
74    int32_t ThermalInterfaceStubRegisterFanCallback(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption);
75
76    int32_t ThermalInterfaceStubUnregisterFanCallback(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption);
77
78    int32_t ThermalInterfaceStubGetVersion(MessageParcel& thermalInterfaceData, MessageParcel& thermalInterfaceReply, MessageOption& thermalInterfaceOption);
79
80
81    static inline ObjectDelegator<OHOS::HDI::Thermal::V1_1::ThermalInterfaceStub, OHOS::HDI::Thermal::V1_1::IThermalInterface> objDelegator_;
82    sptr<OHOS::HDI::Thermal::V1_1::IThermalInterface> impl_;
83};
84} // V1_1
85} // Thermal
86} // HDI
87} // OHOS
88
89#endif // OHOS_HDI_THERMAL_V1_1_THERMALINTERFACESTUB_H
90
91