fix:修补蓝牙配网bug
This commit is contained in:
@@ -379,16 +379,15 @@ void RadarManager::_extractSleep(const RadarFrame& frame) {
|
||||
}
|
||||
|
||||
if (frame.data_length >= 3) {
|
||||
// data[0]: 入床/离床
|
||||
// data[1]: 睡眠状态
|
||||
// data[2]: 评分
|
||||
|
||||
// 跌倒检测: 可能在睡眠异常标志中
|
||||
if (frame.data_length >= 4) {
|
||||
_data.fall = (frame.data[3] & 0x01) != 0;
|
||||
_data.resident = (frame.data[3] & 0x02) != 0;
|
||||
}
|
||||
_data.sleepState = frame.data[1]; // 0=清醒 1=浅睡 2=深睡
|
||||
_data.sleepScore = frame.data[2]; // 0~100
|
||||
_data.lastUpdate = millis();
|
||||
_notifyUpdate();
|
||||
}
|
||||
|
||||
if (frame.data_length >= 4) {
|
||||
_data.fall = (frame.data[3] & 0x01) != 0;
|
||||
_data.resident = (frame.data[3] & 0x02) != 0;
|
||||
_data.lastUpdate = millis();
|
||||
_notifyUpdate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user