CameraFovStatus.parse constructor

CameraFovStatus.parse(
  1. ByteData data_
)

Implementation

factory CameraFovStatus.parse(ByteData data_) {
  if (data_.lengthInBytes < CameraFovStatus.mavlinkEncodedLength) {
    var len = CameraFovStatus.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 latCamera = data_.getInt32(4, Endian.little);
  var lonCamera = data_.getInt32(8, Endian.little);
  var altCamera = data_.getInt32(12, Endian.little);
  var latImage = data_.getInt32(16, Endian.little);
  var lonImage = data_.getInt32(20, Endian.little);
  var altImage = data_.getInt32(24, Endian.little);
  var q = MavlinkMessage.asFloat32List(data_, 28, 4);
  var hfov = data_.getFloat32(44, Endian.little);
  var vfov = data_.getFloat32(48, Endian.little);

  return CameraFovStatus(
      timeBootMs: timeBootMs,
      latCamera: latCamera,
      lonCamera: lonCamera,
      altCamera: altCamera,
      latImage: latImage,
      lonImage: lonImage,
      altImage: altImage,
      q: q,
      hfov: hfov,
      vfov: vfov);
}