@@ -284,8 +284,17 @@ void BaseAPI::setCamera(AsyncWebServerRequest* request) {
284
284
uint8_t temp_camera_hflip = 0 ;
285
285
uint8_t temp_camera_quality = 0 ;
286
286
uint8_t temp_camera_brightness = 0 ;
287
+ uint8_t temp_simple_auto_exposure_on = SIMPLE_AUTO_EXPOSURE_ON;
288
+ uint8_t temp_fancy_auto_exposure_on = FANCY_AUTO_EXPOSURE_ON;
289
+ int temp_ae_level = AE_LEVEL;
290
+ unsigned int temp_aec_value = AEC_VALUE;
291
+ uint8_t temp_auto_gain_on = AUTO_GAIN_ON;
292
+
287
293
288
294
int params = request->params ();
295
+ // TODO we probably should refactor this at some point, maybe some serialization of sorts, or direct mapping of
296
+ // TODO get parameters? Can we even do that?
297
+
289
298
// ! Using the else if statements to ensure that the values do not need to
290
299
// ! be set in a specific order This means the order of the URL params does
291
300
// ! not matter
@@ -301,13 +310,25 @@ void BaseAPI::setCamera(AsyncWebServerRequest* request) {
301
310
temp_camera_quality = (uint8_t )param->value ().toInt ();
302
311
} else if (param->name () == " brightness" ) {
303
312
temp_camera_brightness = (uint8_t )param->value ().toInt ();
313
+ } else if (param->name () == " simple_auto_exposure_on" ) {
314
+ temp_simple_auto_exposure_on = (uint8_t )param->value ().toInt ();
315
+ } else if (param->name () == " fancy_auto_exposure_on" ) {
316
+ temp_fancy_auto_exposure_on = (uint8_t )param->value ().toInt ();
317
+ } else if (param->name () == " ae_level" ) {
318
+ temp_ae_level = param->value ().toInt ();
319
+ } else if (param->name () == " aec_value" ) {
320
+ temp_aec_value = (uint8_t )param->value ().toInt ();
321
+ } else if (param->name () == " auto_gain_on" ) {
322
+ temp_auto_gain_on = (uint8_t )param->value ().toInt ();
304
323
}
305
324
}
306
325
// note: We're passing empty params by design, this is done to reset
307
326
// specific fields
308
327
projectConfig->setCameraConfig (&temp_camera_vflip, &temp_camera_framesize,
309
328
&temp_camera_hflip, &temp_camera_quality,
310
- &temp_camera_brightness, true );
329
+ &temp_camera_brightness, temp_simple_auto_exposure_on,
330
+ temp_fancy_auto_exposure_on, temp_ae_level,
331
+ temp_aec_value, temp_auto_gain_on, true );
311
332
312
333
request->send (200 , MIMETYPE_JSON,
313
334
" {\" msg\" :\" Done. Camera Settings have been set.\" }" );
0 commit comments