Changes to support Vodafone K4606
Dependencies: Socket USBHostWANDongle lwip-sys lwip
Fork of VodafoneUSBModem by
Diff: VodafoneUSBModem.cpp
- Revision:
- 71:0da249386019
- Parent:
- 69:9b475f458fbc
- Child:
- 74:b70519f17a22
--- a/VodafoneUSBModem.cpp Wed Feb 06 16:55:08 2013 +0000 +++ b/VodafoneUSBModem.cpp Sun Feb 10 16:23:44 2013 +0000 @@ -17,7 +17,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#define __DEBUG__ 4 +#define __DEBUG__ 0 #ifndef __MODULE__ #define __MODULE__ "VodafoneUSBModem.cpp" #endif @@ -526,17 +526,19 @@ m_dongle.tryConnect(); if (m_dongle.connected()) { - DBG("Great the dongle is connected"); + DBG("Great the dongle is connected - I've tried %d times to connect", x); detectConnectedModem = true; // OK we can break out this while loop now - the dongle has been connected break; // Break out of the for loop once the dongle is connected - otherwise try for a while more } Thread::wait(10); } - - // OK we got this far - so give up trying and let someone know you can't see the modem - m_dongleConnected = false; // set the member variable of this object to false - so if we get called again we know we have to try to detect again - ERR("There is no dongle pluged into the board, or the module does not respond. Is the module/modem switched on?"); - return HARDWARE_NO_RESPONSE; + if (!detectConnectedModem) + { + // OK we got this far - so give up trying and let someone know you can't see the modem + m_dongleConnected = false; // set the member variable of this object to false - so if we get called again we know we have to try to detect again + ERR("There is no dongle pluged into the board, or the module does not respond. Is the module/modem switched on?"); + return HARDWARE_NO_RESPONSE; + } }