Skip to content

Commit

Permalink
Merge branch 'bugfix/multiple_metadata_push' into 'main'
Browse files Browse the repository at this point in the history
Fix device metadata getting sent multiple times

See merge request app-frameworks/esp-insights!170
  • Loading branch information
shahpiyushv committed Oct 16, 2024
2 parents 0cca923 + 72e2075 commit e1c0ac5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions components/esp_insights/src/esp_insights.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,15 +397,14 @@ static void send_insights_config(void)
/* Returns true if ESP Insights metadata CRC is changed */
static bool insights_meta_changed(void)
{
return true;
uint32_t nvs_crc;
uint32_t meta_crc = esp_diag_meta_crc_get();
esp_err_t err = esp_insights_meta_nvs_crc_get(&nvs_crc);
if (err == ESP_OK && nvs_crc == meta_crc) {
/* crc found and matched, no need to send insights meta */
return false;
}
ESP_LOGI(TAG, "Insights metrics metadata changed");
ESP_LOGI(TAG, "Insights metadata changed");
s_insights_data.meta_crc = meta_crc;
return true;
}
Expand Down

0 comments on commit e1c0ac5

Please sign in to comment.