Lab2_web / Mbed 2 deprecated webserverBlinky

Dependencies:   mbed

Fork of webserverBlinky by RealTimeCompLab2

Revision:
5:27624c02189f
Parent:
4:a469050d5b80
Child:
6:fba4c2e817b8
diff -r a469050d5b80 -r 27624c02189f main.cpp
--- a/main.cpp	Thu Dec 29 04:21:29 2016 +0000
+++ b/main.cpp	Thu Dec 29 04:34:25 2016 +0000
@@ -134,18 +134,20 @@
 }
 
 void LCPrequestFrame() {
-      ppp.pkt.buf[4]=2; // change to an ACK packet
-      sendFrame(); // return their request
-      ppp.pkt.buf[4]=1; // change back to a request
-      ppp.pkt.buf[5] = ppp.pkt.buf[5]+1; // take the next id
-      ppp.pkt.buf[16] = ppp.pkt.buf[16] ^ 0x33; // modify magic number
-      ppp.pkt.buf[17] = ppp.pkt.buf[16] ^ 0x33; // modify magic number
-      sendFrame(); // send our request
+    ppp.pkt.buf[4]=2; // change to an ACK packet
+    sendFrame(); // acknowledge their request
+    // this is the right time to send our LCP setup request to them
+    ppp.pkt.buf[4]=1; // change back to a request
+    ppp.pkt.buf[5] =  ppp.pkt.buf[5]+1; // take the next id
+    ppp.pkt.buf[16] = ppp.pkt.buf[16] ^ 0x33; // modify magic number
+    ppp.pkt.buf[17] = ppp.pkt.buf[16] ^ 0x33; // modify magic number
+    sendFrame(); // send our request
+
 }
     
 void LCPackFrame() {
     xx.printf("== PPP is up ==\n");
-}    
+} 
 
 void generalFrame() {
     xx.printf("== General Frame ==\n");