startRecordLineFile method

Future<bool> startRecordLineFile(
  1. int timestamp,
  2. int event, {
  3. int timeout = 5,
  4. int channel = 4,
  5. int frameNo = 0,
  6. int key = 0,
})

Implementation

Future<bool> startRecordLineFile(int timestamp, int event,
    {int timeout = 5, int channel = 4, int frameNo = 0, int key = 0}) async {
  bool ret = await writeCgi(
      "livestream.cgi?streamid=5&ntsamp=$timestamp&event=$event&framenum=$frameNo&recch=$channel&key=$key&",
      timeout: timeout);
  if (ret) {
    CommandResult result = await waitCommandResult((int cmd, Uint8List data) {
      return cmd == 24631;
    }, timeout);
    if (result.isSuccess) {
      Map data = result.getMap();
      return data["result"] == "0";
    }
  }
  return false;
}