esp_tls_error_capture_internal.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef __ESP_TLS_ERROR_CAPTURE_INTERNAL_H__
  7. #define __ESP_TLS_ERROR_CAPTURE_INTERNAL_H__
  8. /**
  9. * Note: this is an implementation placeholder for error logger.
  10. * This version is internal to esp-tls component and only saves single esp_err of last occurred error
  11. */
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. /**
  16. * Error tracker logging macro to enable mapping tracking errors internally
  17. * or using an external/global implementation
  18. */
  19. #define ESP_INT_EVENT_TRACKER_CAPTURE(h, type, code) esp_tls_internal_event_tracker_capture(h, type, code)
  20. /**
  21. * @brief Internal tracker capture error
  22. *
  23. * This implementation saves latest errors of available types
  24. *
  25. * @param[in] h esp-tls error handle
  26. * @param[in] err_type Specific error type
  27. * @param[int] code Error code to capture
  28. *
  29. */
  30. void esp_tls_internal_event_tracker_capture(esp_tls_error_handle_t h, uint32_t type, int code);
  31. /**
  32. * @brief Create internal tracker storage
  33. *
  34. * @return Error tracker handle if success or NULL if allocation error
  35. */
  36. esp_tls_error_handle_t esp_tls_internal_event_tracker_create(void);
  37. /**
  38. * @brief Destroy internal tracker storage
  39. *
  40. * @param[in] h esp-tls error handle
  41. */
  42. void esp_tls_internal_event_tracker_destroy(esp_tls_error_handle_t h);
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46. #endif //__ESP_TLS_ERROR_CAPTURE_INTERNAL_H__