getEdit_password_data function

Future<List<int>> getEdit_password_data(
  1. List<int> password,
  2. int NID,
  3. int ID
)

获取 修改密码 的数据 ID为密码对应的存储id NID为对应用户的NID

Implementation

Future<List<int>> getEdit_password_data(
    List<int> password, int NID, int ID) async {
  // 0xFE 0x0d LEN SNO NID TYPE ID PASSWORD checksum
  // 指令
  int cmd = 0x0d;
  // 获取SNO
  final List<int> snoList = await getSNOList();
  // NID为对应用户的NID
  // int NID = 9;
  // TYPE 为密码类型
  int TYPE = 22;
  // ID为密码对应的存储id
  // int ID = 2;

  // 获取密码
  // List<int> password = [0x88, 0x88, 0x88];
  //有效数据
  List<int> subData = [...snoList, NID, TYPE, ID, ...password];

  // 包含指令和数据长度的数组
  List<int> cmdData = [0xfe, cmd, subData.length];

  return tempEncrypt(cmd, subData);
}