getOpen_close_data function

Future<List<int>> getOpen_close_data(
  1. List<int> password,
  2. OPEN_CLOSE_type type
)

获取 开锁关锁 的数据

Implementation

Future<List<int>> getOpen_close_data(
    List<int> password, OPEN_CLOSE_type type) async {
  // 0xFE 0X0a LEN SNO OP_TYPE PASSWORD checksum
  // 指令
  int cmd = 0x0a;
  // 获取SNO
  final List<int> snoList = await getSNOList();
  // OP_TYPE为开关门类型,0x00为关门,0x01为开门
  int OP_TYPE = type.index;

  // 获取密码
  // final List<int> password = [0x08, 0x08, 0x08, 0x08, 0x08, 0x18];
  //有效数据
  List<int> subData = [...snoList, OP_TYPE, ...password];

  return tempEncrypt(cmd, subData);
}