TASS Belgium / Mbed 2 deprecated UDP_Send_Test

Dependencies:   PicoTCP lpc1768-picotcp-eth mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
tass
Date:
Thu Oct 03 06:22:54 2013 +0000
Commit message:
UDP Tx Official Benchmark

Changed in this revision

PicoTCP.lib Show annotated file Show diff for this revision Revisions of this file
lpc1768-picotcp-eth.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PicoTCP.lib	Thu Oct 03 06:22:54 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/daniele/code/PicoTCP/#6764a53bb6e6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lpc1768-picotcp-eth.lib	Thu Oct 03 06:22:54 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/tass/code/lpc1768-picotcp-eth/#1ef61e7465a5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Oct 03 06:22:54 2013 +0000
@@ -0,0 +1,49 @@
+#include "mbed.h"
+#include "EthernetInterface.h"
+
+#define BUFFER_SIZE        1024
+#define NUMBER_OF_SECONDS (20*1000u)  // 20 seconds
+
+#define REMOTE_IP       "192.168.100.2"
+#define REMOTE_PORT      2327
+#define NUMBER_OF_FRAMES 1000
+
+int main() {
+
+    EthernetInterface eth;
+    eth.init();
+    eth.connect();
+    
+    printf("Started UDP Fast Test...\n");
+    
+    UDPSocket server;
+    Endpoint endp;
+    char buffer[BUFFER_SIZE];
+    
+    printf("Remote endpoint @ %s:%d\n",REMOTE_IP,REMOTE_PORT);
+    endp.set_address(REMOTE_IP,REMOTE_PORT);
+    
+    printf("Binding result :%d\n", server.bind(REMOTE_PORT));
+    
+    server.bind(REMOTE_PORT);
+    server.set_blocking(false,1000);
+    
+    printf("Started sending packet flood...\n");
+    
+    while(true)
+    {
+       int cnt = 0;
+       static uint32_t counter = 0;
+       while(cnt<5)
+       {
+        memcpy(buffer,&counter,sizeof(counter));
+        int size = server.sendTo(endp,buffer,sizeof(buffer));
+        counter++;
+        cnt++;
+       }
+       Thread::wait(1);
+    }
+    
+    server.close();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Thu Oct 03 06:22:54 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	Thu Oct 03 06:22:54 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file