A port of KSP SerialIO and KSP Ethernet IO designed for a Nucleo F746ZG. This version doesn't read from or write to any external controls or displays but the user can press the USER_BUTTON to change the status of SAS and RCS. A final version of this project with full documentation and external hardware support is coming. This is an Alpha release.
Dependencies: F7_Ethernet mbed mbed-rtos
Diff: main.cpp
- Revision:
- 9:4757a976148d
- Parent:
- 7:65188f4a8c25
- Child:
- 11:59dcefdda506
--- a/main.cpp Thu Jul 26 15:12:00 2012 +0000 +++ b/main.cpp Fri Jul 27 13:59:39 2012 +0000 @@ -10,24 +10,22 @@ TCPSocketConnection sock; sock.connect("mbed.org", 80); - char http_cmd[] = "GET /media/uploads/donatien/hello.txt HTTP/1.1\r\nHost: %s\r\n\r\n"; - sock.send_all(http_cmd, sizeof(http_cmd) - 1, 3000); + char http_cmd[] = "GET /media/uploads/mbed_official/hello.txt HTTP/1.0\n\n"; + sock.send_all(http_cmd, sizeof(http_cmd)); - char in_buf[256]; + char buffer[300]; int ret; while (true) { - ret = sock.receive(in_buf, 255, 100); + ret = sock.receive(buffer, sizeof(buffer)-1); if (ret <= 0) break; - - in_buf[ret] = '\0'; - printf("Received %d chars from server: %s\n", ret, in_buf); + buffer[ret] = '\0'; + printf("Received %d chars from server:\n%s\n", ret, buffer); } sock.close(); eth.disconnect(); - while(1) { - } + while(1) {} }