Renesas / HttpServer_snapshot_mbed-os

Dependents:   GR-PEACH-webcam GR-Boards_WebCamera GR-Boards_WebCamera GR-Boards_WebCamera

Fork of HttpServer_snapshot by Renesas

Files at this revision

API Documentation at this revision

Comitter:
dkato
Date:
Fri Jun 09 13:26:14 2017 +0000
Parent:
13:d3571c244759
Child:
15:371fbad587ed
Commit message:
SnapshotHandler can register multiple paths.

Changed in this revision

Handler/SnapshotHandler.cpp Show annotated file Show diff for this revision Revisions of this file
Handler/SnapshotHandler.h Show annotated file Show diff for this revision Revisions of this file
--- a/Handler/SnapshotHandler.cpp	Wed Jun 07 05:53:36 2017 +0000
+++ b/Handler/SnapshotHandler.cpp	Fri Jun 09 13:26:14 2017 +0000
@@ -24,7 +24,7 @@
 #include "SnapshotHandler.h"
 
 int (*SnapshotHandler::callback_func_req)(const char ** pp_data);
-int (*SnapshotHandler::callback_func_req2)(const char* rootPath, const char ** pp_data);
+int (*SnapshotHandler::callback_func_req2)(const char* rootPath, const char* path, const char ** pp_data);
 Semaphore SnapshotHandler::req_sem(1);
 
 
@@ -46,7 +46,7 @@
         size = callback_func_req(&p_data);
     }
     if (callback_func_req2 != NULL) {
-        size = callback_func_req2((rootPath()).c_str(), &p_data);
+        size = callback_func_req2((rootPath()).c_str(), (path()).c_str(), &p_data);
     }
 
     if ((p_data == NULL) || (size <= 0)) {
--- a/Handler/SnapshotHandler.h	Wed Jun 07 05:53:36 2017 +0000
+++ b/Handler/SnapshotHandler.h	Fri Jun 09 13:26:14 2017 +0000
@@ -36,7 +36,7 @@
         callback_func_req = fptr;
     }
 
-    static void attach_req(int(*fptr)(const char* rootPath, const char ** pp_data)) {
+    static void attach_req(int(*fptr)(const char* rootPath, const char* path, const char ** pp_data)) {
         callback_func_req2 = fptr;
     }
 
@@ -53,7 +53,7 @@
 
 private:
     static int (*callback_func_req)(const char ** pp_data);
-    static int (*callback_func_req2)(const char* rootPath, const char ** pp_data);
+    static int (*callback_func_req2)(const char* rootPath, const char* path, const char ** pp_data);
     static Semaphore req_sem;
     const char * send_data_buf;
     int send_size;