WIP: 670完成部分,版本合并 #7

Closed
liubiao wants to merge 36 commits from liubiao/APP:main into main
329 changed files with 21203 additions and 30881 deletions
Showing only changes of commit 535f4728ea - Show all commits

View File

@ -128,8 +128,8 @@ class BleHelper {
}
//设置发现新设备的回调
addDeviceFound(callback) {
let key = this.getCurrentPagePath();
addDeviceFound(callback,currKey) {
let key =currKey?currKey:this.getCurrentPagePath();
if (!key) {
key = new Date().getTime();
}
@ -150,8 +150,8 @@ class BleHelper {
}
//移除发现新设备的回调
removeDeviceFound() {
let key = this.getCurrentPagePath();
removeDeviceFound(currKey) {
let key =currKey?currKey: this.getCurrentPagePath();
if (key) {
console.log("key=" + key);
@ -170,8 +170,8 @@ class BleHelper {
}
//添加接收到数据的回调
addReceiveCallback(callback) {
let key = this.getCurrentPagePath();
addReceiveCallback(callback,currKey) {
let key =currKey?currKey: this.getCurrentPagePath();
if (!key) {
key = new Date().getTime();
}
@ -193,8 +193,8 @@ class BleHelper {
//设置接收到数据的回调
removeReceiveCallback(ev) {
let key = this.getCurrentPagePath();
removeReceiveCallback(ev,currKey) {
let key =currKey?currKey: this.getCurrentPagePath();
if (key) {
console.log("key=" + key);
let f = this.cfg.receivDataCallback.findIndex((v) => {

21
utils/BleReceive.js Normal file
View File

@ -0,0 +1,21 @@
class BleReceive {
constructor() {
this.StorageKey = "linkedDevices";
}
}
let instance = null;
export default {
getBleReceive: function(found, receive) {
if (!instance) {
instance = new BleReceive();
}
return instance;
}
}