Merge branch 'release' into develop_address_book
This commit is contained in:
commit
7e5970b76a
@ -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) {
|
||||
|
||||
@ -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}');
|
||||
}
|
||||
|
||||
// 操作记录上传
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user