1# IThermalInterface
2
3
4## 概述
5
6设备温度管理、控制及订阅接口。
7
8服务获取此对象后,可以调用相关的接口管理、控制和订阅设备温度。
9
10**起始版本:** 3.1
11
12**相关模块:**[Thermal](thermal_v10.md)
13
14
15## 汇总
16
17
18### Public 成员函数
19
20| 名称 | 描述 |
21| -------- | -------- |
22| [SetCpuFreq](#setcpufreq) ([in] int freq) | 设置CPU频率。  |
23| [SetGpuFreq](#setgpufreq) ([in] int freq) | 设置GPU频率。  |
24| [SetBatteryCurrent](#setbatterycurrent) ([in] int current) | 设置充电电流。  |
25| [GetThermalZoneInfo](#getthermalzoneinfo) ([out] struct [HdfThermalCallbackInfo](_hdf_thermal_callback_info_v10.md) event) | 获取设备发热的信息。  |
26| [Register](#register) ([in] [IThermalCallback](interface_i_thermal_callback_v10.md) callbackObj) | 注册设备发热状态的回调。  |
27| [Unregister](#unregister) () | 取消注册设备发热状态的回调。  |
28
29
30## 成员函数说明
31
32
33### GetThermalZoneInfo()
34
35```
36IThermalInterface::GetThermalZoneInfo ([out] struct HdfThermalCallbackInfo event)
37```
38**描述**
39获取设备发热的信息。
40
41**起始版本:** 3.1
42
43**参数:**
44
45| 名称 | 描述 |
46| -------- | -------- |
47| event | 输出参数,设备发热信息,包括器件类型、器件温度。 |
48
49**返回:**
50
51HDF_SUCCESS 表示操作成功。
52
53HDF_FAILED 表示操作失败。
54
55**参见:**
56
57[HdfThermalCallbackInfo](_hdf_thermal_callback_info_v10.md)
58
59
60### Register()
61
62```
63IThermalInterface::Register ([in] IThermalCallback callbackObj)
64```
65**描述**
66注册设备发热状态的回调。
67
68**起始版本:** 3.1
69
70**参数:**
71
72| 名称 | 描述 |
73| -------- | -------- |
74| callbackObj | 输入参数,服务注册的回调。 |
75
76**返回:**
77
78HDF_SUCCESS 表示操作成功。
79
80HDF_FAILED 表示操作失败。
81
82**参见:**
83
84[IThermalCallback](interface_i_thermal_callback_v10.md)
85
86
87### SetBatteryCurrent()
88
89```
90IThermalInterface::SetBatteryCurrent ([in] int current)
91```
92**描述**
93设置充电电流。
94
95**起始版本:** 3.1
96
97**参数:**
98
99| 名称 | 描述 |
100| -------- | -------- |
101| current | 输入参数,充电电流,单位毫安。 |
102
103**返回:**
104
105HDF_SUCCESS 表示操作成功。
106
107HDF_FAILED 表示操作失败。
108
109
110### SetCpuFreq()
111
112```
113IThermalInterface::SetCpuFreq ([in] int freq)
114```
115**描述**
116设置CPU频率。
117
118**起始版本:** 3.1
119
120**参数:**
121
122| 名称 | 描述 |
123| -------- | -------- |
124| freq | 输入参数,设置CPU频率的值。 |
125
126**返回:**
127
128HDF_SUCCESS 表示操作成功。
129
130HDF_FAILED 表示操作失败。
131
132
133### SetGpuFreq()
134
135```
136IThermalInterface::SetGpuFreq ([in] int freq)
137```
138**描述**
139设置GPU频率。
140
141**起始版本:** 3.1
142
143**参数:**
144
145| 名称 | 描述 |
146| -------- | -------- |
147| freq | 输入参数,设置GPU频率的值。 |
148
149**返回:**
150
151HDF_SUCCESS 表示操作成功。
152
153HDF_FAILED 表示操作失败。
154
155
156### Unregister()
157
158```
159IThermalInterface::Unregister ()
160```
161**描述**
162取消注册设备发热状态的回调。
163
164**起始版本:** 3.1
165
166**返回:**
167
168HDF_SUCCESS 表示操作成功。
169
170HDF_FAILED 表示操作失败。
171