phs fan / AbitModemInterface

Dependencies:   Socket lwip-sys lwip

Fork of AbitUSBModem by phs fan

Revision:
96:b50f5f795684
Parent:
79:a6ac8206a58d
Child:
97:7d9cc95e2ea7
--- a/ip/PPPIPInterface.cpp	Fri Apr 25 13:33:55 2014 +0000
+++ b/ip/PPPIPInterface.cpp	Wed Feb 18 09:40:07 2015 +0000
@@ -30,12 +30,12 @@
 
 #include "PPPIPInterface.h"
 
-#define MSISDN "*99#"
+#define MSISDN "0570570711##64"
 
-#define CONNECT_CMD "ATD " MSISDN "\x0D"
+#define CONNECT_CMD "ATD" MSISDN "\x0D"
 #define EXPECTED_RESP CONNECT_CMD "\x0D" "\x0A" "CONNECT" "\x0D" "\x0A"
 #define EXPECTED_RESP_DATARATE CONNECT_CMD "\x0D" "\x0A" "CONNECT %d" "\x0D" "\x0A"
-#define EXPECTED_RESP_MIN_LEN 20
+#define EXPECTED_RESP_MIN_LEN 30
 #define OK_RESP "\x0D" "\x0A" "OK" "\x0D" "\x0A"
 #define ESCAPE_SEQ "+++"
 #define HANGUP_CMD "ATH" "\x0D"
@@ -56,14 +56,14 @@
       bool hangupViaATPort
    ) :
    LwIPInterface(),
+   m_pIf(pIf),
    m_linkStatusSphre(1),
    m_pppErrCode(0),
    m_pStream(pStream),
    m_atStream(atStream),
    m_streamAvail(true),
-   m_pppd(-1),
-   m_pIf(pIf),
-   m_hangupViaATPort(hangupViaATPort)
+   m_hangupViaATPort(hangupViaATPort),
+   m_pppd(-1)
 {
 
     m_linkStatusSphre.wait();
@@ -114,6 +114,7 @@
 
     DBG("Expect %s", EXPECTED_RESP);
 
+    Thread::wait(100);
     len = 0;
     size_t readLen;
     ret = m_pStream->read((uint8_t*)buf + len, &readLen, EXPECTED_RESP_MIN_LEN, 10000);