diff --git a/api/4877/BJQ4877.js b/api/4877/BJQ4877.js new file mode 100644 index 0000000..b380f50 --- /dev/null +++ b/api/4877/BJQ4877.js @@ -0,0 +1,110 @@ +export const colors=[ + { + r: 255, + g: 0, + b: 0, + name: '红色', + hex: '#FF0000', + check: false, + id: 1 + }, + { + r: 0, + g: 0, + b: 255, + name: '蓝色', + hex: '#0000FF', + check: false, + id: 2 + }, + { + r: 0, + g: 255, + b: 0, + name: '绿色', + hex: '#00FF00', + check: false, + id: 3 + }, + { + r: 255, + g: 255, + b: 0, + name: '黄色', + hex: '#FFFF00', + check: false, + id: 4 + }, + { + r: 0, + g: 255, + b: 255, + name: '青色', + hex: '#00FFFF', + check: false, + id: 5 + }, + { + r: 255, + g: 0, + b: 255, + name: '紫红色', + hex: '#FF00FF', + check: false, + id: 6 + }, + { + r: 51, + g: 255, + b: 153, + name: '薄荷绿', + hex: '#33FF99', + check: false, + id: 7 + }, + { + r: 255, + g: 102, + b: 102, + name: '珊瑚红', + hex: '#FF6666', + check: false, + id: 8 + }, + { + r: 153, + g: 255, + b: 0, + name: '柠绿', + hex: '#99FF00', + check: false, + id: 9 + }, + { + r: 128, + g: 0, + b: 128, + name: '紫色', + hex: '#800080', + check: false, + id: 10 + }, + { + r: 204, + g: 102, + b: 255, + name: '淡紫', + hex: '#CC66FF', + check: false, + id: 11 + }, + { + r: 102, + g: 204, + b: 255, + name: '浅蓝', + hex: '#66CCFF', + check: false, + id: 12 + } +] \ No newline at end of file diff --git a/manifest.json b/manifest.json index 7255c9c..7fccadd 100644 --- a/manifest.json +++ b/manifest.json @@ -23,7 +23,8 @@ "Camera" : {}, "Geolocation" : {}, "Maps" : {}, - "Record" : {} + "Record" : {}, + "VideoPlayer" : {} }, /* 应用发布信息 */ "distribute" : { diff --git a/pages.json b/pages.json index ac5614a..017af96 100644 --- a/pages.json +++ b/pages.json @@ -347,6 +347,13 @@ { "navigationBarTitleText" : "选择配组" } + }, + { + "path" : "pages/102/HBY102", + "style" : + { + "navigationBarTitleText" : "HBY102" + } } diff --git a/pages/100/HBY100.vue b/pages/100/HBY100.vue index 9933740..2f0265d 100644 --- a/pages/100/HBY100.vue +++ b/pages/100/HBY100.vue @@ -1118,7 +1118,7 @@ let json = recei.ReceiveData(receive, device, pagePath, recArr); - // console.log("收到设备的数据", json) + console.log("收到设备的数据", json) let key = 'sta_VoiceDate'; if (key in json) { @@ -1126,6 +1126,7 @@ console.log("22222", val) if (val === 'start') { //开始发包 + console.log("开始发送数据"); updateLoading(these, { text: "开始发送" }); diff --git a/pages/102/HBY102.vue b/pages/102/HBY102.vue new file mode 100644 index 0000000..ec3b20e --- /dev/null +++ b/pages/102/HBY102.vue @@ -0,0 +1,1694 @@ + + + + + \ No newline at end of file diff --git a/pages/4877/BJQ4877CheckColor.vue b/pages/4877/BJQ4877CheckColor.vue new file mode 100644 index 0000000..c258f59 --- /dev/null +++ b/pages/4877/BJQ4877CheckColor.vue @@ -0,0 +1,310 @@ + + + + + \ No newline at end of file diff --git a/pages/4877/BJQ4877V1.vue b/pages/4877/BJQ4877V1.vue new file mode 100644 index 0000000..6b197bd --- /dev/null +++ b/pages/4877/BJQ4877V1.vue @@ -0,0 +1,1596 @@ + + + + + \ No newline at end of file diff --git a/pages/6155/deviceDetail.vue b/pages/6155/deviceDetail.vue index 80af6e5..b92c4f6 100644 --- a/pages/6155/deviceDetail.vue +++ b/pages/6155/deviceDetail.vue @@ -617,25 +617,26 @@ var processAndSendImageData = function(pixels) { return new Promise((resolve, reject) => { // 创建RGB565格式的像素数据 + // console.log("pixels=",pixels); const arr = ble.convertToRGB565(pixels, 'bgr'); - + var list = []; let index = 0; // 用于追踪arr的当前位置 - let packetSize = 2048; - let cSize = 248; + let packetSize = 3200; + let cSize = 200; // 外层循环:7个主要元素(i从1到7) - for (let i = 1; i < 8; i++) { + for (let i = 1; i < 9; i++) { let secondLevel = []; let secondCnt = 0; // 中层循环:每个主要元素包含9个子数组(j从1到9) - for (let j = 1; j < 10; j++) { + for (let j = 1; j < 9; j++) { // 确定当前子数组的长度:前8个是254,第9个是64 - + let thirdLevel = []; - + // 从arr中提取相应数量的元素 for (let k = 0; k < cSize && index < arr.length; k++) { - + if (secondCnt == packetSize) { break; } @@ -643,14 +644,14 @@ secondCnt++; index++; } - + secondLevel.push(thirdLevel); } list.push(secondLevel); } - + console.log("list=", list); - + let length = 0; for (let i = 0; i < list.length; i++) { const item = list[i]; @@ -660,8 +661,8 @@ console.log("第" + i + "包,第" + j + "小包,长度:" + element.length) length += element.length; clength += element.length; - - + + } } // 分包发送 @@ -675,118 +676,102 @@ var sendImagePackets = function(imageData) { return new Promise((resolve, reject) => { // 总数据包数 - const totalPackets = 7; + const totalPackets = 8; let currentPacket = 1; let childPacket = 1; - let totalChildPacket = 9; - - + let totalChildPacket = 8; + + // 发送单个数据包 const sendNextPacket = () => { if (currentPacket > totalPackets) { + updateLoading(these,{text:'发送完成,等待设备30秒'}); setTimeout(() => { hideLoading(these); these.Status.BottomMenu.show = false; - + these.showPop({ message: "上传成功", iconUrl: "/static/images/6155/DeviceDetail/uploadSuccess.png", borderColor: '#BBE600', buttonBgColor: '#BBE600' }); - + resolve(); - }, 20000) - + }, 0) + return; } - + var packetData = imageData[currentPacket - 1][childPacket - 1]; - // if (packetData.length == 0) { - // hideLoading(these); - // these.Status.BottomMenu.show = false; - - // these.showPop({ - // message: "上传成功", - // iconUrl: "/static/images/6155/DeviceDetail/uploadSuccess.png" - // }); - - // resolve(); - // return; - // } + console.log("childPacket=", childPacket); + console.log("packetData=", packetData); let start = 0; let bufferSize = packetData.length * 2; - - if (currentPacket == 7) { - if (childPacket > 2 && childPacket < 9) { - bufferSize = 496; - } else if (childPacket == 9) { - bufferSize = 128; - } - } - + + + if (childPacket == 1) { bufferSize = bufferSize + 8 start = 8; } - if (childPacket == 9) { //|| (currentPacket==7 && childPacket==3 + if (childPacket == 8) { //|| (currentPacket==7 && childPacket==3 bufferSize = bufferSize + 1 } - - - //FA 09 10 04 FC 09 [00] [01] + 4096字节+FF 数据格式 + + + //FA 09 0C 84 FB 09 00 [01~08] + 3200字节 +FF 数据格式 var buffer = new ArrayBuffer(bufferSize); var dataView = new DataView(buffer); if (childPacket == 1) { dataView.setUint8(0, 0xFA); // 帧头 dataView.setUint8(1, 0x09); // 帧头 - dataView.setUint8(2, 0x10); // 帧头 - dataView.setUint8(3, 0x04); // 帧头 - dataView.setUint8(4, 0xFC); // 帧头 - dataView.setUint8(5, 0x09); // 帧头 - - dataView.setUint8(6, 0x00); // 图序号,图片固定0,视频的话要写序号 - dataView.setUint8(7, currentPacket); //子包序号 + dataView.setUint8(2, 0x0C); // 帧头 + dataView.setUint8(3, 0x84); // 帧头 + dataView.setUint8(4, 0xFB); // 帧头 + dataView.setUint8(5, 0x09); + dataView.setUint8(6, 0x00); // 帧头 + dataView.setUint8(7, currentPacket); //包序号 } - + for (let i = 0; i < packetData.length; i++) { dataView.setUint16(start + i * 2, packetData[i], false); //本包数据,大端字节序 } console.log("packetData.length=", packetData.length); console.log("bufferSize=", bufferSize) - if (childPacket == 9) { // || (currentPacket==7 && childPacket==3 + if (childPacket == 8) { // || (currentPacket==7 && childPacket==3 dataView.setUint8(bufferSize - 1, 0xFF); } - + //发送数据包 ble.sendData(f.deviceId, buffer, f.writeServiceId, f.wirteCharactId, 30) .then(() => { - + let curr = childPacket + (currentPacket - 1) * totalChildPacket; console.log("第" + currentPacket + "大包,第" + childPacket + "小包发送完成,总计:" + curr); updateLoading(these, { - text: "正在发送" + curr + "/63" - + text: "正在发送" + curr + "/64" + }) - if (childPacket == 9) { + if (childPacket == 8) { currentPacket++; childPacket = 1; } else { childPacket++; } - + setTimeout(sendNextPacket, 100); }).catch(err => { if (err.code == 10007) { setTimeout(sendNextPacket, 100); return; } - + console.log("发送数据包失败了", err); - + these.Status.BottomMenu.show = false; these.showPop({ message: "发送数据包失败了" + err.msg, @@ -794,14 +779,14 @@ borderColor: "#e034344d", buttonBgColor: "#E03434", }); - + hideLoading(these); reject(err); }); } // 开始发送数据 sendNextPacket(); - + }); } diff --git a/pages/common/addBLE/addEquip.vue b/pages/common/addBLE/addEquip.vue index e5ae397..10d08c9 100644 --- a/pages/common/addBLE/addEquip.vue +++ b/pages/common/addBLE/addEquip.vue @@ -386,11 +386,11 @@ Promise.allSettled(promis).finally(() => { ble.StopSearch().finally(res => { - // console.log("停止搜索成功"); + console.log("停止搜索成功"); these.EquipMents = []; these.PairEquip = []; ble.StartSearch().then(result => { - // console.log("开始搜索成功"); + console.log("开始搜索成功"); }).catch(err => { console.error("开始搜索失败,err=", err); if (err.code === 10001) { diff --git a/static/images/102/line.png b/static/images/102/line.png new file mode 100644 index 0000000..2e4ee74 Binary files /dev/null and b/static/images/102/line.png differ diff --git a/static/images/102/lineActive.png b/static/images/102/lineActive.png new file mode 100644 index 0000000..73f7cc9 Binary files /dev/null and b/static/images/102/lineActive.png differ diff --git a/static/images/102/liting.png b/static/images/102/liting.png new file mode 100644 index 0000000..3e4b995 Binary files /dev/null and b/static/images/102/liting.png differ diff --git a/static/images/102/litingActive.png b/static/images/102/litingActive.png new file mode 100644 index 0000000..e9260a5 Binary files /dev/null and b/static/images/102/litingActive.png differ diff --git a/static/images/102/lowFlash.png b/static/images/102/lowFlash.png new file mode 100644 index 0000000..52ab71a Binary files /dev/null and b/static/images/102/lowFlash.png differ diff --git a/static/images/102/lowFlashActive.png b/static/images/102/lowFlashActive.png new file mode 100644 index 0000000..e4cd9fb Binary files /dev/null and b/static/images/102/lowFlashActive.png differ diff --git a/static/images/102/redar.png b/static/images/102/redar.png new file mode 100644 index 0000000..6b6f4f3 Binary files /dev/null and b/static/images/102/redar.png differ diff --git a/static/images/102/redarActive.png b/static/images/102/redarActive.png new file mode 100644 index 0000000..d6839aa Binary files /dev/null and b/static/images/102/redarActive.png differ diff --git a/utils/BleHelper.js b/utils/BleHelper.js index 877b62b..e12692a 100644 --- a/utils/BleHelper.js +++ b/utils/BleHelper.js @@ -510,7 +510,7 @@ class BleHelper { } uni.onBluetoothAdapterStateChange((state) => { - // console.log('蓝牙状态发生变化:' + JSON.stringify(state)); + console.log('蓝牙状态发生变化:' + JSON.stringify(state)); this.data.discovering = state.discovering; if (this.data.available !== state.available) { @@ -632,18 +632,23 @@ class BleHelper { }, 0); }); + console.log("111111111") uni.onBluetoothDeviceFound((res) => { - // console.log("发现新设备:" + JSON.stringify(devices)); + // console.log("发现新设备:" + JSON.stringify(res,'name')); let arr = []; for (var i = 0; i < res.devices.length; i++) { let item = res.devices[i]; + if(item.name){ + console.log("发现新设备",item.name+" "+item.RSSI); + } + let f = serviceDic.find(v => { return item.advertisServiceUUIDs .includes(v.serviceId); }); if (f) { - console.log("发现新设备:", item); + console.log("发现目标设备:", item); arr.push(item); } @@ -788,7 +793,7 @@ class BleHelper { if (isUpdate) { this.updateCache(); } - // console.log("str1=", str); + console.log("str1=", str); } catch (ex) { console.error("将数据转文本失败", ex); } @@ -927,7 +932,7 @@ class BleHelper { services: serviceId ? [serviceId] : [], allowDuplicatesKey: true, success: (res) => { - //console.log('开始搜索蓝牙设备成功'); + console.log('开始搜索蓝牙设备成功'); resolve(res); }, @@ -1888,6 +1893,7 @@ class BleHelper { } + } let instance = null; diff --git a/utils/BleReceive.js b/utils/BleReceive.js index 6f558ac..81cd560 100644 --- a/utils/BleReceive.js +++ b/utils/BleReceive.js @@ -536,7 +536,7 @@ class BleReceive { try { - // console.log("str=",receive.str); + console.log("str=",receive.str); receiveData = JSON.parse(receive.str); let recCnt = recArr.find(v => {