Le dimanche 01 février 2009 à 16:59 -0500, Chris Frey a écrit :
> On Sun, Feb 01, 2009 at 06:11:15PM +0100, Nicolas wrote:
> >         Desktop: error getting command table
> >         Sent packet:
> >             00000000: 07 00 0a 00 40 00 00 01 00
> >         00                    ....@.....
> >         
> >         Response packet:
> >         
> >         ERROR: (-110, No error): Timeout in usb_bulk_read
> 
> Is the device resetting itself when this happens?

No I haven't reset...

Nothing happens... I have just a timeout.

I have this issue with barrybackup and opensync.
(what is normal, since it's the same process).


With this patch, I can solve this issue... (but I think we don't have to
use this patch, we have to find an other solution)

diff --git a/src/m_desktop.cc b/src/m_desktop.cc
index 8908a72..05fe310 100644
--- a/src/m_desktop.cc
+++ b/src/m_desktop.cc
@@ -60,7 +60,7 @@ Desktop::~Desktop()
 ///////////////////////////////////////////////////////////////////////////////
 // protected members
 
-void Desktop::LoadCommandTable()
+int Desktop::LoadCommandTable()
 {
        char rawCommand[] = { 6, 0, 0x0a, 0, 0x40, 0, 0, 1, 0, 0 };
        *((uint16_t*) rawCommand) = htobs(m_socket->GetSocket());
@@ -69,10 +69,13 @@ void Desktop::LoadCommandTable()
        Data response;
 
        try {
+std::cout << "NV : LoadCommandTable send" << std::endl;
                m_socket->Packet(command, response);
 
                MAKE_PACKET(rpack, response);
+std::cout << "NV : LoadCommandTable receive" << std::endl;
                while( rpack->command != SB_COMMAND_DB_DONE ) {
+std::cout << "NV : LoadCommandTable next" << std::endl;
                        m_socket->NextRecord(response);
 
                        rpack = (const Protocol::Packet *) response.GetData();
@@ -87,11 +90,17 @@ void Desktop::LoadCommandTable()
                ddout(m_commandTable);
 
        }
+       catch( Usb::Timeout & ) {
+               eout("Timeout");
+               return -1;
+       }
        catch( Usb::Error & ) {
                eout("Desktop: error getting command table");
                eeout(command, response);
                throw;
        }
+
+       return 0;
 }
 
 void Desktop::LoadDBDB()
@@ -176,13 +185,20 @@ void Desktop::Open(const char *password)
 ///
 void Desktop::RetryPassword(const char *password)
 {
+       int ret = 0;
        if( m_socket.get() != 0 )
                throw std::logic_error("Socket alreay open in RetryPassword");
 
        m_socket = m_con.m_zero.Open(m_ModeSocket, password);
 
        // get command table and database database
-       LoadCommandTable();
+       ret = LoadCommandTable();
+       if (ret < 0) {
+               ret = LoadCommandTable();
+
+               if (ret < 0)
+                       throw;
+       }
        LoadDBDB();
 }
 
diff --git a/src/m_desktop.h b/src/m_desktop.h
index 5ae6bce..5470e78 100644
--- a/src/m_desktop.h
+++ b/src/m_desktop.h
@@ -71,7 +71,7 @@ private:
        const IConverter *m_ic;
 
 protected:
-       void LoadCommandTable();
+       int LoadCommandTable();
        void LoadDBDB();
 
 public:


Regards,

-- 
Nicolas VIVIEN


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Barry-devel mailing list
Barry-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/barry-devel

Reply via email to