Your message dated Wed, 24 May 2006 07:32:04 -0700
with message-id <[EMAIL PROTECTED]>
and subject line Bug#270520: fixed in lm-batmon 0.96-4
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: lm_batmon
Version: 0.96-2
Severity: wishlist
Tags: patch

lm_batmon only works with APM, not with ACPI.  I've created a small
patch that enables ACPI support.  It was sucessfully tested on a
Thinkpad T30 with vanilla Kernel 2.6.7.

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing'), (50, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.8.1
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED]

-- 
....Christian.Garbs.....................................http://www.cgarbs.de

Got Mole problems?
Call Avogadro 6.02 x 10^23
--- lm_batmon-0.96/src/apm_info.c.orig  Tue Sep  7 19:46:30 2004
+++ lm_batmon-0.96/src/apm_info.c       Tue Sep  7 20:05:58 2004
@@ -100,6 +100,7 @@
  * the hardware.
  *
  * Author: Nat Friedman <[EMAIL PROTECTED]>
+ *         Christian Garbs <[EMAIL PROTECTED]>
  */
 
 
@@ -107,6 +108,67 @@
  --- ¥€¥ó¥×¥ê¥á¥ó¥È
 ------------------------------------------------------------------------ */
 
+
+/* -------------------------------------------------------------
+  LinuxAcpiInfoGet  -- read ACPI battery status under Linux
+
+   return : gint  0 == success  1 == error
+   gint *remain : variable to hold battery remaining capacity
+   gint *state  : variable to hold the battery status
+
+   Added 2004/09/08 by Christian Garbs <[EMAIL PROTECTED]>
+
+-------------------------------------------------------------- */
+gint LinuxAcpiInfoGet(gint *remain, gint *state)
+{
+
+  FILE  *fp;
+  gint   batmax = 1;
+  gint   batcur = 0;
+  gchar  line[128];
+  gchar  line2[21];
+  gchar *ret;
+
+  /* get maximum battery capacity */
+  fp = fopen("/proc/acpi/battery/BAT0/info", "r");
+  if (fp == NULL) {
+    return(1);
+  }
+  ret = fgets(line, 128, fp);
+  while (ret != NULL) {
+    if (strncmp(line, "last full capacity:", 19) == 0) {
+      sscanf(line, "%*s %*s %*s %d %*s", &batmax);
+    }
+    ret = fgets(line, 127, fp);
+  }
+  fclose(fp);
+
+  /* get current battery capacity and status*/
+  fp = fopen("/proc/acpi/battery/BAT0/state", "r");
+  if (fp == NULL) {
+    return(1);
+  }
+  ret = fgets(line, 128, fp);
+  while (ret != NULL) {
+    if (strncmp(line, "remaining capacity:", 19) == 0) {
+      sscanf(line, "%*s %*s %d %*s", &batcur );
+    }
+    if (strncmp(line, "charging state:", 15) == 0) {
+      sscanf(line, "%*s %*s %11s", (char *)&line2 );
+      if (strncmp(line2, "discharging", 11) == 0) {
+       *state = 1;
+      } else {
+       *state = 0;
+      }
+    }
+    ret = fgets(line, 127, fp);
+  }
+  fclose(fp);
+  *remain = (batcur * 100 / batmax);
+  return(0);
+}
+
+
 /* -------------------------------------------------------------
   ApmInfoGet          -- APMŸðÊóŒèÆÀ
 
@@ -138,8 +200,12 @@
     fp = fopen("/proc/apm", "r");
     if (fp == NULL) {
       /* -- /proc/apm €¬Ìµ€€ ¢ª apmd €¬Æ°ºî€·€Æ€€€Ê€€ */
-      stat = 2;
-      remain = 0;
+
+      /* no APM -- try ACPI */
+      if (LinuxAcpiInfoGet(&remain, &stat)) {
+       stat = 2;
+       remain = 0;
+      }
     }
     else {
       fgets((char*)line, 127, fp);

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Source: lm-batmon
Source-Version: 0.96-4

We believe that the bug you reported is fixed in the latest version of
lm-batmon, which is due to be installed in the Debian FTP archive:

lm-batmon_0.96-4.diff.gz
  to pool/main/l/lm-batmon/lm-batmon_0.96-4.diff.gz
lm-batmon_0.96-4.dsc
  to pool/main/l/lm-batmon/lm-batmon_0.96-4.dsc
lm-batmon_0.96-4_i386.deb
  to pool/main/l/lm-batmon/lm-batmon_0.96-4_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
GOTO Masanori <[EMAIL PROTECTED]> (supplier of updated lm-batmon package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Thu, 18 May 2006 10:38:57 +0900
Source: lm-batmon
Binary: lm-batmon
Architecture: source i386
Version: 0.96-4
Distribution: unstable
Urgency: low
Maintainer: GOTO Masanori <[EMAIL PROTECTED]>
Changed-By: GOTO Masanori <[EMAIL PROTECTED]>
Description: 
 lm-batmon  - A Cute and Cuddly APM Battery Monitor
Closes: 270520 277253
Changes: 
 lm-batmon (0.96-4) unstable; urgency=low
 .
   * debian/control: Fix package description typo.  Patched by Florian
     Zumbiehl <[EMAIL PROTECTED]>.  (Closes: #277253)
   * debian/apm_info.c.patch: Add support ACPI support.  Patched by
     Christian Garbs <[EMAIL PROTECTED]>.  (Closes: #270520)
   * debian/apm_info.c.patch: Add trying both BAT0 and BATA pathname.
   * debian/dirs: All binaries and manual pages are moved from /usr/X11R6
     to /usr standards directories.
   * debian/rules: Likewise.
   * debian/menu: Likewise.
   * debian/lm_batmon.1: Renamed from debian/lm_batmon.1x.
   * debian/rules: Likewise.
   * debian/copyright: Update upstream URL.
   * debian/control: Update Standards-Version.
   * debian/compat: Added.
Files: 
 7c39dc06c685aade0573ba16563dfa6f 611 x11 optional lm-batmon_0.96-4.dsc
 7c8991369b3ed865f1e0ed5c7bb20abd 4303 x11 optional lm-batmon_0.96-4.diff.gz
 4ec9458ba844d77fb16525b01e19477e 35680 x11 optional lm-batmon_0.96-4_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFEdGutqIqasIZIJsMRAnNJAKCV2LN1l3wJ2olcfuqYBrJ4ymDzgwCggl5U
2HGOqZa8zyscb1UBFDrNlWE=
=jgPQ
-----END PGP SIGNATURE-----


--- End Message ---

Reply via email to