getRecordData method

Future<bool> getRecordData(
  1. String date,
  2. List<int> data,
  3. int timeout,
  4. int offset,
)

Implementation

Future<bool> getRecordData(
    String date, List<int> data, int timeout, int offset) async {
  bool ret = await writeCgi("get_record_idx.cgi?dirname=$date&offset=$offset",
      timeout: timeout);
  if (ret) {
    CommandResult result = await waitCommandResult((int cmd, Uint8List data) {
      return cmd == 24833;
    }, timeout);

    if (result.isSuccess && result.data!.lengthInBytes > 12) {
      data.addAll(result.data!.getRange(12, result.data!.lengthInBytes));
      if (result.data!.lengthInBytes == 60000 + 12)
        return getRecordData(date, data, timeout, offset + 1);
    }
  } else {}
  return ret;
}