PowerManagement_SetSystemPowerProfile 函数
标头: #include <applibs/powermanagement.h>
设置系统电源配置文件。 系统根据指定的电源配置文件动态调整 CPU 频率,以平衡功耗和性能。
int PowerManagement_SetSystemPowerProfile(PowerManagement_System_PowerProfile desired_profile);
注意
电源配置文件在重新启动后不会保留,应始终在应用程序启动时设置。
参数
-
PowerManagement_PowerSaver
指示系统应优先考虑节能性能。 -
PowerManagement_Balanced
指示系统应根据系统负载平衡节能和性能。 -
PowerManagement_HighPerformance
指示系统应将性能优先于节能。
错误
如果遇到错误并设置为 errno
错误值,则返回 -1。
- EACCES:不允许访问设置系统电源配置文件,因为应用程序清单中未列出所需的条目。
- EINVAL:为desired_profile指定了无效的系统电源配置文件。
还可以指定任何其他 errno
项。 此类错误不是确定性的,并且可能无法通过系统更新保留相同的行为。
返回值
如果成功,则返回 0,如果失败,则返回 -1,在这种情况下 errno
,将设置为错误值。
应用程序清单要求
若要使用 PowerManagement_SetSystemPowerProfile () ,应用程序必须在应用程序清单的 PowerControls 字段中声明 SetPowerProfile 值。