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