From c6dde93be0c306e8f6eacb3631fcdf73589cdbf1 Mon Sep 17 00:00:00 2001 From: abratchik Date: Sat, 24 Dec 2022 15:57:46 +0400 Subject: [PATCH] merge PR #249 --- Docs/html/annotated.html | 17 +- Docs/html/app__cam_8h.html | 21 -- Docs/html/app__cam_8h_source.html | 204 ++++++-------- Docs/html/app__component_8h.html | 4 +- Docs/html/app__component_8h_source.html | 12 +- Docs/html/app__config_8h_source.html | 61 ++--- Docs/html/app__httpd_8h.html | 50 +++- Docs/html/app__httpd_8h_source.html | 305 ++++++++++++--------- Docs/html/class_c_l_app_cam.html | 108 +------- Docs/html/class_c_l_app_component.html | 12 +- Docs/html/class_c_l_app_conn.html | 6 +- Docs/html/class_c_l_app_httpd.html | 343 +++++++++++++++++++++--- Docs/html/classes.html | 9 +- Docs/html/functions.html | 26 +- Docs/html/functions_func.html | 24 +- Docs/html/functions_vars.html | 2 - Docs/html/globals.html | 8 +- Docs/html/globals_defs.html | 4 +- Docs/html/hierarchy.html | 17 +- Docs/html/index.html | 18 +- Docs/html/menudata.js | 1 - Docs/html/search/all_0.js | 3 +- Docs/html/search/all_10.js | 3 +- Docs/html/search/all_11.js | 2 +- Docs/html/search/all_3.js | 13 +- Docs/html/search/all_5.js | 68 ++--- Docs/html/search/all_7.js | 2 +- Docs/html/search/all_8.js | 5 +- Docs/html/search/all_c.js | 7 +- Docs/html/search/all_d.js | 2 +- Docs/html/search/all_e.js | 18 +- Docs/html/search/classes_0.js | 6 +- Docs/html/search/classes_1.js | 7 +- Docs/html/search/classes_2.js | 3 +- Docs/html/search/defines_2.js | 2 +- Docs/html/search/defines_4.js | 5 +- Docs/html/search/defines_5.js | 4 +- Docs/html/search/functions_0.js | 2 +- Docs/html/search/functions_4.js | 68 ++--- Docs/html/search/functions_6.js | 2 +- Docs/html/search/functions_a.js | 2 +- Docs/html/search/functions_b.js | 57 ++-- Docs/html/search/functions_d.js | 3 +- Docs/html/search/functions_e.js | 2 +- Docs/html/search/searchdata.js | 4 +- Docs/html/search/variables_5.js | 3 +- Docs/html/search/variables_6.js | 5 +- Docs/html/struct_app_servo.html | 8 +- README.md | 2 +- data/default_cam.json | 2 - data/default_httpd.json | 4 + data/www/index.html | 13 + data/www/js/cam.js | 53 ++-- data/www/setup.html | 14 +- src/app_cam.cpp | 30 --- src/app_cam.h | 23 -- src/app_config.h | 7 - src/app_httpd.cpp | 285 +++++++++++++++----- src/app_httpd.h | 61 ++++- 59 files changed, 1217 insertions(+), 835 deletions(-) diff --git a/Docs/html/annotated.html b/Docs/html/annotated.html index 8425ee6..4294f9a 100644 --- a/Docs/html/annotated.html +++ b/Docs/html/annotated.html @@ -69,16 +69,15 @@
Here are the data structures with brief descriptions:
- - - - - + + + - - - - + + + +
 CAppServo
 CCLAppCamCamera Manager Manages all interactions with camera
 CCLAppComponentAbstract root class for the appication components
 CCLAppConnConnection Manager This class manages everything related to connectivity of the application: WiFi, OTA etc
 CCLAppHttpdWebServer Manager Class for handling web server requests. The web pages are assumed to be stored in the file system (can be SD card or LittleFS).
+
 CCLAppCamCamera Manager Manages all interactions with camera
 CCLAppComponentAbstract root class for the appication components
 CCLAppConnConnection Manager This class manages everything related to connectivity of the application: WiFi, OTA etc
 CCLAppHttpdWebServer Manager Class for handling web server requests. The web pages are assumed to be stored in the file system (can be SD card or LittleFS).
 CCLStorageStorage Manager Encapsulates access to the file system, which can be either external (SD card) or internal (LittleFS)
 CStaticIPStatic IP strcuture for configuring AP and WiFi parameters
 CStationWiFi connectivity details (SSID/password)
 CUriMappingStatic URI to path mapping
 CCLStorageStorage Manager Encapsulates access to the file system, which can be either external (SD card) or internal (LittleFS)
 CStaticIPStatic IP strcuture for configuring AP and WiFi parameters
 CStationWiFi connectivity details (SSID/password)
 CUriMappingStatic URI to path mapping
diff --git a/Docs/html/app__cam_8h.html b/Docs/html/app__cam_8h.html index be3627a..7b335a9 100644 --- a/Docs/html/app__cam_8h.html +++ b/Docs/html/app__cam_8h.html @@ -70,7 +70,6 @@
app_cam.h File Reference
@@ -89,31 +88,11 @@  Camera Manager Manages all interactions with camera. More...
  - - - -

-Macros

#define LAMP_DEFAULT   80
 

Variables

CLAppCam AppCam
 
-

Macro Definition Documentation

- -

◆ LAMP_DEFAULT

- -
-
- - - - -
#define LAMP_DEFAULT   80
-
- -
-

Variable Documentation

◆ AppCam

diff --git a/Docs/html/app__cam_8h_source.html b/Docs/html/app__cam_8h_source.html index 4e3491a..d42c994 100644 --- a/Docs/html/app__cam_8h_source.html +++ b/Docs/html/app__cam_8h_source.html @@ -81,127 +81,99 @@
8#include "app_component.h"
9#include "camera_pins.h"
10
-
11#define LAMP_DEFAULT 80 // initial lamp value, range 0-100
-
12
-
13#if defined(LED_DISABLE)
-
14 #undef LED_PIN // undefining this disables the notification LED
-
15#endif
-
16
-
17
-
22class CLAppCam : public CLAppComponent {
-
23 public:
-
24
-
25 CLAppCam();
-
26
-
27 int start();
-
28 int stop();
-
29 int loadPrefs();
-
30 int savePrefs();
-
31
-
32 void setLamp(int newVal = LAMP_DEFAULT);
-
33 int getLamp() {return lampVal;};
-
34
-
35 void setAutoLamp(bool val) {autoLamp = val;};
-
36 bool isAutoLamp() { return autoLamp;};
-
37
-
38 int getSensorPID() {return (sensor?sensor->id.PID:0);};
-
39 sensor_t * getSensor() {return sensor;};
-
40 String getErr() {return critERR;};
-
41
-
42 int getFrameRate() {return frameRate;};
-
43 void setFrameRate(int newFrameRate) {frameRate = newFrameRate;};
+
11
+
16class CLAppCam : public CLAppComponent {
+
17 public:
+
18
+
19 CLAppCam();
+
20
+
21 int start();
+
22 int stop();
+
23 int loadPrefs();
+
24 int savePrefs();
+
25
+
26 int getSensorPID() {return (sensor?sensor->id.PID:0);};
+
27 sensor_t * getSensor() {return sensor;};
+
28 String getErr() {return critERR;};
+
29
+
30 int getFrameRate() {return frameRate;};
+
31 void setFrameRate(int newFrameRate) {frameRate = newFrameRate;};
+
32
+
33 void setXclk(int val) {xclk = val;};
+
34 int getXclk() {return xclk;};
+
35
+
36 void setRotation(int val) {myRotation = val;};
+
37 int getRotation() {return myRotation;};
+
38
+
39 int snapToBufer();
+
40 uint8_t * getBuffer() {return fb->buf;};
+
41 size_t getBufferSize() {return fb->len;};
+
42 bool isJPEGinBuffer() {return fb->format == PIXFORMAT_JPEG;};
+
43 void releaseBuffer();
44
-
45 void setXclk(int val) {xclk = val;};
-
46 int getXclk() {return xclk;};
-
47
-
48 void setRotation(int val) {myRotation = val;};
-
49 int getRotation() {return myRotation;};
-
50
-
51 int snapToBufer();
-
52 uint8_t * getBuffer() {return fb->buf;};
-
53 size_t getBufferSize() {return fb->len;};
-
54 bool isJPEGinBuffer() {return fb->format == PIXFORMAT_JPEG;};
-
55 void releaseBuffer();
-
56
-
57 private:
-
58 // Camera config structure
-
59 camera_config_t config;
-
60
-
61 // Camera module bus communications frequency.
-
62 // Originally: config.xclk_freq_mhz = 20000000, but this lead to visual artifacts on many modules.
-
63 // See https://github.com/espressif/esp32-camera/issues/150#issuecomment-726473652 et al.
-
64 // Initial setting is configured in /default_prefs.json
-
65 int xclk = 8;
-
66
-
67 // frame rate in FPS
-
68 // default can be set in /default_prefs.json
-
69 int frameRate = 25;
-
70
-
71 // Flash LED lamp parameters.
-
72 bool autoLamp = false; // Automatic lamp (auto on while camera running)
-
73
-
74 // Illumination LAMP and status LED
-
75 #if defined(LAMP_DISABLE)
-
76 int lampVal = -1; // lamp is disabled in config
-
77 #elif defined(LAMP_PIN)
-
78 int lampVal = 0;
-
79 #else
-
80 int lampVal = -1; // no lamp pin assigned
-
81 #endif
-
82
-
83 int lampChannel = 7; // a free PWM channel (some channels used by camera)
-
84 const int pwmfreq = 50000; // 50K pwm frequency
-
85 const int pwmresolution = 9; // duty cycle bit range
-
86 const int pwmMax = pow(2,pwmresolution)-1;
-
87
-
88 // Critical error string; if set during init (camera hardware failure) it
-
89 // will be returned for stream and still image requests
-
90 String critERR = "";
-
91
-
92 // initial rotation
-
93 // default can be set in /default_prefs.json
-
94 int myRotation = 0;
-
95
-
96 // camera buffer pointer
-
97 camera_fb_t * fb = NULL;
-
98
-
99 // camera sensor
-
100 sensor_t * sensor;
-
101
-
102
-
103};
-
104
-
105extern CLAppCam AppCam;
-
106
-
107#endif
-
CLAppCam AppCam
Definition: app_cam.cpp:247
-
#define LAMP_DEFAULT
Definition: app_cam.h:11
+
45 private:
+
46 // Camera config structure
+
47 camera_config_t config;
+
48
+
49 // Camera module bus communications frequency.
+
50 // Originally: config.xclk_freq_mhz = 20000000, but this lead to visual artifacts on many modules.
+
51 // See https://github.com/espressif/esp32-camera/issues/150#issuecomment-726473652 et al.
+
52 // Initial setting is configured in /default_prefs.json
+
53 int xclk = 8;
+
54
+
55 // frame rate in FPS
+
56 // default can be set in /default_prefs.json
+
57 int frameRate = 25;
+
58
+
59
+
60 int lampChannel = 7; // a free PWM channel (some channels used by camera)
+
61 const int pwmfreq = 50000; // 50K pwm frequency
+
62 const int pwmresolution = 9; // duty cycle bit range
+
63 const int pwmMax = pow(2,pwmresolution)-1;
+
64
+
65 // Critical error string; if set during init (camera hardware failure) it
+
66 // will be returned for stream and still image requests
+
67 String critERR = "";
+
68
+
69 // initial rotation
+
70 // default can be set in /default_prefs.json
+
71 int myRotation = 0;
+
72
+
73 // camera buffer pointer
+
74 camera_fb_t * fb = NULL;
+
75
+
76 // camera sensor
+
77 sensor_t * sensor;
+
78
+
79
+
80};
+
81
+
82extern CLAppCam AppCam;
+
83
+
84#endif
+
CLAppCam AppCam
Definition: app_cam.cpp:217
-
Camera Manager Manages all interactions with camera.
Definition: app_cam.h:22
-
int savePrefs()
Definition: app_cam.cpp:169
-
bool isJPEGinBuffer()
Definition: app_cam.h:54
-
int loadPrefs()
Definition: app_cam.cpp:109
-
void setRotation(int val)
Definition: app_cam.h:48
+
Camera Manager Manages all interactions with camera.
Definition: app_cam.h:16
+
int savePrefs()
Definition: app_cam.cpp:141
+
bool isJPEGinBuffer()
Definition: app_cam.h:42
+
int loadPrefs()
Definition: app_cam.cpp:83
+
void setRotation(int val)
Definition: app_cam.h:36
CLAppCam()
Definition: app_cam.cpp:3
-
void setFrameRate(int newFrameRate)
Definition: app_cam.h:43
-
int getRotation()
Definition: app_cam.h:49
-
int getFrameRate()
Definition: app_cam.h:42
-
int getLamp()
Definition: app_cam.h:33
-
int snapToBufer()
Definition: app_cam.cpp:232
-
void setLamp(int newVal=LAMP_DEFAULT)
Definition: app_cam.cpp:96
-
int getXclk()
Definition: app_cam.h:46
-
int stop()
Definition: app_cam.cpp:89
-
String getErr()
Definition: app_cam.h:40
-
void setXclk(int val)
Definition: app_cam.h:45
-
size_t getBufferSize()
Definition: app_cam.h:53
-
void setAutoLamp(bool val)
Definition: app_cam.h:35
-
bool isAutoLamp()
Definition: app_cam.h:36
-
uint8_t * getBuffer()
Definition: app_cam.h:52
-
void releaseBuffer()
Definition: app_cam.cpp:238
-
int getSensorPID()
Definition: app_cam.h:38
+
void setFrameRate(int newFrameRate)
Definition: app_cam.h:31
+
int getRotation()
Definition: app_cam.h:37
+
int getFrameRate()
Definition: app_cam.h:30
+
int snapToBufer()
Definition: app_cam.cpp:202
+
int getXclk()
Definition: app_cam.h:34
+
int stop()
Definition: app_cam.cpp:78
+
String getErr()
Definition: app_cam.h:28
+
void setXclk(int val)
Definition: app_cam.h:33
+
size_t getBufferSize()
Definition: app_cam.h:41
+
uint8_t * getBuffer()
Definition: app_cam.h:40
+
void releaseBuffer()
Definition: app_cam.cpp:208
+
int getSensorPID()
Definition: app_cam.h:26
int start()
Definition: app_cam.cpp:8
-
sensor_t * getSensor()
Definition: app_cam.h:39
+
sensor_t * getSensor()
Definition: app_cam.h:27
Abstract root class for the appication components.
Definition: app_component.h:14
diff --git a/Docs/html/app__component_8h.html b/Docs/html/app__component_8h.html index 6085e4c..24f33b5 100644 --- a/Docs/html/app__component_8h.html +++ b/Docs/html/app__component_8h.html @@ -73,8 +73,8 @@
app_component.h File Reference
-
#include <json_generator.h>
-#include <json_parser.h>
+
#include "json_generator.h"
+#include "json_parser.h"
#include "app_config.h"
#include "storage.h"
diff --git a/Docs/html/app__component_8h_source.html b/Docs/html/app__component_8h_source.html index 4c35604..d6f53a9 100644 --- a/Docs/html/app__component_8h_source.html +++ b/Docs/html/app__component_8h_source.html @@ -74,8 +74,8 @@ Go to the documentation of this file.
1#ifndef app_component_h
2#define app_component_h
3
-
4#include <json_generator.h>
-
5#include <json_parser.h>
+
4#include "json_generator.h"
+
5#include "json_parser.h"
6
7#include "app_config.h"
8#include "storage.h"
@@ -105,7 +105,7 @@
36
37 void setErr(int err_code) {last_err = err_code;};
38
-
43 int readJsonIntVal(jparse_ctx_t *jctx, char* token);
+
43 int readJsonIntVal(jparse_ctx_t *jctx, const char* token);
44
45 int parsePrefs(jparse_ctx_t *jctx);
46
@@ -130,16 +130,16 @@
int loadPrefs()
Definition: app_component.h:19
int savePrefs()
Definition: app_component.h:20
bool isDebugMode()
Definition: app_component.h:28
+
int readJsonIntVal(jparse_ctx_t *jctx, const char *token)
reads the Int value from JSON context by token.
Definition: app_component.cpp:29
void setTag(const char *t)
Definition: app_component.h:35
-
int parsePrefs(jparse_ctx_t *jctx)
Definition: app_component.cpp:51
+
int parsePrefs(jparse_ctx_t *jctx)
Definition: app_component.cpp:54
int start()
Definition: app_component.h:18
void setErr(int err_code)
Definition: app_component.h:37
void setDebugMode(bool val)
Definition: app_component.h:27
-
int readJsonIntVal(jparse_ctx_t *jctx, char *token)
reads the Int value from JSON context by token.
Definition: app_component.cpp:29
bool isConfigured()
Definition: app_component.h:32
void dumpPrefs()
Definition: app_component.cpp:19
char * getPrefsFileName(bool forsave=false)
Definition: app_component.cpp:3
-
int removePrefs()
Definition: app_component.cpp:37
+
int removePrefs()
Definition: app_component.cpp:40
diff --git a/Docs/html/app__config_8h_source.html b/Docs/html/app__config_8h_source.html index 7e5b63a..3444e4e 100644 --- a/Docs/html/app__config_8h_source.html +++ b/Docs/html/app__config_8h_source.html @@ -99,40 +99,33 @@
26// Uncomment to disable the notification LED on the module
27// #define LED_DISABLE
28
-
29// Uncomment to disable the illumination lamp features
-
30// #define LAMP_DISABLE
-
31
-
32// Uncomment this line to use LittleFS instead of SD.
-
33// NOTE!
-
34// LittleFS is still experimental, not recommended. The 'official' library installed from the Library Manager
-
35// seems to be broken, but fixed in this PR: https://github.com/lorol/LITTLEFS/pull/56
-
36// To install it, please navigate to you /libraries sub-folder of your sketch location and then execute
-
37// git clone https://github.com/Michael2MacDonald/LITTLEFS.
-
38// #define USE_LittleFS
-
39
-
40// Define the startup lamp power setting (as a percentage, defaults to 0%)
-
41// Saved user settings will override this
-
42// #define LAMP_DEFAULT 0
-
43
-
44/*
-
45 * Camera Hardware Selectiom
-
46 *
-
47 * You must uncomment one, and only one, of the lines below to select your board model.
-
48 * Remember to also select the board in the Boards Manager
-
49 * This is not optional
-
50 */
-
51#define CAMERA_MODEL_AI_THINKER // default
-
52// #define CAMERA_MODEL_WROVER_KIT
-
53// #define CAMERA_MODEL_ESP_EYE
-
54// #define CAMERA_MODEL_M5STACK_PSRAM
-
55// #define CAMERA_MODEL_M5STACK_V2_PSRAM
-
56// #define CAMERA_MODEL_M5STACK_WIDE
-
57// #define CAMERA_MODEL_M5STACK_ESP32CAM // Originally: CAMERA_MODEL_M5STACK_NO_PSRAM
-
58// #define CAMERA_MODEL_TTGO_T_JOURNAL
-
59// #define CAMERA_MODEL_ARDUCAM_ESP32S_UNO
-
60
-
61
-
62#endif
+
29// Uncomment this line to use LittleFS instead of SD.
+
30// NOTE!
+
31// LittleFS is still experimental, not recommended. The 'official' library installed from the Library Manager
+
32// seems to be broken, but fixed in this PR: https://github.com/lorol/LITTLEFS/pull/56
+
33// To install it, please navigate to you /libraries sub-folder of your sketch location and then execute
+
34// git clone https://github.com/Michael2MacDonald/LITTLEFS.
+
35// #define USE_LittleFS
+
36
+
37/*
+
38 * Camera Hardware Selectiom
+
39 *
+
40 * You must uncomment one, and only one, of the lines below to select your board model.
+
41 * Remember to also select the board in the Boards Manager
+
42 * This is not optional
+
43 */
+
44#define CAMERA_MODEL_AI_THINKER // default
+
45// #define CAMERA_MODEL_WROVER_KIT
+
46// #define CAMERA_MODEL_ESP_EYE
+
47// #define CAMERA_MODEL_M5STACK_PSRAM
+
48// #define CAMERA_MODEL_M5STACK_V2_PSRAM
+
49// #define CAMERA_MODEL_M5STACK_WIDE
+
50// #define CAMERA_MODEL_M5STACK_ESP32CAM // Originally: CAMERA_MODEL_M5STACK_NO_PSRAM
+
51// #define CAMERA_MODEL_TTGO_T_JOURNAL
+
52// #define CAMERA_MODEL_ARDUCAM_ESP32S_UNO
+
53
+
54
+
55#endif