Merge pull request #3744 from cesanta/hcd

Add coredump RPC method
This commit is contained in:
Sergio R. Caprile authored and GitHub committed 2026-11-06 07:34:38 +00:00
commit 324f59abc5
6 files changed
+204

No files matched your search

+16
View File
@@ -256,6 +256,7 @@ extern "C" {
#if MG_ENABLE_HEALTH
#include <esp_memory_utils.h>
#include <esp_core_dump.h>
#include <esp_partition.h>
#endif
#define MG_PATH_MAX 128
@@ -4495,6 +4496,9 @@ static inline uint16_t esp2mg(esp_reset_reason_t rr) {
#define MG_HEALTH_INIT() mg_health_init()
extern size_t mg_print_crash_record(mg_pfn_t, void *, va_list *);
extern void mg_health_init(void);
extern bool mg_health_coredump_begin(size_t *size);
extern bool mg_health_coredump_read(size_t offset, void *buf, size_t *len);
extern bool mg_health_coredump_end(void);
#else
#define MG_HEALTH_INIT()
static inline int mg_health_reason(void) {
@@ -4509,6 +4513,18 @@ static inline size_t mg_print_crash_record(mg_pfn_t fn, void *arg,
(void) ap;
return mg_xprintf(fn, arg, "{}");
}
static inline bool mg_health_coredump_begin(size_t *size) {
(void) size;
return false;
}
static inline bool mg_health_coredump_read(size_t offset, void *buf,
size_t *len) {
(void) offset, (void) buf, (void) len;
return false;
}
static inline bool mg_health_coredump_end(void) {
return false;
}
#endif
// Cloud connector API to https://mdash.net - device management cloud