Files
ESP32_COMM/main/monitor/health_monitor.h
T
小龙虾 478e5e5a31 feat(ota-relay): 更新ESP32-C3 OTA中继固件配置和功能增强
- 修改WiFi配置默认为STA模式连接路由器,并调整相关参数
- 优化调试日志系统,添加环形缓冲区支持HTTP日志拉取功能
- 重构健康监控,提高温度监控频率至1秒并添加电压监控定时器
- 更新分区表配置以适应4MB Flash布局
- 添加OTA更新组件依赖和蓝牙支持
- 修复UDP socket延迟创建时机,确保网络接口初始化正确
- 调整WiFi信号强度告警阈值,提升连接稳定性
- 更新README文档中的IP地址配置示例
- 修改VSCode端口配置为COM13
2026-05-05 03:28:44 +08:00

40 lines
1.0 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* health_monitor.h - 系统健康监控头文件
*/
#pragma once
#include <stdint.h>
#include "app_config.h"
// T9.3: 健康状态等级
typedef enum {
SYS_NORMAL = 0, // 正常
SYS_WARNING = 1, // 警告
SYS_CRITICAL = 2, // 危险
SYS_SAFE_SHUTDOWN = 3 // 安全关机
} health_state_t;
typedef enum {
HEALTH_MON_OK = 0,
HEALTH_MON_WARNING = 1,
HEALTH_MON_CRITICAL = 2,
HEALTH_MON_SHUTDOWN = 3
} health_status_t;
// 外部共享状态(互斥锁保护)
extern health_state_t g_health_state;
// WiFi RSSI 阈值(来自 app_config.h)
#define WIFI_RSSI_NORMAL WIFI_RSSI_WARNING
#define WIFI_RSSI_WEAK WIFI_RSSI_CRITICAL
// 函数声明
void health_monitor_init(void);
void health_monitor_task(void *pvParameters);
health_status_t health_check_before_ota(void);
void health_log_event(const char *event, int value);
health_state_t health_get_current(void);
health_status_t health_update_from_wifi_rssi(int8_t rssi);
float health_get_last_temperature(void);
float health_get_last_voltage(void);