USB Host WAN Dongle library

Fork of USBHostWANDongle_bleedingedge by Donatien Garnier

Files at this revision

API Documentation at this revision

Comitter:
ashleymills
Date:
Wed Jan 09 16:13:34 2013 +0000
Parent:
23:8f2d9a244224
Child:
25:3184f71557bf
Commit message:
Experimental MU509 Support.

Changed in this revision

USB3GModule/WANDongle.cpp Show annotated file Show diff for this revision Revisions of this file
USB3GModule/WANDongleInitializer.cpp Show annotated file Show diff for this revision Revisions of this file
USB3GModule/WANDongleSerialPort.cpp Show annotated file Show diff for this revision Revisions of this file
USBHost/USBDeviceConnected.h Show annotated file Show diff for this revision Revisions of this file
USBHost/USBHost.h Show annotated file Show diff for this revision Revisions of this file
--- a/USB3GModule/WANDongle.cpp	Wed Dec 19 09:32:39 2012 +0000
+++ b/USB3GModule/WANDongle.cpp	Wed Jan 09 16:13:34 2013 +0000
@@ -16,7 +16,7 @@
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
 
-#define __DEBUG__ 4
+#define __DEBUG__ 0
 #ifndef __MODULE__
 #define __MODULE__ "WANDongle.cpp"
 #endif
@@ -69,6 +69,7 @@
 
           DBG("Enumerate");
           ret = host->enumerate(dev, this);
+          
           if(ret)
           {
             host->unlock();
@@ -106,7 +107,6 @@
               dev_connected = true;
               host->unlock();
               
-              
               return true;
             }
             else if ((dev->getVid() == m_pInitializer->getMSDVid()) && (dev->getPid() == m_pInitializer->getMSDPid()))
--- a/USB3GModule/WANDongleInitializer.cpp	Wed Dec 19 09:32:39 2012 +0000
+++ b/USB3GModule/WANDongleInitializer.cpp	Wed Jan 09 16:13:34 2013 +0000
@@ -16,7 +16,7 @@
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
 
-#define __DEBUG__ 4
+#define __DEBUG__ 0
 #ifndef __MODULE__
 #define __MODULE__ "WANDongleInitializer.cpp"
 #endif
@@ -179,7 +179,18 @@
 
 USBEndpoint* VodafoneMU509Initializer::getEp(USBDeviceConnected* pDev, int serialPortNumber, bool tx)
 {
-  return pDev->getEndpoint((serialPortNumber==1)?0:1, BULK_ENDPOINT, tx?OUT:IN, 0);
+  /*
+  int sPort = serialPortNumber;
+  if(sPort==1)
+     sPort = 0;
+  if(sPort==2)
+     sPort = 1;
+  if(sPort==0)
+     sPort = 2;
+  return pDev->getEndpoint(sPort, BULK_ENDPOINT, tx?OUT:IN, 0);
+  */
+  return pDev->getEndpoint(serialPortNumber, BULK_ENDPOINT, tx?OUT:IN, 0);
+  //return pDev->getEndpoint((serialPortNumber==1)?0:1, BULK_ENDPOINT, tx?OUT:IN, 0);
 }
 
 int VodafoneMU509Initializer::getSerialPortCount()
@@ -197,7 +208,7 @@
 {
   if( intf_class == 0xFF )
   {
-    if( (m_currentSerialIntf == 0) || (m_currentSerialIntf == 1) )
+    if( (m_currentSerialIntf == 0) || (m_currentSerialIntf == 2) )
     {
       m_currentSerialIntf++;
       return true;
@@ -211,6 +222,7 @@
 {
   if( (type == BULK_ENDPOINT) && m_endpointsToFetch )
   {
+    DBG("new endpoint");
     m_endpointsToFetch--;
     return true;
   }
--- a/USB3GModule/WANDongleSerialPort.cpp	Wed Dec 19 09:32:39 2012 +0000
+++ b/USB3GModule/WANDongleSerialPort.cpp	Wed Jan 09 16:13:34 2013 +0000
@@ -16,7 +16,7 @@
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
 
-#define __DEBUG__ 4
+#define __DEBUG__ 0
 #ifndef __MODULE__
 #define __MODULE__ "WANDongleSerialPort.cpp"
 #endif
--- a/USBHost/USBDeviceConnected.h	Wed Dec 19 09:32:39 2012 +0000
+++ b/USBHost/USBDeviceConnected.h	Wed Jan 09 16:13:34 2013 +0000
@@ -23,7 +23,7 @@
 #include "USBEndpoint.h"
 
 #define MAX_ENDPOINT_PER_INTERFACE  2
-#define MAX_INTF                    2
+#define MAX_INTF                    3
 
 typedef struct {
     bool in_use;
--- a/USBHost/USBHost.h	Wed Dec 19 09:32:39 2012 +0000
+++ b/USBHost/USBHost.h	Wed Jan 09 16:13:34 2013 +0000
@@ -296,6 +296,7 @@
     /////////////////////////
     /// FOR DEBUG
     /////////////////////////
+    public:
     void printBulk();
     void printInt();