HOme Sheriff And Lamp

Dependencies:   CameraC328 HCSR04 SDFileSystem WIZnetInterface mbed

Fork of HoSAL by pi bae

Files at this revision

API Documentation at this revision

Comitter:
uasonice
Date:
Tue Aug 11 17:52:59 2015 +0000
Parent:
4:ca368c50f8c9
Child:
6:089da4f2fb39
Commit message:
update httpFile debug code

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
rev_httpFile.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Aug 11 17:46:53 2015 +0000
+++ b/main.cpp	Tue Aug 11 17:52:59 2015 +0000
@@ -128,7 +128,7 @@
         
         //wait_ms(1000);
         tm1.stop();
-        DM_fLN("time: %d", tm1.read_ms());
+        //DM_fLN("time: %d", tm1.read_ms());
     }
     //return 0;
 }
--- a/rev_httpFile.cpp	Tue Aug 11 17:46:53 2015 +0000
+++ b/rev_httpFile.cpp	Tue Aug 11 17:52:59 2015 +0000
@@ -84,7 +84,7 @@
             DM_FLN(" file");
             while ((rdCnt = fread(buffer, sizeof( char ), HTTPD_MAX_REQ_LENGTH, fp)) == HTTPD_MAX_REQ_LENGTH) {
                 client.send(buffer, rdCnt);
-                DM_FLN(".");
+                DM_(".");
             }
             client.send(buffer, rdCnt);
             fclose(fp);
@@ -95,9 +95,11 @@
 
 void fileServer(void)
 {
-
-    DM_FLN(_N_"Wait for new connection...");
-    server.accept(client);
+    int ret;
+    
+    //DM_FLN("Wait for new connection...");
+    ret = server.accept(client);
+    if(ret < 0) return;
     client.set_blocking(false, 1500); // Timeout after 1500ms
 
     DM_FLN("Connection from: %s", client.get_address());