HTTP_SDcard_file_server example for WIZwiki-W7500
Dependencies: SDFileSystem WIZnetInterface mbed
Fork of HTTP_SDcard_file_server by
Diff: main.cpp
- Revision:
- 1:7d3ed406dd3d
- Parent:
- 0:fbb29d9ea96b
diff -r fbb29d9ea96b -r 7d3ed406dd3d main.cpp
--- a/main.cpp Sun Apr 07 11:23:03 2013 +0000
+++ b/main.cpp Tue Jun 23 03:44:18 2015 +0000
@@ -5,13 +5,13 @@
#define EnDebugMSG false //true-> print debug message to PC USB terminal, false->not print
#include "filelib.h"
-#define IP "192.168.100.100"
+#define IP "192.168.240.100"
#define MASK "255.255.255.0"
-#define GATEWAY "192.168.100.1"
+#define GATEWAY "192.168.240.1"
#define PORT 80
Serial pc (USBTX,USBRX); // tx, rx
-SDFileSystem sd(p5, p6, p7, p8, "wfs"); // the pinout on the mbed
+SDFileSystem sd(PB_3, PB_2, PB_1, PB_0, "wfs"); // the pinout on the mbed
char sMethod[7];
char sURL[250];
@@ -67,7 +67,7 @@
printf(sentBuffer);
printf("\n--end Header-- bytes:%d",strlen(sentBuffer));
}
- Thread::wait(200); //200ms important for browser!
+ wait(0.2); //200ms important for browser!
}
void send_HTML_line(char* line, unsigned int length_line)
@@ -75,7 +75,7 @@
client.send_all(line,length_line);
if (EnDebugMSG)
printf("\n-->send HTML line:\n%s ...Ok!",line);
- Thread::wait(10);
+ wait(0.01);
}
void send_HTML_error( int status_code, char* title, char* body_text)
@@ -301,12 +301,12 @@
int main()
{
-
+ uint8_t MAC_Addr[6] = {0x00, 0x08, 0xDC, 0x00, 0x01, 0x02};
ledTick.attach(&ledTickfunc,0.5);
//ledTick.detach();
//setup ethernet interface
//eth.init(); //Use DHCP
- eth.init(IP,MASK,GATEWAY); //IP,mask,Gateway
+ eth.init(MAC_Addr,IP,MASK,GATEWAY); //MAC,IP,mask,Gateway
eth.connect();
printf("IP Address is %s\n\r", eth.getIPAddress());
@@ -362,7 +362,7 @@
}//while
printf("close connection.\n\rHTTP server is listening...\n\r\n");
client.close();
- Thread::wait(50);
+ wait(0.05);
led2 = false;
}
}
