Chris and I have been investigating a device hang on a BB 8330. The
following patch is minimalist, should not affect the overall speed of
the library and limits the change to very low level code.

---------------------------------------------------------------------------



diff -Naur barry.orig/src/usbwrap.cc barry.patch/src/usbwrap.cc
--- barry.orig/src/usbwrap.cc   2009-02-27 01:54:00.000000000 +0000
+++ barry.patch/src/usbwrap.cc  2009-02-27 01:56:34.000000000 +0000
@@ -187,6 +187,11 @@
        dout("usb_clear_halt(" << std::dec << m_handle << "," << std::dec <<
ep << ")");
        int ret = usb_clear_halt(m_handle, ep);
        m_lasterror = ret;
+
+       //Paul O'Keefe p...@megabelle.net 26-feb-2009
+       //Device may hang if commands sent immediately after this call.
+       //Add small sleep to allow device to settle before continuing
+       usleep(100000);
        return ret >= 0;
 }
 
diff -Naur barry.orig/src/usbwrap.h barry.patch/src/usbwrap.h
--- barry.orig/src/usbwrap.h    2009-02-27 01:54:00.000000000 +0000
+++ barry.patch/src/usbwrap.h   2009-02-27 01:55:04.000000000 +0000
@@ -29,6 +29,9 @@
 #include <map>
 #include "error.h"
 
+// Paul O'Keefe. p...@megabelle.net 26-feb-2009
+#include <unistd.h>
+
 #define USBWRAP_DEFAULT_TIMEOUT        30000
 
 namespace Barry { class Data; }


---------------------------------------------------------------------------

--
Paul O'Keefe <p...@megabelle.net>
VOIP:    1-770-250-5165
FindMe: 1-678-967-4103   


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Barry-devel mailing list
Barry-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/barry-devel

Reply via email to