bcharge.cc File Reference


Detailed Description

Talk to the Blackberry just enough to change the Max Power to 500mA.

Cycles through all devices attached to USB, attempting to set all matching Blackberry devices to charge.

This file is part of the Barry project:

http://www.netdirect.ca/software/packages/barry/index.php http://sourceforge.net/projects/barry

Compile with the following command (needs libusb):

g++ -o bcharge bcharge.cc -lusb

Definition in file bcharge.cc.

#include <usb.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string>

Go to the source code of this file.

Defines

#define VENDOR_RIM   0x0fca
#define PRODUCT_RIM_BLACKBERRY   0x0001
#define PRODUCT_RIM_PEARL_DUAL   0x0004
#define PRODUCT_RIM_PEARL_8120   0x8004
#define PRODUCT_RIM_PEARL   0x0006
#define IPRODUCT_RIM_HANDHELD   2
#define IPRODUCT_RIM_MASS_STORAGE   4
#define IPRODUCT_RIM_COMPOSITE   5
#define BLACKBERRY_INTERFACE   0
#define BLACKBERRY_CONFIGURATION   1

Functions

void Usage ()
void control (usb_dev_handle *dev, int requesttype, int request, int value, int index, char *bytes, int size, int timeout)
void charge (struct usb_dev_handle *handle)
void pearl_mode (struct usb_dev_handle *handle)
int find_mass_storage_interface (struct usb_dev_handle *handle)
void driver_conflict (struct usb_dev_handle *handle)
bool process (struct usb_device *dev, bool is_pearl)
bool power_write (const std::string &file, const std::string &value)
void resume ()
int main (int argc, char *argv[])

Variables

bool old_style_pearl = false
bool force_dual = false
std::string udev_devpath
std::string sysfs_path = "/sys"


Generated on Wed Sep 24 21:27:32 2008 for Barry by  doxygen 1.5.1