fix:增加128bit的绑定状态判断改为位判断

This commit is contained in:
liyi 2025-08-04 15:25:00 +08:00
parent 5de4d4de57
commit 295ce15fc4

View File

@ -362,6 +362,27 @@ class BlueManage {
// 00=01=
if (pairStatus == '00') {
return true; // true
} else {
// 0~255
int statusValue = int.parse(pairStatus, radix: 16);
// byte01
int byte0 = (statusValue >> 0) & 0x01; //
// byte12
int byte1 = (statusValue >> 1) & 0x01; //
//
bool isPaired = (byte0 == 1);
//
bool hasNewEvent = (byte1 == 1);
//
if (isPaired) {
return true; // false
} else {
return false; // true
}
}
// 01trueuuid
}