Vodafone K3770/K3772-Z modems driver & networking library

Dependencies:   Socket USBHostWANDongle lwip-sys lwip

Dependents:   VodafoneUSBModemHTTPClientTest VodafoneUSBModemNTPClientTest VodafoneUSBModemSMSTest VodafoneUSBModemUSSDTest ... more

Fork of VodafoneUSBModem_bleedingedge by Donatien Garnier

This is the driver for the Vodafone K3700 & K3772-Z Dongles:

K3770

More details and instructions can be found here.

Revision:
9:3f077dde13c9
Parent:
8:04b6a042595f
Child:
11:565b2ec40dea
--- a/VodafoneK3770.cpp	Tue Jun 26 13:44:59 2012 +0000
+++ b/VodafoneK3770.cpp	Wed Jul 11 12:44:33 2012 +0000
@@ -176,12 +176,14 @@
     return ret;
   }
 
+  #if USE_ONE_PORT
   m_smsInit = false; //SMS status reset
   m_ussdInit = false; //USSD status reset
+  #endif
 
   ATCommandsInterface::ATResult result;
 
-#if 0
+  #if 0
   //Get network info & select corresponding APN
   COPSProcessor copsProcessor;
   DBG("Get network info & select APN from DB");
@@ -219,21 +221,27 @@
 
   //Connect
   DBG("Connecting");
+  #if 0
   ret = m_at.executeSimple("ATDT *99#", &result);
   DBG("Result of command: Err code=%d", ret);
   DBG("ATResult: AT return=%d (code %d)", result.result, result.code);
+  #endif
+  #if USE_ONE_PORT
   m_at.close(); // Closing AT parser
   m_atOpen = false; //Will need to be reinitialized afterwards
+  #endif
 
+  #if 0
   DBG("AT Parser closed");
   if( (ret!=NET_MOREINFO) || (result.result != ATCommandsInterface::ATResult::AT_CONNECT))
   {
     ERR("Could not connect");
     return ret; //Could not connect
   }
+  #endif
   DBG("Connecting PPP");
 
-  ret = m_ppp.connect();
+  ret = m_ppp.connect("*99#");
   DBG("Result of connect: Err code=%d", ret);
   return ret;
 }
@@ -251,6 +259,7 @@
   //Ugly but leave dongle time to recover
   Thread::wait(500);
 
+  #if USE_ONE_PORT
   ATCommandsInterface::ATResult result;
   DBG("Starting AT thread");
   ret = m_at.open();
@@ -258,10 +267,11 @@
   {
     return ret;
   }
+  #endif
 
   DBG("Trying to hangup");
 
-#if 0 //Does not appear to work
+  #if 0 //Does not appear to work
   int tries = 10;
   do
   {
@@ -275,8 +285,9 @@
     DBG("Result of command: Err code=%d\n", ret);
     DBG("ATResult: AT return=%d (code %d)\n", result.result, result.code);
   }
-#endif
+  #endif
 
+  #if USE_ONE_PORT
   //Reinit AT parser
   ret = m_at.init();
   DBG("Result of command: Err code=%d\n", ret);
@@ -287,8 +298,11 @@
     return NET_TIMEOUT;
   }
 
+  #if 0
   m_at.close(); // Closing AT parser
   DBG("AT Parser closed");
+  #endif
+  #endif
   return OK;
 }
 
@@ -436,6 +450,7 @@
     return ret;
   }
 
+  #if USE_ONE_PORT
   DBG("Configuring unsolicited result codes support properly");
   //Configuring port
   ret = m_at.executeSimple("AT^CURC=0;^PORTSEL=1", NULL); //Huawei-specific, not 3GPP-compliant
@@ -443,6 +458,7 @@
   {
     return NET_PROTOCOL;
   }
+  #endif
 
   ATCommandsInterface::ATResult result;