|
|
|
@ -661,13 +661,25 @@ class PairingController extends GetxController { |
|
|
|
_verifiedDeviceAddress = uuids; |
|
|
|
print('找到匹配设备,获取到 uuids: $uuids'); |
|
|
|
//检查是否已经绑定 |
|
|
|
// if (User.instance.earphonelicense != "" && |
|
|
|
// User.instance.earphonemac == device.address) { |
|
|
|
// // 已经绑定 |
|
|
|
// return 10; |
|
|
|
// } else { |
|
|
|
final existingDevice = User.instance.devices.firstWhere( |
|
|
|
(d) => |
|
|
|
d.devicetype == 2 && |
|
|
|
d.license != "" && |
|
|
|
d.devicemac == device.address, |
|
|
|
orElse: () => UserDevice( |
|
|
|
id: -1, |
|
|
|
uid: '', |
|
|
|
devicetype: -1, |
|
|
|
devicename: '', |
|
|
|
devicemac: '', |
|
|
|
license: ''), |
|
|
|
); |
|
|
|
if (existingDevice.id != -1) { |
|
|
|
// 已经绑定 |
|
|
|
return 10; |
|
|
|
} else { |
|
|
|
return 1; |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (Platform.isAndroid) { |
|
|
|
// Android设备,提取15-24字节的授权码 |
|
|
|
|