local fork (temporary)

Dependents:   VodafoneUSBModem_bleedingedge2

Fork of USBHostWANDongle_bleedingedge by Donatien Garnier

Revision:
6:075e36a3463e
Parent:
3:4394986752db
Child:
8:0d1ec493842c
--- a/USB3GModule/WANDongleInitializer.h	Wed Jul 25 11:13:50 2012 +0000
+++ b/USB3GModule/WANDongleInitializer.h	Fri Jul 27 16:14:07 2012 +0000
@@ -24,8 +24,9 @@
 using std::uint32_t;
 
 #include "USBHost.h"
+#include "IUSBEnumerator.h"
 
-class WANDongleInitializer
+class WANDongleInitializer : public IUSBEnumerator
 {
 protected:
     WANDongleInitializer(USBHost* pHost);
@@ -44,6 +45,12 @@
     
     virtual int getSerialPortCount() = 0;
     
+    virtual void setVidPid(uint16_t vid, uint16_t pid) = 0;
+    
+    virtual bool parseInterface(uint8_t intf_nb, uint8_t intf_class, uint8_t intf_subclass, uint8_t intf_protocol) = 0; //Must return true if the interface should be parsed
+    
+    virtual bool useEndpoint(uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir) = 0; //Must return true if the endpoint will be used
+    
     static WANDongleInitializer** getInitializers(USBHost* pHost);
 };
 
@@ -63,6 +70,18 @@
     virtual Endpoint* getEp(USBDeviceConnected* pDev, int serialPortNumber, bool tx);
     
     virtual int getSerialPortCount();
+    
+    virtual void setVidPid(uint16_t vid, uint16_t pid);
+    
+    virtual bool parseInterface(uint8_t intf_nb, uint8_t intf_class, uint8_t intf_subclass, uint8_t intf_protocol); //Must return true if the interface should be parsed
+    
+    virtual bool useEndpoint(uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir); //Must return true if the endpoint will be used
+    
+private:
+
+  bool m_hasSwitched;
+  int m_currentSerialIntf;
+  int m_endpointsToFetch;
 };
 
 #endif