AC and Battery

AC and Battery

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 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

Thank you.

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

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

Thanks,
Lester

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

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.

Leave a Comment

Please sign in to add a comment. Not a member? Join today