fix: 1、修复扭力设置bug。2、星星锁添加万师傅入口。3、添加蓝牙、网关扫描类型区分。4、删除项目中废弃的协议
This commit is contained in:
parent
17245ab71d
commit
7516813a1c
Binary file not shown.
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 159 KiB |
BIN
images/mine/icon_mine_wan_wanshifu.png
Normal file
BIN
images/mine/icon_mine_wan_wanshifu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 354 KiB |
@ -627,13 +627,13 @@
|
|||||||
baseConfigurationReference = 16A83D21DFB231D8453DC681 /* Pods-Runner.release-sky.xcconfig */;
|
baseConfigurationReference = 16A83D21DFB231D8453DC681 /* Pods-Runner.release-sky.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-sky.entitlements";
|
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-sky.entitlements";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
DEVELOPMENT_TEAM = NAQ5PL2DYC;
|
DEVELOPMENT_TEAM = NAQ5PL2DYC;
|
||||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = NAQ5PL2DYC;
|
|
||||||
INFOPLIST_FILE = Runner/Info_sky.plist;
|
INFOPLIST_FILE = Runner/Info_sky.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||||
PRODUCT_NAME = Runner;
|
PRODUCT_NAME = Runner;
|
||||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Appstore_com.skychip.lock.mobileprovision;
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
SUPPORTS_MACCATALYST = NO;
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||||
@ -646,14 +646,14 @@
|
|||||||
baseConfigurationReference = CDC2B8ED804B514A774F187D /* Pods-Runner.release-xhj.xcconfig */;
|
baseConfigurationReference = CDC2B8ED804B514A774F187D /* Pods-Runner.release-xhj.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-xhj.entitlements";
|
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-xhj.entitlements";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
DEVELOPMENT_TEAM = P8997RW3V8;
|
DEVELOPMENT_TEAM = P8997RW3V8;
|
||||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = P8997RW3V8;
|
|
||||||
INFOPLIST_FILE = Runner/Info_xhj.plist;
|
INFOPLIST_FILE = Runner/Info_xhj.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.xhjcn.lock;
|
PRODUCT_BUNDLE_IDENTIFIER = com.xhjcn.lock;
|
||||||
PRODUCT_NAME = Runner;
|
PRODUCT_NAME = Runner;
|
||||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Appstore_com.xhjcn.lock.mobileprovision;
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
SUPPORTS_MACCATALYST = NO;
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||||
@ -742,16 +742,13 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-dev.entitlements";
|
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-dev.entitlements";
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CODE_SIGN_STYLE = Manual;
|
DEVELOPMENT_TEAM = NAQ5PL2DYC;
|
||||||
DEVELOPMENT_TEAM = "";
|
|
||||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = NAQ5PL2DYC;
|
|
||||||
INFOPLIST_FILE = Runner/Info_dev.plist;
|
INFOPLIST_FILE = Runner/Info_dev.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.starlock.lock.local;
|
PRODUCT_BUNDLE_IDENTIFIER = com.starlock.lock.local;
|
||||||
PRODUCT_NAME = Runner;
|
PRODUCT_NAME = Runner;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Debug_com.starlock.lock.local.mobileprovision;
|
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
SUPPORTS_MACCATALYST = NO;
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||||
@ -840,16 +837,13 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-dev.entitlements";
|
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-dev.entitlements";
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CODE_SIGN_STYLE = Manual;
|
DEVELOPMENT_TEAM = NAQ5PL2DYC;
|
||||||
DEVELOPMENT_TEAM = "";
|
|
||||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = NAQ5PL2DYC;
|
|
||||||
INFOPLIST_FILE = Runner/Info_dev.plist;
|
INFOPLIST_FILE = Runner/Info_dev.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.starlock.lock.local;
|
PRODUCT_BUNDLE_IDENTIFIER = com.starlock.lock.local;
|
||||||
PRODUCT_NAME = Runner;
|
PRODUCT_NAME = Runner;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Debug_com.starlock.lock.local.mobileprovision;
|
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
SUPPORTS_MACCATALYST = NO;
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||||
@ -1078,16 +1072,13 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-dev.entitlements";
|
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-dev.entitlements";
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CODE_SIGN_STYLE = Manual;
|
DEVELOPMENT_TEAM = NAQ5PL2DYC;
|
||||||
DEVELOPMENT_TEAM = "";
|
|
||||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = NAQ5PL2DYC;
|
|
||||||
INFOPLIST_FILE = Runner/Info_dev.plist;
|
INFOPLIST_FILE = Runner/Info_dev.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.starlock.lock.local;
|
PRODUCT_BUNDLE_IDENTIFIER = com.starlock.lock.local;
|
||||||
PRODUCT_NAME = Runner;
|
PRODUCT_NAME = Runner;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Debug_com.starlock.lock.local.mobileprovision;
|
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
SUPPORTS_MACCATALYST = NO;
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||||
@ -1170,16 +1161,14 @@
|
|||||||
baseConfigurationReference = D697F91E8405773AB9A5881E /* Pods-Runner.pre-release-sky.xcconfig */;
|
baseConfigurationReference = D697F91E8405773AB9A5881E /* Pods-Runner.pre-release-sky.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-sky.entitlements";
|
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-sky.entitlements";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Manual;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = NAQ5PL2DYC;
|
||||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = NAQ5PL2DYC;
|
|
||||||
INFOPLIST_FILE = Runner/Info_pre.plist;
|
INFOPLIST_FILE = Runner/Info_pre.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.skychip.lock.pre;
|
PRODUCT_BUNDLE_IDENTIFIER = com.skychip.lock.pre;
|
||||||
PRODUCT_NAME = Runner;
|
PRODUCT_NAME = Runner;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Adhoc_com.skychip.lock.pre.mobileprovision;
|
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
SUPPORTS_MACCATALYST = NO;
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||||
@ -1262,16 +1251,14 @@
|
|||||||
baseConfigurationReference = 126D1370182AB44291C67A10 /* Pods-Runner.dev-release-sky.xcconfig */;
|
baseConfigurationReference = 126D1370182AB44291C67A10 /* Pods-Runner.dev-release-sky.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-sky.entitlements";
|
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-sky.entitlements";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Manual;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = NAQ5PL2DYC;
|
||||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = NAQ5PL2DYC;
|
|
||||||
INFOPLIST_FILE = Runner/Info_dev.plist;
|
INFOPLIST_FILE = Runner/Info_dev.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.skychip.lock.dev;
|
PRODUCT_BUNDLE_IDENTIFIER = com.skychip.lock.dev;
|
||||||
PRODUCT_NAME = Runner;
|
PRODUCT_NAME = Runner;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Adhoc_com.skychip.lock.dev.mobileprovision;
|
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
SUPPORTS_MACCATALYST = NO;
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||||
@ -1354,16 +1341,14 @@
|
|||||||
baseConfigurationReference = 789004F1B475B44713E199BC /* Pods-Runner.pre-release-xhj.xcconfig */;
|
baseConfigurationReference = 789004F1B475B44713E199BC /* Pods-Runner.pre-release-xhj.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-xhj.entitlements";
|
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-xhj.entitlements";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Manual;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = P8997RW3V8;
|
||||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = P8997RW3V8;
|
|
||||||
INFOPLIST_FILE = Runner/Info_pre.plist;
|
INFOPLIST_FILE = Runner/Info_pre.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.xhjcn.lock.pre;
|
PRODUCT_BUNDLE_IDENTIFIER = com.xhjcn.lock.pre;
|
||||||
PRODUCT_NAME = Runner;
|
PRODUCT_NAME = Runner;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Adhoc_com.xhjcn.lock.pre.mobileprovision;
|
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
SUPPORTS_MACCATALYST = NO;
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||||
@ -1446,16 +1431,14 @@
|
|||||||
baseConfigurationReference = ED3A443EA1439FD0FB4BCF80 /* Pods-Runner.dev-release-xhj.xcconfig */;
|
baseConfigurationReference = ED3A443EA1439FD0FB4BCF80 /* Pods-Runner.dev-release-xhj.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-xhj.entitlements";
|
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-xhj.entitlements";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Manual;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = P8997RW3V8;
|
||||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = P8997RW3V8;
|
|
||||||
INFOPLIST_FILE = Runner/Info_dev.plist;
|
INFOPLIST_FILE = Runner/Info_dev.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.xhjcn.lock.dev;
|
PRODUCT_BUNDLE_IDENTIFIER = com.xhjcn.lock.dev;
|
||||||
PRODUCT_NAME = Runner;
|
PRODUCT_NAME = Runner;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Adhoc_com.xhjcn.lock.dev.mobileprovision;
|
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
SUPPORTS_MACCATALYST = NO;
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||||
|
|||||||
@ -1108,6 +1108,9 @@
|
|||||||
"密码需至少包含数字/字母/字符中的2种组合": "The password must contain at least 2 of the following: numbers, letters, and special characters",
|
"密码需至少包含数字/字母/字符中的2种组合": "The password must contain at least 2 of the following: numbers, letters, and special characters",
|
||||||
"已开锁": "Unlocked",
|
"已开锁": "Unlocked",
|
||||||
"已闭锁": "Locked",
|
"已闭锁": "Locked",
|
||||||
"两次密码不一致哦": "The passwords are inconsistent"
|
"两次密码不一致哦": "The passwords are inconsistent",
|
||||||
|
|
||||||
|
"中功率": "Medium power",
|
||||||
|
"常规使用": "Regular use",
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1104,9 +1104,11 @@
|
|||||||
"支持的语言": "支持的语言",
|
"支持的语言": "支持的语言",
|
||||||
"英语": "英语",
|
"英语": "英语",
|
||||||
"Google Home操作流程的值": "1.用智能锁APP添加锁和网关\n\n2.在APP里开启锁的远程开锁功能(这个功能默认是关闭的)。如果没有这个选项,则锁不支持Google Home \n\n3.安装Google Home APP,点击左上角的“+”按钮\n\n4.在设置页面,选择“与Google协同工作”\n\n5.搜索“ScienerSmart”,并用智能锁APP的账号和密码进行授权\n\n",
|
"Google Home操作流程的值": "1.用智能锁APP添加锁和网关\n\n2.在APP里开启锁的远程开锁功能(这个功能默认是关闭的)。如果没有这个选项,则锁不支持Google Home \n\n3.安装Google Home APP,点击左上角的“+”按钮\n\n4.在设置页面,选择“与Google协同工作”\n\n5.搜索“ScienerSmart”,并用智能锁APP的账号和密码进行授权\n\n",
|
||||||
|
|
||||||
"密码需至少包含数字/字母/字符中的2种组合": "密码需至少包含数字/字母/字符中的2种组合",
|
"密码需至少包含数字/字母/字符中的2种组合": "密码需至少包含数字/字母/字符中的2种组合",
|
||||||
"已开锁": "已开锁",
|
"已开锁": "已开锁",
|
||||||
"已闭锁": "已闭锁",
|
"已闭锁": "已闭锁",
|
||||||
"两次密码不一致哦": "两次密码不一致哦"
|
"两次密码不一致哦": "两次密码不一致哦",
|
||||||
|
|
||||||
|
"中功率": "中功率",
|
||||||
|
"常规使用": "常规使用"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1104,9 +1104,12 @@
|
|||||||
"支持的语言": "支持的语言",
|
"支持的语言": "支持的语言",
|
||||||
"英语": "英语",
|
"英语": "英语",
|
||||||
"Google Home操作流程的值": "1.用智能锁APP添加锁和网关\n\n2.在APP里开启锁的远程开锁功能(这个功能默认是关闭的)。如果没有这个选项,则锁不支持Google Home \n\n3.安装Google Home APP,点击左上角的“+”按钮\n\n4.在设置页面,选择“与Google协同工作”\n\n5.搜索“ScienerSmart”,并用智能锁APP的账号和密码进行授权\n\n",
|
"Google Home操作流程的值": "1.用智能锁APP添加锁和网关\n\n2.在APP里开启锁的远程开锁功能(这个功能默认是关闭的)。如果没有这个选项,则锁不支持Google Home \n\n3.安装Google Home APP,点击左上角的“+”按钮\n\n4.在设置页面,选择“与Google协同工作”\n\n5.搜索“ScienerSmart”,并用智能锁APP的账号和密码进行授权\n\n",
|
||||||
|
|
||||||
"密码需至少包含数字/字母/字符中的2种组合": "密码需至少包含数字/字母/字符中的2种组合",
|
"密码需至少包含数字/字母/字符中的2种组合": "密码需至少包含数字/字母/字符中的2种组合",
|
||||||
"已开锁": "已开锁",
|
"已开锁": "已开锁",
|
||||||
"已闭锁": "已闭锁",
|
"已闭锁": "已闭锁",
|
||||||
"两次密码不一致哦": "两次密码不一致哦"
|
"两次密码不一致哦": "两次密码不一致哦",
|
||||||
|
|
||||||
|
"中功率": "中功率",
|
||||||
|
"常规使用": "常规使用"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import 'package:star_lock/tools/commonDataManage.dart';
|
|||||||
import 'io_tool/io_model.dart';
|
import 'io_tool/io_model.dart';
|
||||||
import 'io_tool/io_tool.dart';
|
import 'io_tool/io_tool.dart';
|
||||||
import 'io_tool/manager_event_bus.dart';
|
import 'io_tool/manager_event_bus.dart';
|
||||||
|
import 'io_type.dart';
|
||||||
import 'reciver_data.dart';
|
import 'reciver_data.dart';
|
||||||
|
|
||||||
//连接状态回调
|
//连接状态回调
|
||||||
@ -241,7 +242,8 @@ class BlueManage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// 开始扫描蓝牙设备
|
/// 开始扫描蓝牙设备
|
||||||
Future<void> startScan(int timeout, ScanDevicesCallBack scanDevicesCallBack,
|
Future<void> startScan(int timeout, DeviceType deviceType,
|
||||||
|
ScanDevicesCallBack scanDevicesCallBack,
|
||||||
{List<Guid>? idList}) async {
|
{List<Guid>? idList}) async {
|
||||||
FlutterBluePlus.isSupported.then((bool isAvailable) async {
|
FlutterBluePlus.isSupported.then((bool isAvailable) async {
|
||||||
if (isAvailable) {
|
if (isAvailable) {
|
||||||
@ -259,7 +261,7 @@ class BlueManage {
|
|||||||
? scanResult.advertisementData.serviceUuids[0]
|
? scanResult.advertisementData.serviceUuids[0]
|
||||||
: '')
|
: '')
|
||||||
.toString()
|
.toString()
|
||||||
.contains('758824')) &&
|
.contains(getDeviceType(deviceType))) &&
|
||||||
(scanResult.rssi >= -100)) {
|
(scanResult.rssi >= -100)) {
|
||||||
// 查询id相同的元素
|
// 查询id相同的元素
|
||||||
final int knownDeviceIndex = scanDevices.indexWhere(
|
final int knownDeviceIndex = scanDevices.indexWhere(
|
||||||
|
|||||||
@ -1,134 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
/// 该协议已弃用 使用新协议SenderAddICCardWithTimeCycleCoercionCommand 2024.4.16 addby 魏少阳
|
|
||||||
///
|
|
||||||
/// 设置自定义密码
|
|
||||||
// /*
|
|
||||||
// 备注:
|
|
||||||
// 删除单个指纹规则:UseCountLimit 设置为 0。删除全部指纹规则: UseCountLimit 设置为 0,FingerNo 设置为 255,userId 设置为“Delete All !@#”,只有门锁管理员才有权限
|
|
||||||
// **/
|
|
||||||
// class SenderAddICCardCommand extends SenderProtocol {
|
|
||||||
// String? keyID;
|
|
||||||
// String? userID;
|
|
||||||
// int? cardNo;
|
|
||||||
// int? useCountLimit;
|
|
||||||
// List<int>? token;
|
|
||||||
// int? startTime;
|
|
||||||
// int? endTime;
|
|
||||||
// int? needAuthor;
|
|
||||||
// List<int>? signKey;
|
|
||||||
// List<int>? privateKey;
|
|
||||||
//
|
|
||||||
// SenderAddICCardCommand({
|
|
||||||
// this.keyID,
|
|
||||||
// this.userID,
|
|
||||||
// this.cardNo,
|
|
||||||
// this.useCountLimit,
|
|
||||||
// this.token,
|
|
||||||
// this.startTime,
|
|
||||||
// this.endTime,
|
|
||||||
// this.needAuthor,
|
|
||||||
// this.signKey,
|
|
||||||
// this.privateKey,
|
|
||||||
// }) : super(CommandType.generalExtendedCommond);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// List<int> messageDetail() {
|
|
||||||
// List<int> data = [];
|
|
||||||
// List<int> subData = [];
|
|
||||||
// List<int> ebcData = [];
|
|
||||||
//
|
|
||||||
// // 指令类型
|
|
||||||
// int type = commandType!.typeValue;
|
|
||||||
// double typeDouble = type / 256;
|
|
||||||
// int type1 = typeDouble.toInt();
|
|
||||||
// int type2 = type % 256;
|
|
||||||
// data.add(type1);
|
|
||||||
// data.add(type2);
|
|
||||||
//
|
|
||||||
// // 子命令类型
|
|
||||||
// data.add(21);
|
|
||||||
//
|
|
||||||
// // keyID 40
|
|
||||||
// int keyIDLength = utf8.encode(keyID!).length;
|
|
||||||
// subData.addAll(utf8.encode(keyID!));
|
|
||||||
// subData = getFixedLengthList(subData, 40 - keyIDLength);
|
|
||||||
//
|
|
||||||
// //userID 20
|
|
||||||
// int userIDLength = utf8.encode(userID!).length;
|
|
||||||
// subData.addAll(utf8.encode(userID!));
|
|
||||||
// subData = getFixedLengthList(subData, 20 - userIDLength);
|
|
||||||
//
|
|
||||||
// // PwdNo
|
|
||||||
// subData.add(cardNo!);
|
|
||||||
//
|
|
||||||
// // UseCountLimit
|
|
||||||
// subData.add(useCountLimit!);
|
|
||||||
//
|
|
||||||
// // token
|
|
||||||
// subData.addAll(token!);
|
|
||||||
//
|
|
||||||
// // startTime 4
|
|
||||||
// subData.add((startTime! & 0xff000000) >> 24);
|
|
||||||
// subData.add((startTime! & 0xff0000) >> 16);
|
|
||||||
// subData.add((startTime! & 0xff00) >> 8);
|
|
||||||
// subData.add((startTime! & 0xff));
|
|
||||||
//
|
|
||||||
// // endTime 4
|
|
||||||
// subData.add((endTime! & 0xff000000) >> 24);
|
|
||||||
// subData.add((endTime! & 0xff0000) >> 16);
|
|
||||||
// subData.add((endTime! & 0xff00) >> 8);
|
|
||||||
// subData.add((endTime! & 0xff));
|
|
||||||
//
|
|
||||||
// if (needAuthor == 0) {
|
|
||||||
// //AuthCodeLen 1
|
|
||||||
// subData.add(0);
|
|
||||||
// } else {
|
|
||||||
// List<int> authCodeData = [];
|
|
||||||
// //KeyID
|
|
||||||
// authCodeData.addAll(utf8.encode(keyID!));
|
|
||||||
//
|
|
||||||
// //authUserID
|
|
||||||
// authCodeData.addAll(utf8.encode(userID!));
|
|
||||||
//
|
|
||||||
// //token 4 首次请求 Token 填 0,如果锁需要鉴权操作者身份,则会分配动态口令并在应答消息中返回,二次请求时带上。
|
|
||||||
// authCodeData.addAll(token!);
|
|
||||||
//
|
|
||||||
// authCodeData.addAll(signKey!);
|
|
||||||
//
|
|
||||||
// // 把KeyID、authUserID、时间戳、公钥通过md5加密之后就是authCode
|
|
||||||
// var authCode = crypto.md5.convert(authCodeData);
|
|
||||||
//
|
|
||||||
// subData.add(authCode.bytes.length);
|
|
||||||
// subData.addAll(authCode.bytes);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// data.add(subData.length);
|
|
||||||
// data.addAll(subData);
|
|
||||||
//
|
|
||||||
// if ((data.length % 16) != 0) {
|
|
||||||
// int add = (16 - data.length % 16);
|
|
||||||
// for (int i = 0; i < add; i++) {
|
|
||||||
// data.add(0);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// // 拿到数据之后通过LockId进行SM4 ECB加密 key:544d485f633335373034383064613864
|
|
||||||
// ebcData = SM4.encrypt(data, key: privateKey, mode: SM4CryptoMode.ECB);
|
|
||||||
// return ebcData;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class SenderAddICCardReply extends Reply {
|
|
||||||
// SenderAddICCardReply.parseData(CommandType commandType, List<int> dataDetail)
|
|
||||||
// : super.parseData(commandType, dataDetail) {
|
|
||||||
// data = dataDetail;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class SenderAddICCardConfirmationReply extends Reply {
|
|
||||||
// SenderAddICCardConfirmationReply.parseData(
|
|
||||||
// CommandType commandType, List<int> dataDetail)
|
|
||||||
// : super.parseData(commandType, dataDetail) {
|
|
||||||
// data = dataDetail;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
@ -16,7 +15,6 @@ import 'package:crypto/crypto.dart' as crypto;
|
|||||||
删除单个指纹规则:UseCountLimit 设置为 0。删除全部指纹规则: UseCountLimit 设置为 0,FingerNo 设置为 255,userId 设置为“Delete All !@#”,只有门锁管理员才有权限
|
删除单个指纹规则:UseCountLimit 设置为 0。删除全部指纹规则: UseCountLimit 设置为 0,FingerNo 设置为 255,userId 设置为“Delete All !@#”,只有门锁管理员才有权限
|
||||||
**/
|
**/
|
||||||
class SenderAddICCardWithTimeCycleCoercionCommand extends SenderProtocol {
|
class SenderAddICCardWithTimeCycleCoercionCommand extends SenderProtocol {
|
||||||
|
|
||||||
SenderAddICCardWithTimeCycleCoercionCommand({
|
SenderAddICCardWithTimeCycleCoercionCommand({
|
||||||
this.keyID,
|
this.keyID,
|
||||||
this.userID,
|
this.userID,
|
||||||
@ -55,7 +53,6 @@ class SenderAddICCardWithTimeCycleCoercionCommand extends SenderProtocol {
|
|||||||
List<int>? signKey;
|
List<int>? signKey;
|
||||||
List<int>? privateKey;
|
List<int>? privateKey;
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SenderAddICCardWithTimeCycleCoercionCommand{keyID: $keyID, '
|
return 'SenderAddICCardWithTimeCycleCoercionCommand{keyID: $keyID, '
|
||||||
@ -131,8 +128,8 @@ class SenderAddICCardWithTimeCycleCoercionCommand extends SenderProtocol {
|
|||||||
subData.add(endDate! & 0xff);
|
subData.add(endDate! & 0xff);
|
||||||
|
|
||||||
// startTime 4
|
// startTime 4
|
||||||
final List<int> startTimeList = <int>[0,0,0,0];
|
final List<int> startTimeList = <int>[0, 0, 0, 0];
|
||||||
if(startTime!.contains(':')){
|
if (startTime!.contains(':')) {
|
||||||
final List<String> getStartTimeList = startTime!.split(':');
|
final List<String> getStartTimeList = startTime!.split(':');
|
||||||
startTimeList[2] = int.parse(getStartTimeList[0]);
|
startTimeList[2] = int.parse(getStartTimeList[0]);
|
||||||
startTimeList[3] = int.parse(getStartTimeList[1]);
|
startTimeList[3] = int.parse(getStartTimeList[1]);
|
||||||
@ -140,15 +137,15 @@ class SenderAddICCardWithTimeCycleCoercionCommand extends SenderProtocol {
|
|||||||
subData.addAll(startTimeList);
|
subData.addAll(startTimeList);
|
||||||
|
|
||||||
// endTime 4
|
// endTime 4
|
||||||
final List<int> endTimeList = <int>[0,0,0,0];
|
final List<int> endTimeList = <int>[0, 0, 0, 0];
|
||||||
if(endTime!.contains(':')){
|
if (endTime!.contains(':')) {
|
||||||
final List<String> getendTimeList = endTime!.split(':');
|
final List<String> getendTimeList = endTime!.split(':');
|
||||||
endTimeList[2] = int.parse(getendTimeList[0]);
|
endTimeList[2] = int.parse(getendTimeList[0]);
|
||||||
endTimeList[3] = int.parse(getendTimeList[1]);
|
endTimeList[3] = int.parse(getendTimeList[1]);
|
||||||
}
|
}
|
||||||
subData.addAll(endTimeList);
|
subData.addAll(endTimeList);
|
||||||
|
|
||||||
if(needAuthor == 0){
|
if (needAuthor == 0) {
|
||||||
//AuthCodeLen 1
|
//AuthCodeLen 1
|
||||||
subData.add(0);
|
subData.add(0);
|
||||||
} else {
|
} else {
|
||||||
@ -189,7 +186,8 @@ class SenderAddICCardWithTimeCycleCoercionCommand extends SenderProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SenderAddICCardWithTimeCycleCoercionReply extends Reply {
|
class SenderAddICCardWithTimeCycleCoercionReply extends Reply {
|
||||||
SenderAddICCardWithTimeCycleCoercionReply.parseData(CommandType commandType, List<int> dataDetail)
|
SenderAddICCardWithTimeCycleCoercionReply.parseData(
|
||||||
|
CommandType commandType, List<int> dataDetail)
|
||||||
: super.parseData(commandType, dataDetail) {
|
: super.parseData(commandType, dataDetail) {
|
||||||
data = dataDetail;
|
data = dataDetail;
|
||||||
final int status = data[2];
|
final int status = data[2];
|
||||||
@ -198,7 +196,8 @@ class SenderAddICCardWithTimeCycleCoercionReply extends Reply {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SenderAddICCardConfirmationReply extends Reply {
|
class SenderAddICCardConfirmationReply extends Reply {
|
||||||
SenderAddICCardConfirmationReply.parseData(CommandType commandType, List<int> dataDetail)
|
SenderAddICCardConfirmationReply.parseData(
|
||||||
|
CommandType commandType, List<int> dataDetail)
|
||||||
: super.parseData(commandType, dataDetail) {
|
: super.parseData(commandType, dataDetail) {
|
||||||
data = dataDetail;
|
data = dataDetail;
|
||||||
final int status = data[2];
|
final int status = data[2];
|
||||||
|
|||||||
@ -1,152 +0,0 @@
|
|||||||
|
|
||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:crypto/crypto.dart' as crypto;
|
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
|
||||||
|
|
||||||
import '../io_reply.dart';
|
|
||||||
import '../io_sender.dart';
|
|
||||||
import '../io_tool/io_tool.dart';
|
|
||||||
import '../io_type.dart';
|
|
||||||
import '../sm4Encipher/sm4.dart';
|
|
||||||
|
|
||||||
/// 添加胁迫密码
|
|
||||||
/*
|
|
||||||
备注:
|
|
||||||
删除单个指纹规则:UseCountLimit 设置为 0。删除全部指纹规则: UseCountLimit 设置为 0,FingerNo 设置为 255,userId 设置为“Delete All !@#”,只有门锁管理员才有权限
|
|
||||||
**/
|
|
||||||
class SenderAddStressPasswordCommand extends SenderProtocol {
|
|
||||||
|
|
||||||
SenderAddStressPasswordCommand({
|
|
||||||
this.keyID,
|
|
||||||
this.userID,
|
|
||||||
this.passwordNo,
|
|
||||||
this.useCountLimit,
|
|
||||||
this.token,
|
|
||||||
this.startTime,
|
|
||||||
this.endTime,
|
|
||||||
this.needAuthor,
|
|
||||||
this.publicKey,
|
|
||||||
this.privateKey,
|
|
||||||
}) : super(CommandType.generalExtendedCommond);
|
|
||||||
|
|
||||||
String? keyID;
|
|
||||||
String? userID;
|
|
||||||
int? passwordNo;
|
|
||||||
int? useCountLimit;
|
|
||||||
List<int>? token;
|
|
||||||
int? startTime;
|
|
||||||
int? endTime;
|
|
||||||
int? needAuthor;
|
|
||||||
List<int>? publicKey;
|
|
||||||
List<int>? privateKey;
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'SenderAddStressPasswordCommand{keyID: $keyID, userID: $userID, '
|
|
||||||
'passwordNo: $passwordNo, useCountLimit: $useCountLimit, '
|
|
||||||
'token: $token, '
|
|
||||||
'startTime: ${DateTool().dateIntToYMDHNString(startTime)}, '
|
|
||||||
'endTime: ${DateTool().dateIntToYMDHNString(endTime)}, '
|
|
||||||
'needAuthor: $needAuthor, publicKey: $publicKey, '
|
|
||||||
'privateKey: $privateKey}';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
List<int> messageDetail() {
|
|
||||||
final List<int> data = <int>[];
|
|
||||||
List<int> subData = <int>[];
|
|
||||||
List<int> ebcData = <int>[];
|
|
||||||
|
|
||||||
// 指令类型
|
|
||||||
final int type = commandType!.typeValue;
|
|
||||||
final double typeDouble = type / 256;
|
|
||||||
final int type1 = typeDouble.toInt();
|
|
||||||
final int type2 = type % 256;
|
|
||||||
data.add(type1);
|
|
||||||
data.add(type2);
|
|
||||||
|
|
||||||
// 子命令类型
|
|
||||||
data.add(60);
|
|
||||||
|
|
||||||
// keyID 40
|
|
||||||
final int keyIDLength = utf8.encode(keyID!).length;
|
|
||||||
subData.addAll(utf8.encode(keyID!));
|
|
||||||
subData = getFixedLengthList(subData, 40 - keyIDLength);
|
|
||||||
|
|
||||||
//userID 20
|
|
||||||
final int userIDLength = utf8.encode(userID!).length;
|
|
||||||
subData.addAll(utf8.encode(userID!));
|
|
||||||
subData = getFixedLengthList(subData, 20 - userIDLength);
|
|
||||||
|
|
||||||
// PwdNo
|
|
||||||
subData.add(passwordNo!);
|
|
||||||
|
|
||||||
// UseCountLimit
|
|
||||||
subData.add(0xff);
|
|
||||||
|
|
||||||
// token
|
|
||||||
subData.addAll(token!);
|
|
||||||
|
|
||||||
// startTime 4
|
|
||||||
subData.add((startTime! & 0xff000000) >> 24);
|
|
||||||
subData.add((startTime! & 0xff0000) >> 16);
|
|
||||||
subData.add((startTime! & 0xff00) >> 8);
|
|
||||||
subData.add(startTime! & 0xff);
|
|
||||||
|
|
||||||
// endTime 4
|
|
||||||
subData.add((endTime! & 0xff000000) >> 24);
|
|
||||||
subData.add((endTime! & 0xff0000) >> 16);
|
|
||||||
subData.add((endTime! & 0xff00) >> 8);
|
|
||||||
subData.add(endTime! & 0xff);
|
|
||||||
|
|
||||||
if(needAuthor == 0){
|
|
||||||
//AuthCodeLen 1
|
|
||||||
subData.add(0);
|
|
||||||
} else {
|
|
||||||
final List<int> authCodeData = <int>[];
|
|
||||||
|
|
||||||
//authUserID
|
|
||||||
authCodeData.addAll(utf8.encode(userID!));
|
|
||||||
|
|
||||||
//KeyID
|
|
||||||
authCodeData.addAll(utf8.encode(keyID!));
|
|
||||||
|
|
||||||
//token 4 首次请求 Token 填 0,如果锁需要鉴权操作者身份,则会分配动态口令并在应答消息中返回,二次请求时带上。
|
|
||||||
authCodeData.addAll(token!);
|
|
||||||
|
|
||||||
authCodeData.addAll(publicKey!);
|
|
||||||
|
|
||||||
// 把KeyID、authUserID、时间戳、公钥通过md5加密之后就是authCode
|
|
||||||
final crypto.Digest authCode = crypto.md5.convert(authCodeData);
|
|
||||||
|
|
||||||
subData.add(authCode.bytes.length);
|
|
||||||
subData.addAll(authCode.bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
data.add(subData.length);
|
|
||||||
data.addAll(subData);
|
|
||||||
|
|
||||||
if ((data.length % 16) != 0) {
|
|
||||||
final int add = 16 - data.length % 16;
|
|
||||||
for (int i = 0; i < add; i++) {
|
|
||||||
data.add(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
printLog(data);
|
|
||||||
// 拿到数据之后通过LockId进行SM4 ECB加密 key:544d485f633335373034383064613864
|
|
||||||
ebcData = SM4.encrypt(data, key: privateKey, mode: SM4CryptoMode.ECB);
|
|
||||||
return ebcData;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class SenderAddStressPasswordReply extends Reply {
|
|
||||||
SenderAddStressPasswordReply.parseData(CommandType commandType, List<int> dataDetail)
|
|
||||||
: super.parseData(commandType, dataDetail) {
|
|
||||||
data = dataDetail;
|
|
||||||
final int status = data[2];
|
|
||||||
errorWithStstus(status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,126 +0,0 @@
|
|||||||
|
|
||||||
// 查询指纹状态
|
|
||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import '../../app_settings/app_settings.dart';
|
|
||||||
import '../io_reply.dart';
|
|
||||||
import '../io_sender.dart';
|
|
||||||
import '../io_tool/io_tool.dart';
|
|
||||||
import '../io_type.dart';
|
|
||||||
import '../sm4Encipher/sm4.dart';
|
|
||||||
import 'package:crypto/crypto.dart' as crypto;
|
|
||||||
|
|
||||||
class SenderCheckingCardStatusCommand extends SenderProtocol {
|
|
||||||
SenderCheckingCardStatusCommand({
|
|
||||||
this.keyID,
|
|
||||||
this.userID,
|
|
||||||
this.role,
|
|
||||||
this.cardCount,
|
|
||||||
this.cardNo,
|
|
||||||
this.token,
|
|
||||||
this.needAuthor,
|
|
||||||
this.publicKey,
|
|
||||||
this.privateKey,
|
|
||||||
}) : super(CommandType.generalExtendedCommond);
|
|
||||||
|
|
||||||
String? keyID;
|
|
||||||
String? userID;
|
|
||||||
int? role;
|
|
||||||
int? cardCount;
|
|
||||||
int? cardNo;
|
|
||||||
List<int>? token;
|
|
||||||
int? needAuthor;
|
|
||||||
List<int>? publicKey;
|
|
||||||
List<int>? privateKey;
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'SenderCheckingCardStatusCommand{keyID: $keyID, userID: $userID, '
|
|
||||||
'role: $role, cardCount: $cardCount, cardNo: $cardNo, token: $token, '
|
|
||||||
'needAuthor: $needAuthor, publicKey: $publicKey, privateKey: $privateKey}';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
List<int> messageDetail() {
|
|
||||||
final List<int> data = <int>[];
|
|
||||||
List<int> subData = <int>[];
|
|
||||||
List<int> ebcData = <int>[];
|
|
||||||
|
|
||||||
// 指令类型
|
|
||||||
final int type = commandType!.typeValue;
|
|
||||||
final double typeDouble = type / 256;
|
|
||||||
final int type1 = typeDouble.toInt();
|
|
||||||
final int type2 = type % 256;
|
|
||||||
data.add(type1);
|
|
||||||
data.add(type2);
|
|
||||||
|
|
||||||
// 子命令类型
|
|
||||||
data.add(20);
|
|
||||||
|
|
||||||
// keyID 40
|
|
||||||
final int keyIDLength = utf8.encode(keyID!).length;
|
|
||||||
subData.addAll(utf8.encode(keyID!));
|
|
||||||
subData = getFixedLengthList(subData, 40 - keyIDLength);
|
|
||||||
|
|
||||||
//userID 20
|
|
||||||
final int userIDLength = utf8.encode(userID!).length;
|
|
||||||
subData.addAll(utf8.encode(userID!));
|
|
||||||
subData = getFixedLengthList(subData, 20 - userIDLength);
|
|
||||||
|
|
||||||
// role
|
|
||||||
subData.add(role!);
|
|
||||||
|
|
||||||
// CardCount
|
|
||||||
subData.add(cardCount!);
|
|
||||||
|
|
||||||
// CardNo
|
|
||||||
subData.add(cardNo!);
|
|
||||||
|
|
||||||
if(needAuthor == 0){
|
|
||||||
//AuthCodeLen 1
|
|
||||||
subData.add(0);
|
|
||||||
} else {
|
|
||||||
final List<int> authCodeData = <int>[];
|
|
||||||
|
|
||||||
//authUserID
|
|
||||||
authCodeData.addAll(utf8.encode(userID!));
|
|
||||||
|
|
||||||
//KeyID
|
|
||||||
authCodeData.addAll(utf8.encode(keyID!));
|
|
||||||
|
|
||||||
//token 4 首次请求 Token 填 0,如果锁需要鉴权操作者身份,则会分配动态口令并在应答消息中返回,二次请求时带上。
|
|
||||||
authCodeData.addAll(token!);
|
|
||||||
|
|
||||||
authCodeData.addAll(publicKey!);
|
|
||||||
|
|
||||||
// 把KeyID、authUserID、时间戳、公钥通过md5加密之后就是authCode
|
|
||||||
final crypto.Digest authCode = crypto.md5.convert(authCodeData);
|
|
||||||
|
|
||||||
subData.add(authCode.bytes.length);
|
|
||||||
subData.addAll(authCode.bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
data.add(subData.length);
|
|
||||||
data.addAll(subData);
|
|
||||||
|
|
||||||
if ((data.length % 16) != 0) {
|
|
||||||
final int add = 16 - data.length % 16;
|
|
||||||
for (int i = 0; i < add; i++) {
|
|
||||||
data.add(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
printLog(data);
|
|
||||||
// 拿到数据之后通过LockId进行SM4 ECB加密 key:544d485f633335373034383064613864
|
|
||||||
ebcData = SM4.encrypt(data, key: privateKey, mode: SM4CryptoMode.ECB);
|
|
||||||
return ebcData;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class SenderCheckingCardStatusReply extends Reply {
|
|
||||||
SenderCheckingCardStatusReply.parseData(CommandType commandType, List<int> dataDetail)
|
|
||||||
: super.parseData(commandType, dataDetail) {
|
|
||||||
data = dataDetail;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,130 +0,0 @@
|
|||||||
|
|
||||||
// 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
|
||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:crypto/crypto.dart' as crypto;
|
|
||||||
|
|
||||||
import '../io_reply.dart';
|
|
||||||
import '../io_sender.dart';
|
|
||||||
import '../io_tool/io_tool.dart';
|
|
||||||
import '../io_type.dart';
|
|
||||||
import '../sm4Encipher/sm4.dart';
|
|
||||||
|
|
||||||
class SenderCheckingUserInfoCountCommand extends SenderProtocol {
|
|
||||||
|
|
||||||
SenderCheckingUserInfoCountCommand({
|
|
||||||
this.keyID,
|
|
||||||
this.userID,
|
|
||||||
this.role,
|
|
||||||
this.nowTime,
|
|
||||||
this.token,
|
|
||||||
this.needAuthor,
|
|
||||||
this.publicKey,
|
|
||||||
this.privateKey,
|
|
||||||
}) : super(CommandType.generalExtendedCommond);
|
|
||||||
|
|
||||||
String? keyID;
|
|
||||||
String? userID;
|
|
||||||
int? role;
|
|
||||||
int? nowTime;
|
|
||||||
List<int>? token;
|
|
||||||
int? needAuthor;
|
|
||||||
List<int>? publicKey;
|
|
||||||
List<int>? privateKey;
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'SenderCheckingUserInfoCountCommand{keyID: $keyID, userID: $userID,'
|
|
||||||
' role: $role, nowTime: $nowTime, token: $token, '
|
|
||||||
'needAuthor: $needAuthor, publicKey: $publicKey, privateKey: $privateKey}';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
List<int> messageDetail() {
|
|
||||||
final List<int> data = <int>[];
|
|
||||||
List<int> subData = <int>[];
|
|
||||||
List<int> ebcData = <int>[];
|
|
||||||
|
|
||||||
// 指令类型
|
|
||||||
final int type = commandType!.typeValue;
|
|
||||||
final double typeDouble = type / 256;
|
|
||||||
final int type1 = typeDouble.toInt();
|
|
||||||
final int type2 = type % 256;
|
|
||||||
data.add(type1);
|
|
||||||
data.add(type2);
|
|
||||||
|
|
||||||
// 子命令类型
|
|
||||||
data.add(15);
|
|
||||||
|
|
||||||
// keyID 40
|
|
||||||
final int keyIDLength = utf8.encode(keyID!).length;
|
|
||||||
subData.addAll(utf8.encode(keyID!));
|
|
||||||
subData = getFixedLengthList(subData, 40 - keyIDLength);
|
|
||||||
|
|
||||||
//userID 20
|
|
||||||
final int userIDLength = utf8.encode(userID!).length;
|
|
||||||
subData.addAll(utf8.encode(userID!));
|
|
||||||
subData = getFixedLengthList(subData, 20 - userIDLength);
|
|
||||||
|
|
||||||
// Role
|
|
||||||
subData.add(role!);
|
|
||||||
|
|
||||||
// time
|
|
||||||
subData.add((nowTime! & 0xff000000) >> 24);
|
|
||||||
subData.add((nowTime! & 0xff0000) >> 16);
|
|
||||||
subData.add((nowTime! & 0xff00) >> 8);
|
|
||||||
subData.add(nowTime! & 0xff);
|
|
||||||
|
|
||||||
// token
|
|
||||||
// subData.addAll(token!);
|
|
||||||
|
|
||||||
if(needAuthor == 0){
|
|
||||||
//AuthCodeLen 1
|
|
||||||
subData.add(0);
|
|
||||||
} else {
|
|
||||||
final List<int> authCodeData = <int>[];
|
|
||||||
|
|
||||||
//authUserID
|
|
||||||
authCodeData.addAll(utf8.encode(userID!));
|
|
||||||
|
|
||||||
//KeyID
|
|
||||||
authCodeData.addAll(utf8.encode(keyID!));
|
|
||||||
|
|
||||||
//token 4 首次请求 Token 填 0,如果锁需要鉴权操作者身份,则会分配动态口令并在应答消息中返回,二次请求时带上。
|
|
||||||
authCodeData.addAll(token!);
|
|
||||||
|
|
||||||
authCodeData.addAll(publicKey!);
|
|
||||||
|
|
||||||
// 把KeyID、authUserID、时间戳、公钥通过md5加密之后就是authCode
|
|
||||||
final crypto.Digest authCode = crypto.md5.convert(authCodeData);
|
|
||||||
|
|
||||||
subData.add(authCode.bytes.length);
|
|
||||||
subData.addAll(authCode.bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
data.add(subData.length);
|
|
||||||
data.addAll(subData);
|
|
||||||
|
|
||||||
if ((data.length % 16) != 0) {
|
|
||||||
final int add = 16 - data.length % 16;
|
|
||||||
for (int i = 0; i < add; i++) {
|
|
||||||
data.add(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
printLog(data);
|
|
||||||
// 拿到数据之后通过LockId进行SM4 ECB加密 key:544d485f633335373034383064613864
|
|
||||||
ebcData = SM4.encrypt(data, key: privateKey, mode: SM4CryptoMode.ECB);
|
|
||||||
return ebcData;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class SenderCheckingUserInfoCountReply extends Reply {
|
|
||||||
SenderCheckingUserInfoCountReply.parseData(CommandType commandType, List<int> dataDetail)
|
|
||||||
: super.parseData(commandType, dataDetail) {
|
|
||||||
data = dataDetail;
|
|
||||||
final int status = data[2];
|
|
||||||
errorWithStstus(status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,128 +0,0 @@
|
|||||||
|
|
||||||
// 查询人脸状态
|
|
||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:crypto/crypto.dart' as crypto;
|
|
||||||
|
|
||||||
import '../io_reply.dart';
|
|
||||||
import '../io_sender.dart';
|
|
||||||
import '../io_tool/io_tool.dart';
|
|
||||||
import '../io_type.dart';
|
|
||||||
import '../sm4Encipher/sm4.dart';
|
|
||||||
|
|
||||||
class SenderQueryingFaceStatusCommand extends SenderProtocol {
|
|
||||||
|
|
||||||
SenderQueryingFaceStatusCommand({
|
|
||||||
this.keyID,
|
|
||||||
this.userID,
|
|
||||||
this.role,
|
|
||||||
this.faceCount,
|
|
||||||
this.faceNo,
|
|
||||||
this.token,
|
|
||||||
this.needAuthor,
|
|
||||||
this.publicKey,
|
|
||||||
this.privateKey,
|
|
||||||
}) : super(CommandType.generalExtendedCommond);
|
|
||||||
String? keyID;
|
|
||||||
String? userID;
|
|
||||||
int? role;
|
|
||||||
int? faceCount;
|
|
||||||
int? faceNo;
|
|
||||||
List<int>? token;
|
|
||||||
int? needAuthor;
|
|
||||||
List<int>? publicKey;
|
|
||||||
List<int>? privateKey;
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'SenderQueryingFaceStatusCommand{keyID: $keyID, userID: $userID, '
|
|
||||||
'role: $role, faceCount: $faceCount, faceNo: $faceNo, token: $token, '
|
|
||||||
'needAuthor: $needAuthor, publicKey: $publicKey, privateKey: $privateKey}';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
List<int> messageDetail() {
|
|
||||||
final List<int> data = <int>[];
|
|
||||||
List<int> subData = <int>[];
|
|
||||||
List<int> ebcData = <int>[];
|
|
||||||
|
|
||||||
// 指令类型
|
|
||||||
final int type = commandType!.typeValue;
|
|
||||||
final double typeDouble = type / 256;
|
|
||||||
final int type1 = typeDouble.toInt();
|
|
||||||
final int type2 = type % 256;
|
|
||||||
data.add(type1);
|
|
||||||
data.add(type2);
|
|
||||||
|
|
||||||
// 子命令类型--查询人脸状态
|
|
||||||
data.add(80);
|
|
||||||
|
|
||||||
// keyID 40
|
|
||||||
final int keyIDLength = utf8.encode(keyID!).length;
|
|
||||||
subData.addAll(utf8.encode(keyID!));
|
|
||||||
subData = getFixedLengthList(subData, 40 - keyIDLength);
|
|
||||||
|
|
||||||
//userID 20
|
|
||||||
final int userIDLength = utf8.encode(userID!).length;
|
|
||||||
subData.addAll(utf8.encode(userID!));
|
|
||||||
subData = getFixedLengthList(subData, 20 - userIDLength);
|
|
||||||
|
|
||||||
// role
|
|
||||||
subData.add(role!);
|
|
||||||
|
|
||||||
// fingerCount
|
|
||||||
subData.add(faceCount!);
|
|
||||||
|
|
||||||
// FingerNo
|
|
||||||
subData.add(faceNo!);
|
|
||||||
|
|
||||||
if (needAuthor == 0) {
|
|
||||||
//AuthCodeLen 1
|
|
||||||
subData.add(0);
|
|
||||||
} else {
|
|
||||||
final List<int> authCodeData = <int>[];
|
|
||||||
|
|
||||||
//authUserID
|
|
||||||
authCodeData.addAll(utf8.encode(userID!));
|
|
||||||
|
|
||||||
//KeyID
|
|
||||||
authCodeData.addAll(utf8.encode(keyID!));
|
|
||||||
|
|
||||||
//token 4 首次请求 Token 填 0,如果锁需要鉴权操作者身份,则会分配动态口令并在应答消息中返回,二次请求时带上。
|
|
||||||
authCodeData.addAll(token!);
|
|
||||||
|
|
||||||
authCodeData.addAll(publicKey!);
|
|
||||||
|
|
||||||
// 把KeyID、authUserID、时间戳、公钥通过md5加密之后就是authCode
|
|
||||||
final crypto.Digest authCode = crypto.md5.convert(authCodeData);
|
|
||||||
|
|
||||||
subData.add(authCode.bytes.length);
|
|
||||||
subData.addAll(authCode.bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
data.add(subData.length);
|
|
||||||
data.addAll(subData);
|
|
||||||
|
|
||||||
if ((data.length % 16) != 0) {
|
|
||||||
final int add = 16 - data.length % 16;
|
|
||||||
for (int i = 0; i < add; i++) {
|
|
||||||
data.add(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
printLog(data);
|
|
||||||
ebcData = SM4.encrypt(data, key: privateKey, mode: SM4CryptoMode.ECB);
|
|
||||||
return ebcData;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class SenderQueryingFaceStatusReply extends Reply {
|
|
||||||
SenderQueryingFaceStatusReply.parseData(
|
|
||||||
CommandType commandType, List<int> dataDetail)
|
|
||||||
: super.parseData(commandType, dataDetail) {
|
|
||||||
data = dataDetail;
|
|
||||||
final int status = data[2];
|
|
||||||
errorWithStstus(status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,129 +0,0 @@
|
|||||||
|
|
||||||
// 查询指纹状态
|
|
||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:crypto/crypto.dart' as crypto;
|
|
||||||
|
|
||||||
import '../io_reply.dart';
|
|
||||||
import '../io_sender.dart';
|
|
||||||
import '../io_tool/io_tool.dart';
|
|
||||||
import '../io_type.dart';
|
|
||||||
import '../sm4Encipher/sm4.dart';
|
|
||||||
|
|
||||||
class SenderQueryingFingerprintStatusCommand extends SenderProtocol {
|
|
||||||
|
|
||||||
SenderQueryingFingerprintStatusCommand({
|
|
||||||
this.keyID,
|
|
||||||
this.userID,
|
|
||||||
this.role,
|
|
||||||
this.fingerCount,
|
|
||||||
this.fingerNo,
|
|
||||||
this.token,
|
|
||||||
this.needAuthor,
|
|
||||||
this.publicKey,
|
|
||||||
this.privateKey,
|
|
||||||
}) : super(CommandType.generalExtendedCommond);
|
|
||||||
|
|
||||||
String? keyID;
|
|
||||||
String? userID;
|
|
||||||
int? role;
|
|
||||||
int? fingerCount;
|
|
||||||
int? fingerNo;
|
|
||||||
List<int>? token;
|
|
||||||
int? needAuthor;
|
|
||||||
List<int>? publicKey;
|
|
||||||
List<int>? privateKey;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'SenderQueryingFingerprintStatusCommand{keyID: $keyID, '
|
|
||||||
'userID: $userID, role: $role, fingerCount: $fingerCount, '
|
|
||||||
'fingerNo: $fingerNo, token: $token, needAuthor: $needAuthor, '
|
|
||||||
'publicKey: $publicKey, privateKey: $privateKey}';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
List<int> messageDetail() {
|
|
||||||
final List<int> data = <int>[];
|
|
||||||
List<int> subData = <int>[];
|
|
||||||
List<int> ebcData = <int>[];
|
|
||||||
|
|
||||||
// 指令类型
|
|
||||||
final int type = commandType!.typeValue;
|
|
||||||
final double typeDouble = type / 256;
|
|
||||||
final int type1 = typeDouble.toInt();
|
|
||||||
final int type2 = type % 256;
|
|
||||||
data.add(type1);
|
|
||||||
data.add(type2);
|
|
||||||
|
|
||||||
// 子命令类型
|
|
||||||
data.add(30);
|
|
||||||
|
|
||||||
// keyID 40
|
|
||||||
final int keyIDLength = utf8.encode(keyID!).length;
|
|
||||||
subData.addAll(utf8.encode(keyID!));
|
|
||||||
subData = getFixedLengthList(subData, 40 - keyIDLength);
|
|
||||||
|
|
||||||
//userID 20
|
|
||||||
final int userIDLength = utf8.encode(userID!).length;
|
|
||||||
subData.addAll(utf8.encode(userID!));
|
|
||||||
subData = getFixedLengthList(subData, 20 - userIDLength);
|
|
||||||
|
|
||||||
// role
|
|
||||||
subData.add(role!);
|
|
||||||
|
|
||||||
// fingerCount
|
|
||||||
subData.add(fingerCount!);
|
|
||||||
|
|
||||||
// FingerNo
|
|
||||||
subData.add(fingerNo!);
|
|
||||||
|
|
||||||
if(needAuthor == 0){
|
|
||||||
//AuthCodeLen 1
|
|
||||||
subData.add(0);
|
|
||||||
} else {
|
|
||||||
final List<int> authCodeData = <int>[];
|
|
||||||
|
|
||||||
//authUserID
|
|
||||||
authCodeData.addAll(utf8.encode(userID!));
|
|
||||||
|
|
||||||
//KeyID
|
|
||||||
authCodeData.addAll(utf8.encode(keyID!));
|
|
||||||
|
|
||||||
//token 4 首次请求 Token 填 0,如果锁需要鉴权操作者身份,则会分配动态口令并在应答消息中返回,二次请求时带上。
|
|
||||||
authCodeData.addAll(token!);
|
|
||||||
|
|
||||||
authCodeData.addAll(publicKey!);
|
|
||||||
|
|
||||||
// 把KeyID、authUserID、时间戳、公钥通过md5加密之后就是authCode
|
|
||||||
final crypto.Digest authCode = crypto.md5.convert(authCodeData);
|
|
||||||
|
|
||||||
subData.add(authCode.bytes.length);
|
|
||||||
subData.addAll(authCode.bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
data.add(subData.length);
|
|
||||||
data.addAll(subData);
|
|
||||||
|
|
||||||
if ((data.length % 16) != 0) {
|
|
||||||
final int add = 16 - data.length % 16;
|
|
||||||
for (int i = 0; i < add; i++) {
|
|
||||||
data.add(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
printLog(data);
|
|
||||||
// 拿到数据之后通过LockId进行SM4 ECB加密 key:544d485f633335373034383064613864
|
|
||||||
ebcData = SM4.encrypt(data, key: privateKey, mode: SM4CryptoMode.ECB);
|
|
||||||
return ebcData;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class SenderQueryingFingerprintStatusReply extends Reply {
|
|
||||||
SenderQueryingFingerprintStatusReply.parseData(CommandType commandType, List<int> dataDetail)
|
|
||||||
: super.parseData(commandType, dataDetail) {
|
|
||||||
data = dataDetail;
|
|
||||||
final int status = data[2];
|
|
||||||
errorWithStstus(status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,127 +0,0 @@
|
|||||||
|
|
||||||
// 查询事件记录(序号、数量查询)
|
|
||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:crypto/crypto.dart' as crypto;
|
|
||||||
|
|
||||||
import '../io_reply.dart';
|
|
||||||
import '../io_sender.dart';
|
|
||||||
import '../io_tool/io_tool.dart';
|
|
||||||
import '../io_type.dart';
|
|
||||||
import '../sm4Encipher/sm4.dart';
|
|
||||||
|
|
||||||
class SenderReferEventRecordNumberCommand extends SenderProtocol {
|
|
||||||
SenderReferEventRecordNumberCommand({
|
|
||||||
this.keyID,
|
|
||||||
this.userID,
|
|
||||||
this.logsCount,
|
|
||||||
this.logsNo,
|
|
||||||
this.token,
|
|
||||||
this.needAuthor,
|
|
||||||
this.publicKey,
|
|
||||||
this.privateKey,
|
|
||||||
}) : super(CommandType.generalExtendedCommond);
|
|
||||||
|
|
||||||
String? keyID;
|
|
||||||
String? userID;
|
|
||||||
int? logsCount;
|
|
||||||
int? logsNo;
|
|
||||||
List<int>? token;
|
|
||||||
int? needAuthor;
|
|
||||||
List<int>? publicKey;
|
|
||||||
List<int>? privateKey;
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'SenderReferEventRecordNumberCommand{keyID: $keyID, '
|
|
||||||
'userID: $userID, logsCount: $logsCount, logsNo: $logsNo, '
|
|
||||||
'token: $token, needAuthor: $needAuthor, publicKey: $publicKey, '
|
|
||||||
'privateKey: $privateKey}';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
List<int> messageDetail() {
|
|
||||||
final List<int> data = <int>[];
|
|
||||||
List<int> subData = <int>[];
|
|
||||||
List<int> ebcData = <int>[];
|
|
||||||
|
|
||||||
// 指令类型
|
|
||||||
final int type = commandType!.typeValue;
|
|
||||||
final double typeDouble = type / 256;
|
|
||||||
final int type1 = typeDouble.toInt();
|
|
||||||
final int type2 = type % 256;
|
|
||||||
data.add(type1);
|
|
||||||
data.add(type2);
|
|
||||||
|
|
||||||
// 子命令类型
|
|
||||||
data.add(40);
|
|
||||||
|
|
||||||
// keyID 40
|
|
||||||
final int keyIDLength = utf8.encode(keyID!).length;
|
|
||||||
subData.addAll(utf8.encode(keyID!));
|
|
||||||
subData = getFixedLengthList(subData, 40 - keyIDLength);
|
|
||||||
|
|
||||||
//userID 20
|
|
||||||
final int userIDLength = utf8.encode(userID!).length;
|
|
||||||
subData.addAll(utf8.encode(userID!));
|
|
||||||
subData = getFixedLengthList(subData, 20 - userIDLength);
|
|
||||||
|
|
||||||
// logsCount
|
|
||||||
subData.add(logsCount!);
|
|
||||||
|
|
||||||
// logsNo
|
|
||||||
subData.add(logsNo!);
|
|
||||||
|
|
||||||
// token
|
|
||||||
// subData.addAll(token!);
|
|
||||||
|
|
||||||
if(needAuthor == 0){
|
|
||||||
//AuthCodeLen 1
|
|
||||||
subData.add(0);
|
|
||||||
} else {
|
|
||||||
final List<int> authCodeData = <int>[];
|
|
||||||
|
|
||||||
//authUserID
|
|
||||||
authCodeData.addAll(utf8.encode(userID!));
|
|
||||||
|
|
||||||
//KeyID
|
|
||||||
authCodeData.addAll(utf8.encode(keyID!));
|
|
||||||
|
|
||||||
//token 4 首次请求 Token 填 0,如果锁需要鉴权操作者身份,则会分配动态口令并在应答消息中返回,二次请求时带上。
|
|
||||||
authCodeData.addAll(token!);
|
|
||||||
|
|
||||||
authCodeData.addAll(publicKey!);
|
|
||||||
|
|
||||||
// 把KeyID、authUserID、时间戳、公钥通过md5加密之后就是authCode
|
|
||||||
final crypto.Digest authCode = crypto.md5.convert(authCodeData);
|
|
||||||
|
|
||||||
subData.add(authCode.bytes.length);
|
|
||||||
subData.addAll(authCode.bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
data.add(subData.length);
|
|
||||||
data.addAll(subData);
|
|
||||||
|
|
||||||
if ((data.length % 16) != 0) {
|
|
||||||
final int add = 16 - data.length % 16;
|
|
||||||
for (int i = 0; i < add; i++) {
|
|
||||||
data.add(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
printLog(data);
|
|
||||||
// 拿到数据之后通过LockId进行SM4 ECB加密 key:544d485f633335373034383064613864
|
|
||||||
ebcData = SM4.encrypt(data, key: privateKey, mode: SM4CryptoMode.ECB);
|
|
||||||
return ebcData;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class SenderReferEventRecordNumberReply extends Reply {
|
|
||||||
SenderReferEventRecordNumberReply.parseData(CommandType commandType, List<int> dataDetail)
|
|
||||||
: super.parseData(commandType, dataDetail) {
|
|
||||||
data = dataDetail;
|
|
||||||
final int status = data[2];
|
|
||||||
errorWithStstus(status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,128 +0,0 @@
|
|||||||
|
|
||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:crypto/crypto.dart' as crypto;
|
|
||||||
|
|
||||||
import '../io_reply.dart';
|
|
||||||
import '../io_sender.dart';
|
|
||||||
import '../io_tool/io_tool.dart';
|
|
||||||
import '../io_type.dart';
|
|
||||||
import '../sm4Encipher/sm4.dart';
|
|
||||||
|
|
||||||
// 转移权限
|
|
||||||
class TransferPermissionsCommand extends SenderProtocol {
|
|
||||||
TransferPermissionsCommand({
|
|
||||||
this.lockID,
|
|
||||||
this.authUserID,
|
|
||||||
this.keyID,
|
|
||||||
this.oldUserID,
|
|
||||||
this.newUserID,
|
|
||||||
this.needAuthor,
|
|
||||||
this.publicKey,
|
|
||||||
this.privateKey,
|
|
||||||
this.token
|
|
||||||
}) : super(CommandType.transferPermissions);
|
|
||||||
|
|
||||||
String? lockID;
|
|
||||||
String? authUserID;
|
|
||||||
String? keyID;
|
|
||||||
String? oldUserID;
|
|
||||||
String? newUserID;
|
|
||||||
int? needAuthor;
|
|
||||||
List<int>? publicKey;
|
|
||||||
List<int>? privateKey;
|
|
||||||
List<int>? token;
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'TransferPermissionsCommand{lockID: $lockID, '
|
|
||||||
'authUserID: $authUserID, keyID: $keyID, oldUserID: $oldUserID, '
|
|
||||||
'newUserID: $newUserID, needAuthor: $needAuthor, '
|
|
||||||
'publicKey: $publicKey, privateKey: $privateKey, token: $token}';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
List<int> messageDetail() {
|
|
||||||
List<int> data = <int>[];
|
|
||||||
List<int> ebcData = <int>[];
|
|
||||||
|
|
||||||
// 指令类型
|
|
||||||
final int type = commandType!.typeValue;
|
|
||||||
final double typeDouble = type / 256;
|
|
||||||
final int type1 = typeDouble.toInt();
|
|
||||||
final int type2 = type % 256;
|
|
||||||
data.add(type1);
|
|
||||||
data.add(type2);
|
|
||||||
|
|
||||||
// 锁id 40
|
|
||||||
final int lockIDLength = utf8.encode(lockID!).length;
|
|
||||||
data.addAll(utf8.encode(lockID!));
|
|
||||||
data = getFixedLengthList(data, 40 - lockIDLength);
|
|
||||||
|
|
||||||
//authUserID 20
|
|
||||||
final int authUserIDLength = utf8.encode(authUserID!).length;
|
|
||||||
data.addAll(utf8.encode(authUserID!));
|
|
||||||
data = getFixedLengthList(data, 20 - authUserIDLength);
|
|
||||||
|
|
||||||
//KeyID 40
|
|
||||||
final int keyIDLength = utf8.encode(keyID!).length;
|
|
||||||
data.addAll(utf8.encode(keyID!));
|
|
||||||
data = getFixedLengthList(data, 40 - keyIDLength);
|
|
||||||
|
|
||||||
//oldUserID 20
|
|
||||||
final int oldUserIDLength = utf8.encode(oldUserID!).length;
|
|
||||||
data.addAll(utf8.encode(oldUserID!));
|
|
||||||
data = getFixedLengthList(data, 20 - oldUserIDLength);
|
|
||||||
|
|
||||||
//newUserID 20
|
|
||||||
final int newUserIDLength = utf8.encode(newUserID!).length;
|
|
||||||
data.addAll(utf8.encode(newUserID!));
|
|
||||||
data = getFixedLengthList(data, 20 - newUserIDLength);
|
|
||||||
|
|
||||||
// token 长度4 首次请求 Token 填 0,如果锁需要鉴权 操作者身份,则会分配动态口令并在应答消息中返回,二次请求时带上。 当token失效或者第一次发送的时候token为0
|
|
||||||
data.addAll(token!);
|
|
||||||
|
|
||||||
if(needAuthor == 0){
|
|
||||||
//AuthCodeLen 1
|
|
||||||
data.add(0);
|
|
||||||
} else {
|
|
||||||
final List<int> authCodeData = <int>[];
|
|
||||||
|
|
||||||
//authUserID
|
|
||||||
authCodeData.addAll(utf8.encode(authUserID!));
|
|
||||||
|
|
||||||
//KeyID
|
|
||||||
authCodeData.addAll(utf8.encode(keyID!));
|
|
||||||
|
|
||||||
//token 4 首次请求 Token 填 0,如果锁需要鉴权操作者身份,则会分配动态口令并在应答消息中返回,二次请求时带上。
|
|
||||||
authCodeData.addAll(token!);
|
|
||||||
|
|
||||||
authCodeData.addAll(publicKey!);
|
|
||||||
|
|
||||||
// 把KeyID、authUserID、时间戳、公钥通过md5加密之后就是authCode
|
|
||||||
final crypto.Digest authCode = crypto.md5.convert(authCodeData);
|
|
||||||
|
|
||||||
data.add(authCode.bytes.length);
|
|
||||||
data.addAll(authCode.bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((data.length % 16) != 0) {
|
|
||||||
final int add = 16 - data.length % 16;
|
|
||||||
for (int i = 0; i < add; i++) {
|
|
||||||
data.add(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
printLog(data);
|
|
||||||
ebcData = SM4.encrypt(data, key: privateKey, mode: SM4CryptoMode.ECB);
|
|
||||||
return ebcData;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class TransferPermissionsReply extends Reply {
|
|
||||||
TransferPermissionsReply.parseData(CommandType commandType, List<int> dataDetail)
|
|
||||||
: super.parseData(commandType, dataDetail) {
|
|
||||||
data = dataDetail;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,20 +1,37 @@
|
|||||||
|
// 设备
|
||||||
|
enum DeviceType {
|
||||||
|
blue, // 758824
|
||||||
|
|
||||||
|
gateway // 758825
|
||||||
|
}
|
||||||
|
|
||||||
|
String getDeviceType(DeviceType deviceType) {
|
||||||
|
String t = '758824';
|
||||||
|
switch (deviceType) {
|
||||||
|
case DeviceType.blue:
|
||||||
|
t = '758824';
|
||||||
|
break;
|
||||||
|
case DeviceType.gateway:
|
||||||
|
t = '758825';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
// 发送指令类型
|
// 发送指令类型
|
||||||
enum CommandType {
|
enum CommandType {
|
||||||
addUser, //增加用户 = 0x3001
|
addUser, //增加用户 = 0x3001
|
||||||
deletUser, //删除用户 = 0x3002
|
deletUser, //删除用户 = 0x3002
|
||||||
editUser, //修改用户 = 0x3003
|
editUser, //修改用户 = 0x3003
|
||||||
transferSmartLock, //转移智能锁 = 0x300D
|
|
||||||
factoryDataReset, //恢复出厂设置 = 0x3004
|
factoryDataReset, //恢复出厂设置 = 0x3004
|
||||||
openLock, //开门 = 0x3005
|
openLock, //开门 = 0x3005
|
||||||
readLockStatusInfo, //读取锁状态信息 = 0x300A
|
|
||||||
transferPermissions, //转移权限 = 0x300B
|
|
||||||
cleanUpUsers, //转移权限 = 0x300C
|
cleanUpUsers, //转移权限 = 0x300C
|
||||||
reportDoorOpenRecord, //开门记录上报 = 0x3020
|
transferSmartLock, //转移智能锁 = 0x300D
|
||||||
updataLockPasswordList, //上传数据-获取锁密码列表 0x3021
|
updataLockPasswordList, //上传数据-获取锁密码列表 0x3021
|
||||||
updataLockCardList, //上传数据-获取锁卡片列表 0x3022
|
updataLockCardList, //上传数据-获取锁卡片列表 0x3022
|
||||||
updataLockFingerprintList, //上传数据-获取锁指纹列表 0x3023
|
updataLockFingerprintList, //上传数据-获取锁指纹列表 0x3023
|
||||||
updataLockFaceList, //上传数据-获取锁指纹列表 0x3024
|
updataLockFaceList, //上传数据-获取锁人脸列表 0x3024
|
||||||
updataLockPalmVeinList, //上传数据-获取锁指纹列表 0x3025
|
updataLockPalmVeinList, //上传数据-获取锁掌静脉列表 0x3025
|
||||||
updataLockRemoteControlList, //上传数据-获取锁遥控列表 0x3026
|
updataLockRemoteControlList, //上传数据-获取锁遥控列表 0x3026
|
||||||
updataLockSet, //上传数据-获取锁设置 0x302A
|
updataLockSet, //上传数据-获取锁设置 0x302A
|
||||||
getLockPublicKey, // 获取锁公钥 = 0x3090
|
getLockPublicKey, // 获取锁公钥 = 0x3090
|
||||||
@ -22,13 +39,14 @@ enum CommandType {
|
|||||||
calibrationTime, // 校时 = 0x30f0
|
calibrationTime, // 校时 = 0x30f0
|
||||||
readStarLockStatusInfo, //读星锁状态信息 0x3040
|
readStarLockStatusInfo, //读星锁状态信息 0x3040
|
||||||
startOATUpgrade, //OTA升级开始 0x30E0
|
startOATUpgrade, //OTA升级开始 0x30E0
|
||||||
confirmationOTAUpgrade, //OTA升级开始 0x30E2
|
|
||||||
processOTAUpgrade, //OTA升级过程 0x30E1
|
processOTAUpgrade, //OTA升级过程 0x30E1
|
||||||
gatewayGetStatus,//获取网关状态 0x30F8
|
confirmationOTAUpgrade, //OTA升级确认 0x30E2
|
||||||
gatewayConfiguringWifi,//网关配网 0x30F4
|
|
||||||
gatewayConfiguringWifiResult,//网关配网结果 0x30F5
|
gatewayConfiguringWifi, //网关配网 0x30F4
|
||||||
gatewayGetWifiList,//网关获取附近的wifi列表 0x30F6
|
gatewayConfiguringWifiResult, //网关配网结果 0x30F5
|
||||||
gatewayGetWifiListResult,//网关获取附近的wifi列表结果 0x30F7
|
gatewayGetWifiList, //网关获取附近的wifi列表 0x30F6
|
||||||
|
gatewayGetWifiListResult, //网关获取附近的wifi列表结果 0x30F7
|
||||||
|
gatewayGetStatus, //获取网关状态 0x30F8
|
||||||
|
|
||||||
generalExtendedCommond, // 通用扩展指令 = 0x3030
|
generalExtendedCommond, // 通用扩展指令 = 0x3030
|
||||||
gecChangeAdministratorPassword, // 通用扩展指令子命令-修改管理员密码 = 2
|
gecChangeAdministratorPassword, // 通用扩展指令子命令-修改管理员密码 = 2
|
||||||
@ -59,7 +77,7 @@ enum CommandType {
|
|||||||
|
|
||||||
extension ExtensionCommandType on CommandType {
|
extension ExtensionCommandType on CommandType {
|
||||||
static CommandType getCommandType(int value) {
|
static CommandType getCommandType(int value) {
|
||||||
CommandType type = CommandType.readLockStatusInfo;
|
CommandType type = CommandType.readStarLockStatusInfo;
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case 0x3001:
|
case 0x3001:
|
||||||
{
|
{
|
||||||
@ -96,21 +114,6 @@ extension ExtensionCommandType on CommandType {
|
|||||||
type = CommandType.transferSmartLock;
|
type = CommandType.transferSmartLock;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x300A:
|
|
||||||
{
|
|
||||||
type = CommandType.readLockStatusInfo;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 0x300B:
|
|
||||||
{
|
|
||||||
type = CommandType.transferPermissions;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 0x3020:
|
|
||||||
{
|
|
||||||
type = CommandType.reportDoorOpenRecord;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 0x3021:
|
case 0x3021:
|
||||||
{
|
{
|
||||||
type = CommandType.updataLockPasswordList;
|
type = CommandType.updataLockPasswordList;
|
||||||
@ -213,7 +216,7 @@ extension ExtensionCommandType on CommandType {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
type = CommandType.readLockStatusInfo;
|
type = CommandType.readStarLockStatusInfo;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -244,15 +247,6 @@ extension ExtensionCommandType on CommandType {
|
|||||||
case CommandType.transferSmartLock:
|
case CommandType.transferSmartLock:
|
||||||
type = 0x300D;
|
type = 0x300D;
|
||||||
break;
|
break;
|
||||||
case CommandType.readLockStatusInfo:
|
|
||||||
type = 0x300A;
|
|
||||||
break;
|
|
||||||
case CommandType.transferPermissions:
|
|
||||||
type = 0x300B;
|
|
||||||
break;
|
|
||||||
case CommandType.reportDoorOpenRecord:
|
|
||||||
type = 0x3020;
|
|
||||||
break;
|
|
||||||
case CommandType.updataLockPasswordList:
|
case CommandType.updataLockPasswordList:
|
||||||
type = 0x3021;
|
type = 0x3021;
|
||||||
break;
|
break;
|
||||||
@ -374,9 +368,6 @@ extension ExtensionCommandType on CommandType {
|
|||||||
case 0x300B:
|
case 0x300B:
|
||||||
t = '转移权限';
|
t = '转移权限';
|
||||||
break;
|
break;
|
||||||
case 0x3020:
|
|
||||||
t = '开门记录上报';
|
|
||||||
break;
|
|
||||||
case 0x3021:
|
case 0x3021:
|
||||||
t = '上传数据获取锁密码列表';
|
t = '上传数据获取锁密码列表';
|
||||||
break;
|
break;
|
||||||
@ -410,18 +401,6 @@ extension ExtensionCommandType on CommandType {
|
|||||||
case 0x30f0:
|
case 0x30f0:
|
||||||
t = '校时';
|
t = '校时';
|
||||||
break;
|
break;
|
||||||
case 0x30f1:
|
|
||||||
t = '同步位置信息';
|
|
||||||
break;
|
|
||||||
case 0x30f2:
|
|
||||||
t = '运维开锁';
|
|
||||||
break;
|
|
||||||
case 0x3016:
|
|
||||||
t = '写酒店信息';
|
|
||||||
break;
|
|
||||||
case 0x3017:
|
|
||||||
t = '读酒店信息';
|
|
||||||
break;
|
|
||||||
case 0x3040:
|
case 0x3040:
|
||||||
t = '读星锁状态信息';
|
t = '读星锁状态信息';
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -3,6 +3,8 @@ import 'dart:convert';
|
|||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
import 'package:star_lock/blue/blue_manage.dart';
|
import 'package:star_lock/blue/blue_manage.dart';
|
||||||
|
import 'package:star_lock/blue/io_gateway/io_gateway_configuringWifi.dart';
|
||||||
|
import 'package:star_lock/blue/io_gateway/io_gateway_getWifiList.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_addPalmWithTimeCycleCoercion.dart';
|
import 'package:star_lock/blue/io_protocol/io_addPalmWithTimeCycleCoercion.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_changeAdministratorPassword.dart';
|
import 'package:star_lock/blue/io_protocol/io_changeAdministratorPassword.dart';
|
||||||
@ -10,11 +12,8 @@ import 'package:star_lock/blue/io_protocol/io_cleanUpUsers.dart';
|
|||||||
import 'package:star_lock/blue/io_protocol/io_deletUser.dart';
|
import 'package:star_lock/blue/io_protocol/io_deletUser.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_editUser.dart';
|
import 'package:star_lock/blue/io_protocol/io_editUser.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_factoryDataReset.dart';
|
import 'package:star_lock/blue/io_protocol/io_factoryDataReset.dart';
|
||||||
import 'package:star_lock/blue/io_gateway/io_gateway_configuringWifi.dart';
|
|
||||||
import 'package:star_lock/blue/io_gateway/io_gateway_getWifiList.dart';
|
|
||||||
import 'package:star_lock/blue/io_protocol/io_otaUpgrade.dart';
|
import 'package:star_lock/blue/io_protocol/io_otaUpgrade.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_processOtaUpgrade.dart';
|
import 'package:star_lock/blue/io_protocol/io_processOtaUpgrade.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_queryingFaceStatus.dart';
|
|
||||||
import 'package:star_lock/blue/io_protocol/io_readAdminPassword.dart';
|
import 'package:star_lock/blue/io_protocol/io_readAdminPassword.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_readSupportFunctionsNoParameters.dart';
|
import 'package:star_lock/blue/io_protocol/io_readSupportFunctionsNoParameters.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_readSupportFunctionsWithParameters.dart';
|
import 'package:star_lock/blue/io_protocol/io_readSupportFunctionsWithParameters.dart';
|
||||||
@ -22,25 +21,19 @@ import 'package:star_lock/blue/io_protocol/io_referEventRecordTime.dart';
|
|||||||
import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsNoParameters.dart';
|
import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsNoParameters.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsWithParameters.dart';
|
import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsWithParameters.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_timing.dart';
|
import 'package:star_lock/blue/io_protocol/io_timing.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_transferPermissions.dart';
|
|
||||||
|
|
||||||
import '../tools/storage.dart';
|
import '../tools/storage.dart';
|
||||||
|
import 'io_gateway/io_gateway_getStatus.dart';
|
||||||
import 'io_protocol/io_addFingerprintWithTimeCycleCoercion.dart';
|
import 'io_protocol/io_addFingerprintWithTimeCycleCoercion.dart';
|
||||||
import 'io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
import 'io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
||||||
import 'io_protocol/io_addRemoteControlWithTimeCycleCoercion.dart';
|
import 'io_protocol/io_addRemoteControlWithTimeCycleCoercion.dart';
|
||||||
import 'io_protocol/io_addStressPassword.dart';
|
|
||||||
import 'io_protocol/io_addUser.dart';
|
import 'io_protocol/io_addUser.dart';
|
||||||
import 'io_protocol/io_checkingCardStatus.dart';
|
|
||||||
import 'io_protocol/io_checkingUserInfoCount.dart';
|
|
||||||
import 'io_protocol/io_configuringWifi.dart';
|
import 'io_protocol/io_configuringWifi.dart';
|
||||||
import 'io_gateway/io_gateway_getStatus.dart';
|
|
||||||
import 'io_protocol/io_getPrivateKey.dart';
|
import 'io_protocol/io_getPrivateKey.dart';
|
||||||
import 'io_protocol/io_getPublicKey.dart';
|
import 'io_protocol/io_getPublicKey.dart';
|
||||||
import 'io_protocol/io_getStarLockStatusInfo.dart';
|
import 'io_protocol/io_getStarLockStatusInfo.dart';
|
||||||
import 'io_protocol/io_getWifiList.dart';
|
import 'io_protocol/io_getWifiList.dart';
|
||||||
import 'io_protocol/io_openLock.dart';
|
import 'io_protocol/io_openLock.dart';
|
||||||
import 'io_protocol/io_queryingFingerprintStatus.dart';
|
|
||||||
import 'io_protocol/io_referEventRecordNumber.dart';
|
|
||||||
import 'io_protocol/io_senderCustomPasswords.dart';
|
import 'io_protocol/io_senderCustomPasswords.dart';
|
||||||
import 'io_protocol/io_senderResetPasswords.dart';
|
import 'io_protocol/io_senderResetPasswords.dart';
|
||||||
import 'io_protocol/io_transferSmartLock.dart';
|
import 'io_protocol/io_transferSmartLock.dart';
|
||||||
@ -174,11 +167,6 @@ class CommandReciverManager {
|
|||||||
reply = EditUserReply.parseData(commandType, data);
|
reply = EditUserReply.parseData(commandType, data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CommandType.transferPermissions:
|
|
||||||
{
|
|
||||||
reply = TransferPermissionsReply.parseData(commandType, data);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CommandType.transferSmartLock:
|
case CommandType.transferSmartLock:
|
||||||
{
|
{
|
||||||
reply = TransferSmartLockReply.parseData(commandType, data);
|
reply = TransferSmartLockReply.parseData(commandType, data);
|
||||||
@ -306,13 +294,6 @@ class CommandReciverManager {
|
|||||||
// reply = AutomaticPadlockReply.parseData(commandType, data);
|
// reply = AutomaticPadlockReply.parseData(commandType, data);
|
||||||
// }
|
// }
|
||||||
// break;
|
// break;
|
||||||
case 15:
|
|
||||||
{
|
|
||||||
// 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
|
||||||
reply = SenderCheckingUserInfoCountReply.parseData(
|
|
||||||
commandType, data);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 19:
|
case 19:
|
||||||
{
|
{
|
||||||
// 重置开锁密码
|
// 重置开锁密码
|
||||||
@ -320,13 +301,6 @@ class CommandReciverManager {
|
|||||||
SenderResetPasswordsReply.parseData(commandType, data);
|
SenderResetPasswordsReply.parseData(commandType, data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 20:
|
|
||||||
{
|
|
||||||
// 查询卡片状态
|
|
||||||
reply = SenderCheckingCardStatusReply.parseData(
|
|
||||||
commandType, data);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
// case 21:
|
// case 21:
|
||||||
// {
|
// {
|
||||||
// // 注册卡片开始
|
// // 注册卡片开始
|
||||||
@ -361,20 +335,6 @@ class CommandReciverManager {
|
|||||||
commandType, data);
|
commandType, data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 30:
|
|
||||||
{
|
|
||||||
// 查询指纹状态
|
|
||||||
reply = SenderQueryingFingerprintStatusReply.parseData(
|
|
||||||
commandType, data);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
// case 31:
|
|
||||||
// {
|
|
||||||
// // 注册指纹开始
|
|
||||||
// reply =
|
|
||||||
// SenderAddFingerprintReply.parseData(commandType, data);
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
case 32:
|
case 32:
|
||||||
{
|
{
|
||||||
// 注册指纹确认
|
// 注册指纹确认
|
||||||
@ -397,13 +357,6 @@ class CommandReciverManager {
|
|||||||
commandType, data);
|
commandType, data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 40:
|
|
||||||
{
|
|
||||||
// 事件查询记录
|
|
||||||
reply = SenderReferEventRecordNumberReply.parseData(
|
|
||||||
commandType, data);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 41:
|
case 41:
|
||||||
{
|
{
|
||||||
// 时间条件查询事件记录
|
// 时间条件查询事件记录
|
||||||
@ -450,27 +403,6 @@ class CommandReciverManager {
|
|||||||
reply = SenderGetWifiListReply.parseData(commandType, data);
|
reply = SenderGetWifiListReply.parseData(commandType, data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 60:
|
|
||||||
{
|
|
||||||
// 注册胁迫密码
|
|
||||||
reply =
|
|
||||||
SenderAddStressPasswordReply.parseData(commandType, data);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
// case 61:
|
|
||||||
// {
|
|
||||||
// // 注册胁迫卡片
|
|
||||||
// reply =
|
|
||||||
// SenderAddStressICCardReply.parseData(commandType, data);
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
// case 62:
|
|
||||||
// {
|
|
||||||
// // 注册胁迫指纹
|
|
||||||
// reply = SenderAddStressFingerprintReply.parseData(
|
|
||||||
// commandType, data);
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
case 70:
|
case 70:
|
||||||
{
|
{
|
||||||
// 设置支持功能(不带参数)启用/禁用
|
// 设置支持功能(不带参数)启用/禁用
|
||||||
@ -506,13 +438,6 @@ class CommandReciverManager {
|
|||||||
SenderReadAdminPasswordReply.parseData(commandType, data);
|
SenderReadAdminPasswordReply.parseData(commandType, data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 80:
|
|
||||||
{
|
|
||||||
// 查询人脸状态
|
|
||||||
reply = SenderQueryingFaceStatusReply.parseData(
|
|
||||||
commandType, data);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 81:
|
case 81:
|
||||||
{
|
{
|
||||||
// 注册人脸开始
|
// 注册人脸开始
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
|
import 'package:star_lock/blue/io_gateway/io_gateway_getWifiList.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
||||||
|
|
||||||
import 'package:star_lock/blue/io_protocol/io_changeAdministratorPassword.dart';
|
import 'package:star_lock/blue/io_protocol/io_changeAdministratorPassword.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_cleanUpUsers.dart';
|
import 'package:star_lock/blue/io_protocol/io_cleanUpUsers.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_deletUser.dart';
|
import 'package:star_lock/blue/io_protocol/io_deletUser.dart';
|
||||||
import 'package:star_lock/blue/io_gateway/io_gateway_getWifiList.dart';
|
|
||||||
import 'package:star_lock/blue/io_protocol/io_otaUpgrade.dart';
|
import 'package:star_lock/blue/io_protocol/io_otaUpgrade.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_processOtaUpgrade.dart';
|
import 'package:star_lock/blue/io_protocol/io_processOtaUpgrade.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_queryingFaceStatus.dart';
|
|
||||||
import 'package:star_lock/blue/io_protocol/io_readAdminPassword.dart';
|
import 'package:star_lock/blue/io_protocol/io_readAdminPassword.dart';
|
||||||
|
|
||||||
|
import 'io_gateway/io_gateway_configuringWifi.dart';
|
||||||
|
import 'io_gateway/io_gateway_getStatus.dart';
|
||||||
import 'io_protocol/io_addCardCancel.dart';
|
import 'io_protocol/io_addCardCancel.dart';
|
||||||
import 'io_protocol/io_addFaceCancel.dart';
|
import 'io_protocol/io_addFaceCancel.dart';
|
||||||
import 'io_protocol/io_addFingerprintCancel.dart';
|
import 'io_protocol/io_addFingerprintCancel.dart';
|
||||||
@ -18,31 +18,23 @@ import 'io_protocol/io_addPalmCancel.dart';
|
|||||||
import 'io_protocol/io_addPalmWithTimeCycleCoercion.dart';
|
import 'io_protocol/io_addPalmWithTimeCycleCoercion.dart';
|
||||||
import 'io_protocol/io_addRemoteControlCancel.dart';
|
import 'io_protocol/io_addRemoteControlCancel.dart';
|
||||||
import 'io_protocol/io_addRemoteControlWithTimeCycleCoercion.dart';
|
import 'io_protocol/io_addRemoteControlWithTimeCycleCoercion.dart';
|
||||||
import 'io_protocol/io_addStressPassword.dart';
|
|
||||||
import 'io_protocol/io_addUser.dart';
|
import 'io_protocol/io_addUser.dart';
|
||||||
import 'io_protocol/io_checkingCardStatus.dart';
|
|
||||||
import 'io_protocol/io_checkingUserInfoCount.dart';
|
|
||||||
import 'io_protocol/io_configuringWifi.dart';
|
import 'io_protocol/io_configuringWifi.dart';
|
||||||
import 'io_protocol/io_editUser.dart';
|
import 'io_protocol/io_editUser.dart';
|
||||||
import 'io_protocol/io_factoryDataReset.dart';
|
import 'io_protocol/io_factoryDataReset.dart';
|
||||||
import 'io_gateway/io_gateway_configuringWifi.dart';
|
|
||||||
import 'io_gateway/io_gateway_getStatus.dart';
|
|
||||||
import 'io_protocol/io_getPrivateKey.dart';
|
import 'io_protocol/io_getPrivateKey.dart';
|
||||||
import 'io_protocol/io_getPublicKey.dart';
|
import 'io_protocol/io_getPublicKey.dart';
|
||||||
import 'io_protocol/io_getStarLockStatusInfo.dart';
|
import 'io_protocol/io_getStarLockStatusInfo.dart';
|
||||||
import 'io_protocol/io_getWifiList.dart';
|
import 'io_protocol/io_getWifiList.dart';
|
||||||
import 'io_protocol/io_openLock.dart';
|
import 'io_protocol/io_openLock.dart';
|
||||||
import 'io_protocol/io_queryingFingerprintStatus.dart';
|
|
||||||
import 'io_protocol/io_readSupportFunctionsNoParameters.dart';
|
import 'io_protocol/io_readSupportFunctionsNoParameters.dart';
|
||||||
import 'io_protocol/io_readSupportFunctionsWithParameters.dart';
|
import 'io_protocol/io_readSupportFunctionsWithParameters.dart';
|
||||||
import 'io_protocol/io_referEventRecordNumber.dart';
|
|
||||||
import 'io_protocol/io_referEventRecordTime.dart';
|
import 'io_protocol/io_referEventRecordTime.dart';
|
||||||
import 'io_protocol/io_senderCustomPasswords.dart';
|
import 'io_protocol/io_senderCustomPasswords.dart';
|
||||||
import 'io_protocol/io_senderResetPasswords.dart';
|
import 'io_protocol/io_senderResetPasswords.dart';
|
||||||
import 'io_protocol/io_setSupportFunctionsNoParameters.dart';
|
import 'io_protocol/io_setSupportFunctionsNoParameters.dart';
|
||||||
import 'io_protocol/io_setSupportFunctionsWithParameters.dart';
|
import 'io_protocol/io_setSupportFunctionsWithParameters.dart';
|
||||||
import 'io_protocol/io_timing.dart';
|
import 'io_protocol/io_timing.dart';
|
||||||
import 'io_protocol/io_transferPermissions.dart';
|
|
||||||
import 'io_protocol/io_updataLockCardList.dart';
|
import 'io_protocol/io_updataLockCardList.dart';
|
||||||
import 'io_protocol/io_updataLockFaceList.dart';
|
import 'io_protocol/io_updataLockFaceList.dart';
|
||||||
import 'io_protocol/io_updataLockFingerprintList.dart';
|
import 'io_protocol/io_updataLockFingerprintList.dart';
|
||||||
@ -260,32 +252,6 @@ class IoSenderManage {
|
|||||||
callBack: callBack);
|
callBack: callBack);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转移权限
|
|
||||||
static void senderTransferPermissions(
|
|
||||||
{required String? lockID,
|
|
||||||
required String? authUserID,
|
|
||||||
required String? keyID,
|
|
||||||
required String? oldUserID,
|
|
||||||
required String? newUserID,
|
|
||||||
required int? needAuthor,
|
|
||||||
required List<int>? publicKey,
|
|
||||||
required List<int>? privateKey,
|
|
||||||
required List<int>? token,
|
|
||||||
CommandSendCallBack? callBack}) {
|
|
||||||
CommandSenderManager().managerSendData(
|
|
||||||
command: TransferPermissionsCommand(
|
|
||||||
lockID: lockID,
|
|
||||||
authUserID: authUserID,
|
|
||||||
keyID: keyID,
|
|
||||||
oldUserID: oldUserID,
|
|
||||||
newUserID: newUserID,
|
|
||||||
needAuthor: needAuthor,
|
|
||||||
publicKey: publicKey,
|
|
||||||
privateKey: privateKey,
|
|
||||||
token: token),
|
|
||||||
callBack: callBack);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 转移智能锁
|
// 转移智能锁
|
||||||
static void sendTransferSmartLockCommand(
|
static void sendTransferSmartLockCommand(
|
||||||
{required String? lockID,
|
{required String? lockID,
|
||||||
@ -834,53 +800,6 @@ class IoSenderManage {
|
|||||||
callBack: callBack);
|
callBack: callBack);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 自动落锁 - 废弃
|
|
||||||
// static void senderAutomaticPadlockCommand({
|
|
||||||
// required String? lockID,
|
|
||||||
// required String? userID,
|
|
||||||
// required int? autoLockFlag,
|
|
||||||
// required List<int>? token,
|
|
||||||
// required int? needAuthor,
|
|
||||||
// required List<int>? signKey,
|
|
||||||
// required List<int>? privateKey,
|
|
||||||
// CommandSendCallBack? callBack}) {
|
|
||||||
// CommandSenderManager().managerSendData(
|
|
||||||
// command: AutomaticPadlockCommand(
|
|
||||||
// lockID: lockID,
|
|
||||||
// userID: userID,
|
|
||||||
// autoLockFlag: autoLockFlag,
|
|
||||||
// token: token,
|
|
||||||
// needAuthor: needAuthor,
|
|
||||||
// signKey: signKey,
|
|
||||||
// privateKey: privateKey,
|
|
||||||
// ), callBack:callBack);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 事件记录(页数查询)
|
|
||||||
static void senderReferEventRecordNumberCommand(
|
|
||||||
{required String? keyID,
|
|
||||||
required String? userID,
|
|
||||||
required int? logsCount,
|
|
||||||
required int? logsNo,
|
|
||||||
required List<int>? token,
|
|
||||||
required int? needAuthor,
|
|
||||||
required List<int>? publicKey,
|
|
||||||
required List<int>? privateKey,
|
|
||||||
CommandSendCallBack? callBack}) {
|
|
||||||
CommandSenderManager().managerSendData(
|
|
||||||
command: SenderReferEventRecordNumberCommand(
|
|
||||||
keyID: keyID,
|
|
||||||
userID: userID,
|
|
||||||
logsCount: logsCount,
|
|
||||||
logsNo: logsNo,
|
|
||||||
token: token,
|
|
||||||
needAuthor: needAuthor,
|
|
||||||
publicKey: publicKey,
|
|
||||||
privateKey: privateKey,
|
|
||||||
),
|
|
||||||
callBack: callBack);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 事件记录(时间查询)
|
// 事件记录(时间查询)
|
||||||
static void senderReferEventRecordTimeCommand(
|
static void senderReferEventRecordTimeCommand(
|
||||||
{required String? keyID,
|
{required String? keyID,
|
||||||
@ -908,112 +827,6 @@ class IoSenderManage {
|
|||||||
callBack: callBack);
|
callBack: callBack);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询指纹状态
|
|
||||||
static void senderQueryingFingerprintStatusCommand(
|
|
||||||
{required String? keyID,
|
|
||||||
required String? userID,
|
|
||||||
required int? role,
|
|
||||||
required int? fingerCount,
|
|
||||||
required int? fingerNo,
|
|
||||||
required List<int>? token,
|
|
||||||
required int? needAuthor,
|
|
||||||
required List<int>? publicKey,
|
|
||||||
required List<int>? privateKey,
|
|
||||||
CommandSendCallBack? callBack}) {
|
|
||||||
CommandSenderManager().managerSendData(
|
|
||||||
command: SenderQueryingFingerprintStatusCommand(
|
|
||||||
keyID: keyID,
|
|
||||||
userID: userID,
|
|
||||||
role: role,
|
|
||||||
fingerCount: fingerCount,
|
|
||||||
fingerNo: fingerNo,
|
|
||||||
token: token,
|
|
||||||
needAuthor: needAuthor,
|
|
||||||
publicKey: publicKey,
|
|
||||||
privateKey: privateKey,
|
|
||||||
),
|
|
||||||
callBack: callBack);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询卡片状态
|
|
||||||
static void senderCheckingCardStatusCommand(
|
|
||||||
{required String? keyID,
|
|
||||||
required String? userID,
|
|
||||||
required int? role,
|
|
||||||
required int? cardCount,
|
|
||||||
required int? cardNo,
|
|
||||||
required List<int>? token,
|
|
||||||
required int? needAuthor,
|
|
||||||
required List<int>? publicKey,
|
|
||||||
required List<int>? privateKey,
|
|
||||||
CommandSendCallBack? callBack}) {
|
|
||||||
CommandSenderManager().managerSendData(
|
|
||||||
command: SenderCheckingCardStatusCommand(
|
|
||||||
keyID: keyID,
|
|
||||||
userID: userID,
|
|
||||||
role: role,
|
|
||||||
cardCount: cardCount,
|
|
||||||
cardNo: cardNo,
|
|
||||||
token: token,
|
|
||||||
needAuthor: needAuthor,
|
|
||||||
publicKey: publicKey,
|
|
||||||
privateKey: privateKey,
|
|
||||||
),
|
|
||||||
callBack: callBack);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询人脸状态
|
|
||||||
static void senderQueryingFaceStatusCommand(
|
|
||||||
{required String? keyID,
|
|
||||||
required String? userID,
|
|
||||||
required int? role,
|
|
||||||
required int? faceCount,
|
|
||||||
required int? faceNo,
|
|
||||||
required List<int>? token,
|
|
||||||
required int? needAuthor,
|
|
||||||
required List<int>? publicKey,
|
|
||||||
required List<int>? privateKey,
|
|
||||||
CommandSendCallBack? callBack}) {
|
|
||||||
CommandSenderManager().managerSendData(
|
|
||||||
command: SenderQueryingFaceStatusCommand(
|
|
||||||
keyID: keyID,
|
|
||||||
userID: userID,
|
|
||||||
role: role,
|
|
||||||
faceCount: faceCount,
|
|
||||||
faceNo: faceNo,
|
|
||||||
token: token,
|
|
||||||
needAuthor: needAuthor,
|
|
||||||
publicKey: publicKey,
|
|
||||||
privateKey: privateKey,
|
|
||||||
),
|
|
||||||
callBack: callBack);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
|
||||||
static void senderCheckingUserInfoCountCommand(
|
|
||||||
{required String? keyID,
|
|
||||||
required String? userID,
|
|
||||||
required int? role,
|
|
||||||
required int? nowTime,
|
|
||||||
required List<int>? token,
|
|
||||||
required int? needAuthor,
|
|
||||||
required List<int>? publicKey,
|
|
||||||
required List<int>? privateKey,
|
|
||||||
CommandSendCallBack? callBack}) {
|
|
||||||
CommandSenderManager().managerSendData(
|
|
||||||
command: SenderCheckingUserInfoCountCommand(
|
|
||||||
keyID: keyID,
|
|
||||||
userID: userID,
|
|
||||||
role: role,
|
|
||||||
nowTime: nowTime,
|
|
||||||
token: token,
|
|
||||||
needAuthor: needAuthor,
|
|
||||||
publicKey: publicKey,
|
|
||||||
privateKey: privateKey,
|
|
||||||
),
|
|
||||||
callBack: callBack);
|
|
||||||
}
|
|
||||||
|
|
||||||
// wifi列表
|
// wifi列表
|
||||||
static void getWifiListCommand(
|
static void getWifiListCommand(
|
||||||
{required String? keyID,
|
{required String? keyID,
|
||||||
@ -1132,35 +945,6 @@ class IoSenderManage {
|
|||||||
// callBack: callBack);
|
// callBack: callBack);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// 添加胁迫密码
|
|
||||||
static void senderAddStressPasswordCommand(
|
|
||||||
{required String? keyID,
|
|
||||||
required String? userID,
|
|
||||||
required int? passwordNo,
|
|
||||||
required int? useCountLimit,
|
|
||||||
required List<int>? token,
|
|
||||||
required int? startTime,
|
|
||||||
required int? endTime,
|
|
||||||
required int? needAuthor,
|
|
||||||
required List<int>? publicKey,
|
|
||||||
required List<int>? privateKey,
|
|
||||||
CommandSendCallBack? callBack}) {
|
|
||||||
CommandSenderManager().managerSendData(
|
|
||||||
command: SenderAddStressPasswordCommand(
|
|
||||||
keyID: keyID,
|
|
||||||
userID: userID,
|
|
||||||
passwordNo: passwordNo,
|
|
||||||
useCountLimit: useCountLimit,
|
|
||||||
token: token,
|
|
||||||
startTime: startTime,
|
|
||||||
endTime: endTime,
|
|
||||||
needAuthor: needAuthor,
|
|
||||||
publicKey: publicKey,
|
|
||||||
privateKey: privateKey,
|
|
||||||
),
|
|
||||||
callBack: callBack);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 读取支持功能(不带参数)启用/禁用
|
// 读取支持功能(不带参数)启用/禁用
|
||||||
static void readSupportFunctionsNoParametersCommand(
|
static void readSupportFunctionsNoParametersCommand(
|
||||||
{required String? keyID,
|
{required String? keyID,
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -16,7 +15,6 @@ import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
|||||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||||
|
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../blue/io_protocol/io_transferPermissions.dart';
|
|
||||||
import '../../../../blue/io_reply.dart';
|
import '../../../../blue/io_reply.dart';
|
||||||
import '../../../../blue/io_tool/io_tool.dart';
|
import '../../../../blue/io_tool/io_tool.dart';
|
||||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||||
@ -225,10 +223,11 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('add_authorizedAdmin', {
|
UmengCommonSdk.onEvent('add_authorizedAdmin', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'add_password_result':'添加授权管理员成功',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
|
'add_password_result': '添加授权管理员成功',
|
||||||
});
|
});
|
||||||
|
|
||||||
state.createUser.value = 0;
|
state.createUser.value = 0;
|
||||||
@ -245,12 +244,13 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
state.createUser.value = 1;
|
state.createUser.value = 1;
|
||||||
sendElectronicKeyRequest();
|
sendElectronicKeyRequest();
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
UmengCommonSdk.onEvent('add_authorizedAdmin', {
|
UmengCommonSdk.onEvent('add_authorizedAdmin', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'add_password_result':'添加授权管理员失败:${entity.errorMsg}',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
|
'add_password_result': '添加授权管理员失败:${entity.errorMsg}',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,15 +1,12 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_queryingFaceStatus.dart';
|
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
import 'package:star_lock/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/iris/irisList/irisList_state.dart';
|
import 'package:star_lock/main/lockDetail/iris/irisList/irisList_state.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../blue/io_protocol/io_checkingUserInfoCount.dart';
|
|
||||||
import '../../../../blue/io_reply.dart';
|
import '../../../../blue/io_reply.dart';
|
||||||
import '../../../../blue/io_tool/io_tool.dart';
|
import '../../../../blue/io_tool/io_tool.dart';
|
||||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||||
@ -29,15 +26,6 @@ class IrisListLogic extends BaseGetXController {
|
|||||||
if ((reply is SenderAddFaceReply) && (state.isDeletFaceData == true)) {
|
if ((reply is SenderAddFaceReply) && (state.isDeletFaceData == true)) {
|
||||||
_replyAddFaceBegin(reply);
|
_replyAddFaceBegin(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reply is SenderQueryingFaceStatusReply) {
|
|
||||||
// 获取人脸状态
|
|
||||||
_replyQueryingFaceStatus(reply);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reply is SenderCheckingUserInfoCountReply) {
|
|
||||||
_replyCheckingUserInfoCount(reply);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,10 +47,13 @@ class IrisListLogic extends BaseGetXController {
|
|||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
final List<int> getPrivateKeyList =
|
||||||
|
changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
final List<String>? signKey =
|
||||||
|
await Storage.getStringList(saveBlueSignKey);
|
||||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||||
|
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
@ -92,26 +83,6 @@ class IrisListLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取人脸状态
|
|
||||||
Future<void> _replyQueryingFaceStatus(Reply reply) async {
|
|
||||||
final int status = reply.data[2];
|
|
||||||
|
|
||||||
switch (status) {
|
|
||||||
case 0x00:
|
|
||||||
//成功
|
|
||||||
// _getLockStatus();
|
|
||||||
break;
|
|
||||||
case 0x06:
|
|
||||||
//无权限
|
|
||||||
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
//失败
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取卡片状态
|
// 获取卡片状态
|
||||||
Future<void> _replyReferEventRecordNumber(Reply reply) async {
|
Future<void> _replyReferEventRecordNumber(Reply reply) async {
|
||||||
final int status = reply.data[2];
|
final int status = reply.data[2];
|
||||||
@ -130,77 +101,23 @@ class IrisListLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
|
||||||
Future<void> _replyCheckingUserInfoCount(Reply reply) async {
|
|
||||||
final int status = reply.data[2];
|
|
||||||
|
|
||||||
// 用户数量
|
|
||||||
final int userNum = reply.data[5];
|
|
||||||
|
|
||||||
// 指纹数量
|
|
||||||
final int fingerNum = reply.data[6];
|
|
||||||
|
|
||||||
// 密码数量
|
|
||||||
final int pwdNum = reply.data[7];
|
|
||||||
|
|
||||||
// 卡片数量
|
|
||||||
final int cardNum = reply.data[8];
|
|
||||||
|
|
||||||
// 记录数量
|
|
||||||
final int logsNum = reply.data[9];
|
|
||||||
|
|
||||||
// 版本
|
|
||||||
final int verNo = reply.data[10];
|
|
||||||
|
|
||||||
// 最大管理员指纹数量
|
|
||||||
final int maxAdminFingerNum = reply.data[11];
|
|
||||||
|
|
||||||
// 最大用户指纹数量
|
|
||||||
final int maxUserFingerNum = reply.data[12];
|
|
||||||
|
|
||||||
// 最大管理员密码数量
|
|
||||||
final int maxAdminPassNum = reply.data[13];
|
|
||||||
|
|
||||||
// 最大用户密码数量
|
|
||||||
final int maxUserPassNum = reply.data[14];
|
|
||||||
|
|
||||||
// 最大管理员卡片数量
|
|
||||||
final int maxAdminCardNum = reply.data[15];
|
|
||||||
|
|
||||||
// 最大用户卡片数量
|
|
||||||
final int maxUserCardNum = reply.data[16];
|
|
||||||
|
|
||||||
// 序列号
|
|
||||||
final List<int> serialNo = reply.data.sublist(17, 21);
|
|
||||||
|
|
||||||
switch (status) {
|
|
||||||
case 0x00:
|
|
||||||
//成功
|
|
||||||
// _getLockStatus();
|
|
||||||
break;
|
|
||||||
case 0x06:
|
|
||||||
//需要鉴权
|
|
||||||
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
//失败
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取人脸状态
|
// 获取人脸状态
|
||||||
Future<void> senderQueryingFaceStatus() async {
|
Future<void> senderQueryingFaceStatus() async {
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
(BluetoothConnectionState state) async {
|
(BluetoothConnectionState state) async {
|
||||||
if (state == BluetoothConnectionState.connected) {
|
if (state == BluetoothConnectionState.connected) {
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
final List<int> getPrivateKeyList =
|
||||||
|
changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
|
||||||
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
|
final List<String>? publicKey =
|
||||||
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
await Storage.getStringList(saveBluePublicKey);
|
||||||
|
final List<int> getPublicKeyList =
|
||||||
|
changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
// IoSenderManage.senderQueryingFaceStatusCommand(
|
// IoSenderManage.senderQueryingFaceStatusCommand(
|
||||||
// keyID: BlueManage().connectDeviceName,
|
// keyID: BlueManage().connectDeviceName,
|
||||||
@ -222,14 +139,18 @@ class IrisListLogic extends BaseGetXController {
|
|||||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
(BluetoothConnectionState state) async {
|
(BluetoothConnectionState state) async {
|
||||||
if (state == BluetoothConnectionState.connected) {
|
if (state == BluetoothConnectionState.connected) {
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
final List<int> getPrivateKeyList =
|
||||||
|
changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
|
||||||
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
|
final List<String>? publicKey =
|
||||||
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
await Storage.getStringList(saveBluePublicKey);
|
||||||
|
final List<int> getPublicKeyList =
|
||||||
|
changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
// IoSenderManage.senderCheckingUserInfoCountCommand(
|
// IoSenderManage.senderCheckingUserInfoCountCommand(
|
||||||
// keyID: BlueManage().connectDeviceName,
|
// keyID: BlueManage().connectDeviceName,
|
||||||
@ -254,11 +175,14 @@ class IrisListLogic extends BaseGetXController {
|
|||||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
(BluetoothConnectionState deviceConnectionState) async {
|
(BluetoothConnectionState deviceConnectionState) async {
|
||||||
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
final List<String>? signKey =
|
||||||
|
await Storage.getStringList(saveBlueSignKey);
|
||||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||||
|
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
final List<int> getPrivateKeyList =
|
||||||
|
changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
@ -293,7 +217,8 @@ class IrisListLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 获取虹膜列表
|
// 获取虹膜列表
|
||||||
Future<void> getIrisListData() async {
|
Future<void> getIrisListData() async {
|
||||||
final FingerprintListDataEntity entity = await ApiRepository.to.getFaceListData(
|
final FingerprintListDataEntity entity =
|
||||||
|
await ApiRepository.to.getFaceListData(
|
||||||
lockId: state.lockId.value.toString(),
|
lockId: state.lockId.value.toString(),
|
||||||
pageNo: '1',
|
pageNo: '1',
|
||||||
pageSize: '20',
|
pageSize: '20',
|
||||||
@ -344,7 +269,9 @@ class IrisListLogic extends BaseGetXController {
|
|||||||
// 监听修改完详情之后刷新列表
|
// 监听修改完详情之后刷新列表
|
||||||
late StreamSubscription _teamEvent;
|
late StreamSubscription _teamEvent;
|
||||||
void _initRefreshAction() {
|
void _initRefreshAction() {
|
||||||
_teamEvent = eventBus.on<OtherTypeRefreshListEvent>().listen((OtherTypeRefreshListEvent event) {
|
_teamEvent = eventBus
|
||||||
|
.on<OtherTypeRefreshListEvent>()
|
||||||
|
.listen((OtherTypeRefreshListEvent event) {
|
||||||
getIrisListData();
|
getIrisListData();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
@ -20,16 +19,17 @@ import 'motorPower_state.dart';
|
|||||||
class MotorPowerLogic extends BaseGetXController {
|
class MotorPowerLogic extends BaseGetXController {
|
||||||
final MotorPowerState state = MotorPowerState();
|
final MotorPowerState state = MotorPowerState();
|
||||||
|
|
||||||
// 配置锁的常开模式设置 -> 防撬报警
|
// 配置锁的常开模式设置 -> 电机功率设置
|
||||||
Future<void> _setLockSetGeneralSetting() async{
|
Future<void> _setLockSetGeneralSetting() async {
|
||||||
final LoginEntity entity = await ApiRepository.to.setOpenDoorDirectionData(
|
final LoginEntity entity = await ApiRepository.to.setMotorTorqueData(
|
||||||
lockId: state.lockSetInfoData.value.lockId!,
|
lockId: state.lockSetInfoData.value.lockId!,
|
||||||
openDirectionValue:state.motorTorsion.value, // 1-开启、2-关闭;
|
motorTorsion: state.motorTorsion.value, // // 1:小,2:中,3:大
|
||||||
);
|
);
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
state.lockSetInfoData.value.lockSettingInfo!.openDirectionValue =
|
||||||
state.lockSetInfoData.value.lockSettingInfo!.openDirectionValue = state.motorTorsion.value;
|
state.motorTorsion.value;
|
||||||
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
eventBus
|
||||||
|
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||||
showToast('操作成功'.tr);
|
showToast('操作成功'.tr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,8 +37,9 @@ class MotorPowerLogic extends BaseGetXController {
|
|||||||
// 获取解析后的数据
|
// 获取解析后的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) {
|
_replySubscription =
|
||||||
if(reply is SetSupportFunctionsNoParametersReply) {
|
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) {
|
||||||
|
if (reply is SetSupportFunctionsNoParametersReply) {
|
||||||
_replySetSupportFunctionsWithParameters(reply);
|
_replySetSupportFunctionsWithParameters(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +70,7 @@ class MotorPowerLogic extends BaseGetXController {
|
|||||||
// 设置自动落锁数据解析
|
// 设置自动落锁数据解析
|
||||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||||
final int status = reply.data[2];
|
final int status = reply.data[2];
|
||||||
switch(status){
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
_setLockSetGeneralSetting();
|
_setLockSetGeneralSetting();
|
||||||
@ -85,16 +86,21 @@ class MotorPowerLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 读取支持功能-带参数
|
// 读取支持功能-带参数
|
||||||
Future<void> _readSupportFunctionsNoParameters() async {
|
Future<void> _readSupportFunctionsNoParameters() async {
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
|
(BluetoothConnectionState connectionState) async {
|
||||||
if (connectionState == BluetoothConnectionState.connected) {
|
if (connectionState == BluetoothConnectionState.connected) {
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
final List<int> getPrivateKeyList =
|
||||||
|
changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
|
||||||
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
|
final List<String>? publicKey =
|
||||||
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
await Storage.getStringList(saveBluePublicKey);
|
||||||
|
final List<int> getPublicKeyList =
|
||||||
|
changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
IoSenderManage.readSupportFunctionsNoParametersCommand(
|
IoSenderManage.readSupportFunctionsNoParametersCommand(
|
||||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||||
@ -103,24 +109,28 @@ class MotorPowerLogic extends BaseGetXController {
|
|||||||
token: getTokenList,
|
token: getTokenList,
|
||||||
needAuthor: 1,
|
needAuthor: 1,
|
||||||
publicKey: getPublicKeyList,
|
publicKey: getPublicKeyList,
|
||||||
privateKey: getPrivateKeyList
|
privateKey: getPrivateKeyList);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置支持功能(带参数)
|
// 设置支持功能(带参数)
|
||||||
Future<void> sendOpenDoorDirection() async {
|
Future<void> sendOpenDoorDirection() async {
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
|
(BluetoothConnectionState connectionState) async {
|
||||||
if (connectionState == BluetoothConnectionState.connected) {
|
if (connectionState == BluetoothConnectionState.connected) {
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
final List<int> getPrivateKeyList =
|
||||||
|
changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
|
||||||
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
|
final List<String>? publicKey =
|
||||||
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
await Storage.getStringList(saveBluePublicKey);
|
||||||
|
final List<int> getPublicKeyList =
|
||||||
|
changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
IoSenderManage.setSupportFunctionsWithParametersCommand(
|
IoSenderManage.setSupportFunctionsWithParametersCommand(
|
||||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||||
@ -155,5 +165,4 @@ class MotorPowerLogic extends BaseGetXController {
|
|||||||
super.onClose();
|
super.onClose();
|
||||||
_replySubscription.cancel();
|
_replySubscription.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,8 @@ import 'package:get/get.dart';
|
|||||||
|
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../tools/titleAppBar.dart';
|
import '../../../../tools/titleAppBar.dart';
|
||||||
|
import 'motorPower_logic.dart';
|
||||||
|
import 'motorPower_state.dart';
|
||||||
|
|
||||||
class MotorPowerPage extends StatefulWidget {
|
class MotorPowerPage extends StatefulWidget {
|
||||||
const MotorPowerPage({Key? key}) : super(key: key);
|
const MotorPowerPage({Key? key}) : super(key: key);
|
||||||
@ -13,7 +15,8 @@ class MotorPowerPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _MotorPowerPageState extends State<MotorPowerPage> {
|
class _MotorPowerPageState extends State<MotorPowerPage> {
|
||||||
bool isCheck = false;
|
final MotorPowerLogic logic = Get.put(MotorPowerLogic());
|
||||||
|
final MotorPowerState state = Get.find<MotorPowerLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -42,23 +45,39 @@ class _MotorPowerPageState extends State<MotorPowerPage> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 40.h,
|
height: 40.h,
|
||||||
),
|
),
|
||||||
_buildTipsView('${'小功率:'.tr}\n', '耗电少'.tr, isCheck),
|
_buildTipsView(
|
||||||
|
'${'小功率:'.tr}\n', '耗电少'.tr, state.motorTorsion.value == 1, () {
|
||||||
|
state.motorTorsion.value = 1;
|
||||||
|
logic.sendOpenDoorDirection();
|
||||||
|
}),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
_buildTipsView('${'大功率'.tr}\n',
|
_buildTipsView(
|
||||||
'大功率提示'.tr, !isCheck)
|
'${'中功率'.tr}\n', '常规使用'.tr, state.motorTorsion.value == 2, () {
|
||||||
|
state.motorTorsion.value = 2;
|
||||||
|
logic.sendOpenDoorDirection();
|
||||||
|
}),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
_buildTipsView(
|
||||||
|
'${'大功率'.tr}\n', '大功率提示'.tr, state.motorTorsion.value == 3, () {
|
||||||
|
state.motorTorsion.value = 3;
|
||||||
|
logic.sendOpenDoorDirection();
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildTipsView(String titleStr, String subTitle, bool isClick) {
|
Widget _buildTipsView(
|
||||||
|
String titleStr, String subTitle, bool isClick, Function() action) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
child: Container(
|
child: Container(
|
||||||
width: ScreenUtil().screenWidth - 40.w,
|
width: ScreenUtil().screenWidth - 40.w,
|
||||||
margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h),
|
margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h),
|
||||||
padding: EdgeInsets.only(
|
padding:
|
||||||
left: 20.w, top: 30.h, bottom: 30.h, right: 15.w),
|
EdgeInsets.only(left: 20.w, top: 30.h, bottom: 30.h, right: 15.w),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isClick
|
color: isClick
|
||||||
? AppColors.blueViewBgColor
|
? AppColors.blueViewBgColor
|
||||||
@ -67,27 +86,25 @@ class _MotorPowerPageState extends State<MotorPowerPage> {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (isClick) Image.asset(
|
if (isClick)
|
||||||
'images/mine/icon_mine_blueSelect.png',
|
Image.asset(
|
||||||
width: 20.w,
|
'images/mine/icon_mine_blueSelect.png',
|
||||||
height: 14.w,
|
width: 20.w,
|
||||||
) else SizedBox(
|
height: 14.w,
|
||||||
width: 20.w,
|
)
|
||||||
height: 14.w,
|
else
|
||||||
),
|
SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
height: 14.w,
|
||||||
|
),
|
||||||
SizedBox(width: 20.w),
|
SizedBox(width: 20.w),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: ScreenUtil().screenWidth - 40.w - 20.w*4,
|
width: ScreenUtil().screenWidth - 40.w - 20.w * 4,
|
||||||
child: _buildRichText(titleStr, subTitle, isClick)
|
child: _buildRichText(titleStr, subTitle, isClick)),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: action,
|
||||||
setState(() {
|
|
||||||
isCheck = !isCheck;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,19 +1,15 @@
|
|||||||
|
|
||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../lockSet/lockSetInfo_entity.dart';
|
import '../lockSet/lockSetInfo_entity.dart';
|
||||||
|
|
||||||
class MotorPowerState {
|
class MotorPowerState {
|
||||||
|
|
||||||
var lockSetInfoData = LockSetInfoData().obs;
|
|
||||||
var motorTorsion = 1.obs;
|
|
||||||
|
|
||||||
MotorPowerState() {
|
MotorPowerState() {
|
||||||
var map = Get.arguments;
|
final map = Get.arguments;
|
||||||
lockSetInfoData.value = map["lockSetInfoData"];
|
lockSetInfoData.value = map['lockSetInfoData'];
|
||||||
|
|
||||||
motorTorsion.value = lockSetInfoData.value.lockSettingInfo!.motorTorsion!;
|
motorTorsion.value = lockSetInfoData.value.lockSettingInfo!.motorTorsion!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rx<LockSetInfoData> lockSetInfoData = LockSetInfoData().obs;
|
||||||
|
RxInt motorTorsion = 1.obs; // 1:小,2:中,3:大
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import 'package:star_lock/blue/io_protocol/io_getPrivateKey.dart';
|
|||||||
import 'package:star_lock/blue/io_protocol/io_getPublicKey.dart';
|
import 'package:star_lock/blue/io_protocol/io_getPublicKey.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_otaUpgrade.dart';
|
import 'package:star_lock/blue/io_protocol/io_otaUpgrade.dart';
|
||||||
import 'package:star_lock/blue/io_protocol/io_processOtaUpgrade.dart';
|
import 'package:star_lock/blue/io_protocol/io_processOtaUpgrade.dart';
|
||||||
|
import 'package:star_lock/blue/io_type.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lockSet/lockTime/getServerDatetime_entity.dart';
|
import 'package:star_lock/main/lockDetail/lockSet/lockTime/getServerDatetime_entity.dart';
|
||||||
import 'package:star_lock/mine/addLock/nearbyLock/nearbyLock_page.dart';
|
import 'package:star_lock/mine/addLock/nearbyLock/nearbyLock_page.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
@ -235,7 +236,8 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 重置次数
|
// 重置次数
|
||||||
final List<int> restoreCounter = reply.data.sublist(index, index + 2);
|
final List<int> restoreCounter = reply.data.sublist(index, index + 2);
|
||||||
state.lockInfo['restoreCount'] = restoreCounter[0] * 256 + restoreCounter[1];
|
state.lockInfo['restoreCount'] =
|
||||||
|
restoreCounter[0] * 256 + restoreCounter[1];
|
||||||
index = index + 2;
|
index = index + 2;
|
||||||
// AppLog.log('重置次数 restoreCounter:${restoreCounter[0] * 256 + restoreCounter[1]}');
|
// AppLog.log('重置次数 restoreCounter:${restoreCounter[0] * 256 + restoreCounter[1]}');
|
||||||
|
|
||||||
@ -276,7 +278,8 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
// AppLog.log('mac地址 macAddressStr:$macAddressStr');
|
// AppLog.log('mac地址 macAddressStr:$macAddressStr');
|
||||||
|
|
||||||
//时区偏移
|
//时区偏移
|
||||||
state.lockInfo['timezoneOffset'] = DateTime.now().timeZoneOffset.inSeconds;
|
state.lockInfo['timezoneOffset'] =
|
||||||
|
DateTime.now().timeZoneOffset.inSeconds;
|
||||||
|
|
||||||
// 锁特征值字符串长度
|
// 锁特征值字符串长度
|
||||||
final int featureValueLength = reply.data[index];
|
final int featureValueLength = reply.data[index];
|
||||||
@ -389,7 +392,7 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void startScanBlueList() {
|
void startScanBlueList() {
|
||||||
BlueManage().startScan(2000, (List<ScanResult> list) {
|
BlueManage().startScan(2000, DeviceType.blue, (List<ScanResult> list) {
|
||||||
state.devices.clear();
|
state.devices.clear();
|
||||||
for (int i = 0; i < list.length; i++) {
|
for (int i = 0; i < list.length; i++) {
|
||||||
final ScanResult device = list[i];
|
final ScanResult device = list[i];
|
||||||
@ -497,7 +500,8 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
final int now = DateTime.now().millisecondsSinceEpoch;
|
final int now = DateTime.now().millisecondsSinceEpoch;
|
||||||
// final String msg = '传输完成 时间:${now - startSecond}秒 otaCount:$otaCount otaIndex:$otaIndex ';
|
// final String msg = '传输完成 时间:${now - startSecond}秒 otaCount:$otaCount otaIndex:$otaIndex ';
|
||||||
closeOTADAta();
|
closeOTADAta();
|
||||||
AppLog.log('传输完成 时间:${now - startSecond}秒 otaCount:$otaCount otaIndex:$otaIndex ');
|
AppLog.log(
|
||||||
|
'传输完成 时间:${now - startSecond}秒 otaCount:$otaCount otaIndex:$otaIndex ');
|
||||||
// showToast(msg);
|
// showToast(msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -670,7 +674,8 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
// AppLog.log('bluetoothRequest:$e');
|
// AppLog.log('bluetoothRequest:$e');
|
||||||
// }
|
// }
|
||||||
final bool bluetoothRequest = await PermissionDialog.requestBluetooth();
|
final bool bluetoothRequest = await PermissionDialog.requestBluetooth();
|
||||||
final bool locationRequest = await PermissionDialog.request(Permission.location);
|
final bool locationRequest =
|
||||||
|
await PermissionDialog.request(Permission.location);
|
||||||
AppLog.log('locationRequest:$locationRequest');
|
AppLog.log('locationRequest:$locationRequest');
|
||||||
if (!bluetoothRequest || !locationRequest) {
|
if (!bluetoothRequest || !locationRequest) {
|
||||||
return;
|
return;
|
||||||
@ -680,5 +685,4 @@ class NearbyLockLogic extends BaseGetXController {
|
|||||||
state.ifCurrentScreen.value = true;
|
state.ifCurrentScreen.value = true;
|
||||||
startScanBlueList();
|
startScanBlueList();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import '../../../../blue/io_gateway/io_gateway_getStatus.dart';
|
|||||||
import '../../../../blue/io_reply.dart';
|
import '../../../../blue/io_reply.dart';
|
||||||
import '../../../../blue/io_tool/io_tool.dart';
|
import '../../../../blue/io_tool/io_tool.dart';
|
||||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||||
|
import '../../../../blue/io_type.dart';
|
||||||
import '../../../../blue/sender_manage.dart';
|
import '../../../../blue/sender_manage.dart';
|
||||||
import '../../../../tools/storage.dart';
|
import '../../../../tools/storage.dart';
|
||||||
import '../../../../widget/permission/permission_dialog.dart';
|
import '../../../../widget/permission/permission_dialog.dart';
|
||||||
@ -93,7 +94,7 @@ class SelectGatewayListLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void startScanBlueList() {
|
void startScanBlueList() {
|
||||||
BlueManage().startScan(2000, (List<ScanResult> list) {
|
BlueManage().startScan(2000, DeviceType.gateway, (List<ScanResult> list) {
|
||||||
state.devices.clear();
|
state.devices.clear();
|
||||||
for (int i = 0; i < list.length; i++) {
|
for (int i = 0; i < list.length; i++) {
|
||||||
final ScanResult device = list[i];
|
final ScanResult device = list[i];
|
||||||
|
|||||||
@ -19,6 +19,7 @@ import '../../../tools/showTipView.dart';
|
|||||||
import '../../../tools/submitBtn.dart';
|
import '../../../tools/submitBtn.dart';
|
||||||
import '../../../tools/titleAppBar.dart';
|
import '../../../tools/titleAppBar.dart';
|
||||||
import '../../../tools/wechat/wechatManageTool.dart';
|
import '../../../tools/wechat/wechatManageTool.dart';
|
||||||
|
import '../../../tools/wechat/wx_push_miniProgram/wx_push_miniProgram.dart';
|
||||||
import '../../../translations/trans_lib.dart';
|
import '../../../translations/trans_lib.dart';
|
||||||
|
|
||||||
class MineSetPage extends StatefulWidget {
|
class MineSetPage extends StatefulWidget {
|
||||||
@ -60,26 +61,43 @@ class _MineSetPageState extends State<MineSetPage>
|
|||||||
_checkNotificationPermission();
|
_checkNotificationPermission();
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: widget.showAppBar
|
appBar: widget.showAppBar
|
||||||
? F.sw(
|
? F.sw(
|
||||||
skyCall: () => TitleAppBar(
|
skyCall: () => TitleAppBar(
|
||||||
barTitle: '更多设置'.tr,
|
barTitle: '更多设置'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
|
),
|
||||||
|
xhjCall: () => TitleAppBar(
|
||||||
|
barTitle: '更多设置'.tr,
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
iconColor: AppColors.blackColor,
|
||||||
|
titleColor: AppColors.blackColor,
|
||||||
|
))
|
||||||
|
: null,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: styleHierarchy(),
|
||||||
|
),
|
||||||
|
floatingActionButton: widget.showAppBar
|
||||||
|
? null
|
||||||
|
: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
WechatManageTool.getAppInfo(() {
|
||||||
|
WxPushWeChatMiniProgramTool.pushWeChatMiniProgram(
|
||||||
|
'wxbe340095d2b8fd51');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(40.r),
|
||||||
|
child: Image.asset(
|
||||||
|
'images/mine/icon_mine_wan_wanshifu.png',
|
||||||
|
width: 80.w,
|
||||||
|
height: 80.w,
|
||||||
),
|
),
|
||||||
xhjCall: () => TitleAppBar(
|
),
|
||||||
barTitle: '更多设置'.tr,
|
));
|
||||||
haveBack: true,
|
|
||||||
backgroundColor: Colors.white,
|
|
||||||
iconColor: AppColors.blackColor,
|
|
||||||
titleColor: AppColors.blackColor,
|
|
||||||
))
|
|
||||||
: null,
|
|
||||||
body: SingleChildScrollView(
|
|
||||||
child: styleHierarchy(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//样式层级
|
//样式层级
|
||||||
|
|||||||
@ -800,6 +800,15 @@ class ApiProvider extends BaseProvider {
|
|||||||
'openDirectionValue': openDirectionValue,
|
'openDirectionValue': openDirectionValue,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// 电机扭力设置
|
||||||
|
Future<Response> setMotorPowerData(int lockId, int motorTorsion) =>
|
||||||
|
post(
|
||||||
|
updateLockSettingUrl.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
'motorTorsion': motorTorsion,
|
||||||
|
}));
|
||||||
|
|
||||||
// 远程开锁
|
// 远程开锁
|
||||||
Future<Response> remoteUnlockingOpenOrCloseLoadData(
|
Future<Response> remoteUnlockingOpenOrCloseLoadData(
|
||||||
int lockId, int remoteUnlock) =>
|
int lockId, int remoteUnlock) =>
|
||||||
|
|||||||
@ -874,6 +874,15 @@ class ApiRepository {
|
|||||||
return LoginEntity.fromJson(res.body);
|
return LoginEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 电机扭力
|
||||||
|
Future<LoginEntity> setMotorTorqueData({
|
||||||
|
required int lockId,
|
||||||
|
required int motorTorsion,
|
||||||
|
}) async {
|
||||||
|
final res = await apiProvider.setMotorPowerData(lockId, motorTorsion);
|
||||||
|
return LoginEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
// 设置房态
|
// 设置房态
|
||||||
Future<LoginEntity> setRoomStatusData({
|
Future<LoginEntity> setRoomStatusData({
|
||||||
required int lockId,
|
required int lockId,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user