修复添加指纹模块bug

This commit is contained in:
魏少阳 2023-10-13 15:37:24 +08:00
parent a824c33c3c
commit 2878f291a7
5 changed files with 35 additions and 18 deletions

View File

@ -3,6 +3,7 @@ import 'dart:async';
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:star_lock/blue/io_type.dart';
import '../../../../../blue/blue_manage.dart';
@ -50,10 +51,10 @@ class AddFingerprintLogic extends BaseGetXController {
}
Future<void> _replyAddFingerprintBegin(Reply reply) async {
var token = reply.data.sublist(2, 6);
var saveStrList = changeIntListToStringList(token);
print("_replyAddFingerprintReplyToken:$token");
Storage.setStringList(saveBlueToken, saveStrList);
// var token = reply.data.sublist(2, 6);
// var saveStrList = changeIntListToStringList(token);
// print("_replyAddFingerprintReplyToken:$token");
// Storage.setStringList(saveBlueToken, saveStrList);
int status = reply.data[2];
print("status:$status");
@ -74,6 +75,9 @@ class AddFingerprintLogic extends BaseGetXController {
var publicKey = await Storage.getStringList(saveBluePublicKey);
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
var token = await Storage.getStringList(saveBlueToken);
List<int> getTokenList = changeStringListToIntList(token!);
IoSenderManage.senderAddFingerprintCommand(
keyID:"1",
userID:await Storage.getUid(),
@ -84,7 +88,7 @@ class AddFingerprintLogic extends BaseGetXController {
needAuthor:1,
publicKey:publicKeyDataList,
privateKey:getPrivateKeyList,
token: token,
token: getTokenList,
);
break;
case 0x07:
@ -164,7 +168,7 @@ class AddFingerprintLogic extends BaseGetXController {
//
print("${reply.commandType!.typeValue} 数据解析成功");
// print("添加指纹确认成功,调用添加指纹接口");
if(state.isCoerced.value == "1"){
if(state.isCoerced.value == "2"){
//
addFingerprintsData();
}else{
@ -234,8 +238,8 @@ class AddFingerprintLogic extends BaseGetXController {
//
Future<void> senderAddFingerprint() async {
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState state) async {
if (state == DeviceConnectionState.connected){
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState deviceConnectionState) async {
if (deviceConnectionState == DeviceConnectionState.connected){
var publicKey = await Storage.getStringList(saveBluePublicKey);
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
@ -244,7 +248,7 @@ class AddFingerprintLogic extends BaseGetXController {
var token = await Storage.getStringList(saveBlueToken);
List<int> getTokenList = changeStringListToIntList(token!);
print("openDoorTokenPubToken:$getTokenList");
print("openDoorTokenPubToken:$getTokenList state.startDate.value:${state.startDate.value}");
IoSenderManage.senderAddFingerprintCommand(
keyID:"1",
@ -253,6 +257,8 @@ class AddFingerprintLogic extends BaseGetXController {
useCountLimit:1,
startTime:0x11223344,
endTime:0x11223344,
// startTime:int.parse(state.startDate.value)~/1000,
// endTime:int.parse(state.endDate.value)~/1000,
needAuthor:1,
publicKey:publicKeyDataList,
privateKey:getPrivateKeyList,
@ -264,8 +270,8 @@ class AddFingerprintLogic extends BaseGetXController {
//
Future<void> senderAddStressFingerprint() async {
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState state) async {
if (state == DeviceConnectionState.connected){
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState deviceConnectionState) async {
if (deviceConnectionState == DeviceConnectionState.connected){
var publicKey = await Storage.getStringList(saveBluePublicKey);
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
@ -283,6 +289,8 @@ class AddFingerprintLogic extends BaseGetXController {
useCountLimit:1,
startTime:0x11223344,
endTime:0x11223344,
// startTime:int.parse(state.startDate.value)~/1000,
// endTime:int.parse(state.endDate.value)~/1000,
needAuthor:1,
publicKey:publicKeyDataList,
privateKey:getPrivateKeyList,

View File

@ -114,7 +114,7 @@ class AddICCardLogic extends BaseGetXController{
//
print("${reply.commandType!.typeValue} 数据解析成功");
// print("添加指纹确认成功,调用添加指纹接口");
if(state.isCoerced.value == "1"){
if(state.isCoerced.value == "2"){
//
addICCardData();
}else{

View File

@ -72,7 +72,7 @@ class OtherTypeAddKeyLogic extends BaseGetXController {
fingerprintType = 4;
}
print("addOtherType startDate:$startDate endDate:$endDate");
switch (state.lockType.value) {
case 0:
//

View File

@ -6,6 +6,7 @@ import 'package:star_lock/appRouters.dart';
import '../../app_settings/app_colors.dart';
import '../../tools/commonItem.dart';
import '../../tools/titleAppBar.dart';
import '../../tools/toast.dart';
import '../../translations/trans_lib.dart';
//
@ -64,7 +65,9 @@ class _AbountPageState extends State<AbountPage> {
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {}),
action: () {
Toast.show(msg: "功能暂未开放");
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
@ -113,7 +116,9 @@ class _AbountPageState extends State<AbountPage> {
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {}),
action: () {
Toast.show(msg: "功能暂未开放");
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
@ -126,7 +131,9 @@ class _AbountPageState extends State<AbountPage> {
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {}),
action: () {
Toast.show(msg: "功能暂未开放");
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
@ -139,7 +146,9 @@ class _AbountPageState extends State<AbountPage> {
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {}),
action: () {
Toast.show(msg: "功能暂未开放");
}),
],
),
);

View File

@ -92,7 +92,7 @@ abstract class Api {
final String addICCardURL = '/identityCard/add'; // IC卡
final String editICCardURL = '/identityCard/update'; // IC卡
final String deleteICCardURL = '/identityCard/delete'; // IC卡
final String updateICCardUserNoURL = '/identityCard/updatePwdUserNo'; // ic卡用户序号
final String updateICCardUserNoURL = '/identityCard/updateCardUserNo'; // ic卡用户序号
final String transferLockListURL = '/room/listForTransfer'; //
final String transferLockConfirmURL = '/room/transferLockConfirm'; //