File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
Expand file tree Collapse file tree 3 files changed +10
-3
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
Original file line number Diff line number Diff line change @@ -94,7 +94,8 @@ class Frame
9494 */
9595 bool toBmp ();
9696
97- /* * \we converted the buffer ourself outside the lib and need to set it!
97+ /* * \brief Assign buffer from outside
98+ * \We converted the buffer ourself outside the lib and need to set it!
9899 */
99100 void
100101 setData (uint8_t * newdata, size_t newsize, bool bIsBmp);
You can’t perform that action at this time.
0 commit comments