feat:增加32bit的锁uuid兼容
This commit is contained in:
parent
074938c2f7
commit
ef46fb8860
@ -179,12 +179,19 @@ class BlueManage {
|
||||
upload: false);
|
||||
if (isExit) {
|
||||
for (final ScanResult scanResult in results) {
|
||||
if (((scanResult.advertisementData.serviceUuids.isNotEmpty
|
||||
? scanResult.advertisementData.serviceUuids[0]
|
||||
: '')
|
||||
.toString()
|
||||
.contains('758824')) &&
|
||||
(scanResult.rssi >= -100)) {
|
||||
if (scanResult.advertisementData.serviceUuids.isNotEmpty) {
|
||||
// AppLog.log(
|
||||
// '扫描到的设备:${scanResult.advertisementData.serviceUuids[0].toString()}');
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
final isMatch = _isMatch(scanResult
|
||||
.advertisementData.serviceUuids
|
||||
.map((e) => e.uuid)
|
||||
.toList());
|
||||
|
||||
if (isMatch && (scanResult.rssi >= -100)) {
|
||||
// 查询id相同的元素
|
||||
final int knownDeviceIndex = scanDevices.indexWhere(
|
||||
(ScanResult d) =>
|
||||
@ -261,10 +268,11 @@ class BlueManage {
|
||||
}
|
||||
|
||||
final isMatch = _isMatch(
|
||||
scanResult.advertisementData.serviceUuids
|
||||
.map((e) => e.uuid)
|
||||
.toList(),
|
||||
deviceType);
|
||||
scanResult.advertisementData.serviceUuids
|
||||
.map((e) => e.uuid)
|
||||
.toList(),
|
||||
deviceType: deviceType,
|
||||
);
|
||||
// 判断名字为空的直接剔除
|
||||
if (isMatch && (scanResult.rssi >= -100)) {
|
||||
// 查询id相同的元素
|
||||
@ -307,7 +315,8 @@ class BlueManage {
|
||||
}
|
||||
|
||||
/// 判断是否包含指定的uuid
|
||||
bool _isMatch(List<String> serviceUuids, DeviceType deviceType) {
|
||||
bool _isMatch(List<String> serviceUuids,
|
||||
{DeviceType deviceType = DeviceType.blue}) {
|
||||
// 获取设备类型数组
|
||||
List<String> deviceTypeList = getDeviceType(deviceType);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user