Merge branch 'release' into develop_address_book

This commit is contained in:
Liuyf 2025-05-27 14:15:36 +08:00
commit 7e5970b76a
3 changed files with 23 additions and 6 deletions

View File

@ -123,14 +123,18 @@ class BlueManage {
.eventBus!
.on<EventSendModel>()
.listen((EventSendModel model) {
AppLog.log('eventBus接收发送数据:${model}');
if (model.sendChannel == DataChannel.ble) {
FlutterBluePlus.isSupported.then((bool isAvailable) async {
if (isAvailable) {
if (_adapterState == BluetoothAdapterState.on) {
//
AppLog.log('蓝牙已开启,开始收发送数据:${model.data}');
writeCharacteristicWithResponse(model.data);
} else {
try {} catch (e) {
try {
AppLog.log('蓝牙已关闭,停止发送数据:${model.data}');
} catch (e) {
AppLog.log('蓝牙打开失败');
}
}
@ -315,8 +319,10 @@ class BlueManage {
}
/// uuid
bool _isMatch(List<String> serviceUuids, {DeviceType deviceType = DeviceType.blue}) {
final List<String> prefixes = getDeviceType(deviceType).map((e) => e.toLowerCase()).toList();
bool _isMatch(List<String> serviceUuids,
{DeviceType deviceType = DeviceType.blue}) {
final List<String> prefixes =
getDeviceType(deviceType).map((e) => e.toLowerCase()).toList();
for (String uuid in serviceUuids) {
final String cleanUuid = uuid.replaceAll('-', '').toLowerCase();
if (cleanUuid.length == 8) {

View File

@ -59,7 +59,7 @@ class LockDetailLogic extends BaseGetXController {
//
if (reply is SenderReferEventRecordTimeReply &&
state.ifCurrentScreen.value == true) {
_replyReferEventRecordTime(reply);
await _replyReferEventRecordTime(reply);
}
});
}
@ -116,7 +116,9 @@ class LockDetailLogic extends BaseGetXController {
state.animationController!.stop();
//
AppLog.log('开锁成功,开始同步所记录:getLockRecordLastUploadDataTime');
getLockRecordLastUploadDataTime();
AppLog.log('开锁成功,结束同步所记录:getLockRecordLastUploadDataTime');
//
if (StartChartManage().talkStatus.status ==
TalkStatus.answeredSuccessfully) {
@ -338,6 +340,7 @@ class LockDetailLogic extends BaseGetXController {
reply.data.removeRange(0, 7);
// 17
if (reply.data.length < 17) {
AppLog.log('数据长度不够17:${reply.data}');
return;
}
final List<List<int>> getList = splitList(reply.data, 17);
@ -378,12 +381,13 @@ class LockDetailLogic extends BaseGetXController {
if (i == getList.length - 1) {
//
state.operateDate = operateDate;
state.operateDate = time;
}
} catch (e) {
AppLog.log('操作记录:$indexList,解析失败,跳过该跳记录,进行下一条记录解析。');
}
}
AppLog.log('上传数据长度:${uploadList.length}');
lockRecordUploadData(uploadList);
if (dataLength == state.logCountPage) {
@ -510,6 +514,8 @@ class LockDetailLogic extends BaseGetXController {
});
BlueManage().blueSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState connectionState) async {
AppLog.log(
'开始发送同步锁记录命令,蓝牙状态是否链接:${connectionState == BluetoothConnectionState.connected}');
if (connectionState == BluetoothConnectionState.connected) {
final List<String>? privateKey =
await Storage.getStringList(saveBluePrivateKey);
@ -524,6 +530,8 @@ class LockDetailLogic extends BaseGetXController {
final List<int> getPublicKeyList =
changeStringListToIntList(publicKey!);
AppLog.log(
'发送同步锁记录命令:${BlueManage().connectDeviceName}');
IoSenderManage.senderReferEventRecordTimeCommand(
keyID: BlueManage().connectDeviceName,
userID: await Storage.getUid(),
@ -602,11 +610,14 @@ class LockDetailLogic extends BaseGetXController {
final LockOperatingRecordGetLastRecordTimeEntity entity =
await ApiRepository.to.getLockRecordLastUploadDataTime(
lockId: state.keyInfos.value.lockId.toString());
AppLog.log('开始获取服务端所记录更新时间:${entity}');
if (entity.errorCode!.codeIsSuccessful) {
state.operateDate = entity.data!.operateDate! ~/ 1000;
state.currentDate = entity.data!.currentDate! ~/ 1000;
AppLog.log('发送同步所记录命令:---');
senderReferEventRecordTime();
}
AppLog.log('结束获取服务端所记录更新时间:${entity}');
}
//

View File

@ -4,7 +4,7 @@ import 'flavors.dart';
import 'main.dart' as runner;
Future<void> main() async {
F.appFlavor = Flavor.xhj;
F.appFlavor = Flavor.xhj_pre;
// AppLog.log('local调用了main函数');
await runner.main();
}