EthernetNetIf Compatibility.

Dependents:   XBeeWiFi_SPI_example

Fork of NetServicesSource by Donatien Garnier

Revision:
9:c79fa4034f5b
Parent:
5:dd63a1e02b1b
--- a/if/gprsmodule/GPRSModuleNetIf.cpp	Wed Jul 28 12:45:32 2010 +0000
+++ b/if/gprsmodule/GPRSModuleNetIf.cpp	Thu Aug 05 14:32:43 2010 +0000
@@ -29,7 +29,7 @@
 #define __DEBUG
 #include "dbg/dbg.h"
 
-GPRSModuleNetIf::GPRSModuleNetIf(PinName tx, PinName rx, PinName pwrSetPin, PinName pwrMonPin, int baud /*= 115200*/) : PPPNetIf(NULL), m_module(pwrSetPin, pwrMonPin), m_serial(tx, rx)
+GPRSModuleNetIf::GPRSModuleNetIf(PinName tx, PinName rx, int baud /*= 115200*/) : PPPNetIf(NULL), m_serial(tx, rx)
 {
   PPPNetIf::m_pIf = new GPRSModem();
   m_serial.baud(baud);
@@ -42,22 +42,15 @@
   
 PPPErr GPRSModuleNetIf::connect(const char* apn /*= NULL*/, const char* userId /*= NULL*/, const char* password /*= NULL*/) //Connect using GPRS
 {
-  if(m_module.isOn())
-  {
-    DBG("Resetting module...\n");
-    m_module.off(); //Reset module if needed
-  }
-  
-  wait(4);
 
   DBG("Powering on module.\n")
-  if(!m_module.on()) //Could not power on module
+  if(!setOn()) //Could not power on module
   {
     DBG("Could not power on module.\n");
     return PPP_MODEM;
   }
   
-  wait(10); //Wait for module to init.
+  //wait(10); //Wait for module to init.
 
   ATErr atErr;
   for(int i=0; i<3; i++)
@@ -71,7 +64,7 @@
     
   if(atErr)
   {
-    m_module.off();
+    setOff();
     return PPP_MODEM;
   }
     
@@ -89,7 +82,7 @@
   }
   if(pppErr)
   {
-    m_module.off();
+    setOff();
     return pppErr;
   }
     
@@ -108,7 +101,7 @@
   m_pIf->close();
   
   DBG("Powering off module.\n")
-  m_module.off(); //Power off module
+  setOff(); //Power off module
   
   DBG("Off.\n")