From 2c94fb9310a2897fc26d7e00489d3e955dc8e6c5 Mon Sep 17 00:00:00 2001 From: Daisy <> Date: Mon, 8 Jan 2024 11:25:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=B9=E8=AE=B2?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E7=AC=AC=E4=BA=8C=E6=AC=A1=E5=8D=A1=E9=A1=BF?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitoring/lockMonitoring_logic.dart | 1 + .../monitoring/lockMonitoring_state.dart | 6 ++--- star_lock/lib/talk/call/callTalk.dart | 23 +++++++++++++------ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_logic.dart b/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_logic.dart index e14baf60..f732a2d4 100644 --- a/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_logic.dart +++ b/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_logic.dart @@ -406,5 +406,6 @@ class LockMonitoringLogic extends BaseGetXController { state.oneMinuteTimeTimer.cancel(); } stopProcessing(); + state.listData.value = Uint8List(0); } } diff --git a/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_state.dart b/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_state.dart index 1e3bec11..f0018324 100644 --- a/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_state.dart +++ b/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_state.dart @@ -24,9 +24,9 @@ class LockMonitoringState { late final VoiceProcessor? voiceProcessor; - - late Timer oneMinuteTimeTimer;// 定时器超过60秒关闭当前界面 - var oneMinuteTime = 0.obs;// 定时器秒数 + late Timer oneMinuteTimeTimer = + Timer(const Duration(seconds: 1), () {}); // 定时器超过60秒关闭当前界面 + var oneMinuteTime = 0.obs; // 定时器秒数 // 定时器如果发送了接听的命令 而没收到回复就每秒重复发送10次 late Timer answerTimer; diff --git a/star_lock/lib/talk/call/callTalk.dart b/star_lock/lib/talk/call/callTalk.dart index 9316a486..f8a260af 100644 --- a/star_lock/lib/talk/call/callTalk.dart +++ b/star_lock/lib/talk/call/callTalk.dart @@ -41,6 +41,7 @@ class CallTalk { Future getAVData(Uint8List bb, int len) async { // 音频数据 if (bb[61] == 1) { + // print('音频数据来了'); Uint8List g711Data = bb.sublist(77, bb.length); List pcmBytes; @@ -62,6 +63,7 @@ class CallTalk { } // 视频数据 else { + // print('********视频数据来了'); // 音视频数据开始下标 var bagLen = bb[POS_blen + 2] + bb[POS_blen + 3] * 256; // print('音视频数据开始下标 bagLen:$bagLen'); @@ -69,7 +71,7 @@ class CallTalk { // 获取帧序号 63 int getIframeIndex = bb[POS_iframe_index] + bb[POS_iframe_index + 1] * 256; - // print('获取帧序号 getIframeIndex:$getIframeIndex'); + print('获取帧序号 getIframeIndex:$getIframeIndex'); // 获取帧长度 65 // int alen = bb[POS_alen] & 0xff; @@ -82,10 +84,10 @@ class CallTalk { // 当前包号 71 int getBagIndex = bb[POS_bag_index] & 0xff; - // print('当前包号 getBagIndex:$getBagIndex'); + print('当前包号 getBagIndex:$getBagIndex'); // 总包数 69 int getBagNum = bb[POS_bag_num] & 0xff; - // print('总包数 getBagNum:$getBagNum'); + print('总包数 getBagNum:$getBagNum'); // 数据长度 73 int blen = bb[POS_blen] + bb[POS_blen + 1] * 256; // print('数据长度 blen:$blen'); @@ -114,10 +116,11 @@ class CallTalk { // print('播放第${iframe!.iframeIndex}帧 一帧图片的hexStringData: ${Uint8List.fromList(growableList)}'); //判断第一帧是否接收到 - if (iframe!.iframeIndex == 0) { - getFirstFrame = true; - eventBus.fire(GetFirstFrameGoPush(getFirstFrame)); - } + // if (iframe!.iframeIndex == 0) { + // print('得到第一帧了么'); + // getFirstFrame = true; + // eventBus.fire(GetFirstFrameGoPush(getFirstFrame)); + // } eventBus.fire(GetTVDataRefreshUI(growableList)); } @@ -157,5 +160,11 @@ class CallTalk { FlutterPcmSound.pause(); FlutterPcmSound.clear(); FlutterPcmSound.stop(); + + iframe = IframeInfo(); + iframe!.iframeIndex = 0; + iframe!.bagNum = 0; + iframe!.bagReceive = 0; + growableList = []; } } From 8957756a0f5dac8324374564a4a79bdbdaaa926e Mon Sep 17 00:00:00 2001 From: Daisy <> Date: Mon, 8 Jan 2024 11:28:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=9B=91=E8=A7=86=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lockDetail/lockDetail_page.dart | 120 ++++++++++-------- .../realTimePicture_logic.dart | 7 +- .../realTimePicture/realTimePicture_page.dart | 52 ++++++-- .../realTimePicture_state.dart | 8 +- star_lock/lib/network/api.dart | 40 ++++-- star_lock/lib/talk/udp/udp_reciverData.dart | 11 +- 6 files changed, 148 insertions(+), 90 deletions(-) diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart index 46528b51..2835f48e 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -26,7 +26,8 @@ class LockDetailPage extends StatefulWidget { State createState() => _LockDetailPageState(); } -class _LockDetailPageState extends State with TickerProviderStateMixin, RouteAware { +class _LockDetailPageState extends State + with TickerProviderStateMixin, RouteAware { // with RouteAware final logic = Get.put(LockDetailLogic()); final state = Get.find().state; @@ -41,22 +42,27 @@ class _LockDetailPageState extends State with TickerProviderStat state.lockUserNo = state.keyInfos.value.lockUserNo!; state.senderUserId = state.keyInfos.value.senderUserId!; state.isAttendance.value = state.keyInfos.value.lockSetting!.attendance!; - state.isOpenLockNeedOnline.value = state.keyInfos.value.lockSetting!.appUnlockOnline!; + state.isOpenLockNeedOnline.value = + state.keyInfos.value.lockSetting!.appUnlockOnline!; state.electricQuantity.value = state.keyInfos.value.electricQuantity!; - BlueManage().connectDeviceName = state.keyInfos.value.bluetooth!.bluetoothDeviceName!; + BlueManage().connectDeviceName = + state.keyInfos.value.bluetooth!.bluetoothDeviceName!; - List publicKeyData = state.keyInfos.value.bluetooth!.publicKey!.cast(); + List publicKeyData = + state.keyInfos.value.bluetooth!.publicKey!.cast(); var saveStrList = changeIntListToStringList(publicKeyData); Storage.setStringList(saveBluePublicKey, saveStrList); // 私钥 - List privateKeyData = state.keyInfos.value.bluetooth!.privateKey!.cast(); + List privateKeyData = + state.keyInfos.value.bluetooth!.privateKey!.cast(); var savePrivateKeyList = changeIntListToStringList(privateKeyData); Storage.setStringList(saveBluePrivateKey, savePrivateKeyList); // signKey - List signKeyData = state.keyInfos.value.bluetooth!.signKey!.cast(); + List signKeyData = + state.keyInfos.value.bluetooth!.signKey!.cast(); var saveSignKeyList = changeIntListToStringList(signKeyData); Storage.setStringList(saveBlueSignKey, saveSignKeyList); @@ -74,10 +80,7 @@ class _LockDetailPageState extends State with TickerProviderStat height: 1.sh - ScreenUtil().statusBarHeight * 2, color: Colors.white, child: Column( - children: [ - topWidget(), - Expanded(child: Obx(() => bottomWidget())) - ], + children: [topWidget(), Expanded(child: Obx(() => bottomWidget()))], ), ); } @@ -93,20 +96,27 @@ class _LockDetailPageState extends State with TickerProviderStat SizedBox( width: 1.sw - 120.w * 2, child: Center( - child: - Text(widget.lockListInfoItemEntity.lockAlias!, style: TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w400), + child: Text( + widget.lockListInfoItemEntity.lockAlias!, + style: + TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w400), ))), Positioned( child: Obx(() => Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Text("${state.electricQuantity.value}%", style: TextStyle(fontSize: 18.sp, color: AppColors.darkGrayTextColor)), - SizedBox(width: 2.w), - Image.asset(showElectricIcon(state.electricQuantity.value), width: 30.w, height: 24.w), - SizedBox(width: 30.w), - ], - )) - ) + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text("${state.electricQuantity.value}%", + style: TextStyle( + fontSize: 18.sp, + color: AppColors.darkGrayTextColor)), + SizedBox(width: 2.w), + Image.asset( + showElectricIcon(state.electricQuantity.value), + width: 30.w, + height: 24.w), + SizedBox(width: 30.w), + ], + ))) ], ), SizedBox(height: 30.h), @@ -118,7 +128,7 @@ class _LockDetailPageState extends State with TickerProviderStat children: [ Center( child: GestureDetector( - child: Obx(() => Stack( + child: Obx(() => Stack( children: [ Image.asset( // state.connectState.value == 0 ? 'images/main/icon_main_openLockBtn_grey.png' : 'images/main/icon_main_openLockBtn_center.png', @@ -136,14 +146,14 @@ class _LockDetailPageState extends State with TickerProviderStat )), ], )), - onTap: () { - // Get.log("点击开锁"); - logic.startOpenLock(); - }, - onLongPressStart: (details) { - Get.log("长按开锁"); - // logic.startConnect(); - }, + onTap: () { + // Get.log("点击开锁"); + logic.startOpenLock(); + }, + onLongPressStart: (details) { + Get.log("长按开锁"); + // logic.startConnect(); + }, )), ], ), @@ -196,7 +206,9 @@ class _LockDetailPageState extends State with TickerProviderStat Text( state.keyInfos.value.isLockOwner == 1 ? TranslationLoader.lanKeys!.superAdmin!.tr - : (state.keyInfos.value.keyRight == 1 ? TranslationLoader.lanKeys!.authorizedAdmin!.tr: TranslationLoader.lanKeys!.normalUser!.tr), + : (state.keyInfos.value.keyRight == 1 + ? TranslationLoader.lanKeys!.authorizedAdmin!.tr + : TranslationLoader.lanKeys!.normalUser!.tr), style: TextStyle( fontSize: 20.sp, color: AppColors.darkGrayTextColor), ), @@ -272,11 +284,12 @@ class _LockDetailPageState extends State with TickerProviderStat } // 根据权限显示不同的底部按钮 - List getBottomWidget(){ - if(state.keyInfos.value.isLockOwner == 1 || state.keyInfos.value.keyRight == 1){ + List getBottomWidget() { + if (state.keyInfos.value.isLockOwner == 1 || + state.keyInfos.value.keyRight == 1) { // 超级管理员、授权管理员 return getAllWidget(); - }else{ + } else { return getNormalWidget(); } } @@ -287,12 +300,14 @@ class _LockDetailPageState extends State with TickerProviderStat // 操作记录 bottomItem('images/main/icon_main_operatingRecord.png', TranslationLoader.lanKeys!.operatingRecord!.tr, () { - Get.toNamed(Routers.lockOperatingRecordPage, - arguments: {"keyInfo": widget.lockListInfoItemEntity}); - }), + Get.toNamed(Routers.lockOperatingRecordPage, + arguments: {"keyInfo": widget.lockListInfoItemEntity}); + }), // 设置 - bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, () { + bottomItem( + 'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, + () { // BlueManage().stopScan(); Get.toNamed(Routers.lockSetPage, arguments: {"lockId": widget.lockListInfoItemEntity.lockId}); @@ -358,7 +373,8 @@ class _LockDetailPageState extends State with TickerProviderStat //可视对讲门锁新增->人脸 if (state.keyInfos.value.lockFeature!.d3Face == 1) { showWidgetArr.add( - bottomItem('images/main/icon_face.png', TranslationLoader.lanKeys!.humanFace!.tr, () { + bottomItem('images/main/icon_face.png', + TranslationLoader.lanKeys!.humanFace!.tr, () { Get.toNamed(Routers.faceList, arguments: { "lockId": widget.lockListInfoItemEntity.lockId, }); // Toast.show(msg: "功能暂未开放"); @@ -377,7 +393,7 @@ class _LockDetailPageState extends State with TickerProviderStat bottomItem('images/main/icon_catEyes.png', TranslationLoader.lanKeys!.monitoring!.tr, () { Get.toNamed(Routers.realTimePicturePage, arguments: { - "lockId": widget.lockListInfoItemEntity.lockId, + "lockName": widget.lockListInfoItemEntity.lockName, "isMonitoring": true }); }), @@ -398,16 +414,20 @@ class _LockDetailPageState extends State with TickerProviderStat arguments: {"keyInfo": widget.lockListInfoItemEntity}); }), // 视频日志 - bottomItem('images/main/icon_lockDetail_videoLog.png', TranslationLoader.lanKeys!.videoLog!.tr, () { + bottomItem('images/main/icon_lockDetail_videoLog.png', + TranslationLoader.lanKeys!.videoLog!.tr, () { //视频日志 Get.toNamed(Routers.videoLogPage); }), // 消息提醒 - bottomItem('images/main/icon_lockDetail_messageReminding.png', TranslationLoader.lanKeys!.messageReminding!.tr, () { + bottomItem('images/main/icon_lockDetail_messageReminding.png', + TranslationLoader.lanKeys!.messageReminding!.tr, () { Get.toNamed(Routers.msgNotificationPage); }), // 设置 - bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, () { + bottomItem( + 'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, + () { // BlueManage().stopScan(); Get.toNamed(Routers.lockSetPage, arguments: {"lockId": widget.lockListInfoItemEntity.lockId}); @@ -466,16 +486,16 @@ class _LockDetailPageState extends State with TickerProviderStat // logic.connectBlueAndAnimationController(); } - String showElectricIcon (int electricnumber){ - if(electricnumber >= 100){ + String showElectricIcon(int electricnumber) { + if (electricnumber >= 100) { return 'images/main/icon_lockElectricLevel_5.png'; - }else if((electricnumber > 50) && (electricnumber < 100)){ + } else if ((electricnumber > 50) && (electricnumber < 100)) { return 'images/main/icon_lockElectricLevel_4.png'; - }else if((electricnumber > 25) && (electricnumber <= 50)){ + } else if ((electricnumber > 25) && (electricnumber <= 50)) { return 'images/main/icon_lockElectricLevel_3.png'; - }else if((electricnumber > 5) && (electricnumber <= 25)){ + } else if ((electricnumber > 5) && (electricnumber <= 25)) { return 'images/main/icon_lockElectricLevel_2.png'; - }else if(electricnumber <= 5){ + } else if (electricnumber <= 5) { return 'images/main/icon_lockElectricLevel_1.png'; } return 'images/main/icon_lockElectricLevel_5.png'; @@ -612,6 +632,4 @@ class _LockDetailPageState extends State with TickerProviderStat state.animationController.reset(); state.animationController.forward(); } - } - diff --git a/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_logic.dart b/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_logic.dart index 452e1de1..b07d7a04 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_logic.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_logic.dart @@ -58,7 +58,7 @@ class RealTimePictureLogic extends BaseGetXController { command: 150, commandTypeIsCalling: 1, subCommand: 30, - lockID: state.getLockID.value, + lockID: state.getLockName.value, lockIP: UDPManage().host, userMobile: await state.userMobile, userMobileIP: await state.userMobileIP, @@ -79,7 +79,7 @@ class RealTimePictureLogic extends BaseGetXController { command: 152, commandTypeIsCalling: 1, subCommand: 20, - lockID: state.getLockID.value, + lockID: state.getLockName.value, lockIP: UDPManage().host, userMobile: await state.userMobile, userMobileIP: await state.userMobileIP, @@ -92,11 +92,12 @@ class RealTimePictureLogic extends BaseGetXController { command: 152, commandTypeIsCalling: 1, subCommand: 1, - lockID: state.getLockID.value, + lockID: state.getLockName.value, lockIP: UDPManage().host, userMobile: await state.userMobile, userMobileIP: await state.userMobileIP, endData: []); + // print('得到lockName------${state.getLockName.value}'); } /// 接听 diff --git a/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_page.dart b/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_page.dart index 95663ece..14d0729d 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_page.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_page.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -40,12 +42,24 @@ class _RealTimePicturePageState extends State } }); - // 延迟10秒后自动暂停动画 - Future.delayed(const Duration(seconds: 10), () { - state.animationController.stop(); - }); + initiateUdpMonitorAction(); + } - logic.udpMonitorAction(); +//发起监视命令,每隔一秒钟发一次,三十秒无应答则失败 + void initiateUdpMonitorAction() { + // 每隔一秒调用一次 udpMonitorAction 方法 + state.realTimePicTimer = + Timer.periodic(const Duration(seconds: 1), (timer) { + state.elapsedSeconds++; + logic.udpMonitorAction(); + + // 检查条件,如果达到30秒且未得到应答,则认为失败 + if (state.elapsedSeconds >= 30) { + state.realTimePicTimer.cancel(); // 取消定时器 + + _handleFailure(); + } + }); } @override @@ -70,12 +84,14 @@ class _RealTimePicturePageState extends State height: 1.sh, fit: BoxFit.cover, )), - Positioned( - bottom: 300.h, - child: Text( - '正在创建安全连接...', - style: TextStyle(color: Colors.black, fontSize: 26.sp), - )), + Obx(() => state.listData.value.isEmpty + ? Positioned( + bottom: 300.h, + child: Text( + '正在创建安全连接...', + style: TextStyle(color: Colors.black, fontSize: 26.sp), + )) + : Container()), Positioned( bottom: 10.w, child: Container( @@ -95,7 +111,9 @@ class _RealTimePicturePageState extends State ], ), )), - buildRotationTransition() + Obx(() => state.listData.value.isEmpty + ? buildRotationTransition() + : Container()) ], ), ); @@ -193,10 +211,9 @@ class _RealTimePicturePageState extends State })), bottomBtnItemWidget( "images/main/icon_lockDetail_hangUp.png", "挂断", Colors.red, () async { - logic.stopProcessing(); - CallTalk().stopPcmSound(); // 挂断 logic.udpHangUpAction(); + Get.back(); }), bottomBtnItemWidget("images/main/icon_lockDetail_monitoringUnlock.png", "开锁", AppColors.mainColor, () { @@ -314,11 +331,18 @@ class _RealTimePicturePageState extends State ), onTap: () { state.animationController.forward(); + initiateUdpMonitorAction(); }, ), ); } + void _handleFailure() { + // 在这里处理失败的逻辑 + print('Failed to get response within 30 seconds.'); + state.animationController.stop(); + } + @override void dispose() { state.animationController.dispose(); diff --git a/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_state.dart b/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_state.dart index c8da8ff5..ef27a9e9 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_state.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/realTimePicture/realTimePicture_state.dart @@ -29,7 +29,7 @@ class RealTimePictureState { Timer(const Duration(seconds: 1), () {}); // 定时器超过60秒关闭当前界面 var oneMinuteTime = 0.obs; // 定时器秒数 - var getLockID = ''.obs; //lockID + var getLockName = ''.obs; //lockName // 定时器如果发送了接听的命令 而没收到回复就每秒重复发送10次 late Timer answerTimer; @@ -37,7 +37,11 @@ class RealTimePictureState { late Timer openDoorTimer; late AnimationController animationController; + late Timer realTimePicTimer = + Timer(const Duration(seconds: 1), () {}); //监视命令定时器 + var elapsedSeconds = 0.obs; + RealTimePictureState() { - getLockID.value = Get.arguments["lockId"].toString(); + getLockName.value = Get.arguments["lockName"].toString(); } } diff --git a/star_lock/lib/network/api.dart b/star_lock/lib/network/api.dart index b6ea9a69..e8810a25 100644 --- a/star_lock/lib/network/api.dart +++ b/star_lock/lib/network/api.dart @@ -1,6 +1,6 @@ abstract class Api { - static String baseAddress = "https://pre.lock.star-lock.cn:8093"; //预发布环境 - // static String baseAddress = "http://192.168.56.101:8099"; //联调环境 + // static String baseAddress = "https://pre.lock.star-lock.cn:8093"; //预发布环境 + static String baseAddress = "http://192.168.56.101:8099"; //联调环境 // static String baseAddress = "http://192.168.1.15:8022"; //谢总本地 final String baseUrl = "$baseAddress/api"; @@ -27,7 +27,8 @@ abstract class Api { '/room/uploadElectricQuantity'; //锁电量更新 final String lockRecordUploadURL = '/lockRecords/fromLock'; //操作上传 - final String getLockRecordLastUploadDataTimeURL = '/lockRecords/getLastRecordTime'; //查询锁记录最后时间 + final String getLockRecordLastUploadDataTimeURL = + '/lockRecords/getLastRecordTime'; //查询锁记录最后时间 final String getLockNetTokenURL = '/lock/getLockNetToken'; //获取手机联网token final String updateLockUserNoURL = '/key/updateLockUserNo'; //更新锁用户NO @@ -60,12 +61,14 @@ abstract class Api { final String lockGroupAddLockURL = '/keyGroup/addLockGroup'; //锁分组里面添加锁 final String lockGroupDeletLockURL = '/keyGroup/deleteLockGroup'; //锁分组里面删除锁 - final String listLockByGroupURL = '/authorizedAdmin/listLockByGroup'; //获取分组下的锁列表 + final String listLockByGroupURL = + '/authorizedAdmin/listLockByGroup'; //获取分组下的锁列表 final String setRoomStatusURL = '/lock/updateLockStatus'; //标记房态 // final String keyGroupListURL = '/keyGroup/list'; //分组列表 // final String lockListByGroupURL = '/room/listByGroup'; //分组下的锁 final String getWifiServiceIpURL = '/wifiLock/getWifiServiceIp'; // 获取Wifi锁服务器 - final String updateLockSettingUrl = '/lockSetting/updateLockSetting'; // 锁设置里面所有的设置 + final String updateLockSettingUrl = + '/lockSetting/updateLockSetting'; // 锁设置里面所有的设置 final String roomQueryDateUrl = '/room/queryDate'; // 获取网关时间 final String lockDiagnoseUrl = '/room/uploadLockInfo'; // 锁诊断 @@ -76,12 +79,18 @@ abstract class Api { final String setCheckInCreateCompanyURL = '/attendanceCompany/add'; // 设置考勤时创建公司 - final String getAttendanceRecordListByDateURL = '/attendanceRecord/listByDate'; // 获取考勤列表-早到榜日榜 - final String getAttendanceRecordListByMonthURL = '/attendanceRecord/earlyListByMonth'; // 获取考勤列表-早到榜月榜 - final String getAttendanceRecordListLateTimesByDateURL = '/attendanceRecord/lateListByDate'; // 获取考勤列表-迟到榜日榜 - final String getAttendanceRecordListLateTimesByMonthURL = '/attendanceRecord/lateEarlyListByMonth'; // 获取考勤列表-迟到榜月榜 - final String getAttendanceRecordHardworkingListURL = '/attendanceRecord/listForHardworking'; // 获取考勤列表- - final String getAttendanceRecordDtailURL = '/attendanceRecord/listByMonth'; // 获取考勤详情 + final String getAttendanceRecordListByDateURL = + '/attendanceRecord/listByDate'; // 获取考勤列表-早到榜日榜 + final String getAttendanceRecordListByMonthURL = + '/attendanceRecord/earlyListByMonth'; // 获取考勤列表-早到榜月榜 + final String getAttendanceRecordListLateTimesByDateURL = + '/attendanceRecord/lateListByDate'; // 获取考勤列表-迟到榜日榜 + final String getAttendanceRecordListLateTimesByMonthURL = + '/attendanceRecord/lateEarlyListByMonth'; // 获取考勤列表-迟到榜月榜 + final String getAttendanceRecordHardworkingListURL = + '/attendanceRecord/listForHardworking'; // 获取考勤列表- + final String getAttendanceRecordDtailURL = + '/attendanceRecord/listByMonth'; // 获取考勤详情 final String getStaffListURL = '/staff/list'; // 获取员工列表 final String addStaffURL = '/staff/add'; // 添加员工 final String editStaffURL = '/staff/update'; // 编辑员工 @@ -96,20 +105,23 @@ abstract class Api { final String addFingerprintURL = '/fingerprint/add'; // 添加指纹 final String editFingerprintURL = '/fingerprint/changePeriod'; // 编辑指纹 final String deleteFingerprintURL = '/fingerprint/delete'; // 删除指纹 - final String updateFingerprintUserNoURL = '/fingerprint/updateFingerprintUserNo'; // 更新指纹用户序号 + final String updateFingerprintUserNoURL = + '/fingerprint/updateFingerprintUserNo'; // 更新指纹用户序号 final String getICCardListURL = '/identityCard/list'; // IC卡列表 final String addICCardURL = '/identityCard/add'; // 添加IC卡 final String editICCardURL = '/identityCard/update'; // 编辑IC卡 final String deleteICCardURL = '/identityCard/delete'; // 删除IC卡 - final String updateICCardUserNoURL = '/identityCard/updateCardUserNo'; // 更新ic卡用户序号 + final String updateICCardUserNoURL = + '/identityCard/updateCardUserNo'; // 更新ic卡用户序号 final String transferLockListURL = '/room/listForTransfer'; // 转移锁锁列表 final String transferLockConfirmURL = '/room/transferLockConfirm'; // 转移智能锁确认 final String transferLockURL = '/room/transfer'; // 转移智能锁 final String gatewaykListURL = '/plug/list'; // 转网关列表 - final String transferGatewayConfirmURL = '/plug/transferPlugConfirm'; // 转移网关确认 + final String transferGatewayConfirmURL = + '/plug/transferPlugConfirm'; // 转移网关确认 final String transferGatewayURL = '/plug/transfer'; // 转移网关 final String getKeyDetailURL = '/key/get'; //获取单把钥匙详情信息 diff --git a/star_lock/lib/talk/udp/udp_reciverData.dart b/star_lock/lib/talk/udp/udp_reciverData.dart index 99617d3c..7dc73858 100644 --- a/star_lock/lib/talk/udp/udp_reciverData.dart +++ b/star_lock/lib/talk/udp/udp_reciverData.dart @@ -10,8 +10,6 @@ import '../call/callTalk.dart'; import 'udp_talkClass.dart'; class CommandUDPReciverManager { - - static void appDataReceive(List data) async { ///解析数据 if (data.isEmpty) { @@ -33,7 +31,6 @@ class CommandUDPReciverManager { if (data[6] == 4) { if (data[7] == 2) { // print("心跳包反馈 在线状态"); - } else if (data[7] == 3) { [Toast.show(msg: "您已在其他设备登录")]; } @@ -52,7 +49,7 @@ class CommandUDPReciverManager { //被叫 // lockId var lockId = data.sublist(9, 29); - var lockIdStr = utf8String(lockId); + var lockIdStr = utf8String(lockId); UDPManage().lockId = lockIdStr; UDPTalkClass().status = 0; UDPTalkClass().beCallW(data: data); @@ -115,10 +112,10 @@ class CommandUDPReciverManager { } UDPTalkClass().status = 0; UDPTalkClass().isBeCall = false; - Get.back(); UDPTalkClass().stopLocalAudio(); CallTalk().stopPcmSound(); eventBus.fire(GetUDPStatusRefreshUI(UDPTalkClass().status)); + Get.back(); } break; case 140: @@ -164,7 +161,9 @@ class CommandUDPReciverManager { case 8: { //音视频数据 - //print("音视频数据"); + // print("音视频数据"); + CallTalk cllTalk = CallTalk(); + cllTalk.getAVData(data1, data1.length); } break; case 9: