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: PicoTCP lpc1768-picotcp-eth mbed-rtos mbed
Revision 0:5c0efd6f5ec6, committed 2013-10-02
- Comitter:
- tass
- Date:
- Wed Oct 02 07:51:01 2013 +0000
- Commit message:
- TCP Official Tx Benchmark
Changed in this revision
diff -r 000000000000 -r 5c0efd6f5ec6 PicoTCP.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PicoTCP.lib Wed Oct 02 07:51:01 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/daniele/code/PicoTCP/#6764a53bb6e6
diff -r 000000000000 -r 5c0efd6f5ec6 lpc1768-picotcp-eth.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lpc1768-picotcp-eth.lib Wed Oct 02 07:51:01 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/tass/code/lpc1768-picotcp-eth/#1ef61e7465a5
diff -r 000000000000 -r 5c0efd6f5ec6 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Oct 02 07:51:01 2013 +0000
@@ -0,0 +1,56 @@
+#include <mbed.h>
+#include <stdarg.h>
+#include "EthernetInterface.h"
+
+#define ECHO_SERVER_PORT 7
+#define BUFFER_QUANTITY (1024*1024)
+#define BUFFER_SIZE (1024)
+
+
+EthernetInterface eth;
+
+int main()
+{
+ TCPSocketServer server;
+
+ printf("Started PicoTCP Tx Benchmark....\n");
+
+ eth.init();
+ printf("Waiting for DHCP server to give IP...\n");
+
+ while(eth.connect() != 0);
+ printf("IP address assigned : %s\n",eth.getIPAddress());
+
+ server.bind(ECHO_SERVER_PORT);
+ server.listen();
+ printf("Local server listening on port : %d\n",ECHO_SERVER_PORT);
+
+
+ while (true) {
+ printf("\n>>> You can start PicoTCP_Official_TCP_Tx_Benchmark.py\n");
+
+ TCPSocketConnection client;
+ server.accept(client);
+ client.set_blocking(false, 1500); // Timeout after (1.5)s
+
+ char buffer[BUFFER_SIZE];
+ int dataSent = 0;
+ while(dataSent < BUFFER_QUANTITY)
+ {
+ int n = client.send_all(buffer, sizeof(buffer));
+ if (n <= 0) {
+ break;
+ }
+ dataSent += n;
+ }
+
+ if(dataSent == BUFFER_QUANTITY)
+ {
+ printf("You can read the Tx Throughput now \n");
+ }
+ else
+ {
+ printf("Benchmark failed !\n");
+ }
+ }
+}
diff -r 000000000000 -r 5c0efd6f5ec6 mbed-rtos.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-rtos.lib Wed Oct 02 07:51:01 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed-rtos/#ee87e782d34f
diff -r 000000000000 -r 5c0efd6f5ec6 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Oct 02 07:51:01 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file