Software Archive
Read-only legacy content
17060 Discussions

AC and Battery

nirkushtai
Beginner
1,417 Views
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?
0 Kudos
5 Replies
James_M_Intel1
Employee
1,417 Views

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

0 Kudos
nirkushtai
Beginner
1,417 Views

Thank you.

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

0 Kudos
James_M_Intel1
Employee
1,417 Views

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

Thanks,
Lester

0 Kudos
Robert_S_Intel2
Employee
1,417 Views

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

0 Kudos
Intel_C_Intel
Employee
1,417 Views
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.
0 Kudos
Reply