Lab2_web / Mbed 2 deprecated webserverBlinky

Dependencies:   mbed

Fork of webserverBlinky by RealTimeCompLab2

Revision:
8:48e40f1ff316
Parent:
7:ab147f5e97ac
Child:
9:0992486d4a30
diff -r ab147f5e97ac -r 48e40f1ff316 main.cpp
--- a/main.cpp	Thu Dec 29 16:31:48 2016 +0000
+++ b/main.cpp	Thu Dec 29 17:25:16 2016 +0000
@@ -161,36 +161,19 @@
     }
 }
 
-
-
-    
 void LCPackFrame() {
     xx.printf("== Saw Ack - PPP is up ==\n");
 } 
 
 
-void rejectIPcompression() {
-    xx.printf("== IP Compression Reject Frame ==\n");
-    generalFrame();
-    static char rejectCompression [] = {0x80,0x21,4,0,0,10,2,6,0,45,15,1,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-    // 128/33=IPCP 4=Rej 0=id 0=sizeHigh 10=sizeLow 2,6,0,45,1=RejectCcompression                         
-    ppp.pkt.len=sizeof( rejectCompression );
-    memcpy( rejectCompression, ppp.pkt.buf, ppp.pkt.len);
-    ppp.pkt.buf[3]=ppp.pkt.id;
-    sendFrame();
-}    
-
 void ipRequestHandler(){
     xx.printf("== IP Request Frame ==\n");
-    if( ppp.pkt.buf[7] != 10 ) {
+    generalFrame();
+    if ( ppp.pkt.buf[7] != 4 ) {
         ppp.pkt.buf[4]=4; // Nack
-        sendFrame(); // we want minimum config
+        sendFrame();
     } else  {
         ppp.pkt.buf[4]=2; // ack the minimum
-        ppp.pkt.buf[10]=10; // ip addr 1
-        ppp.pkt.buf[11]=10; // ip addr 2
-        ppp.pkt.buf[12]=10; // ip addr 3
-        ppp.pkt.buf[13]=10; // ip addr 4
         sendFrame(); // acknowledge
         xx.printf("zeroconf ack\n");
         // send our own request now
@@ -228,7 +211,6 @@
 
 void IPFrame() {
     led1 = ppp.pkt.buf[5] & 1; // This is the sequence number so the led blinks on packets
-    //ppp.pkt.len = (((unsigned int)ppp.pkt.buf[4])<<8) + (((unsigned int)ppp.pkt.buf[5])<<0);
     ppp.pkt.id = ppp.pkt.buf[5]; // remember the sequence number 
     int action = ppp.pkt.buf[4]; // packet type is here
     if(0);