22#ifndef DETERMINISTICESPASYNCWEBSERVER_GUARDRAILS_H
23#define DETERMINISTICESPASYNCWEBSERVER_GUARDRAILS_H
29#if DETWS_ENABLE_GUARDRAILS
35 uint32_t min_free_heap;
36 uint32_t largest_free_block;
44 static constexpr uint8_t DETWS_BREACH_NONE = 0;
45 static constexpr uint8_t DETWS_BREACH_HEAP = 1;
46 static constexpr uint8_t DETWS_BREACH_FRAG = 2;
47 static constexpr uint8_t DETWS_BREACH_STACK = 4;
55uint8_t detws_guardrail_eval(
const DetwsHealth *h, uint32_t heap_min, uint32_t frag_min_block, uint32_t stack_min);
61int detws_health_json(
const DetwsHealth *h,
char *out,
size_t cap);
68void detws_guardrails_sample(DetwsHealth *h);
71typedef void (*detws_breach_fn)(uint8_t breaches,
const DetwsHealth *h);
74void detws_guardrails_begin(detws_breach_fn cb);
80uint8_t detws_guardrails_check(
void);
User-facing configuration for DeterministicESPAsyncWebServer.