File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -13,13 +13,15 @@ CameraClass Camera;
1313bool
1414CameraClass::begin (const Config& config)
1515{
16- return esp_camera_init (reinterpret_cast <const camera_config_t *>(config.m_cfg )) == ESP_OK;
16+ lastEspErr = esp_camera_init (reinterpret_cast <const camera_config_t *>(config.m_cfg ));
17+ return (lastEspErr == ESP_OK ? true : false );
1718}
1819
1920bool
2021CameraClass::end ()
2122{
22- return esp_camera_deinit () == ESP_OK;
23+ lastEspErr = esp_camera_deinit ();
24+ return (lastEspErr == ESP_OK ? true : false );
2325}
2426
2527bool
Original file line number Diff line number Diff line change @@ -225,6 +225,10 @@ class CameraClass
225225 return streamMjpeg (client, StreamMjpegConfig ());
226226 }
227227
228+ /* * \brief Return value for esp API calls
229+ * \Store last api return value here useful for error handling!
230+ */
231+ esp_err_t lastEspErr;
228232
229233};
230234
You can’t perform that action at this time.
0 commit comments