AC and Battery

AC and Battery

Portrait de nirkushtai
How is the machanism of letting Windows know if it is on battery or on AC power? Is there is an API to switch from AC to battery, or is it some hardware line that have to be wired to the chipset?
6 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.
Portrait de Lester Memmott (Intel)


If I understand your question correctly you would like your application to control whether the system will be running off of batter power or if it will be running off of external/AC power (assuming both are present). Windows does not provide any APIs to do this. It is all managed in the hardware and in all cases I've seen, it automatically switches to AC power as soon as a live cable is plugged into the system. It switches back to battery power automatically when the AC cord is removed.


Thanks,
Lester

Portrait de nirkushtai

Thank you.

Do you know how it is done by the hardware? GPIO, I2C...

Portrait de Lester Memmott (Intel)


I'm not familiar with the details of how it is implemented in hardware.


Thanks,
Lester

Portrait de Robert Steigerwald (Intel)

Hello Nirkushtai - Can you please describe the problem you wish to solve? Perhaps there is another method to use.

Portrait de Community Admin
The method Windows uses to get the battery state is dependent on the OEM implementation. You would have to look into the hardware specification to determine the methods you could get that. Overall you can only get the power state from windows, but individual OEM's may expose more information.

Connectez-vous pour laisser un commentaire.