This performs an ethernet sniff test. Copied from an existing ethernet sniff test and updated to work properly with the LISA, supporting output of content to the USB console. See also: http://mbed.org/users/rolf/code/ethsnif/

Dependencies:   C027-REVB mbed

Fork of ethsnif by Rolf Meyer

Revision:
0:29e2df9de9f1
Child:
1:a7a52d202638
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hexview.h	Fri Sep 04 12:24:03 2009 +0000
@@ -0,0 +1,29 @@
+/* Function: hexview
+ *  Prints an array of char to stdout in hex.
+ *  The data is grouped in two 8 byte groups per line.
+ *  Each byte is displayed as 2 hex digits and every 
+ *  line starts with the address of the first byte.
+ *
+ *  There is no text view of a line.
+ *
+ * Variables:
+ *  buffer - The array to display.
+ *  size - The length of buffer.
+ */
+inline void hexview(char *buffer, unsigned int size) {
+    for(int i = 0; i < size; ++i) {
+        if((i%16)!=0) {
+            printf(" ");
+        } else {
+            printf("%04X:  ", (i));
+        }
+        printf("%02hhx", buffer[i]);
+        if((i%16) ==  7) { 
+            printf(" ");
+        }
+        if((i%16) == 15) {
+            printf("\n");
+        }
+    }
+    printf("\n\n\n");
+}
\ No newline at end of file