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: DHT MQTTforLecture WIZnetInterface mbed-src
Fork of w7500-paho-mqtt by
Revision 7:a5ead1402704, committed 2015-05-04
- Comitter:
- mbedAustin
- Date:
- Mon May 04 22:47:02 2015 +0000
- Parent:
- 6:5dae237341f7
- Child:
- 8:f837e0d255e8
- Commit message:
- updated example code to be more verbose
Changed in this revision
--- a/EthernetInterface.lib Tue Jun 04 16:07:06 2013 +0100 +++ b/EthernetInterface.lib Mon May 04 22:47:02 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/EthernetInterface/ \ No newline at end of file +http://mbed.org/users/mbed_official/code/EthernetInterface/#2fc406e2553f
--- a/main.cpp Tue Jun 04 16:07:06 2013 +0100
+++ b/main.cpp Mon May 04 22:47:02 2015 +0000
@@ -7,7 +7,7 @@
EthernetInterface eth;
eth.init(); //Use DHCP
eth.connect();
- printf("IP Address is %s\n", eth.getIPAddress());
+ printf("\nServer IP Address is %s\n", eth.getIPAddress());
TCPSocketServer server;
server.bind(ECHO_SERVER_PORT);
@@ -25,6 +25,22 @@
int n = client.receive(buffer, sizeof(buffer));
if (n <= 0) break;
+ // print received message to terminal
+ buffer[n] = '\0';
+ printf("Received message from Client :'%s'\n",buffer);
+
+ // reverse the message
+ char temp;
+ for(int f = 0, l = n-1; f<l; f++,l--){
+ temp = buffer[f];
+ buffer[f] = buffer[l];
+ buffer[l] = temp;
+ }
+
+ // print reversed message to terminal
+ printf("Sending message to Client: '%s'\n",buffer);
+
+ // Echo received message back to client
client.send_all(buffer, n);
if (n <= 0) break;
}
--- a/mbed-rtos.lib Tue Jun 04 16:07:06 2013 +0100 +++ b/mbed-rtos.lib Mon May 04 22:47:02 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed-rtos/ \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed-rtos/#557d5b275f31
--- a/mbed.bld Tue Jun 04 16:07:06 2013 +0100 +++ b/mbed.bld Mon May 04 22:47:02 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/ \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/8ab26030e058 \ No newline at end of file
