650/670增加关闭探测功能,删除一些跟供应商调试的页面
This commit is contained in:
@ -532,6 +532,20 @@ class BleHelper {
|
||||
});
|
||||
this.updateCache();
|
||||
}
|
||||
|
||||
if (str.indexOf('imei:') == 0) {
|
||||
let imei = str.split(':')[1];
|
||||
|
||||
|
||||
this.data.LinkedList.find((v) => {
|
||||
if (v.deviceId == receive
|
||||
.deviceId) {
|
||||
v.imei=imei;
|
||||
}
|
||||
});
|
||||
this.updateCache();
|
||||
|
||||
}
|
||||
|
||||
if (bytes[0] == 0xFC) { //6155以0xFC开头代表mac地址
|
||||
console.log("收到mac地址:", bytes)
|
||||
@ -669,8 +683,8 @@ class BleHelper {
|
||||
let RunSearch = (serviceId) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.startBluetoothDevicesDiscovery({
|
||||
services: [serviceId],
|
||||
allowDuplicatesKey: false,
|
||||
services:serviceId? [serviceId]:[],
|
||||
allowDuplicatesKey: true,
|
||||
success: (res) => {
|
||||
//console.log('开始搜索蓝牙设备成功');
|
||||
resolve(res);
|
||||
@ -689,11 +703,11 @@ class BleHelper {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
let promises = [];
|
||||
for (let i = 0; i < serviceIds.length; i++) {
|
||||
|
||||
promises.push(RunSearch(serviceIds[i]));
|
||||
}
|
||||
// for (let i = 0; i < serviceIds.length; i++) {
|
||||
|
||||
// promises.push(RunSearch(serviceIds[i]));
|
||||
// }
|
||||
promises.push(RunSearch());
|
||||
Promise.all(promises).then(resolve).catch(reject);
|
||||
|
||||
});
|
||||
@ -1150,7 +1164,7 @@ class BleHelper {
|
||||
console.log("正在连接" + deviceId);
|
||||
uni.createBLEConnection({
|
||||
deviceId: deviceId,
|
||||
timeout: 3000,
|
||||
timeout: 30000,
|
||||
success: (info) => {
|
||||
console.log("新连接成功", this.data.LinkedList);
|
||||
this.getLinkBlue().then((arr) => {
|
||||
|
||||
Reference in New Issue
Block a user