|
33 | 33 | // /awb/agc/aec/hmirror/vflip/awb_gain/agc_gain/aec_value/aec2/cw/bpc/wpc |
34 | 34 | // /raw_gma/lenc/special_effect/wb_mode/ae_level |
35 | 35 | void ESP3DCommands::ESP170(int cmd_params_pos, ESP3DMessage* msg) { |
36 | | - const char* camcmd = [] = { |
| 36 | + const char* camcmd[] = { |
37 | 37 | "framesize", |
38 | 38 | "quality", |
39 | 39 | "contrast", |
@@ -63,13 +63,17 @@ void ESP3DCommands::ESP170(int cmd_params_pos, ESP3DMessage* msg) { |
63 | 63 | "light", |
64 | 64 | #endif // CAM_LED_PIN |
65 | 65 | }; |
| 66 | + bool hasError = false; |
| 67 | + String ok_msg; |
| 68 | + String error_msg; |
66 | 69 | ESP3DClientType target = msg->origin; |
67 | 70 | ESP3DRequest requestId = msg->request_id; |
68 | 71 | msg->target = target; |
69 | 72 | msg->origin = ESP3DClientType::command; |
70 | 73 | bool json = hasTag(msg, cmd_params_pos, "json"); |
71 | 74 | String tmpstr; |
72 | | -#if AUTHENTICATION_FEATURE |
| 75 | + |
| 76 | +#ifdef AUTHENTICATION_FEATURE |
73 | 77 | if (msg->authentication_level == ESP3DAuthenticationLevel::guest) { |
74 | 78 | dispatchAuthenticationError(msg, COMMAND_ID, json); |
75 | 79 | return; |
@@ -102,146 +106,146 @@ void ESP3DCommands::ESP170(int cmd_params_pos, ESP3DMessage* msg) { |
102 | 106 | // now send all settings one by one |
103 | 107 | // framesize |
104 | 108 | if (!dispatchIdValue(json, "framesize", |
105 | | - String(status.framesize).c_str(), target, |
| 109 | + String(s->status.framesize).c_str(), target, |
106 | 110 | requestId, true)) { |
107 | 111 | return; |
108 | 112 | } |
109 | 113 |
|
110 | 114 | // quality |
111 | | - if (!dispatchIdValue(json, "quality", String(status.quality).c_str(), |
| 115 | + if (!dispatchIdValue(json, "quality", String(s->status.quality).c_str(), |
112 | 116 | target, requestId)) { |
113 | 117 | return; |
114 | 118 | } |
115 | 119 |
|
116 | 120 | // brightness |
117 | 121 | if (!dispatchIdValue(json, "brightness", |
118 | | - String(status.brightness).c_str(), target, |
| 122 | + String(s->status.brightness).c_str(), target, |
119 | 123 | requestId)) { |
120 | 124 | return; |
121 | 125 | } |
122 | 126 |
|
123 | 127 | // contrast |
124 | | - if (!dispatchIdValue(json, "contrast", String(status.contrast).c_str(), |
| 128 | + if (!dispatchIdValue(json, "contrast", String(s->status.contrast).c_str(), |
125 | 129 | target, requestId)) { |
126 | 130 | return; |
127 | 131 | } |
128 | 132 |
|
129 | 133 | // saturation |
130 | 134 | if (!dispatchIdValue(json, "saturation", |
131 | | - String(status.saturation).c_str(), target, |
| 135 | + String(s->status.saturation).c_str(), target, |
132 | 136 | requestId)) { |
133 | 137 | return; |
134 | 138 |
|
135 | 139 | // sharpness |
136 | 140 | if (!dispatchIdValue(json, "sharpness", |
137 | | - String(status.sharpness).c_str(), target, |
| 141 | + String(s->status.sharpness).c_str(), target, |
138 | 142 | requestId)) { |
139 | 143 | return; |
140 | 144 | } |
141 | 145 |
|
142 | 146 | // special_effect |
143 | 147 | if (!dispatchIdValue(json, "special_effect", |
144 | | - String(status.special_effect).c_str(), target, |
| 148 | + String(s->status.special_effect).c_str(), target, |
145 | 149 | requestId)) { |
146 | 150 | return; |
147 | 151 | } |
148 | 152 |
|
149 | 153 | // wb_mode |
150 | | - if (!dispatchIdValue(json, "wb_mode", String(status.wb_mode).c_str(), |
| 154 | + if (!dispatchIdValue(json, "wb_mode", String(s->status.wb_mode).c_str(), |
151 | 155 | target, requestId)) { |
152 | 156 | return; |
153 | 157 | } |
154 | 158 |
|
155 | 159 | // awb |
156 | | - if (!dispatchIdValue(json, "awb", String(status.awb).c_str(), target, |
| 160 | + if (!dispatchIdValue(json, "awb", String(s->status.awb).c_str(), target, |
157 | 161 | requestId)) { |
158 | 162 | return; |
159 | 163 | } |
160 | 164 |
|
161 | 165 | // awb_gain |
162 | 166 | if (!dispatchIdValue(json, "awb_gain", |
163 | | - String(status.awb_gain).c_str(), target, |
| 167 | + String(s->status.awb_gain).c_str(), target, |
164 | 168 | requestId)) { |
165 | 169 | return; |
166 | 170 | } |
167 | 171 |
|
168 | 172 | // aec |
169 | | - if (!dispatchIdValue(json, "aec", String(status.aec).c_str(), target, |
| 173 | + if (!dispatchIdValue(json, "aec", String(s->status.aec).c_str(), target, |
170 | 174 | requestId)) { |
171 | 175 | return; |
172 | 176 | } |
173 | 177 | // aec2 |
174 | | - if (!dispatchIdValue(json, "aec2", String(status.aec2).c_str(), |
| 178 | + if (!dispatchIdValue(json, "aec2", String(s->status.aec2).c_str(), |
175 | 179 | target, requestId)) { |
176 | 180 | return; |
177 | 181 | } |
178 | 182 | // ae_level |
179 | 183 | if (!dispatchIdValue(json, "ae_level", |
180 | | - String(status.ae_level).c_str(), target, |
| 184 | + String(s->status.ae_level).c_str(), target, |
181 | 185 | requestId)) { |
182 | 186 | return; |
183 | 187 | } |
184 | 188 | // aec_value |
185 | 189 | if (!dispatchIdValue(json, "aec_value", |
186 | | - String(status.aec_value).c_str(), target, |
| 190 | + String(s->status.aec_value).c_str(), target, |
187 | 191 | requestId)) { |
188 | 192 | return; |
189 | 193 | } |
190 | 194 | // agc |
191 | | - if (!dispatchIdValue(json, "agc", String(status.agc).c_str(), target, |
| 195 | + if (!dispatchIdValue(json, "agc", String(s->status.agc).c_str(), target, |
192 | 196 | requestId)) { |
193 | 197 | return; |
194 | 198 | } |
195 | 199 | // agc_gain |
196 | 200 | if (!dispatchIdValue(json, "agc_gain", |
197 | | - String(status.agc_gain).c_str(), target, |
| 201 | + String(s->status.agc_gain).c_str(), target, |
198 | 202 | requestId)) { |
199 | 203 | return; |
200 | 204 | } |
201 | 205 | // gainceiling |
202 | 206 | if (!dispatchIdValue(json, "gainceiling", |
203 | | - String(status.gainceiling).c_str(), target, |
| 207 | + String(s->status.gainceiling).c_str(), target, |
204 | 208 | requestId)) { |
205 | 209 | return; |
206 | 210 | } |
207 | 211 | // bpc |
208 | | - if (!dispatchIdValue(json, "bpc", String(status.bpc).c_str(), target, |
| 212 | + if (!dispatchIdValue(json, "bpc", String(s->status.bpc).c_str(), target, |
209 | 213 | requestId)) { |
210 | 214 | return; |
211 | 215 | } |
212 | 216 | // wpc |
213 | | - if (!dispatchIdValue(json, "wpc", String(status.wpc).c_str(), target, |
| 217 | + if (!dispatchIdValue(json, "wpc", String(s->status.wpc).c_str(), target, |
214 | 218 | requestId)) { |
215 | 219 | return; |
216 | 220 | } |
217 | 221 | // raw_gma |
218 | | - if (!dispatchIdValue(json, "raw_gma", String(status.raw_gma).c_str(), |
| 222 | + if (!dispatchIdValue(json, "raw_gma", String(s->status.raw_gma).c_str(), |
219 | 223 | target, requestId)) { |
220 | 224 | return; |
221 | 225 | } |
222 | 226 | // lenc |
223 | | - if (!dispatchIdValue(json, "lenc", String(status.lenc).c_str(), |
| 227 | + if (!dispatchIdValue(json, "lenc", String(s->status.lenc).c_str(), |
224 | 228 | target, requestId)) { |
225 | 229 | return; |
226 | 230 | } |
227 | 231 | // vflip |
228 | | - if (!dispatchIdValue(json, "vflip", String(status.vflip).c_str(), |
| 232 | + if (!dispatchIdValue(json, "vflip", String(s->status.vflip).c_str(), |
229 | 233 | target, requestId)) { |
230 | 234 | return; |
231 | 235 | } |
232 | 236 | // hmirror |
233 | | - if (!dispatchIdValue(json, "hmirror", String(status.hmirror).c_str(), |
| 237 | + if (!dispatchIdValue(json, "hmirror", String(s->status.hmirror).c_str(), |
234 | 238 | target, requestId)) { |
235 | 239 | return; |
236 | 240 | } |
237 | 241 | // dcw |
238 | | - if (!dispatchIdValue(json, "dcw", String(status.dcw).c_str(), target, |
| 242 | + if (!dispatchIdValue(json, "dcw", String(s->status.dcw).c_str(), target, |
239 | 243 | requestId)) { |
240 | 244 | return; |
241 | 245 | } |
242 | 246 | // colorbar |
243 | 247 | if (!dispatchIdValue(json, "colorbar", |
244 | | - String(status.colorbar).c_str(), target, |
| 248 | + String(s->status.colorbar).c_str(), target, |
245 | 249 | requestId)) { |
246 | 250 | return; |
247 | 251 | } |
|
0 commit comments