Funzione PowerManagement_SetSystemPowerProfilePowerManagement_SetSystemPowerProfile Function
Intestazione: #include <applibs/Powermanagement. h>Header: #include <applibs/powermanagement.h>
Imposta il profilo di alimentazione del sistema.Sets the system power profile. Il sistema regola dinamicamente la frequenza della CPU per bilanciare il consumo di energia e le prestazioni in base al profilo di alimentazione specificato.The system dynamically adjusts the CPU frequency to balance power consumption and performance according to the specified Power Profile.
int PowerManagement_SetSystemPowerProfile(PowerManagement_System_PowerProfile desired_profile);
Nota
I profili risparmio energia non vengono mantenuti tra i riavvii e devono sempre essere impostati all'avvio dell'applicazione.Power profiles do not persist across reboots and should always be set when your application starts.
ParametriParameters
PowerManagement_PowerSaver
indica che il sistema deve assegnare una priorità al risparmio di energia rispetto alle prestazioni.PowerManagement_PowerSaver
indicates that the system should prioritize power savings over performance.PowerManagement_Balanced
indica che il sistema deve bilanciare il risparmio di energia e le prestazioni in base al carico del sistema.PowerManagement_Balanced
indicates that the the system should balance power savings and performance according to system load.PowerManagement_HighPerformance
indica che il sistema deve classificare in ordine di priorità le prestazioni rispetto al risparmio energetico.PowerManagement_HighPerformance
indicates that the system should prioritize performance over power savings.
ErrorsErrors
Restituisce-1 se viene rilevato un errore e imposta sul errno
valore di errore.Returns -1 if an error is encountered and sets errno
to the error value.
- EACCES: l'accesso per impostare il profilo di alimentazione del sistema non è consentito perché l'elemento obbligatorio non è elencato nel manifesto dell'applicazione.EACCES: access to set system power profile is not permitted as the required entry is not listed in the application manifest.
- EINVAL: è stato specificato un profilo di alimentazione di sistema non valido per desired_profile.EINVAL: an invalid system power profile was specified for desired_profile.
errno
È possibile specificare anche altri.Any other errno
may also be specified. Tali errori non sono deterministici e non è detto che venga mantenuto lo stesso comportamento con gli aggiornamenti del sistema.Such errors aren't deterministic and the same behavior might not be retained through system updates.
Valore restituitoReturn value
Restituisce 0 in caso di esito positivo o-1 per l'esito negativo, nel qual caso errno
verrà impostato sul valore di errore.Returns 0 for success or -1 for failure, in which case errno
will be set to the error value.
Requisiti del manifesto dell'applicazioneApplication manifest requirements
Per usare PowerManagement_SetSystemPowerProfile (), l'applicazione deve dichiarare il valore SetPowerProfile nel campo PowerControls del manifesto dell' applicazione.To use PowerManagement_SetSystemPowerProfile(), your application must declare the SetPowerProfile value in the PowerControls field of the application manifest.