Re: [Barry-devel] Charging the BlackBerry on Linux
Status: Beta
Brought to you by:
ndprojects
From: Chris F. <cd...@fo...> - 2006-12-30 00:17:33
|
On Fri, Dec 29, 2006 at 06:28:13PM -0500, R P Herrold wrote: > > g++ -o bcharge bcharge.cc -lusb > > > > The RPM attempts to get fancy and adjust your udev rules so that it > > automatically runs bcharge as soon as you plug in your BlackBerry. > > The RPM was made on a recent version of Fedora. > > um -- no .spec file or Source RPM was posted -- running the > rpm requires a leap of faith -- might we see the contents > please? You can snag the src rpm from here: http://www.netdirect.ca/downloads/barry/ I'll update the SourceForge page with it as well. > In running the binary (compiled from the sources [under > CentOS-4, without issue, as one would expect] I could examine, > it scans, and does not find a device, and so exits, when the > Blackberry is not already plugged in. > > RFE: I understand this is a first pass on this code, but > adding a sleep and repoll, or even a (unplug|plug) event > driven requery would be useful. The idea is to use the hotplug or udev features to run bcharge on these events. These events are already handled, so might as well do it in a system-consistent manner. It helps keep the bcharge.cc code short and concise too. :-) > After starting the binary, with the device already plugged > in, I get the customary message from the device about low > current level problems; Is there a way for the program > to query, and then report back, once it has made then change? This is what you should see when you run bcharge: [cdfrey@tools]$ g++ -o bcharge bcharge.cc -lusb [cdfrey@tools]$ ./bcharge Scanning for Blackberry devices... Found...attempting to adjust charge setting. 1 device adjusted. [cdfrey@tools]$ ./bcharge Scanning for Blackberry devices... Found...already at 500mA 0 device adjusted. If you run it twice, it should say it found it, and do nothing. > lsusb reports for my device [an 8700] (after the program has > run and exited): > > Bus 003 Device 005: ID 0fca:0001 Research In Motion, Ltd. > Blackberry Handheld > Device Descriptor: > bLength 18 > bDescriptorType 1 > bcdUSB 1.10 > bDeviceClass 255 Vendor Specific Class > bDeviceSubClass 255 Vendor Specific Subclass > bDeviceProtocol 255 Vendor Specific Protocol > bMaxPacketSize0 16 > idVendor 0x0fca Research In Motion, Ltd. > idProduct 0x0001 Blackberry Handheld > bcdDevice 1.04 > iManufacturer 1 Research In Motion > iProduct 2 BlackBerry Device > iSerial 0 > bNumConfigurations 1 > Configuration Descriptor: > bLength 9 > bDescriptorType 2 > wTotalLength 46 > bNumInterfaces 1 > bConfigurationValue 1 > iConfiguration 0 > bmAttributes 0x80 > MaxPower 500mA ^^^^^^^^ That's the key value :-) - Chris |