Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Socket USBHostWANDongle lwip-sys lwip
Fork of VodafoneUSBModem by
Revision 27:37d3ac289e86, committed 2012-08-30
- Comitter:
- donatien
- Date:
- Thu Aug 30 09:16:05 2012 +0000
- Parent:
- 26:d37501dc6c61
- Child:
- 28:c94ffb45a848
- Commit message:
- Power gating feature
Changed in this revision
--- a/USBHostWANDongleLib.lib Wed Aug 29 16:28:13 2012 +0000 +++ b/USBHostWANDongleLib.lib Thu Aug 30 09:16:05 2012 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/donatien/code/USBHostWANDongle_bleedingedge/#c9e9817c398c +http://mbed.org/users/donatien/code/USBHostWANDongle_bleedingedge/#08bce4cd973a
--- a/VodafoneUSBModem.cpp Wed Aug 29 16:28:13 2012 +0000
+++ b/VodafoneUSBModem.cpp Thu Aug 30 09:16:05 2012 +0000
@@ -455,25 +455,15 @@
{
return NET_INVALID; //A pin name has not been provided in the constructor
}
-
- if(!enable && m_ppp.isConnected())
+
+ if(!enable) //Will force components to re-init
{
- WARN("Data connection is still open"); //Try to encourage good behaviour from the user
- m_ppp.disconnect();
+ cleanup();
}
DigitalOut powerGatingOut(m_powerGatingPin);
powerGatingOut = enable;
- if(!enable) //Will force components to re-init
- {
- m_dongleConnected = false;
- m_smsInit = false;
- m_ussdInit = false;
- m_linkMonitorInit = false;
- m_atOpen = false;
- //We don't reset m_ipInit as PPPIPInterface::init() only needs to be called once
- }
-
+
return OK;
}
@@ -589,4 +579,28 @@
return OK;
}
+int VodafoneUSBModem::cleanup()
+{
+ if(m_ppp.isConnected())
+ {
+ WARN("Data connection is still open"); //Try to encourage good behaviour from the user
+ m_ppp.disconnect();
+ }
+
+ m_smsInit = false;
+ m_ussdInit = false;
+ m_linkMonitorInit = false;
+ //We don't reset m_ipInit as PPPIPInterface::init() only needs to be called once
+
+ if(m_atOpen)
+ {
+ m_at.close();
+ m_atOpen = false;
+ }
+
+ m_dongle.disconnect();
+ m_dongleConnected = false;
+
+ return OK;
+}
--- a/VodafoneUSBModem.h Wed Aug 29 16:28:13 2012 +0000 +++ b/VodafoneUSBModem.h Thu Aug 30 09:16:05 2012 +0000 @@ -107,6 +107,7 @@ bool power(); int init(); + int cleanup(); private: WANDongle m_dongle;
--- a/ip/IPInterface.cpp Wed Aug 29 16:28:13 2012 +0000
+++ b/ip/IPInterface.cpp Thu Aug 30 09:16:05 2012 +0000
@@ -24,7 +24,7 @@
#include <cstring> //For strcpy
-IPInterface::IPInterface()
+IPInterface::IPInterface() : m_connected(false)
{
}
--- a/ip/PPPIPInterface.cpp Wed Aug 29 16:28:13 2012 +0000 +++ b/ip/PPPIPInterface.cpp Thu Aug 30 09:16:05 2012 +0000 @@ -17,7 +17,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#define __DEBUG__ 0 //Maximum verbosity +#define __DEBUG__ 0 #ifndef __MODULE__ #define __MODULE__ "PPPIPInterface.cpp" #endif
