2025-08-27 10:32:13 +08:00
|
|
|
class BleReceive {
|
|
|
|
|
constructor() {
|
|
|
|
|
this.StorageKey = "linkedDevices";
|
2025-10-23 16:36:48 +08:00
|
|
|
this.HandlerMap = {
|
|
|
|
|
'/pages/6155/deviceDetail': this.Receive_6155.bind(this),
|
|
|
|
|
'/pages/7305/BJQ7305': this.Receive_6155.bind(this),
|
|
|
|
|
'/pages/650/HBY650': this.Receive_650.bind(this),
|
|
|
|
|
'/pages/670/HBY670': this.Receive_670.bind(this)
|
|
|
|
|
};
|
2025-08-27 10:32:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getCurrentPagePath() {
|
|
|
|
|
|
|
|
|
|
const pages = getCurrentPages();
|
|
|
|
|
|
|
|
|
|
if (pages.length === 0) {
|
|
|
|
|
console.log("pages.length=0");
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const currentPage = pages[pages.length - 1];
|
|
|
|
|
console.log("currentPage=", currentPage.route);
|
|
|
|
|
return currentPage.route;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setBleFormData(data,f) {
|
|
|
|
|
if(data){
|
|
|
|
|
let linkedList=uni.getStorageSync(this.StorageKey);
|
2025-09-25 09:59:37 +08:00
|
|
|
if(!linkedList){
|
|
|
|
|
return;
|
|
|
|
|
}
|
2025-08-27 10:32:13 +08:00
|
|
|
linkedList.find((v)=>{
|
|
|
|
|
if(f.deviceId==v.deviceId){
|
|
|
|
|
let keys=Object.keys(data);
|
|
|
|
|
keys.forEach((key)=>{
|
|
|
|
|
if(!v.formData){
|
|
|
|
|
v.formData={};
|
|
|
|
|
}
|
|
|
|
|
if(!f.formData){
|
|
|
|
|
f.formData={};
|
|
|
|
|
}
|
|
|
|
|
v.formData[key]=data[key];
|
|
|
|
|
f.formData[key]=data[key];
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
uni.setStorageSync(this.StorageKey,linkedList);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2025-09-17 15:21:20 +08:00
|
|
|
ReceiveData(receive,f,path,recArr) {
|
2025-10-23 16:36:48 +08:00
|
|
|
if(f && f.macAddress && f.device && f.device.id){
|
|
|
|
|
let handler = this.HandlerMap[f.device.detailPageUrl];
|
|
|
|
|
if(handler){
|
|
|
|
|
let data=handler(receive, f, path, recArr);
|
|
|
|
|
return data;
|
|
|
|
|
}else{
|
|
|
|
|
console.log("已收到消息,但无指定处理程序",receive);
|
2025-08-27 10:32:13 +08:00
|
|
|
}
|
|
|
|
|
|
2025-09-16 14:51:23 +08:00
|
|
|
}else{
|
|
|
|
|
console.log("已收到该消息,但无法处理",receive);
|
2025-08-27 10:32:13 +08:00
|
|
|
}
|
2025-09-16 14:51:23 +08:00
|
|
|
|
2025-08-28 14:05:06 +08:00
|
|
|
return receive;
|
2025-08-27 10:32:13 +08:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-17 15:21:20 +08:00
|
|
|
Receive_650(receive,f,path,recArr) {
|
2025-08-27 10:32:13 +08:00
|
|
|
console.log("通用程序正在处理650的数据",receive);
|
|
|
|
|
|
|
|
|
|
var parseData = () => {
|
|
|
|
|
let bytes = receive.bytes;
|
|
|
|
|
if (bytes[0] == 0x55) {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
let staticLevelByte = bytes[1];
|
|
|
|
|
let staticLevelText = '未知';
|
|
|
|
|
let modeCurr = "";
|
|
|
|
|
|
|
|
|
|
switch (staticLevelByte) {
|
|
|
|
|
case 0x65:
|
|
|
|
|
staticLevelText = '高档';
|
|
|
|
|
modeCurr = "hight";
|
|
|
|
|
break;
|
|
|
|
|
case 0x66:
|
|
|
|
|
staticLevelText = '中档';
|
|
|
|
|
modeCurr = "center";
|
|
|
|
|
break;
|
|
|
|
|
case 0x67:
|
|
|
|
|
staticLevelText = '低档';
|
|
|
|
|
modeCurr = "low";
|
|
|
|
|
break;
|
2025-09-23 08:36:21 +08:00
|
|
|
case 0x64:
|
2025-08-27 10:32:13 +08:00
|
|
|
staticLevelText = '关闭';
|
|
|
|
|
modeCurr = "close";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 解析照明档位
|
|
|
|
|
let lightingLevelByte = bytes[2];
|
|
|
|
|
let lightingLevelText = lightingLevelByte === 0x6e ? '开启' : '关闭';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 解析剩余照明时间(第三和第四字节,大端序)
|
|
|
|
|
let lightingTime = (bytes[3] << 8) | bytes[4];
|
|
|
|
|
let hours = Math.floor(lightingTime / 60);
|
|
|
|
|
let remainingMinutes = lightingTime % 60;
|
|
|
|
|
let xuhang = '0分';
|
|
|
|
|
// 处理不同情况的显示
|
|
|
|
|
if (hours === 0) {
|
|
|
|
|
xuhang = `${remainingMinutes}分`;
|
|
|
|
|
} else if (remainingMinutes === 0) {
|
|
|
|
|
xuhang = `${hours}小时`;
|
|
|
|
|
} else {
|
|
|
|
|
xuhang = `${hours}小时${remainingMinutes}分`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 解析剩余电量
|
|
|
|
|
let batteryLevelByte = bytes[5];
|
|
|
|
|
// 电量百分比范围检查
|
|
|
|
|
let batteryLevel = Math.max(0, Math.min(100, batteryLevelByte));
|
|
|
|
|
let iswarn = false;
|
|
|
|
|
let warn = bytes[6];
|
|
|
|
|
if (warn == 0x00) {
|
|
|
|
|
warn = '无预警';
|
|
|
|
|
} else if (warn == 0x01) {
|
|
|
|
|
warn = '弱预警';
|
|
|
|
|
} else if (warn == 0x02) {
|
|
|
|
|
iswarn = true;
|
|
|
|
|
warn = '中预警';
|
|
|
|
|
} else if (warn == 0x03) {
|
|
|
|
|
iswarn = true;
|
|
|
|
|
warn = '强预警';
|
|
|
|
|
} else if (warn == 0x04) {
|
|
|
|
|
iswarn = true;
|
|
|
|
|
warn = '非常强预警';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let formData={};
|
|
|
|
|
formData.battary = batteryLevel;
|
|
|
|
|
formData.xuhang = xuhang;
|
|
|
|
|
formData.cMode = lightingLevelByte === 0x6e;
|
|
|
|
|
formData.modeCurr = modeCurr;
|
|
|
|
|
formData.warnLevel = warn;
|
|
|
|
|
formData.iswarn = iswarn;
|
|
|
|
|
this.setBleFormData(formData,f);
|
|
|
|
|
|
|
|
|
|
let route=this.getCurrentPagePath();
|
|
|
|
|
console.log("f=",f);
|
|
|
|
|
console.log("route="+route);
|
|
|
|
|
if (iswarn && f.detailPageUrl.indexOf(route)==-1 ) {
|
|
|
|
|
uni.showModal({
|
|
|
|
|
content:"环境存在漏电电源",
|
|
|
|
|
title:"警告",
|
|
|
|
|
success(res){
|
|
|
|
|
if(res.confirm){
|
|
|
|
|
|
|
|
|
|
if(f){
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: f.detailPageUrl,
|
|
|
|
|
events: {
|
|
|
|
|
ack: function(data) {}
|
|
|
|
|
},
|
|
|
|
|
success: (res) => {
|
|
|
|
|
res.eventChannel.emit('detailData', {
|
|
|
|
|
data: f,
|
|
|
|
|
deviceType: '',
|
|
|
|
|
apiType: 'listA'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
console.log("当前全局不处理此消息");
|
|
|
|
|
}
|
|
|
|
|
return formData;
|
|
|
|
|
} catch (error) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (receive.str) {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
let str = receive.str;
|
|
|
|
|
|
|
|
|
|
if (str.indexOf('mac address:') == 0) {
|
|
|
|
|
let formData={};
|
|
|
|
|
formData.macAddress = str.split(':')[1];
|
|
|
|
|
this.setBleFormData(formData,f);
|
|
|
|
|
return formData;
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
let receiveData={a:1};
|
|
|
|
|
try {
|
|
|
|
|
let json=JSON.parse(str);
|
|
|
|
|
|
|
|
|
|
if("staBlue_picture" in json){
|
|
|
|
|
//重发图片
|
|
|
|
|
console.log("收到重新发送图片的命令");
|
|
|
|
|
receiveData=json;
|
|
|
|
|
}
|
|
|
|
|
else if("staBlue_text" in json){
|
|
|
|
|
//重发文本
|
|
|
|
|
console.log("收到重新发送文本的命令");
|
|
|
|
|
receiveData=json;
|
|
|
|
|
}
|
|
|
|
|
else if("staBlue_vidio" in json){
|
|
|
|
|
//重发视频
|
|
|
|
|
console.log("收到重新发送视频的命令");
|
|
|
|
|
receiveData=json;
|
|
|
|
|
}
|
|
|
|
|
else if("staBlue" in json){
|
|
|
|
|
if(json.staBlue=="finish"){
|
|
|
|
|
console.log("收到设备回复,全部传输完成");
|
|
|
|
|
receiveData=json;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
receiveData={};
|
|
|
|
|
console.log("无法解析该文本");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
receiveData={};
|
|
|
|
|
console.log("文本解析失败")
|
|
|
|
|
}
|
|
|
|
|
return receiveData;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let data=parseData(receive.bytes);
|
|
|
|
|
console.log("data=",data);
|
|
|
|
|
return data;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-17 15:21:20 +08:00
|
|
|
Receive_670(receive,f,path,recArr){
|
|
|
|
|
console.log("pagh=",path);
|
2025-08-27 10:32:13 +08:00
|
|
|
var todo = (bytes) =>{
|
2025-08-28 14:05:06 +08:00
|
|
|
// console.log("todo",receive);
|
2025-08-27 10:32:13 +08:00
|
|
|
let receiveData = {};
|
|
|
|
|
if (bytes[0] == 0x55) {
|
|
|
|
|
try {
|
2025-08-28 14:05:06 +08:00
|
|
|
// console.log("todo");
|
2025-08-27 10:32:13 +08:00
|
|
|
// 跳过帧头(第一个字节),从第二个字节开始解析
|
|
|
|
|
let staticLevelByte = bytes[1];
|
|
|
|
|
let staticLevelText = '';
|
|
|
|
|
switch (staticLevelByte) {
|
|
|
|
|
case 0x65:
|
|
|
|
|
staticLevelText = 'hight';
|
|
|
|
|
break
|
|
|
|
|
case 0x66:
|
|
|
|
|
staticLevelText = 'center';
|
|
|
|
|
break
|
|
|
|
|
case 0x67:
|
|
|
|
|
staticLevelText = 'low';
|
|
|
|
|
break
|
2025-09-23 08:36:21 +08:00
|
|
|
case 0x64:
|
2025-08-27 10:32:13 +08:00
|
|
|
staticLevelText = 'close';
|
|
|
|
|
break
|
|
|
|
|
}
|
2025-08-28 14:05:06 +08:00
|
|
|
// console.log("todo");
|
2025-08-27 10:32:13 +08:00
|
|
|
// 解析照明档位
|
|
|
|
|
let lightingLevelByte = bytes[2];
|
|
|
|
|
let lightingLevelText = lightingLevelByte === 0x6d ? 'hight': lightingLevelByte === 0x6e ? 'low': 'close';
|
|
|
|
|
|
|
|
|
|
// 解析剩余照明时间(第三和第四字节,小端序)
|
|
|
|
|
let lightingTime = (bytes[3] << 8) | bytes[4];
|
|
|
|
|
|
|
|
|
|
// 解析剩余电量 // 电量百分比范围检查
|
|
|
|
|
let batteryLevelByte = bytes[5];
|
|
|
|
|
|
|
|
|
|
let batteryLevel = Math.max(0, Math.min(100, batteryLevelByte));
|
2025-08-28 14:05:06 +08:00
|
|
|
// console.log("todo");
|
2025-08-27 10:32:13 +08:00
|
|
|
let warn = bytes[6];
|
|
|
|
|
if (warn == 0x00) {
|
|
|
|
|
warn = 'none';
|
|
|
|
|
} else if (warn == 0x01) {
|
|
|
|
|
warn = 'ruo';
|
|
|
|
|
} else if (warn == 0x02) {
|
|
|
|
|
warn = 'center';
|
|
|
|
|
} else if (warn == 0x03) {
|
|
|
|
|
warn = 'hight';
|
|
|
|
|
} else if (warn == 0x04) {
|
|
|
|
|
warn = 'veryhight';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let staticWarn = bytes[7] == 0x01;//静止报警
|
|
|
|
|
let fourGStrenth = bytes[8]; //4g信号强度
|
|
|
|
|
let sosTxt = bytes[9] == 0x00 ? 'close' : bytes[9] == 0x01 ? 'sg' : 'rb';
|
2025-08-28 14:05:06 +08:00
|
|
|
// console.log("todo");
|
2025-08-27 10:32:13 +08:00
|
|
|
receiveData.modeCurr = staticLevelText;
|
|
|
|
|
receiveData.lightCurr = lightingLevelText;
|
|
|
|
|
receiveData.xuhang = lightingTime ;
|
|
|
|
|
receiveData.battary = batteryLevel;
|
|
|
|
|
receiveData.warnLevel = warn;
|
|
|
|
|
receiveData.staticWarn = staticWarn;
|
|
|
|
|
receiveData.fourGStrenth = fourGStrenth;
|
|
|
|
|
receiveData.SOS=sosTxt;
|
2025-09-17 15:21:20 +08:00
|
|
|
|
|
|
|
|
this.setBleFormData(receiveData,f);
|
|
|
|
|
console.log("recArr=",recArr);
|
|
|
|
|
let recCnt=recArr.find(v=>{
|
|
|
|
|
return v.key == f.device.detailPageUrl;
|
|
|
|
|
});
|
|
|
|
|
if(!recCnt){
|
|
|
|
|
if (this.formData.staticWarn) { //有静止报警
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title:"警告",
|
|
|
|
|
content:"设备静止报警中",
|
|
|
|
|
showCancel:false
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-08-27 10:32:13 +08:00
|
|
|
} catch(error) {
|
|
|
|
|
console.log('数据解析错误:', error);
|
|
|
|
|
}
|
2025-08-28 14:05:06 +08:00
|
|
|
// console.log("todo");
|
2025-08-27 10:32:13 +08:00
|
|
|
} else {
|
|
|
|
|
try {
|
|
|
|
|
let uint8Array = new Uint8Array(receive.value);
|
|
|
|
|
let str = '';
|
|
|
|
|
for (let i = 0; i < uint8Array.length; i++) {
|
|
|
|
|
// 将每个字节转换为对应的字符
|
|
|
|
|
str += String.fromCharCode(uint8Array[i]);
|
|
|
|
|
}
|
|
|
|
|
if (str.indexOf('mac address:') == 0) {
|
|
|
|
|
receiveData.macAddress = str.split(':').slice(1).join(":");
|
|
|
|
|
console.log('收到mac地址:', +this.receiveData.macAddress);
|
|
|
|
|
} else if (str.indexOf('imei:') == 0) {
|
|
|
|
|
receiveData.imei = str.split(':')[1];
|
|
|
|
|
console.log('收到IEMI:', +this.receiveData.macAddress);
|
|
|
|
|
|
|
|
|
|
} else if (str.indexOf('longitude:') == 0) {
|
|
|
|
|
receiveData.Lon = str.split(':')[1];
|
|
|
|
|
console.log('收到经度:', +this.receiveData.macAddress);
|
|
|
|
|
} else if (str.indexOf('latitude:') == 0) {
|
|
|
|
|
receiveData.Lat = str.split(':')[1];
|
|
|
|
|
console.log('收到纬度:', +this.receiveData.macAddress);
|
|
|
|
|
} else {
|
|
|
|
|
try {
|
2025-08-28 14:05:06 +08:00
|
|
|
// console.log("str=",str);
|
2025-08-27 10:32:13 +08:00
|
|
|
let json=JSON.parse(str);
|
|
|
|
|
if("staBlue_picture" in json){
|
|
|
|
|
//重发图片
|
|
|
|
|
console.log("收到重新发送图片的命令");
|
|
|
|
|
receiveData=json;
|
|
|
|
|
}
|
|
|
|
|
else if("staBlue_text" in json){
|
|
|
|
|
//重发文本
|
|
|
|
|
console.log("收到重新发送文本的命令");
|
|
|
|
|
receiveData=json;
|
|
|
|
|
}
|
|
|
|
|
else if("staBlue_vidio" in json){
|
|
|
|
|
//重发视频
|
|
|
|
|
console.log("收到重新发送视频的命令");
|
|
|
|
|
receiveData=json;
|
|
|
|
|
}
|
|
|
|
|
else if("staBlue" in json){
|
|
|
|
|
if(json.staBlue=="finish"){
|
|
|
|
|
console.log("收到设备回复,全部传输完成");
|
|
|
|
|
receiveData=json;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
receiveData={};
|
|
|
|
|
console.log("无法解析该文本");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
receiveData={};
|
2025-08-28 14:05:06 +08:00
|
|
|
// console.log("文本解析失败",error)
|
2025-08-27 10:32:13 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch(ex) {
|
|
|
|
|
receiveData={};
|
|
|
|
|
console.log('将数据转文本失败', ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-08-28 14:05:06 +08:00
|
|
|
// console.log("todo",receiveData);
|
2025-08-27 10:32:13 +08:00
|
|
|
this.setBleFormData(receiveData,f);
|
|
|
|
|
return receiveData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let data=todo(receive.bytes);
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
}
|
2025-09-17 15:21:20 +08:00
|
|
|
Receive_6155(receive,f,path,recArr) {
|
2025-09-16 14:51:23 +08:00
|
|
|
let bytes=receive.bytes;
|
|
|
|
|
if (bytes[0] == 0xFB && bytes[1] == 0x64 && bytes.length >= 8) {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
let staticLevelByte = bytes[2];
|
|
|
|
|
let getName = function(type) {
|
|
|
|
|
let name = "";
|
|
|
|
|
switch (type) {
|
|
|
|
|
case 0x02:
|
|
|
|
|
name = '弱光';
|
|
|
|
|
break;
|
|
|
|
|
case 0x04:
|
|
|
|
|
name = '工作光';
|
|
|
|
|
break;
|
|
|
|
|
case 0x01:
|
|
|
|
|
name = '强光';
|
|
|
|
|
break;
|
|
|
|
|
case 0x03:
|
|
|
|
|
name = '爆闪';
|
|
|
|
|
break;
|
|
|
|
|
case 0x00:
|
|
|
|
|
name = '关闭';
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return name;
|
|
|
|
|
}
|
|
|
|
|
let staticLevelText = getName(staticLevelByte);
|
|
|
|
|
|
|
|
|
|
// 解析照明档位
|
|
|
|
|
let lightingLevelByte = bytes[3];
|
|
|
|
|
let lightingLevelText = getName(lightingLevelByte);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 解析剩余电量
|
|
|
|
|
let batteryLevelByte = bytes[4];
|
|
|
|
|
// 电量百分比范围检查
|
|
|
|
|
let batteryLevel = Math.max(0, Math.min(100, batteryLevelByte));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//充电状态
|
|
|
|
|
let warn = bytes[5];
|
|
|
|
|
if (warn == 0x00) {
|
|
|
|
|
warn = '未充电';
|
|
|
|
|
} else if (warn == 0x01) {
|
|
|
|
|
warn = '充电中';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 解析剩余照明时间(第三和第四字节,小端序)
|
|
|
|
|
let lightingTime = "";
|
|
|
|
|
let HH = Math.max(0, Math.min(100, bytes[6]));
|
|
|
|
|
let mm = Math.max(0, Math.min(100, bytes[7]));
|
|
|
|
|
lightingTime = HH + "小时" + mm + "分钟";
|
|
|
|
|
let formData={};
|
|
|
|
|
formData.mode = staticLevelText;
|
|
|
|
|
formData.fuMode = lightingLevelText;
|
|
|
|
|
formData.battary = batteryLevel;
|
|
|
|
|
formData.statu = warn;
|
|
|
|
|
formData.xuhang = lightingTime;
|
|
|
|
|
|
|
|
|
|
if (batteryLevel <= 20) {
|
|
|
|
|
uni.showModal({
|
|
|
|
|
content:"设备电量低",
|
|
|
|
|
title:"提示"
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.setBleFormData(formData,f);
|
|
|
|
|
return formData;
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.log('数据解析错误:', error);
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-08-27 10:32:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let receiveInstance = null;
|
|
|
|
|
export default {
|
|
|
|
|
getBleReceive: function(found, receive) {
|
|
|
|
|
if (!receiveInstance) {
|
|
|
|
|
receiveInstance = new BleReceive();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return receiveInstance;
|
|
|
|
|
}
|
|
|
|
|
}
|