修复八电极蓝牙对接流程

This commit is contained in:
qcl_123 2026-03-17 09:51:59 +08:00
parent a161319690
commit 4ff1bb8e67
6 changed files with 318 additions and 314 deletions

View File

@ -79,7 +79,9 @@ Page({
if (!device.name && !device.localName) { if (!device.name && !device.localName) {
return return
} }
if (device.name.indexOf('AiLink_') != -1) { console.log("name", device.name)
if (device.name.indexOf('AiLink_') != -1 || device.name.toLowerCase().indexOf(
'pcf01') != -1) {
wx.stopBluetoothDevicesDiscovery() //搜索到名称为“AiLink_”的蓝牙后停止搜寻附近的蓝牙 wx.stopBluetoothDevicesDiscovery() //搜索到名称为“AiLink_”的蓝牙后停止搜寻附近的蓝牙
const foundDevices = this.data.devices const foundDevices = this.data.devices
const idx = inArray(foundDevices, 'deviceId', device.deviceId) const idx = inArray(foundDevices, 'deviceId', device.deviceId)
@ -222,7 +224,9 @@ Page({
let sex = "0x01" let sex = "0x01"
let age = "0x" + A.toString(16) let age = "0x" + A.toString(16)
let height = "0x" + H.toString(16) let height = "0x" + H.toString(16)
let arr = [0x01, parseInt(sex), parseInt(age), parseInt(height),0x00] let arr = [0x01, parseInt(sex), parseInt(age), parseInt(height),
0x00
]
plugin.sendDataOfA7(arr) plugin.sendDataOfA7(arr)
console.log("握手成功", arr) console.log("握手成功", arr)
} else if (bleData.status == 1) { } else if (bleData.status == 1) {

BIN
bluetooth_demo_J01.zip Normal file

Binary file not shown.

BIN
bluetooth_demo_L01.zip Normal file

Binary file not shown.

BIN
bluetooth_demo_L08.zip Normal file

Binary file not shown.

View File

@ -291,11 +291,11 @@ Page({
}) })
} }
} }
if (typeInfo == "05") { // if (typeInfo == "05") {
let mcu = payload.substring(4, 6) // let mcu = payload.substring(4, 6)
let imp = parseInt(payload.substring(6, 14), 16) // let imp = parseInt(payload.substring(6, 14), 16)
console.log("阻抗类型:", payload, type, typeInfo, mcu,imp) //阻抗模式 // console.log("阻抗类型:", payload, type, typeInfo, mcu,imp) //阻抗模式
} // }
} }
if (type == "0f") { if (type == "0f") {
that.setData({ that.setData({

Binary file not shown.