修复蓝牙连接锁未释放的问题
This commit is contained in:
@ -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;
|
||||
Reference in New Issue
Block a user