fix:resident 字段修复(误伤了,重新放开)

feat:增加防抖功能。
This commit is contained in:
2026-08-17 16:23:55 +08:00
parent b960682d73
commit 03129c9ed8
4 changed files with 60 additions and 7 deletions
+5
View File
@@ -74,6 +74,7 @@ private:
void _extractSleep(const RadarFrame& frame);
void _extractWorkStatus(const RadarFrame& frame);
void _extractDetectRange(const RadarFrame& frame);
void _filterMotion(bool rawMotion); // 运动状态 3 帧去抖
uint8_t _calcChecksum(const uint8_t* data, uint16_t len);
void _notifyUpdate();
@@ -95,6 +96,10 @@ private:
bool _stablePresence; // 防抖后的稳定有人/无人
uint8_t _presenceCnt; // 连续一致计数
bool _lastRawPresence; // 上一次原始值
// 运动状态防抖 (体动信号常因小动作抖动, 加 3 帧持续才确认)
uint8_t _motionCnt; // 连续一致计数
bool _lastRawMotion; // 上一次原始值
};
#endif // RADAR_MANAGER_H