2023-08-15 18:54:44 +08:00
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
2023-08-17 18:45:10 +08:00
|
|
|
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
2024-04-26 15:38:59 +08:00
|
|
|
|
import 'package:star_lock/app_settings/app_settings.dart';
|
2023-08-17 18:45:10 +08:00
|
|
|
|
import 'package:star_lock/blue/blue_manage.dart';
|
2024-12-10 09:45:50 +08:00
|
|
|
|
import 'package:star_lock/blue/io_gateway/io_gateway_configuringWifi.dart';
|
|
|
|
|
|
import 'package:star_lock/blue/io_gateway/io_gateway_getWifiList.dart';
|
2024-01-23 18:12:51 +08:00
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
2024-07-27 18:18:54 +08:00
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_addPalmWithTimeCycleCoercion.dart';
|
2024-01-18 11:25:56 +08:00
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_changeAdministratorPassword.dart';
|
2024-05-09 13:41:53 +08:00
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_cleanUpUsers.dart';
|
2023-08-17 18:45:10 +08:00
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_deletUser.dart';
|
2023-08-18 16:25:41 +08:00
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_editUser.dart';
|
2023-08-24 14:25:55 +08:00
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_factoryDataReset.dart';
|
2024-04-24 16:04:07 +08:00
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_otaUpgrade.dart';
|
|
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_processOtaUpgrade.dart';
|
2023-11-13 11:28:42 +08:00
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_readAdminPassword.dart';
|
2023-10-07 18:55:59 +08:00
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_readSupportFunctionsNoParameters.dart';
|
|
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_readSupportFunctionsWithParameters.dart';
|
2023-09-28 18:05:23 +08:00
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_referEventRecordTime.dart';
|
2023-10-07 18:55:59 +08:00
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsNoParameters.dart';
|
|
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsWithParameters.dart';
|
2023-08-31 15:56:01 +08:00
|
|
|
|
import 'package:star_lock/blue/io_protocol/io_timing.dart';
|
2023-08-16 18:21:42 +08:00
|
|
|
|
|
2023-08-15 18:54:44 +08:00
|
|
|
|
import '../tools/storage.dart';
|
2024-12-10 09:45:50 +08:00
|
|
|
|
import 'io_gateway/io_gateway_getStatus.dart';
|
2024-04-15 16:30:00 +08:00
|
|
|
|
import 'io_protocol/io_addFingerprintWithTimeCycleCoercion.dart';
|
|
|
|
|
|
import 'io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
2024-07-23 11:16:18 +08:00
|
|
|
|
import 'io_protocol/io_addRemoteControlWithTimeCycleCoercion.dart';
|
2023-08-08 09:42:35 +08:00
|
|
|
|
import 'io_protocol/io_addUser.dart';
|
2023-09-07 18:36:16 +08:00
|
|
|
|
import 'io_protocol/io_configuringWifi.dart';
|
2023-08-11 14:50:42 +08:00
|
|
|
|
import 'io_protocol/io_getPrivateKey.dart';
|
2023-08-08 09:42:35 +08:00
|
|
|
|
import 'io_protocol/io_getPublicKey.dart';
|
2023-10-07 18:55:59 +08:00
|
|
|
|
import 'io_protocol/io_getStarLockStatusInfo.dart';
|
2024-03-09 17:17:38 +08:00
|
|
|
|
import 'io_protocol/io_getWifiList.dart';
|
2023-08-16 18:21:42 +08:00
|
|
|
|
import 'io_protocol/io_openLock.dart';
|
2024-06-14 15:46:43 +08:00
|
|
|
|
import 'io_protocol/io_senderCustomPasswords.dart';
|
2024-05-08 18:31:45 +08:00
|
|
|
|
import 'io_protocol/io_senderResetPasswords.dart';
|
2024-06-14 15:46:43 +08:00
|
|
|
|
import 'io_protocol/io_transferSmartLock.dart';
|
2024-05-23 10:35:06 +08:00
|
|
|
|
import 'io_protocol/io_updataLockCardList.dart';
|
|
|
|
|
|
import 'io_protocol/io_updataLockFaceList.dart';
|
|
|
|
|
|
import 'io_protocol/io_updataLockFingerprintList.dart';
|
|
|
|
|
|
import 'io_protocol/io_updataLockPalmVeinList.dart';
|
|
|
|
|
|
import 'io_protocol/io_updataLockPasswordList.dart';
|
2024-07-23 15:02:57 +08:00
|
|
|
|
import 'io_protocol/io_updataLockRemoteControlList.dart';
|
2024-05-29 09:06:26 +08:00
|
|
|
|
import 'io_protocol/io_updataLockSet.dart';
|
2023-08-31 15:56:01 +08:00
|
|
|
|
import 'io_reply.dart';
|
2023-08-15 18:54:44 +08:00
|
|
|
|
import 'io_tool/io_manager.dart';
|
2023-08-08 09:42:35 +08:00
|
|
|
|
import 'io_tool/io_tool.dart';
|
|
|
|
|
|
import 'io_tool/manager_event_bus.dart';
|
2024-06-14 15:46:43 +08:00
|
|
|
|
import 'io_type.dart';
|
2023-08-11 14:50:42 +08:00
|
|
|
|
import 'sm4Encipher/sm4.dart';
|
2023-08-08 09:42:35 +08:00
|
|
|
|
|
|
|
|
|
|
class CommandReciverManager {
|
2024-05-21 15:33:06 +08:00
|
|
|
|
static Future<void> appDataReceive(List<int> data) async {
|
2023-08-08 09:42:35 +08:00
|
|
|
|
///解析数据
|
2024-01-23 18:12:51 +08:00
|
|
|
|
if (data.isEmpty) {
|
2023-08-09 09:32:09 +08:00
|
|
|
|
return;
|
2023-08-08 09:42:35 +08:00
|
|
|
|
}
|
2024-05-21 15:33:06 +08:00
|
|
|
|
final int dataSize = data.length;
|
2023-08-09 09:32:09 +08:00
|
|
|
|
// 当小于包头加起来13个字节
|
2024-01-23 18:12:51 +08:00
|
|
|
|
if (dataSize < 13) {
|
2023-08-08 09:42:35 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
2023-09-04 15:00:42 +08:00
|
|
|
|
|
2024-01-23 18:12:51 +08:00
|
|
|
|
if ((data[0] == 0xEF) &&
|
|
|
|
|
|
(data[1] == 0x01) &&
|
|
|
|
|
|
(data[2] == 0xEE) &&
|
|
|
|
|
|
(data[3] == 0x02)) {
|
2024-05-21 15:33:06 +08:00
|
|
|
|
final int tmpType = data[7] & 0x0f; // 包标识
|
|
|
|
|
|
// AppLog.log('temType:$tmpType');
|
2023-09-04 15:00:42 +08:00
|
|
|
|
|
2024-05-21 15:33:06 +08:00
|
|
|
|
final int dataLen = data[8] * 256 + data[9]; // 高16位用来指示后面数据块内容的长度
|
|
|
|
|
|
final int oriLen = data[10] * 256 + data[11]; // 低16位用来指示数据加密前的原长度
|
2024-04-26 15:38:59 +08:00
|
|
|
|
// AppLog.log("dataLen:$dataLen oriLen:$oriLen");
|
2024-05-21 15:33:06 +08:00
|
|
|
|
List<int> oriDataList = <int>[];
|
2024-01-23 18:12:51 +08:00
|
|
|
|
switch (tmpType) {
|
2023-08-09 09:32:09 +08:00
|
|
|
|
case 0: //不加密
|
|
|
|
|
|
// for (var i = 0; i < oriLen ; i++) {
|
2023-08-11 14:50:42 +08:00
|
|
|
|
// oriDataList.add(data[12 + i]);
|
2023-08-09 09:32:09 +08:00
|
|
|
|
// }
|
2023-08-12 18:32:49 +08:00
|
|
|
|
oriDataList = data.sublist(12, 12 + dataLen);
|
2024-05-21 15:33:06 +08:00
|
|
|
|
AppLog.log('不加密 :$oriDataList');
|
2023-08-11 14:50:42 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
//AES128
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 2:
|
2023-08-12 18:32:49 +08:00
|
|
|
|
// SM4(事先约定密钥)
|
|
|
|
|
|
// 获取的加密数组
|
2024-05-21 15:33:06 +08:00
|
|
|
|
final List<int> getDataList = data.sublist(12, 12 + dataLen);
|
2023-08-15 18:54:44 +08:00
|
|
|
|
|
2023-08-12 18:32:49 +08:00
|
|
|
|
// 解密
|
2023-08-15 18:54:44 +08:00
|
|
|
|
// String key = SM4.createHexKey(key: IoManager().getCurrentDeviceLockId);
|
2024-01-23 18:12:51 +08:00
|
|
|
|
oriDataList = SM4.decrypt(getDataList,
|
|
|
|
|
|
key: utf8.encode(BlueManage().connectDeviceName),
|
|
|
|
|
|
mode: SM4CryptoMode.ECB);
|
2023-08-12 18:32:49 +08:00
|
|
|
|
oriDataList = oriDataList.sublist(0, oriLen);
|
2024-05-21 15:33:06 +08:00
|
|
|
|
AppLog.log('APP收到的解密后的数据:$oriDataList');
|
2023-08-09 09:32:09 +08:00
|
|
|
|
break;
|
2023-08-12 18:32:49 +08:00
|
|
|
|
case 3:
|
|
|
|
|
|
//SM4(设备指定密钥)
|
2023-08-15 18:54:44 +08:00
|
|
|
|
// 获取的加密数组
|
2024-05-21 15:33:06 +08:00
|
|
|
|
final List<int> getDataList = data.sublist(12, 12 + dataLen);
|
2023-08-15 18:54:44 +08:00
|
|
|
|
|
2024-12-04 13:55:58 +08:00
|
|
|
|
final List<String>? res =
|
|
|
|
|
|
await Storage.getStringList(saveBluePrivateKey);
|
2024-05-21 15:33:06 +08:00
|
|
|
|
final List<int> getPrivateKeyList = changeStringListToIntList(res!);
|
2023-08-15 18:54:44 +08:00
|
|
|
|
|
|
|
|
|
|
// 解密
|
2024-01-23 18:12:51 +08:00
|
|
|
|
oriDataList = SM4.decrypt(getDataList,
|
|
|
|
|
|
key: getPrivateKeyList, mode: SM4CryptoMode.ECB);
|
2023-08-15 18:54:44 +08:00
|
|
|
|
oriDataList = oriDataList.sublist(0, oriLen);
|
2024-05-21 15:33:06 +08:00
|
|
|
|
AppLog.log('APP收到的解密后的数据:$oriDataList data:$data');
|
2023-08-09 09:32:09 +08:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2024-05-09 13:41:53 +08:00
|
|
|
|
parseData(oriDataList).then((Reply? value) async {
|
2025-02-10 13:40:02 +08:00
|
|
|
|
// EasyLoading.dismiss();
|
2024-03-12 16:19:04 +08:00
|
|
|
|
await EventBusManager().eventBusFir(value);
|
2024-10-15 14:24:35 +08:00
|
|
|
|
}).catchError((Object error) {
|
|
|
|
|
|
AppLog.log('APP解析数据时发生错误: ${error.toString()}');
|
2023-08-11 14:50:42 +08:00
|
|
|
|
});
|
2023-08-08 09:42:35 +08:00
|
|
|
|
}
|
2023-08-09 09:32:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Future<Reply?> parseData(List<int> data) async {
|
2024-01-23 18:12:51 +08:00
|
|
|
|
if (data.isNotEmpty) {
|
2024-05-21 15:33:06 +08:00
|
|
|
|
final int cmd = data[0] * 256 + data[1];
|
|
|
|
|
|
final CommandType commandType = ExtensionCommandType.getCommandType(cmd);
|
2023-08-15 18:54:44 +08:00
|
|
|
|
await IoManager().increaseCommandIndex();
|
2023-08-11 14:50:42 +08:00
|
|
|
|
// data.removeRange(0, 2);
|
2024-05-21 15:33:06 +08:00
|
|
|
|
Reply? reply;
|
2024-01-23 18:12:51 +08:00
|
|
|
|
switch (commandType) {
|
2023-08-09 09:32:09 +08:00
|
|
|
|
case CommandType.getLockPublicKey:
|
2023-08-08 09:42:35 +08:00
|
|
|
|
{
|
2023-08-09 09:32:09 +08:00
|
|
|
|
reply = GetPublicKeyReply.parseData(commandType, data);
|
2023-08-08 09:42:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-08-11 14:50:42 +08:00
|
|
|
|
case CommandType.getLockPrivateKey:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = GetPrivateKeyReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-08-09 09:32:09 +08:00
|
|
|
|
case CommandType.addUser:
|
2023-08-08 09:42:35 +08:00
|
|
|
|
{
|
2023-08-09 09:32:09 +08:00
|
|
|
|
reply = AddUserReply.parseData(commandType, data);
|
2023-08-08 09:42:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-08-17 18:45:10 +08:00
|
|
|
|
case CommandType.deletUser:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = DeletUserReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-08-16 18:21:42 +08:00
|
|
|
|
case CommandType.openLock:
|
2023-08-09 09:32:09 +08:00
|
|
|
|
{
|
|
|
|
|
|
reply = OpenDoorReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
2023-08-08 09:42:35 +08:00
|
|
|
|
break;
|
2024-04-19 18:13:34 +08:00
|
|
|
|
// 弃用
|
|
|
|
|
|
// case CommandType.readLockStatusInfo:
|
|
|
|
|
|
// {
|
|
|
|
|
|
// reply = GetLockStatuReply.parseData(commandType, data);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// break;
|
2023-08-18 16:25:41 +08:00
|
|
|
|
case CommandType.editUser:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = EditUserReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-06-14 15:46:43 +08:00
|
|
|
|
case CommandType.transferSmartLock:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = TransferSmartLockReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-08-24 14:25:55 +08:00
|
|
|
|
case CommandType.factoryDataReset:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = FactoryDataResetReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-08-31 15:56:01 +08:00
|
|
|
|
case CommandType.calibrationTime:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = TimingReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-10-07 18:55:59 +08:00
|
|
|
|
case CommandType.readStarLockStatusInfo:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = GetStarLockStatuInfoReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-04-24 16:04:07 +08:00
|
|
|
|
case CommandType.startOATUpgrade:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = OTAUpgradeReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case CommandType.confirmationOTAUpgrade:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = ConfirmationOTAUpgradeReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case CommandType.processOTAUpgrade:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = ProcessOtaUpgradeReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-05-09 13:41:53 +08:00
|
|
|
|
case CommandType.cleanUpUsers:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = CleanUpUsersReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-05-23 10:35:06 +08:00
|
|
|
|
case CommandType.updataLockPasswordList:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = UpdataLockPasswordListReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case CommandType.updataLockCardList:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = UpdataLockCardListReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case CommandType.updataLockFingerprintList:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = UpdataLockFingerprintListReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case CommandType.updataLockFaceList:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = UpdataLockFaceListReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case CommandType.updataLockPalmVeinList:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = UpdataLockPalmVeinListReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-07-23 15:02:57 +08:00
|
|
|
|
case CommandType.updataLockRemoteControlList:
|
|
|
|
|
|
{
|
2024-12-04 13:55:58 +08:00
|
|
|
|
reply =
|
|
|
|
|
|
UpdataLockRemoteControlListReply.parseData(commandType, data);
|
2024-07-23 15:02:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-05-29 09:06:26 +08:00
|
|
|
|
case CommandType.updataLockSet:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = UpdataLockSetReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-09-19 09:26:07 +08:00
|
|
|
|
case CommandType.gatewayConfiguringWifi:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = GatewayConfiguringWifiReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case CommandType.gatewayConfiguringWifiResult:
|
|
|
|
|
|
{
|
2024-12-04 13:55:58 +08:00
|
|
|
|
reply =
|
|
|
|
|
|
GatewayConfiguringWifiResultReply.parseData(commandType, data);
|
2024-09-19 09:26:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case CommandType.gatewayGetWifiList:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = GatewayGetWifiReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case CommandType.gatewayGetWifiListResult:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = GatewayGetWifiListReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-10-07 14:17:46 +08:00
|
|
|
|
case CommandType.gatewayGetStatus:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = GatewayGetStatusReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-08-30 18:36:02 +08:00
|
|
|
|
case CommandType.generalExtendedCommond:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 子命令类型
|
2024-05-21 15:33:06 +08:00
|
|
|
|
final int subType = data[3];
|
2024-01-23 18:12:51 +08:00
|
|
|
|
switch (subType) {
|
2024-01-18 11:25:56 +08:00
|
|
|
|
case 2:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 修改管理员密码
|
2024-01-23 18:12:51 +08:00
|
|
|
|
reply = ChangeAdministratorPasswordReply.parseData(
|
|
|
|
|
|
commandType, data);
|
2024-01-18 11:25:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-08-30 18:36:02 +08:00
|
|
|
|
case 3:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 设置开锁密码
|
2024-01-23 18:12:51 +08:00
|
|
|
|
reply =
|
|
|
|
|
|
SenderCustomPasswordsReply.parseData(commandType, data);
|
2023-08-30 18:36:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-04-19 18:13:34 +08:00
|
|
|
|
// case 4:
|
|
|
|
|
|
// {
|
|
|
|
|
|
// // 自动落锁开关
|
|
|
|
|
|
// reply = AutomaticPadlockReply.parseData(commandType, data);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// break;
|
2024-05-08 18:31:45 +08:00
|
|
|
|
case 19:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 重置开锁密码
|
2024-12-04 13:55:58 +08:00
|
|
|
|
reply =
|
|
|
|
|
|
SenderResetPasswordsReply.parseData(commandType, data);
|
2024-05-08 18:31:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-04-15 16:30:00 +08:00
|
|
|
|
// case 21:
|
|
|
|
|
|
// {
|
|
|
|
|
|
// // 注册卡片开始
|
|
|
|
|
|
// reply = SenderAddICCardReply.parseData(commandType, data);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// break;
|
2023-09-20 14:22:44 +08:00
|
|
|
|
case 22:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 注册卡片确认
|
2024-01-23 18:12:51 +08:00
|
|
|
|
reply = SenderAddICCardConfirmationReply.parseData(
|
|
|
|
|
|
commandType, data);
|
2023-09-20 14:22:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-04-15 16:30:00 +08:00
|
|
|
|
case 24:
|
2023-09-04 15:00:42 +08:00
|
|
|
|
{
|
2024-04-15 16:30:00 +08:00
|
|
|
|
// 注册卡片开始
|
|
|
|
|
|
reply = SenderAddICCardWithTimeCycleCoercionReply.parseData(
|
2024-01-23 18:12:51 +08:00
|
|
|
|
commandType, data);
|
2023-09-04 15:00:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-07-23 11:16:18 +08:00
|
|
|
|
case 26:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 注册遥控开始
|
2024-12-04 13:55:58 +08:00
|
|
|
|
reply = SenderAddRemoteControlWithTimeCycleCoercionReply
|
|
|
|
|
|
.parseData(commandType, data);
|
2024-07-23 11:16:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 27:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 注册遥控确认
|
|
|
|
|
|
reply = SenderAddRemoteControlConfirmationReply.parseData(
|
|
|
|
|
|
commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-08-31 15:56:01 +08:00
|
|
|
|
case 32:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 注册指纹确认
|
2024-01-23 18:12:51 +08:00
|
|
|
|
reply = SenderAddFingerprintConfirmationReply.parseData(
|
|
|
|
|
|
commandType, data);
|
2023-08-31 15:56:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 33:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 注册指纹过程
|
2024-01-23 18:12:51 +08:00
|
|
|
|
reply = SenderAddFingerprintProcessReply.parseData(
|
|
|
|
|
|
commandType, data);
|
2023-08-31 15:56:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-04-15 16:30:00 +08:00
|
|
|
|
case 36:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 注册指纹开始(带限时、循环、胁迫...)
|
2024-04-24 16:04:07 +08:00
|
|
|
|
reply =
|
|
|
|
|
|
SenderAddFingerprintWithTimeCycleCoercionReply.parseData(
|
|
|
|
|
|
commandType, data);
|
2024-04-15 16:30:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-09-28 18:05:23 +08:00
|
|
|
|
case 41:
|
|
|
|
|
|
{
|
2024-04-19 18:13:34 +08:00
|
|
|
|
// 时间条件查询事件记录
|
2024-01-23 18:12:51 +08:00
|
|
|
|
reply = SenderReferEventRecordTimeReply.parseData(
|
|
|
|
|
|
commandType, data);
|
2023-09-28 18:05:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-07-27 18:18:54 +08:00
|
|
|
|
case 42:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 注册掌静脉开始
|
|
|
|
|
|
reply = SenderAddPalmWithTimeCycleCoercionReply.parseData(
|
|
|
|
|
|
commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 43:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 注册掌静脉确认
|
|
|
|
|
|
reply = SenderAddPalmConfirmationReply.parseData(
|
|
|
|
|
|
commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-11-18 10:38:13 +08:00
|
|
|
|
// case 50:
|
|
|
|
|
|
// {
|
|
|
|
|
|
// // wifi配网
|
|
|
|
|
|
// reply = SenderConfiguringWifiReply.parseData(commandType, data);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// break;
|
2023-09-07 18:36:16 +08:00
|
|
|
|
case 51:
|
|
|
|
|
|
{
|
|
|
|
|
|
// wifi配网结果
|
2024-01-23 18:12:51 +08:00
|
|
|
|
reply =
|
|
|
|
|
|
SenderConfiguringWifiReply.parseData(commandType, data);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-03-29 18:32:33 +08:00
|
|
|
|
case 53:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 获取wifilist
|
2024-04-19 18:13:34 +08:00
|
|
|
|
reply = SenderGetWifiReply.parseData(commandType, data);
|
2024-03-29 18:32:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-03-09 17:17:38 +08:00
|
|
|
|
case 54:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 门锁搜索2.4G WIFI SSID 结果
|
|
|
|
|
|
reply = SenderGetWifiListReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-10-07 18:55:59 +08:00
|
|
|
|
case 70:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 设置支持功能(不带参数)启用/禁用
|
2024-01-23 18:12:51 +08:00
|
|
|
|
reply = SetSupportFunctionsNoParametersReply.parseData(
|
|
|
|
|
|
commandType, data);
|
2023-10-07 18:55:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 71:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 读取支持功能(不带参数)启用/禁用状态
|
2024-01-23 18:12:51 +08:00
|
|
|
|
reply = ReadSupportFunctionsNoParametersReply.parseData(
|
|
|
|
|
|
commandType, data);
|
2023-10-07 18:55:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 72:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 设置支持功能(带参数)
|
2024-01-23 18:12:51 +08:00
|
|
|
|
reply = SetSupportFunctionsWithParametersReply.parseData(
|
|
|
|
|
|
commandType, data);
|
2023-10-07 18:55:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 73:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 读取支持功能(带参数)参数
|
2024-01-23 18:12:51 +08:00
|
|
|
|
reply = ReadSupportFunctionsWithParametersReply.parseData(
|
|
|
|
|
|
commandType, data);
|
2023-10-07 18:55:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-11-13 11:28:42 +08:00
|
|
|
|
case 74:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 读取管理员密码
|
2024-01-23 18:12:51 +08:00
|
|
|
|
reply =
|
|
|
|
|
|
SenderReadAdminPasswordReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 81:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 注册人脸开始
|
|
|
|
|
|
reply = SenderAddFaceReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 82:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 注册人脸确认
|
|
|
|
|
|
reply = SenderAddFaceConfirmationReply.parseData(
|
|
|
|
|
|
commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 83:
|
|
|
|
|
|
{
|
|
|
|
|
|
// 注册人脸过程
|
|
|
|
|
|
reply =
|
|
|
|
|
|
SenderAddFaceProcessReply.parseData(commandType, data);
|
2023-11-13 11:28:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-08-30 18:36:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2024-03-12 16:19:04 +08:00
|
|
|
|
default:
|
|
|
|
|
|
{
|
|
|
|
|
|
reply = GetStarLockStatuInfoReply.parseData(commandType, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2023-08-08 09:42:35 +08:00
|
|
|
|
}
|
2023-08-09 09:32:09 +08:00
|
|
|
|
return reply;
|
|
|
|
|
|
}
|
2024-05-21 15:33:06 +08:00
|
|
|
|
return null;
|
2023-08-08 09:42:35 +08:00
|
|
|
|
}
|
2024-01-23 18:12:51 +08:00
|
|
|
|
}
|