66 lines
1.3 KiB
Dart
66 lines
1.3 KiB
Dart
|
|
import '../io_tool/io_tool.dart';
|
|
import 'io_reply.dart';
|
|
import 'io_sender.dart';
|
|
import 'io_type.dart';
|
|
|
|
//TODO:添加用户
|
|
class AddUserCommand extends SenderProtocol {
|
|
|
|
int? cmdID;
|
|
String? lockID;
|
|
String? authUserID;
|
|
String? keyID;
|
|
String? userID;
|
|
int? openMode;
|
|
int? keyType;
|
|
int? startDate;
|
|
int? expireDate;
|
|
int? role;
|
|
String? password;
|
|
int? token;
|
|
int? authCodeLen;
|
|
String? authCode;
|
|
AddUserCommand({
|
|
this.cmdID,
|
|
this.lockID,
|
|
this.authUserID,
|
|
this.keyID,
|
|
this.userID,
|
|
this.openMode,
|
|
this.keyType,
|
|
this.startDate,
|
|
this.expireDate,
|
|
this.role,
|
|
this.password,
|
|
this.token,
|
|
this.authCodeLen,
|
|
this.authCode,
|
|
}) : super(CommandType.addUser);
|
|
|
|
@override
|
|
List<int> messageDetail() {
|
|
List<int> data = [];
|
|
// data.add(0x21);
|
|
// int d = direction!.toInt();
|
|
// data.addAll(intToByte2ListHigh(d));
|
|
// data.add(0x22);
|
|
// int s = speed!.toInt();
|
|
// data.add(s);
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class RemoteControlReply extends Reply {
|
|
RemoteControlReply.parseData(CommandType commandType, List<int> dataDetail, int endIndex)
|
|
: super.parseData(commandType, dataDetail, endIndex) {
|
|
int index = 0;
|
|
while(index < endIndex){
|
|
commandKey = byteUInt8(dataDetail, index);
|
|
index += offset_1!;
|
|
switch(commandKey){
|
|
|
|
}
|
|
}
|
|
}
|
|
} |