Code to run tests on the Ethernet library
Dependencies: EthernetInterface mbed-rtos mbed
Revision 0:3f5638515f99, committed 2013-10-27
- Comitter:
- lawless
- Date:
- Sun Oct 27 09:59:50 2013 +0000
- Child:
- 1:effed2d57b6c
- Commit message:
- First test. Discovered Ethernet checksums are not calculated by the library. Have reported in the forum but seeing as I got no reply to my last comment, I guess I'll have to fix it myself.
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/EthernetInterface.lib Sun Oct 27 09:59:50 2013 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/EthernetInterface/#cba86db5ab96
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun Oct 27 09:59:50 2013 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+#include "EthernetInterface.h"
+
+int main() {
+ EthernetInterface eth;
+ eth.init("192.168.9.8", "255.255.255.0", "192.168.9.1");
+ eth.connect();
+ printf("IP Address is %s\n", eth.getIPAddress());
+
+ UDPSocket sock;
+ sock.init();
+
+ Endpoint seven;
+ seven.set_address("192.168.9.7", 37);
+
+ char out_buffer[] = "plop"; // Does not matter
+
+ while(1) {
+ sock.sendTo(seven, out_buffer, sizeof(out_buffer));
+ wait(1);
+ }
+
+ sock.close();
+
+ eth.disconnect();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-rtos.lib Sun Oct 27 09:59:50 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed-rtos/#ee87e782d34f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Oct 27 09:59:50 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/f37f3b9c9f0b \ No newline at end of file