feat: 兼容7258 32位UUID
This commit is contained in:
parent
c14af80d03
commit
b4aeff31fd
@ -797,6 +797,9 @@ export const useBluetoothStore = defineStore('ble', {
|
||||
if (uuid && uuid.slice(2, 8) === '758824' && uuid.slice(30, 32) === '00') {
|
||||
that.deviceList.push(deviceList[i])
|
||||
}
|
||||
if (uuid && uuid.slice(0, 2) === '75' && uuid.slice(4, 6) === '00') {
|
||||
that.deviceList.push(deviceList[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log('设备列表', that.deviceList)
|
||||
@ -1073,6 +1076,11 @@ export const useBluetoothStore = defineStore('ble', {
|
||||
for (let i = 0; i < deviceList.length; i++) {
|
||||
if (deviceList[i]?.name === that.currentLockInfo.name) {
|
||||
const uuid = deviceList[i]?.advertisServiceUUIDs[0]
|
||||
if (uuid && uuid.slice(2, 8) === '758824') {
|
||||
console.log('设备UUID', uuid, uuid.slice(2, 8), uuid.slice(30, 32))
|
||||
} else if (uuid && uuid.slice(0, 2) === '75') {
|
||||
console.log('设备UUID', uuid, uuid.slice(2, 8), uuid.slice(4, 6))
|
||||
}
|
||||
if (
|
||||
uuid &&
|
||||
uuid.slice(2, 8) === '758824' &&
|
||||
@ -1106,6 +1114,30 @@ export const useBluetoothStore = defineStore('ble', {
|
||||
code: -2
|
||||
})
|
||||
break
|
||||
} else if (uuid && uuid.slice(0, 2) === '75' && uuid.slice(4, 6) === '01') {
|
||||
uni.stopBluetoothDevicesDiscovery()
|
||||
clearTimeout(timer2)
|
||||
clearInterval(timer1)
|
||||
resolve({
|
||||
code: 0,
|
||||
data: {
|
||||
deviceId: deviceList[i].deviceId
|
||||
}
|
||||
})
|
||||
break
|
||||
} else if (uuid && uuid.slice(0, 2) === '75' && uuid.slice(4, 6) === '00') {
|
||||
uni.stopBluetoothDevicesDiscovery()
|
||||
clearTimeout(timer2)
|
||||
clearInterval(timer1)
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '锁已被重置,请重新绑定',
|
||||
icon: 'none'
|
||||
})
|
||||
resolve({
|
||||
code: -2
|
||||
})
|
||||
break
|
||||
} else {
|
||||
uni.stopBluetoothDevicesDiscovery()
|
||||
clearTimeout(timer2)
|
||||
@ -1475,7 +1507,7 @@ export const useBluetoothStore = defineStore('ble', {
|
||||
console.log('写入未执行', this.bluetoothStatus)
|
||||
this.getBluetoothStatus()
|
||||
return {
|
||||
code: -21
|
||||
code: -1
|
||||
}
|
||||
}
|
||||
|
||||
@ -2919,7 +2951,7 @@ export const useBluetoothStore = defineStore('ble', {
|
||||
console.log('写入未执行', this.bluetoothStatus)
|
||||
this.getBluetoothStatus()
|
||||
return {
|
||||
code: -21
|
||||
code: -1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user