getVideoPix method

Future<bool> getVideoPix({
  1. int timeout = 5,
})

Implementation

Future<bool> getVideoPix({int timeout = 5}) async {
  //解码模式
  bool ret = await writeCgi(
      "trans_cmd_string.cgi?cmd=2105&command=3&mark=112233445566_1234&");
  if (ret == true) {
    CommandResult result = await waitCommandResult((cmd, data) {
      if (cmd == 24785) {
        String str = utf8.decode(data);
        return str.contains("cmd=2105;") && str.contains("command=3;");
      }
      return false;
    }, timeout);
    Map data = result.getMap();
    if (result.isSuccess) {
      if (int.tryParse(data["cmd"] ?? "") == 2105) {
        this.videoPix = int.tryParse(data["bPixel300"] ?? "") ?? 0;
      }
    }
    return result.isSuccess;
  }
  return false;
}