|
|
|
@ -606,9 +606,14 @@ class PairingController extends GetxController { |
|
|
|
|
|
|
|
//自动绑定设备 0 未合作商 1 合作商 9经典蓝牙已绑定 10,ble蓝牙已绑定 |
|
|
|
Future<int> authbindingDevice(BluetoothDevice device) async { |
|
|
|
// 检查设备名称是否包含 DeepSound 或 DeapSound |
|
|
|
final deviceName = device.name; |
|
|
|
|
|
|
|
final names = AppConfig.allproductNames(); |
|
|
|
// 检查是否已有绑定的设备 |
|
|
|
print("device.address${device.address}"); |
|
|
|
final existingDevice = User.instance.devices.firstWhere( |
|
|
|
(d) => d.devicetype == 0 && d.devicemac == device.address, |
|
|
|
(d) => d.devicetype == 1 && d.devicemac == device.address, |
|
|
|
orElse: () => UserDevice( |
|
|
|
id: -1, |
|
|
|
uid: '', |
|
|
|
@ -622,10 +627,6 @@ class PairingController extends GetxController { |
|
|
|
return 9; |
|
|
|
} |
|
|
|
|
|
|
|
// 检查设备名称是否包含 DeepSound 或 DeapSound |
|
|
|
final deviceName = device.name; |
|
|
|
|
|
|
|
final names = AppConfig.allproductNames(); |
|
|
|
print( |
|
|
|
'获取到 deviceName: $deviceName address: ${device.address} names:$names'); |
|
|
|
if (names.contains(deviceName)) { |
|
|
|
@ -707,13 +708,10 @@ class PairingController extends GetxController { |
|
|
|
await Future.delayed(Duration(seconds: 1)); |
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
//可以跳转1 |
|
|
|
else { |
|
|
|
return 1; |
|
|
|
} |
|
|
|
return 0; |
|
|
|
//可以跳转1 |
|
|
|
} |
|
|
|
|
|
|
|
// 新增方法:从hex数据中提取MAC地址并与当前设备MAC对比 |
|
|
|
|