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: STATIC_COLORS WIZnetInterface mbed
Fork of HTTP_SDCard_File_Server_WIZwiki-W7500 by
Diff: main.cpp
- Revision:
- 7:04744a9ce2b9
- Parent:
- 6:ca17ce165ebc
- Child:
- 8:4b43259a1e33
--- a/main.cpp Thu Aug 07 03:32:26 2014 +0000
+++ b/main.cpp Sun Apr 12 03:04:28 2015 +0000
@@ -66,17 +66,22 @@
sprintf(fileName, "/sd%s", uri);
fp = fopen(fileName, "r");
if (fp == NULL) {
+ uart.printf("File not found\n");
sprintf(httpHeader,"HTTP/1.1 404 Not Found \r\nContent-Type: text\r\nConnection: Close\r\n\r\n");
client.send(httpHeader,strlen(httpHeader));
client.send(uri,strlen(uri));
} else {
+ uart.printf("Sending: header");
sprintf(httpHeader,"HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nConnection: Close\r\n\r\n");
client.send(httpHeader,strlen(httpHeader));
+ uart.printf(" file");
while ((rdCnt = fread(buffer, sizeof( char ), 1024, fp)) == 1024) {
client.send(buffer, rdCnt);
+ uart.printf(".");
}
client.send(buffer, rdCnt);
fclose(fp);
+ uart.printf("done\n");
}
}
}
