1
0
forked from dyf/APP

修复蓝牙连接锁未释放的问题

This commit is contained in:
liub
2026-04-30 11:23:28 +08:00
parent 677586e51c
commit 6d9df4c945
24 changed files with 1225 additions and 759 deletions

View File

@ -15,6 +15,7 @@ import {
showPop
} from '@/utils/MsgPops.js';
import Common from '@/utils/Common.js';
import api from '@/api/670/HBY670.js'
class SendBatchData {
@ -48,6 +49,7 @@ class SendBatchData {
console.log("开始发送分片数据");
return new Promise((resolve, reject) => {
if (f) {
ble.data.voiceUploading=true;
// 总数据包数
var totalPackets = 1536; //36;
@ -62,6 +64,7 @@ class SendBatchData {
const sendNextVideoPacket = () => {
// console.log("准备发送一段数据");
if (currentPacket > totalPackets) {
ble.data.voiceUploading=false;
if (!ReSendNo) {
setTimeout(() => {
@ -149,7 +152,7 @@ class SendBatchData {
currentPacket);
setTimeout(sendNextVideoPacket, 800);
} else {
ble.data.voiceUploading=false;
hideLoading(these);
showPop({
@ -191,7 +194,7 @@ class SendBatchData {
ble.sendString(f.deviceId, "video transmit start", f
.writeServiceId, f.wirteCharactId).then(res => {
ble.data.voiceUploading=true;
setTimeout(() => {
console.log("握手成功了");
resolve(true);
@ -652,6 +655,14 @@ class SendBatchData {
if (combinedData.length === curr - 1) {
setTimeout(() => {
holdHand('transmit complete', 200).then(res => {
let json = {
deviceId: these.device.id,
name: these.formData.usrname,
position: these.formData.job,
unitName: these.formData.company,
code: these.formData.usrid
};
api.sendUsr(json);
MsgSuccess("人员信息发送成功", "确定", these);
hideLoading(these);
these.setBleFormData();
@ -738,6 +749,11 @@ class SendBatchData {
});
}
SendMsg(){
}
}
export default SendBatchData;