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.
Dependencies: mbed
Fork of webserverBlinky by
Diff: main.cpp
- 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);