Logo Search packages:      
Sourcecode: barry version File versions  Download package

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 BLACKBERRY_CONFIGURATION   1
#define BLACKBERRY_INTERFACE   0
#define IPRODUCT_RIM_COMPOSITE   5
#define IPRODUCT_RIM_HANDHELD   2
#define IPRODUCT_RIM_MASS_STORAGE   4
#define PRODUCT_RIM_BLACKBERRY   0x0001
#define PRODUCT_RIM_PEARL   0x0006
#define PRODUCT_RIM_PEARL_8120   0x8004
#define PRODUCT_RIM_PEARL_DUAL   0x0004
#define VENDOR_RIM   0x0fca

Functions

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

Variables

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


Generated by  Doxygen 1.6.0   Back to index