TCPSocket with STM32F407VET6 board. For more details see https://os.mbed.com/users/hudakz/code/STM32F407VET6_Hello/

Dependencies:   EthernetInterface mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
hudakz
Date:
Mon Apr 02 19:31:31 2018 +0000
Commit message:
Initial issue.

Changed in this revision

EthernetInterface.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
diff -r 000000000000 -r 93bc6de01cd8 EthernetInterface.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EthernetInterface.lib	Mon Apr 02 19:31:31 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/EthernetInterface/#183490eb1b4a
diff -r 000000000000 -r 93bc6de01cd8 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Apr 02 19:31:31 2018 +0000
@@ -0,0 +1,36 @@
+// Blinky demo for the STM32F407VET6 boards.
+// See http://wiki.stm32duino.com/index.php?title=STM32F407.
+//
+// Use "Seed Arch Max" as target platform for the online compiler.
+
+#include "mbed.h"
+#include "EthernetInterface.h"
+ 
+int main() {
+    EthernetInterface eth;
+    eth.init(); //Use DHCP
+    eth.connect();
+    printf("IP Address is %s\n", eth.getIPAddress());
+    
+    TCPSocketConnection sock;
+    sock.connect("httpbin.org", 80);
+    
+    char http_cmd[] = "GET /get?helloworld HTTP/1.0\r\n\r\n";
+    sock.send_all(http_cmd, sizeof(http_cmd)-1);
+    
+    char buffer[300];
+    int ret;
+    while (true) {
+        ret = sock.receive(buffer, sizeof(buffer)-1);
+        if (ret <= 0)
+            break;
+        buffer[ret] = '\0';
+        printf("Received %d chars from server:\n%s\n", ret, buffer);
+    }
+      
+    sock.close();
+    
+    eth.disconnect();
+    
+    while(1) {}
+}
\ No newline at end of file
diff -r 000000000000 -r 93bc6de01cd8 mbed-rtos.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Mon Apr 02 19:31:31 2018 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/mbed-rtos/#5713cbbdb706
diff -r 000000000000 -r 93bc6de01cd8 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Apr 02 19:31:31 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/994bdf8177cb
\ No newline at end of file