@@ -22,18 +22,21 @@ uint8_t temprature_sens_read();
2222enum capture_mode {CAPTURE_STILL, CAPTURE_STREAM};
2323
2424String processor (const String& var);
25- void onDump (AsyncWebServerRequest *request);
25+ void onSystemStatus (AsyncWebServerRequest *request);
2626void onStatus (AsyncWebServerRequest *request);
2727void onInfo (AsyncWebServerRequest *request);
2828void onControl (AsyncWebServerRequest *request);
2929void onWsEvent (AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len);
3030void onSnapTimer (TimerHandle_t pxTimer);
3131
32+ void dumpSystemStatusToJson (char * buf, size_t size);
33+
3234class CLAppHttpd : public CLAppComponent {
3335 public:
3436 CLAppHttpd ();
3537
3638 int start ();
39+ int loadPrefs ();
3740
3841 uint32_t getClientId () {return client_id;};
3942
@@ -51,17 +54,24 @@ class CLAppHttpd : public CLAppComponent {
5154
5255 void updateSnapTimer (int frameRate);
5356
54- void dumpInfo ();
55-
56- void serialSendCommand (const char *cmd);
57- void serialSendCommand (String* cmd);
57+ void serialSendCommand (char *cmd);
58+ void serialSendCommand (String cmd);
5859
5960 int getSketchSize (){ return sketchSize;};
6061 int getSketchSpace () {return sketchSpace;};
6162 String getSketchMD5 () {return sketchMD5;};
6263
64+ String getVersion () {return version;};
65+
66+ char * getName () {return myName;};
67+
6368
6469 private:
70+
71+ // Name of the application used in web interface
72+ // Can be re-defined in the httpd.json file
73+ char myName[20 ] = CAM_NAME;
74+
6575 AsyncWebServer *server;
6676 AsyncWebSocket *ws;
6777 uint32_t client_id = 0 ;
@@ -72,15 +82,15 @@ class CLAppHttpd : public CLAppComponent {
7282 unsigned long imagesServed;
7383
7484 // mode of the image capture
75- //
7685 capture_mode streammode = CAPTURE_STILL;
7786
78- // Gather static values used when dumping status; these are slow functions, so just do them once during startup
7987 // Sketch Info
8088 int sketchSize ;
8189 int sketchSpace ;
8290 String sketchMD5;
8391
92+ const String version = __DATE__ " @ " __TIME__;
93+
8494};
8595
8696
0 commit comments