Commit eb64af1f by 王榕

蓝牙开锁工具修改

parent 446d2267
...@@ -84,7 +84,7 @@ Page({ ...@@ -84,7 +84,7 @@ Page({
alertTip('请输入固件编号') alertTip('请输入固件编号')
return 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 => { .then(res => {
this.setData({ this.setData({
hexStr: res, hexStr: res,
...@@ -179,32 +179,32 @@ Page({ ...@@ -179,32 +179,32 @@ Page({
let devices = res.devices // 设备列表 let devices = res.devices // 设备列表
console.log('onBluetoothDeviceFound获取到设备', res.devices) console.log('onBluetoothDeviceFound获取到设备', res.devices)
res.devices.forEach(elt => { res.devices.forEach(elt => {
if (/^c1/gi.test(elt.deviceId)) { if (/^yd/gi.test(elt.name)) {
deviceSet.add(elt) deviceSet.add(elt)
} }
}) })
that.setData({ that.setData({
deviceList: [...deviceSet] deviceList: [...deviceSet]
}) })
if (e) { // if (e) {
return // return
} // }
if (devices.length > 0) { // if (devices.length > 0) {
for (let i in devices) { // for (let i in devices) {
let mac = ab2str(devices[i].advertisData).toLowerCase() // let mac = ab2str(devices[i].advertisData).toLowerCase()
let deviceId = devices[i].deviceId // let deviceId = devices[i].deviceId
let mac2 = deviceId.split(':').join('').toLowerCase() // let mac2 = deviceId.split(':').join('').toLowerCase()
// // console.log('解析苹果上的advertisData', mac, 'devicesId', deviceId) // // // console.log('解析苹果上的advertisData', mac, 'devicesId', deviceId)
if (mac.indexOf(blueAddress.toLowerCase()) != -1) { // if (mac.indexOf(blueAddress.toLowerCase()) != -1) {
// // console.log('找到对应的车辆', mac) // // // console.log('找到对应的车辆', mac)
if (deviceId) { // if (deviceId) {
if (!that.data.blueConnect) { // if (!that.data.blueConnect) {
that.connectBlue(deviceId) // that.connectBlue(deviceId)
} // }
} // }
} // }
} // }
} // }
}) })
wx.startBluetoothDevicesDiscovery({ wx.startBluetoothDevicesDiscovery({
allowDuplicatesKey: false, allowDuplicatesKey: false,
...@@ -247,6 +247,8 @@ Page({ ...@@ -247,6 +247,8 @@ Page({
title: '连接中', title: '连接中',
mask: true mask: true
}) })
console.log('连接中', deviceId)
let that = this let that = this
that.setData({ that.setData({
deviceId: deviceId, deviceId: deviceId,
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.7.2", "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", "projectname": "%E8%93%9D%E7%89%99%E5%BC%80%E9%94%81%E5%B7%A5%E5%85%B7",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "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