Diagnostics Data Store

DIAG Data Store

Functions

esp_err_t esp_diag_data_store_critical_write(void *data, size_t len)

Write critical data to the diagnostics data store.

Return

ESP_OK on success, appropriate error code otherwise.

Parameters
  • [in] data: Buffer holding the data

  • [in] len: length of the data to be written

esp_err_t esp_diag_data_store_non_critical_write(const char *dg, void *data, size_t len)

Write non_critical data to the diagnostics data store.

Return

ESP_OK on success, appropriate error code otherwise.

Parameters
  • [in] dg: Data group of the data

  • [in] data: Buffer holding the data

  • [in] len: length of the data to be written

int esp_diag_data_store_critical_read(uint8_t *buf, size_t size)

Read critical data from the diagnostics data store.

Return

int bytes > 0 on success. Appropriate error otherwise

Parameters
  • [in] buf: buffer to hold the data

  • [out] size: Number of bytes read

int esp_diag_data_store_non_critical_read(uint8_t *buf, size_t size)

Read non_critical data from the diagnostics data store.

Return

int bytes > 0 on success. Appropriate error otherwise

Parameters
  • [in] buf: buffer to hold the data

  • [out] size: Number of bytes read

esp_err_t esp_diag_data_store_critical_release(size_t size)

Release the size bytes of critical data from diagnostics data store.

This API can be used to remove data from buffer when data is sent asynchronously.

Return

ESP_OK on success, appropriate error code otherwise.

Parameters
  • [in] size: Number of bytes to free.

esp_err_t esp_diag_data_store_non_critical_release(size_t size)

Release the size bytes of non_critical data from diagnostics data store.

This API can be used to remove data from buffer when data is sent asynchronously.

Return

ESP_OK on success, appropriate error code otherwise.

Parameters
  • [in] size: Number of bytes to free.

esp_err_t esp_diag_data_store_init(void)

Initializes the diagnostics data store.

Return

ESP_OK on success, appropriate error code otherwise

void esp_diag_data_store_deinit(void)

Deinitializes the diagnostics data store.

uint32_t esp_diag_data_store_get_crc(void)

Get CRC of diagnostics data store configuration.

Return

crc

esp_err_t esp_diag_data_discard_data(void)

Discard values from diagnostics data store. This API should be called after esp_diag_data_store_init();.

Return

ESP_OK on success, appropriate error on failure.

Enumerations

enum esp_diag_data_store_events_t

Data store events.

Diagnostics data store emits following events using default event loop, every event has event data of type esp_diag_data_store_event_data_t

Values:

ESP_DIAG_DATA_STORE_EVENT_CRITICAL_DATA_WRITE_FAIL
ESP_DIAG_DATA_STORE_EVENT_NON_CRITICAL_DATA_WRITE_FAIL
ESP_DIAG_DATA_STORE_EVENT_CRITICAL_DATA_LOW_MEM
ESP_DIAG_DATA_STORE_EVENT_NON_CRITICAL_DATA_LOW_MEM