ClassControllCamera.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. #include "ClassControllCamera.h"
  2. #include "ClassLogFile.h"
  3. #include <stdio.h>
  4. #include "driver/gpio.h"
  5. #include "esp_timer.h"
  6. #include "esp_log.h"
  7. #include "Helper.h"
  8. #include "CImageBasis.h"
  9. #include "server_ota.h"
  10. #include "server_GPIO.h"
  11. #include "../../include/defines.h"
  12. #include <esp_event.h>
  13. #include <esp_log.h>
  14. #include <esp_system.h>
  15. #include <nvs_flash.h>
  16. #include <sys/param.h>
  17. #include <string.h>
  18. #include "freertos/FreeRTOS.h"
  19. #include "freertos/task.h"
  20. #include "esp_camera.h"
  21. #include "driver/ledc.h"
  22. static const char *TAG = "CAM";
  23. static camera_config_t camera_config = {
  24. .pin_pwdn = CAM_PIN_PWDN,
  25. .pin_reset = CAM_PIN_RESET,
  26. .pin_xclk = CAM_PIN_XCLK,
  27. .pin_sscb_sda = CAM_PIN_SIOD,
  28. .pin_sscb_scl = CAM_PIN_SIOC,
  29. .pin_d7 = CAM_PIN_D7,
  30. .pin_d6 = CAM_PIN_D6,
  31. .pin_d5 = CAM_PIN_D5,
  32. .pin_d4 = CAM_PIN_D4,
  33. .pin_d3 = CAM_PIN_D3,
  34. .pin_d2 = CAM_PIN_D2,
  35. .pin_d1 = CAM_PIN_D1,
  36. .pin_d0 = CAM_PIN_D0,
  37. .pin_vsync = CAM_PIN_VSYNC,
  38. .pin_href = CAM_PIN_HREF,
  39. .pin_pclk = CAM_PIN_PCLK,
  40. //XCLK 20MHz or 10MHz for OV2640 double FPS (Experimental)
  41. .xclk_freq_hz = 20000000, // Orginal value
  42. // .xclk_freq_hz = 5000000, // Test to get rid of the image errors !!!! Hangs in version 9.2 !!!!
  43. .ledc_timer = LEDC_TIMER_0,
  44. .ledc_channel = LEDC_CHANNEL_0,
  45. .pixel_format = PIXFORMAT_JPEG, //YUV422,GRAYSCALE,RGB565,JPEG
  46. .frame_size = FRAMESIZE_VGA, //QQVGA-UXGA Do not use sizes above QVGA when not JPEG
  47. // .frame_size = FRAMESIZE_UXGA, //QQVGA-UXGA Do not use sizes above QVGA when not JPEG
  48. .jpeg_quality = 12, //0-63 lower number means higher quality
  49. .fb_count = 1, //if more than one, i2s runs in continuous mode. Use only with JPEG
  50. .fb_location = CAMERA_FB_IN_PSRAM, /*!< The location where the frame buffer will be allocated */
  51. .grab_mode = CAMERA_GRAB_LATEST, // only from new esp32cam version
  52. };
  53. CCamera Camera;
  54. typedef struct {
  55. httpd_req_t *req;
  56. size_t len;
  57. } jpg_chunking_t;
  58. void CCamera::ledc_init(void)
  59. {
  60. #ifdef USE_PWM_LEDFLASH
  61. // Prepare and then apply the LEDC PWM timer configuration
  62. ledc_timer_config_t ledc_timer = { };
  63. ledc_timer.speed_mode = LEDC_MODE;
  64. ledc_timer.timer_num = LEDC_TIMER;
  65. ledc_timer.duty_resolution = LEDC_DUTY_RES;
  66. ledc_timer.freq_hz = LEDC_FREQUENCY; // Set output frequency at 5 kHz
  67. ledc_timer.clk_cfg = LEDC_AUTO_CLK;
  68. ESP_ERROR_CHECK(ledc_timer_config(&ledc_timer));
  69. // Prepare and then apply the LEDC PWM channel configuration
  70. ledc_channel_config_t ledc_channel = { };
  71. ledc_channel.speed_mode = LEDC_MODE;
  72. ledc_channel.channel = LEDC_CHANNEL;
  73. ledc_channel.timer_sel = LEDC_TIMER;
  74. ledc_channel.intr_type = LEDC_INTR_DISABLE;
  75. ledc_channel.gpio_num = LEDC_OUTPUT_IO;
  76. ledc_channel.duty = 0; // Set duty to 0%
  77. ledc_channel.hpoint = 0;
  78. ESP_ERROR_CHECK(ledc_channel_config(&ledc_channel));
  79. #endif
  80. }
  81. static size_t jpg_encode_stream(void * arg, size_t index, const void* data, size_t len){
  82. jpg_chunking_t *j = (jpg_chunking_t *)arg;
  83. if(!index){
  84. j->len = 0;
  85. }
  86. if(httpd_resp_send_chunk(j->req, (const char *)data, len) != ESP_OK){
  87. return 0;
  88. }
  89. j->len += len;
  90. return len;
  91. }
  92. bool CCamera::SetBrightnessContrastSaturation(int _brightness, int _contrast, int _saturation)
  93. {
  94. bool result = false;
  95. sensor_t * s = esp_camera_sensor_get();
  96. if (_brightness > -100)
  97. _brightness = min(2, max(-2, _brightness));
  98. if (_contrast > -100)
  99. _contrast = min(2, max(-2, _contrast));
  100. if (_saturation > -100)
  101. _saturation = min(2, max(-2, _saturation));
  102. if (_saturation > -100)
  103. s->set_saturation(s, _saturation);
  104. if (_contrast > -100)
  105. s->set_contrast(s, _contrast);
  106. if (_brightness > -100)
  107. s->set_brightness(s, _brightness);
  108. if ((_brightness != brightness) && (_brightness > -100))
  109. result = true;
  110. if ((_contrast != contrast) && (_contrast > -100))
  111. result = true;
  112. if ((_saturation != saturation) && (_saturation > -100))
  113. result = true;
  114. if (_brightness > -100)
  115. brightness = _brightness;
  116. if (_contrast > -100)
  117. contrast = _contrast;
  118. if (_saturation > -100)
  119. saturation = _saturation;
  120. if (result && isFixedExposure)
  121. EnableAutoExposure(waitbeforepicture_org);
  122. return result;
  123. }
  124. void CCamera::SetQualitySize(int qual, framesize_t resol)
  125. {
  126. sensor_t * s = esp_camera_sensor_get();
  127. s->set_quality(s, qual);
  128. s->set_framesize(s, resol);
  129. ActualResolution = resol;
  130. ActualQuality = qual;
  131. if (resol == FRAMESIZE_QVGA)
  132. {
  133. image_height = 240;
  134. image_width = 320;
  135. }
  136. if (resol == FRAMESIZE_VGA)
  137. {
  138. image_height = 480;
  139. image_width = 640;
  140. }
  141. }
  142. void CCamera::EnableAutoExposure(int flash_duration)
  143. {
  144. ESP_LOGD(TAG, "EnableAutoExposure");
  145. LEDOnOff(true);
  146. if (flash_duration > 0)
  147. LightOnOff(true);
  148. const TickType_t xDelay = flash_duration / portTICK_PERIOD_MS;
  149. vTaskDelay( xDelay );
  150. camera_fb_t * fb = esp_camera_fb_get();
  151. esp_camera_fb_return(fb);
  152. fb = esp_camera_fb_get();
  153. if (!fb) {
  154. ESP_LOGE(TAG, "Camera Capture Failed");
  155. LEDOnOff(false);
  156. LightOnOff(false);
  157. LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Capture Failed (Procedure 'EnableAutoExposure') --> Reboot! "
  158. "Check that your camera module is working and connected properly.");
  159. //doReboot();
  160. }
  161. esp_camera_fb_return(fb);
  162. sensor_t * s = esp_camera_sensor_get();
  163. s->set_gain_ctrl(s, 0);
  164. s->set_exposure_ctrl(s, 0);
  165. LEDOnOff(false);
  166. LightOnOff(false);
  167. isFixedExposure = true;
  168. waitbeforepicture_org = flash_duration;
  169. }
  170. esp_err_t CCamera::CaptureToBasisImage(CImageBasis *_Image, int delay)
  171. {
  172. string ftype;
  173. uint8_t *zwischenspeicher = NULL;
  174. LEDOnOff(true);
  175. #ifdef DEBUG_DETAIL_ON
  176. LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - Start");
  177. #endif
  178. if (delay > 0)
  179. {
  180. LightOnOff(true);
  181. const TickType_t xDelay = delay / portTICK_PERIOD_MS;
  182. vTaskDelay( xDelay );
  183. }
  184. #ifdef DEBUG_DETAIL_ON
  185. LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - After LightOn");
  186. #endif
  187. camera_fb_t * fb = esp_camera_fb_get();
  188. esp_camera_fb_return(fb);
  189. fb = esp_camera_fb_get();
  190. if (!fb) {
  191. ESP_LOGE(TAG, "CaptureToBasisImage: Capture Failed");
  192. LEDOnOff(false);
  193. LightOnOff(false);
  194. LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "is not working anymore (CCamera::CaptureToBasisImage) - most probably caused by a hardware problem (instablility, ...). "
  195. "System will reboot.");
  196. doReboot();
  197. return ESP_FAIL;
  198. }
  199. int _size = fb->len;
  200. zwischenspeicher = (uint8_t*) malloc(_size);
  201. if (!zwischenspeicher)
  202. {
  203. ESP_LOGE(TAG, "Insufficient memory space for image in function CaptureToBasisImage()");
  204. LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Insufficient memory space for image in function CaptureToBasisImage()");
  205. }
  206. for (int i = 0; i < _size; ++i)
  207. *(zwischenspeicher + i) = *(fb->buf + i);
  208. esp_camera_fb_return(fb);
  209. #ifdef DEBUG_DETAIL_ON
  210. LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - After fb_get");
  211. #endif
  212. LEDOnOff(false);
  213. if (delay > 0)
  214. LightOnOff(false);
  215. // TickType_t xDelay = 1000 / portTICK_PERIOD_MS;
  216. // vTaskDelay( xDelay ); // wait for power to recover
  217. uint8_t * buf = NULL;
  218. CImageBasis _zwImage;
  219. _zwImage.LoadFromMemory(zwischenspeicher, _size);
  220. free(zwischenspeicher);
  221. #ifdef DEBUG_DETAIL_ON
  222. LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - After LoadFromMemory");
  223. #endif
  224. stbi_uc* p_target;
  225. stbi_uc* p_source;
  226. int channels = 3;
  227. int width = image_width;
  228. int height = image_height;
  229. #ifdef DEBUG_DETAIL_ON
  230. std::string _zw = "Targetimage: " + std::to_string((int) _Image->rgb_image) + " Size: " + std::to_string(_Image->width) + ", " + std::to_string(_Image->height);
  231. _zw = _zw + " _zwImage: " + std::to_string((int) _zwImage.rgb_image) + " Size: " + std::to_string(_zwImage.width) + ", " + std::to_string(_zwImage.height);
  232. LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, _zw);
  233. #endif
  234. for (int x = 0; x < width; ++x)
  235. for (int y = 0; y < height; ++y)
  236. {
  237. p_target = _Image->rgb_image + (channels * (y * width + x));
  238. p_source = _zwImage.rgb_image + (channels * (y * width + x));
  239. p_target[0] = p_source[0];
  240. p_target[1] = p_source[1];
  241. p_target[2] = p_source[2];
  242. }
  243. #ifdef DEBUG_DETAIL_ON
  244. LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - After Copy To Target");
  245. #endif
  246. free(buf);
  247. #ifdef DEBUG_DETAIL_ON
  248. LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - Done");
  249. #endif
  250. return ESP_OK;
  251. }
  252. esp_err_t CCamera::CaptureToFile(std::string nm, int delay)
  253. {
  254. string ftype;
  255. LEDOnOff(true); // Switched off to save power !
  256. if (delay > 0)
  257. {
  258. LightOnOff(true);
  259. const TickType_t xDelay = delay / portTICK_PERIOD_MS;
  260. vTaskDelay( xDelay );
  261. }
  262. camera_fb_t * fb = esp_camera_fb_get();
  263. esp_camera_fb_return(fb);
  264. fb = esp_camera_fb_get();
  265. if (!fb) {
  266. ESP_LOGE(TAG, "CaptureToFile: Camera Capture Failed");
  267. LEDOnOff(false);
  268. LightOnOff(false);
  269. LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Capture Failed (CCamera::CaptureToFile) --> Reboot! "
  270. "Check that your camera module is working and connected properly.");
  271. //doReboot();
  272. return ESP_FAIL;
  273. }
  274. LEDOnOff(false);
  275. #ifdef DEBUG_DETAIL_ON
  276. ESP_LOGD(TAG, "w %d, h %d, size %d", fb->width, fb->height, fb->len);
  277. #endif
  278. nm = FormatFileName(nm);
  279. #ifdef DEBUG_DETAIL_ON
  280. ESP_LOGD(TAG, "Save Camera to: %s", nm.c_str());
  281. #endif
  282. ftype = toUpper(getFileType(nm));
  283. #ifdef DEBUG_DETAIL_ON
  284. ESP_LOGD(TAG, "Filetype: %s", ftype.c_str());
  285. #endif
  286. uint8_t * buf = NULL;
  287. size_t buf_len = 0;
  288. bool converted = false;
  289. if (ftype.compare("BMP") == 0)
  290. {
  291. frame2bmp(fb, &buf, &buf_len);
  292. converted = true;
  293. }
  294. if (ftype.compare("JPG") == 0)
  295. {
  296. if(fb->format != PIXFORMAT_JPEG){
  297. bool jpeg_converted = frame2jpg(fb, ActualQuality, &buf, &buf_len);
  298. converted = true;
  299. if(!jpeg_converted){
  300. ESP_LOGE(TAG, "JPEG compression failed");
  301. }
  302. } else {
  303. buf_len = fb->len;
  304. buf = fb->buf;
  305. }
  306. }
  307. FILE * fp = fopen(nm.c_str(), "wb");
  308. if (fp == NULL) /* If an error occurs during the file creation */
  309. {
  310. fprintf(stderr, "fopen() failed for '%s'\n", nm.c_str());
  311. }
  312. else
  313. {
  314. fwrite(buf, sizeof(uint8_t), buf_len, fp);
  315. fclose(fp);
  316. }
  317. if (converted)
  318. free(buf);
  319. esp_camera_fb_return(fb);
  320. if (delay > 0)
  321. {
  322. LightOnOff(false);
  323. }
  324. return ESP_OK;
  325. }
  326. esp_err_t CCamera::CaptureToHTTP(httpd_req_t *req, int delay)
  327. {
  328. camera_fb_t * fb = NULL;
  329. esp_err_t res = ESP_OK;
  330. size_t fb_len = 0;
  331. int64_t fr_start = esp_timer_get_time();
  332. LEDOnOff(true);
  333. if (delay > 0)
  334. {
  335. LightOnOff(true);
  336. const TickType_t xDelay = delay / portTICK_PERIOD_MS;
  337. vTaskDelay( xDelay );
  338. }
  339. fb = esp_camera_fb_get();
  340. esp_camera_fb_return(fb);
  341. fb = esp_camera_fb_get();
  342. if (!fb) {
  343. ESP_LOGE(TAG, "Camera capture failed");
  344. LEDOnOff(false);
  345. LightOnOff(false);
  346. httpd_resp_send_500(req);
  347. // doReboot();
  348. return ESP_FAIL;
  349. }
  350. LEDOnOff(false);
  351. res = httpd_resp_set_type(req, "image/jpeg");
  352. if(res == ESP_OK){
  353. res = httpd_resp_set_hdr(req, "Content-Disposition", "inline; filename=raw.jpg");
  354. }
  355. if(res == ESP_OK){
  356. if(fb->format == PIXFORMAT_JPEG){
  357. fb_len = fb->len;
  358. res = httpd_resp_send(req, (const char *)fb->buf, fb->len);
  359. } else {
  360. jpg_chunking_t jchunk = {req, 0};
  361. res = frame2jpg_cb(fb, 80, jpg_encode_stream, &jchunk)?ESP_OK:ESP_FAIL;
  362. httpd_resp_send_chunk(req, NULL, 0);
  363. fb_len = jchunk.len;
  364. }
  365. }
  366. esp_camera_fb_return(fb);
  367. int64_t fr_end = esp_timer_get_time();
  368. ESP_LOGI(TAG, "JPG: %uKB %ums", (uint32_t)(fb_len/1024), (uint32_t)((fr_end - fr_start)/1000));
  369. if (delay > 0)
  370. {
  371. LightOnOff(false);
  372. }
  373. return res;
  374. }
  375. void CCamera::LightOnOff(bool status)
  376. {
  377. GpioHandler* gpioHandler = gpio_handler_get();
  378. if ((gpioHandler != NULL) && (gpioHandler->isEnabled())) {
  379. ESP_LOGD(TAG, "Use gpioHandler flashLigh");
  380. gpioHandler->flashLightEnable(status);
  381. } else {
  382. #ifdef USE_PWM_LEDFLASH
  383. if (status)
  384. {
  385. ESP_LOGD(TAG, "Internal Flash-LED turn on with PWM %d", led_intensity);
  386. ESP_ERROR_CHECK(ledc_set_duty(LEDC_MODE, LEDC_CHANNEL, led_intensity));
  387. // Update duty to apply the new value
  388. ESP_ERROR_CHECK(ledc_update_duty(LEDC_MODE, LEDC_CHANNEL));
  389. }
  390. else
  391. {
  392. ESP_LOGD(TAG, "Internal Flash-LED turn off PWM");
  393. ESP_ERROR_CHECK(ledc_set_duty(LEDC_MODE, LEDC_CHANNEL, 0));
  394. ESP_ERROR_CHECK(ledc_update_duty(LEDC_MODE, LEDC_CHANNEL));
  395. }
  396. #else
  397. // Init the GPIO
  398. gpio_pad_select_gpio(FLASH_GPIO);
  399. // Set the GPIO as a push/pull output
  400. gpio_set_direction(FLASH_GPIO, GPIO_MODE_OUTPUT);
  401. if (status)
  402. gpio_set_level(FLASH_GPIO, 1);
  403. else
  404. gpio_set_level(FLASH_GPIO, 0);
  405. #endif
  406. }
  407. }
  408. void CCamera::LEDOnOff(bool status)
  409. {
  410. // Init the GPIO
  411. gpio_pad_select_gpio(BLINK_GPIO);
  412. /* Set the GPIO as a push/pull output */
  413. gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);
  414. if (!status)
  415. gpio_set_level(BLINK_GPIO, 1);
  416. else
  417. gpio_set_level(BLINK_GPIO, 0);
  418. }
  419. void CCamera::GetCameraParameter(httpd_req_t *req, int &qual, framesize_t &resol)
  420. {
  421. char _query[100];
  422. char _qual[10];
  423. char _size[10];
  424. resol = ActualResolution;
  425. qual = ActualQuality;
  426. if (httpd_req_get_url_query_str(req, _query, 100) == ESP_OK)
  427. {
  428. ESP_LOGD(TAG, "Query: %s", _query);
  429. if (httpd_query_key_value(_query, "size", _size, 10) == ESP_OK)
  430. {
  431. #ifdef DEBUG_DETAIL_ON
  432. ESP_LOGD(TAG, "Size: %s", _size);
  433. #endif
  434. if (strcmp(_size, "QVGA") == 0)
  435. resol = FRAMESIZE_QVGA; // 320x240
  436. if (strcmp(_size, "VGA") == 0)
  437. resol = FRAMESIZE_VGA; // 640x480
  438. if (strcmp(_size, "SVGA") == 0)
  439. resol = FRAMESIZE_SVGA; // 800x600
  440. if (strcmp(_size, "XGA") == 0)
  441. resol = FRAMESIZE_XGA; // 1024x768
  442. if (strcmp(_size, "SXGA") == 0)
  443. resol = FRAMESIZE_SXGA; // 1280x1024
  444. if (strcmp(_size, "UXGA") == 0)
  445. resol = FRAMESIZE_UXGA; // 1600x1200
  446. }
  447. if (httpd_query_key_value(_query, "quality", _qual, 10) == ESP_OK)
  448. {
  449. #ifdef DEBUG_DETAIL_ON
  450. ESP_LOGD(TAG, "Quality: %s", _qual);
  451. #endif
  452. qual = atoi(_qual);
  453. if (qual > 63)
  454. qual = 63;
  455. if (qual < 0)
  456. qual = 0;
  457. }
  458. };
  459. }
  460. framesize_t CCamera::TextToFramesize(const char * _size)
  461. {
  462. if (strcmp(_size, "QVGA") == 0)
  463. return FRAMESIZE_QVGA; // 320x240
  464. if (strcmp(_size, "VGA") == 0)
  465. return FRAMESIZE_VGA; // 640x480
  466. if (strcmp(_size, "SVGA") == 0)
  467. return FRAMESIZE_SVGA; // 800x600
  468. if (strcmp(_size, "XGA") == 0)
  469. return FRAMESIZE_XGA; // 1024x768
  470. if (strcmp(_size, "SXGA") == 0)
  471. return FRAMESIZE_SXGA; // 1280x1024
  472. if (strcmp(_size, "UXGA") == 0)
  473. return FRAMESIZE_UXGA; // 1600x1200
  474. return ActualResolution;
  475. }
  476. CCamera::CCamera()
  477. {
  478. #ifdef DEBUG_DETAIL_ON
  479. ESP_LOGD(TAG, "CreateClassCamera");
  480. #endif
  481. brightness = -5;
  482. contrast = -5;
  483. saturation = -5;
  484. isFixedExposure = false;
  485. ledc_init();
  486. }
  487. esp_err_t CCamera::InitCam()
  488. {
  489. ESP_LOGD(TAG, "Init Camera");
  490. ActualQuality = camera_config.jpeg_quality;
  491. ActualResolution = camera_config.frame_size;
  492. //initialize the camera
  493. esp_camera_deinit(); // De-init in case it was already initialized
  494. esp_err_t err = esp_camera_init(&camera_config);
  495. if (err != ESP_OK) {
  496. ESP_LOGE(TAG, "Camera Init Failed");
  497. return err;
  498. }
  499. CameraInitSuccessful = true;
  500. return ESP_OK;
  501. }
  502. void CCamera::SetLEDIntensity(float _intrel)
  503. {
  504. _intrel = min(_intrel, (float) 100);
  505. _intrel = max(_intrel, (float) 0);
  506. _intrel = _intrel / 100;
  507. led_intensity = (int) (_intrel * 8191);
  508. ESP_LOGD(TAG, "Set led_intensity to %d of 8191", led_intensity);
  509. }
  510. bool CCamera::getCameraInitSuccessful()
  511. {
  512. return CameraInitSuccessful;
  513. }