From: Bob Toxen <bob@verysecurelinux.com>
To: Vinod <geekvinod@yahoo.com>, linux-laptop@vger.kernel.org
Subject: Re: system call to check battery energy?
Date: Mon, 11 Jul 2005 16:28:39 -0400 [thread overview]
Message-ID: <20050711202839.GB32183@verysecurelinux.com> (raw)
In-Reply-To: <20050711134454.45790.qmail@web33514.mail.mud.yahoo.com>
Hi Vinod,
> Hi All.
> Would anyone know if i could make a simple system call
> and find the battery energy remaining?
You could read the file "/proc/apm". The number with the "%"
after it is the battery level. The two hex numbers before it
are flags, such as whether or not AC power is present, etc.
You could either read the doc, read the Kernel source, etc.
to determine the meanings of these flags or experiment.
> I am relatively new to linux, but i have uncovered
> that apm and acpi are power management tools. trying
> apm gives me the lifetime ,not in terms of energy say
> in terms of mAh. acpi on the other hand does
> seem(havent tried it yet) to give me values in terms
> of energy. But i was wondering if there is a way i can
> just do a system call and find the energy value than
> having to configure acpi. Would appreciate any
> pointers.
> Thanks,
> Vinod
Best regards,
Bob Toxen, CTO
Fly-By-Day Consulting, Inc.
d/b/a Horizon Network Security
"Your expert in Firewalls, Virus and Spam Filters, VPNs,
Network Monitoring, and Network Security consulting"
http://www.verysecurelinux.com [Network & Linux/Unix Security Consulting]
http://www.realworldlinuxsecurity.com [My 5* book: "Real World Linux Security"]
http://www.verysecurelinux.com/sunset.html [Sunset Computer]
bob@verysecurelinux.com (e-mail)
prev parent reply other threads:[~2005-07-11 20:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-11 13:44 system call to check battery energy? Vinod
2005-07-11 20:28 ` Bob Toxen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050711202839.GB32183@verysecurelinux.com \
--to=bob@verysecurelinux.com \
--cc=geekvinod@yahoo.com \
--cc=linux-laptop@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.