CameraCaptureStatus.parse constructor

CameraCaptureStatus.parse(
  1. ByteData data_
)

Implementation

factory CameraCaptureStatus.parse(ByteData data_) {
  if (data_.lengthInBytes < CameraCaptureStatus.mavlinkEncodedLength) {
    var len = CameraCaptureStatus.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var timeBootMs = data_.getUint32(0, Endian.little);
  var imageInterval = data_.getFloat32(4, Endian.little);
  var recordingTimeMs = data_.getUint32(8, Endian.little);
  var availableCapacity = data_.getFloat32(12, Endian.little);
  var imageStatus = data_.getUint8(16);
  var videoStatus = data_.getUint8(17);
  var imageCount = data_.getInt32(18, Endian.little);

  return CameraCaptureStatus(
      timeBootMs: timeBootMs,
      imageInterval: imageInterval,
      recordingTimeMs: recordingTimeMs,
      availableCapacity: availableCapacity,
      imageStatus: imageStatus,
      videoStatus: videoStatus,
      imageCount: imageCount);
}