Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:software:homelab:library:module:ethernet [2012/05/31 12:04] eero.valjaotsen:software:homelab:library:module:ethernet [2020/07/20 12:00] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Ethernet ====== ====== Ethernet ======
 +
 //Necessary knowledge: [HW] [[en:hardware:homelab:controller]]// //Necessary knowledge: [HW] [[en:hardware:homelab:controller]]//
  
Line 53: Line 54:
  
  
-~~PB~~+<pagebreak>
  
 ===== Example ===== ===== Example =====
Line 101: Line 102:
     pktlen=ethernet_get_packet(BUFFER_SIZE, buf);     pktlen=ethernet_get_packet(BUFFER_SIZE, buf);
  
-        // Performs packet preconditioning and answer to "ping" packet. Returns packet URL.+        // Performs packet preconditioning and answer to "ping" packet.  
 +        // Returns packet URL.
         gPlen=ethernet_analyse_packet(buf,pktlen);         gPlen=ethernet_analyse_packet(buf,pktlen);
  
Line 107: Line 109:
         if (gPlen!=0)         if (gPlen!=0)
  {                 {               
-            // Load URL address part into "str". The first 4 digits are IP address numbers.+            // Load URL address part into "str" 
 +            // The first 4 digits are IP address numbers.
             str = (char *)&(buf[gPlen+4]);             str = (char *)&(buf[gPlen+4]);
   
Line 155: Line 158:
  // Load webpage header  // Load webpage header
  
-       plen=ethernet_load_data(buf,0,PSTR("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nPragma: no-cache\r\n\r\n"));+ plen=ethernet_load_data(buf,0,PSTR 
 + ("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nPragma: no-cache\r\n\r\n"));
          
-    plen=ethernet_load_data(buf,plen,PSTR("<center><p>Homelab PB7 LED: "));+ plen=ethernet_load_data(buf,plen,PSTR("<center><p>Homelab PB7 LED: "));
   
     // if LED is off, display it     // if LED is off, display it
     if (on_off)     if (on_off)
     {     {
-         plen=ethernet_load_data(buf,plen,PSTR("<font color=\"#00FF00\"> OFF</font>"));+      plen=ethernet_load_data(buf,plen,PSTR("<font color=\"#00FF00\"> OFF</font>"));
     }     }
     // if LED is on     // if LED is on
     else     else
     {     {
-         plen=ethernet_load_data(buf,plen,PSTR("<font color=\"#FF0000\"> ON</font>"));+      plen=ethernet_load_data(buf,plen,PSTR("<font color=\"#FF0000\"> ON</font>"));
     }     }
     // Lae "Refresh" nupp     // Lae "Refresh" nupp
-    plen=ethernet_load_data(buf,plen,PSTR(" <small><a href=\".\">[refresh status]</a></small></p>\n<p><a href=\"."));+    plen=ethernet_load_data(buf,plen,PSTR 
 +    (" <small><a href=\".\">[refresh status]</a></small></p>\n<p><a href=\"."));
          
     // Load the button for LED condition change.     // Load the button for LED condition change.
Line 189: Line 194:
  
 </code> </code>
- 
en/software/homelab/library/module/ethernet.1338455067.txt.gz · Last modified: (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0