getAutoLoginData_bujiami function
获取 自动登陆指令 的数据 不加密 返回长度为19的数组
Implementation
Future<List<int>> getAutoLoginData_bujiami(List<int> passwordList) async {
if (passwordList.length != 3) {
print('密码长度不对');
return [];
}
// 手机端发送指令 0xFE 0X01 LEN SNO IMEI PASSWORD checksum
//获取sno
final List<int> snoList = await getSNOList();
//获取imei
final List<int> imeiList = await getImeiList();
//一个随机密码 必须是六位密码
// final List<int> passwordList = [0x12, 0x34, 0x56];
// final List<int> passwordList = [0x11, 0x11, 0x11];
// passwordList = [0x12, 0x34, 0x56];
//有效数据
List<int> subData = [...snoList, ...imeiList, ...passwordList];
int len = subData.length;
int cmd = 0x01;
// 包含指令和数据长度的数组
List<int> cmdData = [0xfe, cmd, len];
//有效数据不足16位,补全
for (int i = 0; i < 16 - len; i++) {
//不足16位就补ff
subData = [...subData, 0xff];
}
return [...cmdData, ...subData];
}