@@ -284,8 +284,17 @@ void BaseAPI::setCamera(AsyncWebServerRequest* request) {
284284 uint8_t temp_camera_hflip = 0 ;
285285 uint8_t temp_camera_quality = 0 ;
286286 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+
287293
288294 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+
289298 // ! Using the else if statements to ensure that the values do not need to
290299 // ! be set in a specific order This means the order of the URL params does
291300 // ! not matter
@@ -301,13 +310,25 @@ void BaseAPI::setCamera(AsyncWebServerRequest* request) {
301310 temp_camera_quality = (uint8_t )param->value ().toInt ();
302311 } else if (param->name () == " brightness" ) {
303312 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 ();
304323 }
305324 }
306325 // note: We're passing empty params by design, this is done to reset
307326 // specific fields
308327 projectConfig->setCameraConfig (&temp_camera_vflip, &temp_camera_framesize,
309328 &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 );
311332
312333 request->send (200 , MIMETYPE_JSON ,
313334 " {\" msg\" :\" Done. Camera Settings have been set.\" }" );
0 commit comments