local fork

Dependencies:   Socket USBHostWANDongle_bleedingedge lwip-sys lwip

Dependents:   Encrypted

Fork of VodafoneUSBModem_bleedingedge by Donatien Garnier

Revision:
33:f505faeda8e7
Parent:
27:37d3ac289e86
Child:
34:b53c619b036d
--- a/VodafoneUSBModem.cpp	Thu Sep 13 13:52:42 2012 +0000
+++ b/VodafoneUSBModem.cpp	Fri Sep 14 10:13:48 2012 +0000
@@ -26,11 +26,11 @@
 
 #include "VodafoneUSBModem.h"
 
-VodafoneUSBModem::VodafoneUSBModem(PinName powerGatingPin /*= NC*/) : m_dongle(),
+VodafoneUSBModem::VodafoneUSBModem(PinName powerGatingPin /*= NC*/, powerGatingOnWhenPinHigh /* = true*/) : m_dongle(),
 m_atStream(m_dongle.getSerial(1)), m_pppStream(m_dongle.getSerial(0)), m_at(&m_atStream),
 m_sms(&m_at), m_ussd(&m_at), m_linkMonitor(&m_at), m_ppp(&m_pppStream), 
 m_dongleConnected(false), m_ipInit(false), m_smsInit(false), m_ussdInit(false), m_linkMonitorInit(false), m_atOpen(false),
-m_powerGatingPin(powerGatingPin)
+m_powerGatingPin(powerGatingPin), m_powerGatingOnWhenPinHigh(powerGatingOnWhenPinHigh)
 {
   if( m_powerGatingPin != NC )
   {
@@ -462,7 +462,7 @@
   }
   
   DigitalOut powerGatingOut(m_powerGatingPin);
-  powerGatingOut = enable;
+  powerGatingOut = m_powerGatingOnWhenPinHigh?enable:!enable;
 
   return OK;
 }
@@ -475,7 +475,7 @@
   }
   
   DigitalOut powerGatingOut(m_powerGatingPin);
-  return powerGatingOut;
+  return m_powerGatingOnWhenPinHigh?powerGatingOut:!powerGatingOut;
 }
 
 int VodafoneUSBModem::init()