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.
Fork of VodafoneUSBModem by
Diff: VodafoneK3770.cpp
- Revision:
- 11:565b2ec40dea
- Parent:
- 10:21a6f09d5631
- Parent:
- 9:3f077dde13c9
- Child:
- 12:66dc2c8eba2d
--- a/VodafoneK3770.cpp Fri Jul 06 08:56:32 2012 +0000 +++ b/VodafoneK3770.cpp Wed Jul 11 12:47:53 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;