fix:增加对讲时的开锁命令

This commit is contained in:
liyi 2025-01-10 14:47:50 +08:00
parent 50d7ea78d9
commit 63eb726c3b
7 changed files with 507 additions and 27 deletions

View File

@ -1,8 +1,15 @@
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_settings.dart';
import 'package:star_lock/blue/blue_manage.dart';
import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsWithParameters.dart';
import 'package:star_lock/blue/io_tool/io_tool.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/talk/startChart/start_chart_manage.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/storage.dart';
import 'package:star_lock/versionUndate/versionUndate_entity.dart';
import 'catEyeSet_state.dart';
@ -12,57 +19,79 @@ class CatEyeSetLogic extends BaseGetXController {
//
Future<void> updateAutoLightScreenConfig() async {
final VersionUndateEntity entity = await ApiRepository.to.updateAutoLightScreenConfig(
final VersionUndateEntity entity =
await ApiRepository.to.updateAutoLightScreenConfig(
lockId: state.lockSetInfoData.value.lockId!,
autoLightScreen: state.isAutoBright.value == true ? 1 : 0,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast(state.settingSuccess);
state.catEyeConfig.value.autoLightScreen =
state.isAutoBright.value == true ? 1 : 0;
state.catEyeConfig.refresh();
updateCatEyeSetConfig();
}
}
//
Future<void> updateLightScreenTimeConfig() async {
final VersionUndateEntity entity = await ApiRepository.to.updateLightScreenTimeConfig(
final VersionUndateEntity entity =
await ApiRepository.to.updateLightScreenTimeConfig(
lockId: state.lockSetInfoData.value.lockId!,
autoLightScreenTime:
int.parse(state.selectBrightDuration.value.replaceAll(''.tr, '')),
);
if (entity.errorCode!.codeIsSuccessful) {
showToast(state.settingSuccess);
state.catEyeConfig.value.autoLightScreenTime =
int.parse(state.selectBrightDuration.value.replaceAll(''.tr, ''));
state.catEyeConfig.refresh();
updateCatEyeSetConfig();
}
}
//
Future<void> updateStayWarnConfig() async {
final VersionUndateEntity entity = await ApiRepository.to.updateStayWarnConfig(
final VersionUndateEntity entity =
await ApiRepository.to.updateStayWarnConfig(
lockId: state.lockSetInfoData.value.lockId!,
stayWarn: state.isStayWarning.value == true ? 1 : 0,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast(state.settingSuccess);
state.catEyeConfig.value.autoLightScreen =
state.isStayWarning.value == true ? 1 : 0;
state.catEyeConfig.refresh();
updateCatEyeSetConfig();
}
}
//
Future<void> updateAbnormalWarnConfig() async {
final VersionUndateEntity entity = await ApiRepository.to.updateAbnormalWarnConfig(
final VersionUndateEntity entity =
await ApiRepository.to.updateAbnormalWarnConfig(
lockId: state.lockSetInfoData.value.lockId!,
abnormalWarn: state.isExceptionWarning.value == true ? 1 : 0,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast(state.settingSuccess);
state.catEyeConfig.value.autoLightScreen =
state.isExceptionWarning.value == true ? 1 : 0;
state.catEyeConfig.refresh();
updateCatEyeSetConfig();
}
}
//
Future<LockSetInfoEntity> getLockSettingInfoData() async {
final LockSetInfoEntity entity = await ApiRepository.to.getLockSettingInfoData(
final LockSetInfoEntity entity =
await ApiRepository.to.getLockSettingInfoData(
lockId: state.lockSetInfoData.value.lockId.toString(),
);
if (entity.errorCode!.codeIsSuccessful) {
state.lockSetInfoData.value = entity.data!;
state.selectBrightDuration.value = '${state.lockSetInfoData.value.lockSettingInfo!.autoLightScreenTime}${''.tr}'; //
state.selectBrightDuration.value =
'${state.lockSetInfoData.value.lockSettingInfo!.autoLightScreenTime}${''.tr}'; //
if (state.lockSetInfoData.value.lockSettingInfo!.autoLightScreen == 0) {
state.isAutoBright.value = false;
@ -91,6 +120,8 @@ class CatEyeSetLogic extends BaseGetXController {
if (state
.lockSetInfoData.value.lockSettingInfo!.catEyeConfig!.isNotEmpty) {
if (state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0]
.catEyeMode ==
XSConstantMacro.catEyeWorkModePowerSaving) {
@ -108,10 +139,155 @@ class CatEyeSetLogic extends BaseGetXController {
XSConstantMacro.catEyeWorkModeCustom) {
state.selectCatEyeWorkMode.value = '自定义模式'.tr;
}
state.catEyeConfig.value = CatEyeSetEntity(
catEyeMode: state.lockSetInfoData.value.lockSettingInfo!
.catEyeConfig![0].catEyeMode,
recordMode: state.lockSetInfoData.value.lockSettingInfo!
.catEyeConfig![0].catEyeModeConfig?.recordMode,
autoLightScreen:
state.lockSetInfoData.value.lockSettingInfo!.autoLightScreen,
autoLightScreenTime:
state.lockSetInfoData.value.lockSettingInfo!.autoLightScreenTime,
stayWarn: state.lockSetInfoData.value.lockSettingInfo!.stayWarn,
abnormalWarn:
state.lockSetInfoData.value.lockSettingInfo!.abnormalWarn,
);
state.catEyeConfig.refresh();
}
}
return entity;
}
void updateCatEyeSetConfig() async {
final int operatingMode = state.catEyeConfig.value.catEyeMode ?? 1; //
final int isAllDay = state.catEyeConfig.value.recordMode ?? 1; //
final int startTime =
state.catEyeConfig.value.recordStartTime ?? 480; // 8:00 AM
final int endTime =
state.catEyeConfig.value.recordEndTime ?? 1080; // 6:00 PM
final int recordingTime = state.catEyeConfig.value.recordTime ?? 0; //
final int detectionDistance =
state.catEyeConfig.value.detectionDistance ?? 0; //0:0.8
final int realTimePicture =
state.catEyeConfig.value.realTimePicture ?? 0; //
final int automaticBrightening =
state.catEyeConfig.value.autoLightScreen ?? 0; //
final int brightScreenTime =
state.catEyeConfig.value.autoLightScreen ?? 15; // 15
final int stayWarning = state.catEyeConfig.value.stayWarn ?? 1; //
final int exceptionWarning =
state.catEyeConfig.value.abnormalWarn ?? 1; //
/// 0
final List<int> config = generateConfig(
operatingMode: operatingMode,
isAllDay: isAllDay,
startTime: startTime,
endTime: endTime,
recordingTime: recordingTime,
detectionDistance: detectionDistance,
realTimePicture: realTimePicture,
automaticBrightening: automaticBrightening,
brightScreenTime: brightScreenTime,
stayWarning: stayWarning,
exceptionWarning: exceptionWarning,
);
final List<String>? privateKey =
await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
final List<String>? token = await Storage.getStringList(saveBlueToken);
final List<int> getTokenList = changeStringListToIntList(token!);
final List<String>? publicKey =
await Storage.getStringList(saveBluePublicKey);
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
final command = SetSupportFunctionsWithParametersCommand(
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
userID: await Storage.getUid(),
featureBit: 64,
featureParaLength: config.length,
featureData: config,
token: getTokenList,
needAuthor: 1,
publicKey: getPublicKeyList,
privateKey: getPrivateKeyList,
);
final packageData = command.packageData();
// List<int>
String hexString = packageData
.map((byte) => byte.toRadixString(16).padLeft(2, '0'))
.join(' ');
AppLog.log('open lock hexString: $hexString');
///
StartChartManage().sendBleMessage(
bluetoothDeviceName: BlueManage().connectDeviceName,
bleStructData: packageData,
);
}
//
List<int> generateConfig({
required int operatingMode,
required int isAllDay,
required int startTime,
required int endTime,
required int recordingTime,
required int detectionDistance,
required int realTimePicture,
required int automaticBrightening,
required int brightScreenTime,
required int stayWarning,
required int exceptionWarning,
}) {
//
List<int> config = [];
// operatingMode
config.add(operatingMode);
// 0
if (operatingMode != 3) {
config.addAll(
[0, 0, 0, 0]); // IsAllDay, StartTime, EndTime, recordingTime
} else {
config.add(isAllDay);
config.addAll(_intToBytes(startTime, 2)); // StartTime 2
config.addAll(_intToBytes(endTime, 2)); // EndTime 2
config.add(recordingTime);
}
// detectionDistance realTimePicture 0
if (operatingMode != 3) {
config.addAll([0, 0]);
} else {
config.add(detectionDistance);
config.add(realTimePicture);
}
//
config.add(automaticBrightening);
config.add(brightScreenTime);
config.add(stayWarning);
config.add(exceptionWarning);
return config;
}
//
List<int> _intToBytes(int value, int length) {
List<int> bytes = [];
for (int i = length - 1; i >= 0; i--) {
bytes.add((value >> (8 * i)) & 0xFF);
}
return bytes;
}
}

View File

@ -1,9 +1,7 @@
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
class CatEyeSetState {
CatEyeSetState() {
Map map = Get.arguments;
lockSetInfoData.value = map['lockSetInfoData'];
@ -31,7 +29,9 @@ class CatEyeSetState {
}
}
}
RxList<String> brightDurationTimeList = <String>['10${''.tr}', '15${''.tr}', '20${''.tr}'].obs;
RxList<String> brightDurationTimeList =
<String>['10${''.tr}', '15${''.tr}', '20${''.tr}'].obs;
RxString selectBrightDuration = '10 ${''.tr}'.obs; //
RxBool isAutoBright = false.obs; //
RxBool isStayWarning = false.obs; //
@ -39,4 +39,40 @@ class CatEyeSetState {
Rx<LockSetInfoData> lockSetInfoData = LockSetInfoData().obs;
RxString selectCatEyeWorkMode = ''.obs; //
final String settingSuccess = '设置成功'.tr;
///
Rx<CatEyeSetEntity> catEyeConfig = CatEyeSetEntity().obs;
}
class CatEyeSetEntity {
int? catEyeMode; //
int? recordMode; //
int? recordTime; //
int? realTimeMode;
int? recordEndTime;
int? recordStartTime;
int? detectionDistance;
int? autoLightScreen;
int? autoLightScreenTime;
int? stayWarn;
int? abnormalWarn;
int? realTimePicture;
CatEyeSetEntity({
this.catEyeMode,
this.recordMode,
this.recordTime,
this.realTimeMode,
this.recordEndTime,
this.recordStartTime,
this.detectionDistance,
this.autoLightScreen,
this.autoLightScreenTime,
this.stayWarn,
this.abnormalWarn,
this.realTimePicture,
});
}

View File

@ -9,9 +9,11 @@ import 'package:network_info_plus/network_info_plus.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:star_lock/app_settings/app_settings.dart';
import 'package:star_lock/blue/io_gateway/io_gateway_configuringWifi.dart';
import 'package:star_lock/blue/io_gateway/io_gateway_getStatus.dart';
import 'package:star_lock/login/login/entity/LoginEntity.dart';
import 'package:star_lock/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifiEntity.dart';
import 'package:star_lock/mine/gateway/addGateway/gatewayConfigurationWifi/getGatewayConfiguration_entity.dart';
import 'package:star_lock/mine/gateway/addGateway/selectGateway/getGatewayInfo_model.dart';
import 'package:star_lock/talk/startChart/entity/star_chart_register_node_entity.dart';
import 'package:star_lock/talk/startChart/start_chart_manage.dart';
import 'package:star_lock/tools/baseGetXController.dart';
@ -72,6 +74,9 @@ class ConfiguringWifiLogic extends BaseGetXController {
if (reply is GatewayConfiguringWifiResultReply) {
_replySenderConfiguringWifiResult(reply);
}
if (reply is GatewayGetStatusReply) {
_replyGatewayGetStatusReply(reply);
}
});
}
@ -184,18 +189,6 @@ class ConfiguringWifiLogic extends BaseGetXController {
//
state.getGatewayConfigurationStr = "{\"userPeerld\": \"$appPeerId\"}";
}
// JSON
// if (state.getGatewayConfigurationStr.isNotEmpty) {
// //
// state.getGatewayConfigurationStr =
// state.getGatewayConfigurationStr.replaceAll(
// RegExp(r'}\s*$'),
// ',\n{\"userPeerld\": \"$appPeerId\"}',
// );
// } else {
// //
// state.getGatewayConfigurationStr = "{\"userPeerld\": \"$appPeerId\"}";
// }
BlueManage().blueSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState connectionState) async {
if (connectionState == BluetoothConnectionState.connected) {
@ -215,6 +208,29 @@ class ConfiguringWifiLogic extends BaseGetXController {
}, isAddEquipment: true);
}
//
Future<void> getDevicesStatusAction() async {
showEasyLoading();
showBlueConnetctToastTimer(action: () {
dismissEasyLoading();
});
BlueManage().blueSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState connectionState) async {
if (connectionState == BluetoothConnectionState.connected) {
IoSenderManage.gatewayGetStatusCommand(
lockID: BlueManage().connectDeviceName,
userID: await Storage.getUid(),
);
} else if (connectionState == BluetoothConnectionState.disconnected) {
dismissEasyLoading();
cancelBlueConnetctToastTimer();
if (state.ifCurrentScreen.value == true) {
showBlueConnetctToast();
}
}
}, isAddEquipment: true);
}
final NetworkInfo _networkInfo = NetworkInfo();
Future<String> getWifiName() async {
@ -248,6 +264,7 @@ class ConfiguringWifiLogic extends BaseGetXController {
getWifiLockServiceIpAndPort();
_initReplySubscription();
getDevicesStatusAction();
}
@override
@ -260,4 +277,59 @@ class ConfiguringWifiLogic extends BaseGetXController {
_replySubscription.cancel();
super.onClose();
}
void _replyGatewayGetStatusReply(GatewayGetStatusReply reply) {
final int status = reply.data[2];
switch (status) {
case 0x00:
//
// state.sureBtnState.value = 0;
cancelBlueConnetctToastTimer();
dismissEasyLoading();
final GetGatewayInfoModel gatewayModel = GetGatewayInfoModel();
// MAC地址
int index = 3;
final List<int> macList = reply.data.sublist(index, index + 20);
final String macStr = utf8String(macList);
// lockInfo['mac'] = macStr;
gatewayModel.mac = macStr;
index = index + 20;
AppLog.log('MAC地址 macList:$macList macStr:$macStr');
//
final List<int> serialNum = reply.data.sublist(index, index + 20);
final String serialNumStr = utf8String(serialNum);
// lockInfo['serialNum'] = serialNumStr;
gatewayModel.serialNum = serialNumStr;
index = index + 20;
AppLog.log('序列号 serialNum:$serialNum serialNumStr:$serialNumStr');
//
final List<int> gatewayVersion = reply.data.sublist(index, index + 20);
final String gatewayVersionStr = utf8String(gatewayVersion);
// lockInfo['gatewayVersion'] = gatewayVersionStr;
gatewayModel.gatewayVersion = gatewayVersionStr;
index = index + 20;
// AppLog.log(
// '软件版本 gatewayVersion:$gatewayVersion gatewayVersionStr:$gatewayVersionStr');
// wifiMac地址
final List<int> wifiMac = reply.data.sublist(index, index + 20);
final String wifiMacStr = utf8String(wifiMac);
// lockInfo['wifiMac'] = wifiMacStr;
gatewayModel.wifiMac = wifiMacStr;
index = index + 20;
AppLog.log('wifiMac地址 wifiMac:$wifiMac wifiMacStr:$wifiMacStr');
// gatewayModel.wifiMac = '00:00:00:00:00:00';
break;
default:
//
dismissEasyLoading();
showToast('配网失败'.tr);
break;
}
}
}

View File

@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:convert';
import 'dart:typed_data';
@ -5,7 +6,14 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/app_settings/app_settings.dart';
import 'package:star_lock/blue/blue_manage.dart';
import 'package:star_lock/blue/io_protocol/io_openLock.dart';
import 'package:star_lock/blue/io_reply.dart';
import 'package:star_lock/blue/io_tool/io_tool.dart';
import 'package:star_lock/blue/io_tool/manager_event_bus.dart';
import 'package:star_lock/blue/reciver_data.dart';
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_logic.dart';
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_state.dart';
import 'package:star_lock/talk/startChart/constant/message_type_constant.dart';
import 'package:star_lock/talk/startChart/entity/scp_message.dart';
import 'package:star_lock/talk/startChart/handle/scp_message_base_handle.dart';
@ -13,21 +21,43 @@ import 'package:star_lock/talk/startChart/handle/scp_message_handle.dart';
import 'package:star_lock/talk/startChart/proto/ble_message.pbserver.dart';
import 'package:star_lock/talk/startChart/proto/gateway_reset.pb.dart';
import 'package:star_lock/talk/startChart/proto/generic.pb.dart';
import 'package:star_lock/tools/bugly/bugly_tool.dart';
import 'package:star_lock/tools/dateTool.dart';
import 'package:star_lock/tools/eventBusEventManage.dart';
import 'package:star_lock/tools/storage.dart';
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
import '../../start_chart_manage.dart';
class UdpBlePassThroughHandler extends ScpMessageBaseHandle
implements ScpMessageHandler {
LockDetailLogic lockDetailLogic = Get.put(LockDetailLogic());
LockDetailState lockDetailState = Get.find<LockDetailLogic>().state;
@override
void handleReq(ScpMessage scpMessage) {
//TODO
}
@override
void handleResp(ScpMessage scpMessage) {
void handleResp(ScpMessage scpMessage) async {
final BleResp bleResp = scpMessage.Payload;
AppLog.log('收到蓝牙消息回复:${bleResp.structData}');
final data = CommandReciverManager.parseData(bleResp.structData);
// List<int>
String hexString = bleResp.structData
.map((byte) => byte.toRadixString(16).padLeft(2, '0'))
.join(' ');
AppLog.log('蓝牙透传回复:$hexString');
await CommandReciverManager.appDataReceive(bleResp.structData);
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
//
if (reply is OpenDoorReply) {
AppLog.log('收到开门请求命令回复');
_replyOpenLock(reply);
}
});
}
@override
@ -59,4 +89,164 @@ class UdpBlePassThroughHandler extends ScpMessageBaseHandle
return payload;
}
}
//
Future<void> _replyOpenLock(Reply reply) async {
final int status = reply.data[6];
BuglyTool.uploadException(
message: '开锁结果,解析数据',
detail: '开锁结果,解析数据 _replyOpenLock:${reply.data}',
upload: true);
if (status != 6) {
final String getMobile = (await Storage.getMobile())!;
UmengCommonSdk.onEvent('open_lock', {
'lock_name': lockDetailState.keyInfos.value.lockName!,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'open_lock_result': '${reply.data}',
});
}
switch (status) {
case 0x00:
//
// _showFullScreenOverlay(Get.context!);
lockDetailState.iSClosedUnlockSuccessfulPopup.value = true;
lockDetailLogic.cancelBlueConnetctToastTimer();
lockDetailState.closedUnlockSuccessfulTimer?.cancel();
// EasyLoading.dismiss();
// 3
lockDetailState.closedUnlockSuccessfulTimer =
Timer.periodic(3.seconds, (Timer timer) {
lockDetailState.iSClosedUnlockSuccessfulPopup.value = false;
timer.cancel();
eventBus.fire(RefreshLockDetailInfoDataEvent());
});
//
final int power = reply.data[7];
lockDetailState.electricQuantity.value = power;
//
if (lockDetailState
.keyInfos.value.lockFeature!.isSupportBackupBattery ==
1) {
final int powerStandby = reply.data[9];
lockDetailState.electricQuantityStandby.value = powerStandby;
}
//
await lockDetailLogic.uploadElectricQuantityRequest();
//
lockDetailLogic.lockReportLockSuccessfullyUploadData();
lockDetailLogic.resetOpenDoorState();
lockDetailState.animationController!.stop();
//
lockDetailLogic.getLockRecordLastUploadDataTime();
if (!EasyLoading.isShow) {
lockDetailLogic.showToast('开门成功'.tr);
}
break;
case 0x06:
//
// token后在重新发送
sendCarryTokenOpenLockMessage(reply);
break;
case 0x16:
// ...
final int isOpen = reply.data[8];
String? msg;
if (isOpen == 0) {
msg = '正在开锁中...'.tr;
} else if (isOpen == 32) {
msg = '正在闭锁中...'.tr;
}
lockDetailLogic.resetOpenDoorState();
if (msg != null) {
lockDetailLogic.showToast(msg, something: () {
lockDetailLogic.cancelBlueConnetctToastTimer();
});
}
break;
case 0x0d:
//
lockDetailLogic.showToast('钥匙无效'.tr);
lockDetailLogic.openDoorError();
break;
case 0x0b:
//
lockDetailLogic.showToast('钥匙过期'.tr);
lockDetailLogic.openDoorError();
break;
case 0x0a:
//
lockDetailLogic.showToast('钥匙不存在'.tr);
lockDetailLogic.openDoorError();
break;
case 0x0c:
//
lockDetailLogic.showToast('钥匙数量已到上限'.tr);
lockDetailLogic.openDoorError();
break;
case 0x0e:
//
lockDetailLogic.showToast('钥匙已存在'.tr);
lockDetailLogic.openDoorError();
break;
case 0x0f:
//
lockDetailLogic.showToast('用户已存在'.tr);
lockDetailLogic.openDoorError();
break;
default:
//
// AppLog.log('开锁失败');
lockDetailLogic.openDoorError();
break;
}
}
void sendCarryTokenOpenLockMessage(Reply reply) async {
/// token信息的开门信息
final List<String>? privateKey =
await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
final List<int> tokenData = reply.data.sublist(2, 6);
final List<String> saveStrList = changeIntListToStringList(tokenData);
Storage.setStringList(saveBlueToken, saveStrList);
final OpenLockCommand openLockCommand = OpenLockCommand(
lockID: BlueManage().connectDeviceName,
userID: await Storage.getUid(),
openMode: lockDetailState.openDoorModel,
openTime: lockDetailLogic.getUTCNetTime(),
onlineToken: lockDetailState.lockNetToken,
token: tokenData,
needAuthor: 1,
signKey: signKeyDataList,
privateKey: getPrivateKeyList,
);
final messageDetail = openLockCommand.packageData();
// List<int>
String hexString = messageDetail
.map((byte) => byte.toRadixString(16).padLeft(2, '0'))
.join(' ');
AppLog.log('open lock hexString: $hexString');
//
StartChartManage().sendRemoteUnLockMessage(
bluetoothDeviceName: BlueManage().connectDeviceName,
openLockCommand: messageDetail,
);
}
}

View File

@ -25,7 +25,7 @@ class AppLifecycleObserver extends WidgetsBindingObserver {
void onAppPaused() {
//
print('App has entered the background.');
// StartChartManage().destruction();
StartChartManage().destruction();
}
void onAppResumed() {

View File

@ -293,7 +293,13 @@ class TalkViewLogic extends BaseGetXController {
signKey: signKeyDataList,
privateKey: getPrivateKeyList,
);
final messageDetail = openLockCommand.messageDetail();
final messageDetail = openLockCommand.packageData();
// List<int>
String hexString = messageDetail
.map((byte) => byte.toRadixString(16).padLeft(2, '0'))
.join(' ');
AppLog.log('open lock hexString: $hexString');
//
StartChartManage().sendRemoteUnLockMessage(
bluetoothDeviceName: BlueManage().connectDeviceName,

View File

@ -261,8 +261,8 @@ dependencies:
#图库保存
gallery_saver: ^2.3.2
fixnum: ^1.1.1
# 获取视频封面
video_thumbnail: ^0.5.3
# 图片预览
photo_view: ^0.15.0