style:去除多余代码
This commit is contained in:
parent
204affd6b1
commit
7f2d591e67
@ -449,50 +449,6 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 判断 128-bit UUID 是否已配对
|
|
||||||
bool isPaired128Bit(String serviceUuid) {
|
|
||||||
if (serviceUuid.length != 36) return false; // 确保是 128-bit UUID
|
|
||||||
try {
|
|
||||||
String status = serviceUuid.substring(30, 32); // 获取第 31 和 32 位
|
|
||||||
return status == '01'; // '01' 表示已配对
|
|
||||||
} catch (e) {
|
|
||||||
return false; // 如果索引越界或其他错误,返回 false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 判断 128-bit UUID 是否休眠
|
|
||||||
bool isSleeping128Bit(String serviceUuid) {
|
|
||||||
if (serviceUuid.length != 36) return false; // 确保是 128-bit UUID
|
|
||||||
try {
|
|
||||||
String status = serviceUuid.substring(32, 34); // 获取第 33 和 34 位
|
|
||||||
return status == '00'; // '00' 表示休眠
|
|
||||||
} catch (e) {
|
|
||||||
return false; // 如果索引越界或其他错误,返回 false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 判断 32-bit UUID 是否已配对
|
|
||||||
bool isPaired32Bit(String serviceUuid) {
|
|
||||||
if (serviceUuid.length != 8) return false; // 确保是 32-bit UUID
|
|
||||||
try {
|
|
||||||
String status = serviceUuid.substring(3, 5); // 获取第 4 和 5 位
|
|
||||||
return status == '01'; // '01' 表示已配对
|
|
||||||
} catch (e) {
|
|
||||||
return false; // 如果索引越界或其他错误,返回 false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 判断 32-bit UUID 是否休眠
|
|
||||||
bool isSleeping32Bit(String serviceUuid) {
|
|
||||||
if (serviceUuid.length != 8) return false; // 确保是 32-bit UUID
|
|
||||||
try {
|
|
||||||
String status = serviceUuid.substring(5, 7); // 获取第 6 和 7 位
|
|
||||||
return status == '00'; // '00' 表示休眠
|
|
||||||
} catch (e) {
|
|
||||||
return false; // 如果索引越界或其他错误,返回 false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void stopScanBlueList() {
|
void stopScanBlueList() {
|
||||||
BlueManage().disconnect();
|
BlueManage().disconnect();
|
||||||
BlueManage().stopScan();
|
BlueManage().stopScan();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user