local fork

Dependencies:   Socket USBHostWANDongle_bleedingedge lwip-sys lwip

Dependents:   Encrypted

Fork of VodafoneUSBModem_bleedingedge by Donatien Garnier

Revision:
18:1789a11d1892
Parent:
12:66dc2c8eba2d
--- a/VodafoneK3770.cpp	Sat Jul 28 14:33:57 2012 +0000
+++ b/VodafoneK3770.cpp	Mon Jul 30 13:51:51 2012 +0000
@@ -21,7 +21,7 @@
 SOFTWARE.
 */
 
-#define __DEBUG__ 0
+#define __DEBUG__ 3
 #ifndef __MODULE__
 #define __MODULE__ "VodafoneK3770.cpp"
 #endif
@@ -480,22 +480,43 @@
     return ret;
   }
 
-  #if USE_ONE_PORT
-  DBG("Configuring unsolicited result codes support properly");
-  //Configuring port to enable 3GPP-compliant unsollicited response codes but disable Huawei-specific unsollicited response codes
-  ret = m_at.executeSimple("AT^CURC=0;^PORTSEL=1", NULL); //Huawei-specific, not 3GPP-compliant
-  if(ret != OK)
+  if(m_dongle.getDongleType() == WAN_DONGLE_TYPE_VODAFONEK3770)
   {
-    return NET_PROTOCOL;
+    INFO("Using a Vodafone K3770 Dongle");
+    #if USE_ONE_PORT
+    DBG("Configuring unsolicited result codes support properly");
+    //Configuring port to enable 3GPP-compliant unsollicited response codes but disable Huawei-specific unsollicited response codes
+    ret = m_at.executeSimple("AT^CURC=0;^PORTSEL=1", NULL); //Huawei-specific, not 3GPP-compliant
+    if(ret != OK)
+    {
+      return NET_PROTOCOL;
+    }
+    #else
+    //Configuring port to disable Huawei-specific unsollicited response codes
+    ret = m_at.executeSimple("AT^CURC=0", NULL); //Huawei-specific, not 3GPP-compliant
+    if(ret != OK)
+    {
+      return NET_PROTOCOL;
+    }  
+    #endif
   }
-  #else
-  //Configuring port to disable Huawei-specific unsollicited response codes
-  ret = m_at.executeSimple("AT^CURC=0", NULL); //Huawei-specific, not 3GPP-compliant
-  if(ret != OK)
+  else if(m_dongle.getDongleType() == WAN_DONGLE_TYPE_VODAFONEK3772Z)
   {
-    return NET_PROTOCOL;
-  }  
-  #endif
+    INFO("Using a Vodafone K3772-Z Dongle");
+    //FIXME this returns %USBMODEM: [0] MODEM DRIVER<CR><LF><CR><LF><CR><LF>OK<CR><LF> which is not a compliant response
+    /*
+    //Configuring modem to directly boot into modem mode
+    ret = m_at.executeSimple("AT%USBMODEM=0", NULL); //Icera-specific, not 3GPP-compliant
+    if(ret != OK)
+    {
+      return NET_PROTOCOL;
+    }
+    */
+  }
+  else
+  {
+    WARN("Using an Unknown Dongle");
+  }
 
   ATCommandsInterface::ATResult result;