Skip to content

Commit b4c1917

Browse files
DematteisGiacomojorgenmk
authored andcommitted
samples: debug: memfault: fix on_connect() handling
Send data on_connect if no coredump is present. Signed-off-by: Giacomo Dematteis <giacomo.dematteis@nordicsemi.no>
1 parent 314a536 commit b4c1917

File tree

1 file changed

+3
-1
lines changed
  • samples/debug/memfault/src

1 file changed

+3
-1
lines changed

samples/debug/memfault/src/main.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <memfault/ports/zephyr/http.h>
1313
#include <memfault/core/data_packetizer.h>
1414
#include <memfault/core/trace_event.h>
15+
#include <memfault/panics/coredump.h>
1516
#include <dk_buttons_and_leds.h>
1617

1718
#include <zephyr/logging/log.h>
@@ -92,7 +93,8 @@ static void on_connect(void)
9293
LOG_INF("Time to connect: %d ms", time_to_lte_connection);
9394
#endif /* IS_ENABLED(MEMFAULT_NCS_LTE_METRICS) */
9495

95-
if (IS_ENABLED(CONFIG_MEMFAULT_NCS_POST_COREDUMP_ON_NETWORK_CONNECTED)) {
96+
if (IS_ENABLED(CONFIG_MEMFAULT_NCS_POST_COREDUMP_ON_NETWORK_CONNECTED) &&
97+
memfault_coredump_has_valid_coredump(NULL)) {
9698
/* Coredump sending handled internally */
9799
return;
98100
}

0 commit comments

Comments
 (0)