Power Status (was Re: Because LC can't do two things at once.)

Mark Wieder mwieder at ahsoftware.net
Thu Mar 5 11:27:51 EST 2015


Peter-

Wednesday, March 4, 2015, 5:10:53 AM, you wrote:

>> and what I see on my Thinkpad running linux Mint 17 is status returns one of
>> three states:
>> 
>> Unknown if the laptop is plugged into the AC adapter
>> Discharging if running off the battery power
>> Charging if it's (wait for it) charging the battery.

> Please clarify: "Unknown" if using the AC adapter, and "Charging"
> if it's charging the battery. How could you be charging the battery
> if you're not using the AC adapter?

> Is "Unknown" reserved for when you're plugged in and the battery is
> fully charged?

Yes. The battery is in place but neither charging nor discharging. I
do see that the "Unknown" description is ambiguous there.

>> If I remove the battery and run the laptop off AC power there is no BAT0
>> directory.

> OK, so a test for "no such file" is called for.

Yes, there are four possible states. And then I guess in Richard's
case you'd also have to check for BAT1.

-- 
-Mark Wieder
 ahsoftware at gmail.com

This communication may be unlawfully collected and stored by the National 
Security Agency (NSA) in secret. The parties to this email do not 
consent to the retrieving or storing of this communication and any 
related metadata, as well as printing, copying, re-transmitting, 
disseminating, or otherwise using it. If you believe you have received 
this communication in error, please delete it immediately.





More information about the Use-livecode mailing list