监视中开门及音频的处理

This commit is contained in:
Daisy 2024-01-09 11:36:51 +08:00
parent 0c21aebf9b
commit b107e19f69
3 changed files with 30 additions and 4 deletions

View File

@ -127,7 +127,7 @@ class RealTimePictureLogic extends BaseGetXController {
}
///
udpOpenDoorAction() async {
udpOpenDoorAction(List<int> list) async {
UDPSenderManage.sendMainProtocol(
command: 152,
commandTypeIsCalling: 1,
@ -136,7 +136,7 @@ class RealTimePictureLogic extends BaseGetXController {
lockIP: UDPManage().host,
userMobile: await state.userMobile,
userMobileIP: await state.userMobileIP,
endData: []);
endData: list);
Get.back();
}

View File

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -194,6 +195,8 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
//
Obx(() => bottomBtnItemWidget(
getAnswerBtnImg(), getAnswerBtnName(), Colors.white, () async {
Toast.show(msg: "监视中无音频");
/*
//
await logic.getPermissionStatus().then((value) async {
if (!value) {
@ -205,7 +208,9 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
//
logic.udpAnswerAction();
});
*/
}, longPress: () {
/*
//
print("onLongPress");
state.listAudioData.value = <int>[];
@ -214,12 +219,15 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
}
// logic.readG711Data();
logic.startProcessing();
*/
}, longPressUp: () async {
/*
//
print("onLongPressUp");
if (state.udpStatus.value == 9) {
state.udpStatus.value = 8;
}
*/
})),
bottomBtnItemWidget(
"images/main/icon_lockDetail_hangUp.png", "挂断", Colors.red, () async {
@ -229,7 +237,10 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
}),
bottomBtnItemWidget("images/main/icon_lockDetail_monitoringUnlock.png",
"开锁", AppColors.mainColor, () {
Toast.show(msg: "监视中暂不能开锁");
/*
showDeletPasswordAlertDialog(context);
*/
})
]);
}
@ -308,8 +319,18 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
return;
}
// List<int> numbers = state.passwordTF.text.split('').map((char) => int.parse(char)).toList();
//
logic.udpOpenDoorAction();
// lockID
List<int> numbers = [];
List<int> lockIDData = utf8.encode(state.passwordTF.text);
numbers.addAll(lockIDData);
// topBytes = getFixedLengthList(lockIDData, 20 - lockIDData.length);
for (int i = 0; i < 6 - lockIDData.length; i++) {
numbers.add(0);
}
print("numbersnumbersnumbers:$numbers");
logic.udpOpenDoorAction(numbers);
},
cancelClick: () {
Get.back();

View File

@ -183,7 +183,11 @@ class CommandUDPReciverManager {
//
if ((data[7] & 0x3) == 2) {
print("开门成功");
} else {}
Toast.show(msg: "开门成功");
} else {
print("开门失败");
Toast.show(msg: "开门失败");
}
}
break;
case 30:
@ -196,6 +200,7 @@ class CommandUDPReciverManager {
//
print("结束监视反馈");
}
Toast.show(msg: "对方已结束监视");
UDPTalkClass().status = 0;
UDPTalkClass().isBeCall = false;
UDPTalkClass().stopLocalAudio();