Bug 6397 - More Logitech mice to report battery status for
Summary: More Logitech mice to report battery status for
Status: RESOLVED FIXED
Alias: None
Product: hal
Classification: Unclassified
Component: hald (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-26 10:54 UTC by Bastien Nocera
Modified: 2006-04-24 14:58 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
hal-more-lmctl-mice.patch (7.65 KB, patch)
2006-03-26 10:55 UTC, Bastien Nocera
Details | Splinter Review
hal-less-lmctl-mice.patch (4.98 KB, patch)
2006-04-19 03:33 UTC, Bastien Nocera
Details | Splinter Review

Description Bastien Nocera 2006-03-26 10:54:40 UTC
Updating from lmctl 0.3.2 (well, the 0.3.2 tarball, the directory still says
0.3.1...), using this as the main():

int main (int argc, char **argv)
{
        int i;
        mouse_t *mouse;

        for (i = 0; mice[i].pid != 0; i++) {
                mouse = &(mice[i]);

                printf ("        <!-- %s -->\n", mouse->name);
                printf ("        <match key=\"usb_device.product_id\"
int=\"0x%x\">\n", mouse->pid);
                printf ("          <append key=\"info.addons\"
type=\"strlist\">hald-addon-usb-csr</append>\n");
                printf ("          <merge key=\"battery.type\"
type=\"string\">mouse</merge>\n");
                printf ("          <merge key=\"battery.is_rechargeable\"
type=\"bool\">true</merge>\n");
                printf ("          <!-- proprietary properties defining the
behavior -->\n");
                printf ("          <merge key=\"battery.csr.has_res\"
type=\"bool\">%s</merge>\n", mouse->has_res ? "true" : "false");               
 printf ("          <merge key=\"battery.csr.has_sms\"
type=\"bool\">%s</merge>\n", mouse->has_sms ? "true" : "false");               
 printf ("          <merge key=\"battery.csr.is_dual\"
type=\"bool\">%s</merge>\n", mouse->is_dual ? "true" : "false");               
 printf ("        </match>\n");
                printf ("\n");         }
         return 0;
}


Patch attached
Comment 1 Bastien Nocera 2006-03-26 10:55:30 UTC
Created attachment 5069 [details] [review]
hal-more-lmctl-mice.patch
Comment 2 David Zeuthen (not reading bugmail) 2006-04-17 07:45:38 UTC
Sorry for the lag. Richard just committed this.
Comment 3 Richard Hughes 2006-04-19 03:03:16 UTC
Umm.. I'm not sure all of those should launch the csr addon... my logitech wired
mouse (no battery in sight) reports 0% battery power with todays CVS... Or
should the csr addon just bail out if there is no battery to monitor?
Comment 4 Bastien Nocera 2006-04-19 03:27:12 UTC
Looks like I got a bit overzealous adding new mice.
lmctl uses CSR for a few features other than battery. The easiest would be to
check (manually) whether the mouse is wireless, and remove it if yes.

I'll start checking which ones need to be removed.
Comment 5 Bastien Nocera 2006-04-19 03:33:05 UTC
Created attachment 5363 [details] [review]
hal-less-lmctl-mice.patch

Removed all the wired mice (looked through Google for which ones weren't
wireless)
Comment 6 Richard Hughes 2006-04-19 07:55:32 UTC
Shouldn't we also add:

<merge key="info.product" type="string">Cordless Presenter Receiver</merge>

As we know the device name, so we should probably update it to something more
than USB mouse?
Comment 7 Richard Hughes 2006-04-25 07:58:45 UTC
2006-04-24  Richard Hughes <richard@hughsie.com>
 * fdi/information/10freedesktop/10-wireless-mice.fdi: Update the patch from
http://bugs.freedesktop.org/show_bug.cgi?id=6397 as we are trying to detect
wired mice here as well. Also add the proper product names, giving a nicer name
in hal-device-manager.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.