Skip to content

Commit

Permalink
Merge branch 'support/http_tport_evt' into 'main'
Browse files Browse the repository at this point in the history
Raise insights transport event from http_transport

See merge request app-frameworks/esp-insights!159
  • Loading branch information
vikramdattu committed Aug 11, 2023
2 parents d082711 + 8946475 commit 723f4b9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/esp_diag_data_store/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "1.0.0"
version: "1.0.1"
description: Simple APIs to use ESP Diagnostics data storage
url: https://github.com/espressif/esp-insights/tree/main/components/esp_diag_data_store
repository: https://github.com/espressif/esp-insights.git
Expand Down
2 changes: 1 addition & 1 deletion components/esp_diagnostics/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "1.0.0"
version: "1.0.1"
description: Diagnostics component used in ESP Insights, which is a remote diagnostics solution to monitor the health of ESP devices in the field.
url: https://github.com/espressif/esp-insights/tree/main/components/esp_diagnostics
repository: https://github.com/espressif/esp-insights.git
Expand Down
2 changes: 1 addition & 1 deletion components/esp_insights/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "1.0.0"
version: "1.0.1"
description: Firmware agent for ESP Insights, which is a remote diagnostics solution to monitor the health of ESP devices in the field.
url: https://github.com/espressif/esp-insights/tree/main/components/esp_insights
repository: https://github.com/espressif/esp-insights.git
Expand Down
6 changes: 6 additions & 0 deletions components/esp_insights/src/transport/esp_insights_https.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <string.h>
#include <esp_err.h>
#include <esp_log.h>
#include <esp_event.h>
#include <esp_http_client.h>
#include <esp_insights.h>
#include <esp_insights_internal.h>
Expand Down Expand Up @@ -138,6 +139,11 @@ static int esp_insights_https_data_send(void *data, size_t len)
ESP_LOGE(TAG, "API response status = %d", status);
}
}
if (msg_id == 0) {
esp_event_post(INSIGHTS_EVENT, INSIGHTS_EVENT_TRANSPORT_SEND_SUCCESS, NULL, 0, portMAX_DELAY);
} else {
esp_event_post(INSIGHTS_EVENT, INSIGHTS_EVENT_TRANSPORT_SEND_FAILED, NULL, 0, portMAX_DELAY);
}
cleanup:
esp_http_client_cleanup(client);
return msg_id;
Expand Down

0 comments on commit 723f4b9

Please sign in to comment.