|
@@ -155,7 +155,17 @@ class bleManager {
|
|
} else {
|
|
} else {
|
|
|
|
|
|
}
|
|
}
|
|
- console.log("gadsfqewrqewrqwerqrqr==222==" + JSON.stringify(result));
|
|
|
|
|
|
+ ///是否已配对
|
|
|
|
+ wx.isBluetoothDevicePaired({
|
|
|
|
+ deviceId: result.deviceId,
|
|
|
|
+ ///{"isPaired":false,"errno":0,"errMsg":"isBluetoothDevicePaired:ok"}
|
|
|
|
+ success: (res) => {
|
|
|
|
+ console.log("gasdfqwerqwerqr==00===" + JSON.stringify(res));
|
|
|
|
+ },
|
|
|
|
+ fail: (err) => {
|
|
|
|
+ console.log("gasdfqwerqwerqr==111===" + JSON.stringify(err));
|
|
|
|
+ }
|
|
|
|
+ })
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
@@ -394,7 +404,7 @@ class bleManager {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- resolve(err);
|
|
|
|
|
|
+ resolve("暂无连接设备");
|
|
}
|
|
}
|
|
},
|
|
},
|
|
fail: (err) => {
|
|
fail: (err) => {
|
|
@@ -409,18 +419,6 @@ class bleManager {
|
|
var that = this;
|
|
var that = this;
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
console.log("开始连接蓝牙:", device.deviceId)
|
|
console.log("开始连接蓝牙:", device.deviceId)
|
|
-
|
|
|
|
- ///是否已配对
|
|
|
|
- // wx.isBluetoothDevicePaired({
|
|
|
|
- // deviceId: device.deviceId,
|
|
|
|
- // ///{"isPaired":false,"errno":0,"errMsg":"isBluetoothDevicePaired:ok"}
|
|
|
|
- // success: (res) => {
|
|
|
|
- // console.log("gasdfqwerqwerqr==00===" + JSON.stringify(res));
|
|
|
|
- // },
|
|
|
|
- // fail: (err) => {
|
|
|
|
- // console.log("gasdfqwerqwerqr==111===" + JSON.stringify(err));
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
wx.createBLEConnection({
|
|
wx.createBLEConnection({
|
|
deviceId: device.deviceId,
|
|
deviceId: device.deviceId,
|
|
success: (res) => {
|
|
success: (res) => {
|