Click here to Skip to main content
16,007,885 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to know if there is any way to change the battery charge condition only using code in C#.
I found a way to do this in android, by using a su command, and I want to do the same in windows, but haven't been able to find a way.
Any help will be greatly appreciated.
Thanks.

What I have tried:

public static PowerStatus power = SystemInformation.PowerStatus;

But this only give me the charge percent, and doesn't allow me to change the charge status.
Posted
Updated 12-Apr-18 23:16pm

1 solution

What do you mean by "battery charge condition"?

The charge status values reported by the system are read only status values.

If you refer to the charging algorithm used by the charger:
That requires access to the charger IC. The system has this access to read the status using a driver.

So you have to identify that driver and check if it provides functions to change the charging algorithm. If such functions are not provided, it might be possible to use the low level bus interface (usually I2C or SPI) to access the charger IC (which type must be know then). With some charger ICs the charging algorithm is not selectable by commands but hard coded on input pins.

Finally a WARNING:
Choosing the wrong charging parameters can damage the battery or even lead to fire or explosion!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900