Commit eb64af1f by 王榕

蓝牙开锁工具修改

parent 446d2267
......@@ -84,7 +84,7 @@ Page({
alertTip('请输入固件编号')
return
}
Api.get('http://yadi-upgrade.zhuzhux.com/download/getFileHex?typeHex=' + firmwareNo)
Api.get('https://yadi-upgrade.zhuzhux.com/download/getFileHex?typeHex=' + firmwareNo)
.then(res => {
this.setData({
hexStr: res,
......@@ -179,32 +179,32 @@ Page({
let devices = res.devices // 设备列表
console.log('onBluetoothDeviceFound获取到设备', res.devices)
res.devices.forEach(elt => {
if (/^c1/gi.test(elt.deviceId)) {
if (/^yd/gi.test(elt.name)) {
deviceSet.add(elt)
}
})
that.setData({
deviceList: [...deviceSet]
})
if (e) {
return
}
if (devices.length > 0) {
for (let i in devices) {
let mac = ab2str(devices[i].advertisData).toLowerCase()
let deviceId = devices[i].deviceId
let mac2 = deviceId.split(':').join('').toLowerCase()
// // console.log('解析苹果上的advertisData', mac, 'devicesId', deviceId)
if (mac.indexOf(blueAddress.toLowerCase()) != -1) {
// // console.log('找到对应的车辆', mac)
if (deviceId) {
if (!that.data.blueConnect) {
that.connectBlue(deviceId)
}
}
}
}
}
// if (e) {
// return
// }
// if (devices.length > 0) {
// for (let i in devices) {
// let mac = ab2str(devices[i].advertisData).toLowerCase()
// let deviceId = devices[i].deviceId
// let mac2 = deviceId.split(':').join('').toLowerCase()
// // // console.log('解析苹果上的advertisData', mac, 'devicesId', deviceId)
// if (mac.indexOf(blueAddress.toLowerCase()) != -1) {
// // // console.log('找到对应的车辆', mac)
// if (deviceId) {
// if (!that.data.blueConnect) {
// that.connectBlue(deviceId)
// }
// }
// }
// }
// }
})
wx.startBluetoothDevicesDiscovery({
allowDuplicatesKey: false,
......@@ -247,6 +247,8 @@ Page({
title: '连接中',
mask: true
})
console.log('连接中', deviceId)
let that = this
that.setData({
deviceId: deviceId,
......
......@@ -22,7 +22,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.7.2",
"appid": "wx918b041f12491a2b",
"appid": "wx9e03f17405a7b412",
"projectname": "%E8%93%9D%E7%89%99%E5%BC%80%E9%94%81%E5%B7%A5%E5%85%B7",
"debugOptions": {
"hidedInDevtools": []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment