From df17484bd92f637eadd379063967ae7476b2f692 Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Thu, 1 May 2008 16:45:38 -0400 Subject: [PATCH] Removed usb_control message check from IpModem endpoint probing. Removed the code from ProbeModem() in src/probe.cc Some devices, like the 8700 have both RIM_UsbSerData mode and IpModem mode. --- ChangeLog | 3 +++ src/probe.cc | 53 +++++++++++++++++++++++++++++++++-------------------- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba9fa549..4ebfb287 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ Release: version 0.13 - 2008/05/?? ------------------------------------------------------------------------------ 2008/05/01 - updated doc/TroubleShooting.txt + - removed usb_control message check from IpModem endpoint probing + in src/probe.cc, since some devices, like the 8700 + have both RIM_UsbSerData mode and IpModem mode. 2008/04/29 - applied Jason Thomas's ACLOCAL_FLAGS patch to make autoreconf work again... Thanks! diff --git a/src/probe.cc b/src/probe.cc index cbd47698..2a6d5ae0 100644 --- a/src/probe.cc +++ b/src/probe.cc @@ -332,28 +332,41 @@ bool Probe::ProbePair(Usb::Device &dev, return true; } -// Thanks to Rick Scott (XmBlackBerry:bb_usb.c) for reverse engineering this bool Probe::ProbeModem(Usb::Device &dev, const Usb::EndpointPair &ep) { - int num_read; - char data[255]; - int local_errno; - - num_read = usb_control_msg(dev.GetHandle(), - /* bmRequestType */ USB_ENDPOINT_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, - /* bRequest */ 0xa5, - /* wValue */ 0, - /* wIndex */ 1, - /* data */ data, - /* wLength */ sizeof(data), - /* timeout */ 2000); - local_errno = errno; - if( num_read > 1 ) { - if( data[0] == 0x02 ) { - return true; - } - } - return false; + // + // This check is not needed for all devices. Some devices, + // like the 8700 have both the RIM_UsbSerData mode and IpModem mode. + // + // If this function is called, then we have extra endpoints, + // so might as well try them. + // + // FIXME - someday, we might wish to confirm that the endpoints + // work as a modem, and return true/false based on that test. + // + return true; + + +// Thanks to Rick Scott (XmBlackBerry:bb_usb.c) for reverse engineering this +// int num_read; +// char data[255]; +// int local_errno; +// +// num_read = usb_control_msg(dev.GetHandle(), +// /* bmRequestType */ USB_ENDPOINT_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, +// /* bRequest */ 0xa5, +// /* wValue */ 0, +// /* wIndex */ 1, +// /* data */ data, +// /* wLength */ sizeof(data), +// /* timeout */ 2000); +// local_errno = errno; +// if( num_read > 1 ) { +// if( data[0] == 0x02 ) { +// return true; +// } +// } +// return false; } int Probe::FindActive(uint32_t pin) const -- 2.11.4.GIT