AC and Battery

AC and Battery

Imagen 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?
publicaciones de 6 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen 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

Imagen de nirkushtai

Thank you.

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

Imagen de Lester Memmott (Intel)


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


Thanks,
Lester

Imagen de Robert Steigerwald (Intel)

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

Imagen 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.

Inicie sesión para dejar un comentario.