CameraSettings.parse constructor

CameraSettings.parse(
  1. ByteData data_
)

Implementation

factory CameraSettings.parse(ByteData data_) {
  if (data_.lengthInBytes < CameraSettings.mavlinkEncodedLength) {
    var len = CameraSettings.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 modeId = data_.getUint8(4);
  var zoomlevel = data_.getFloat32(5, Endian.little);
  var focuslevel = data_.getFloat32(9, Endian.little);

  return CameraSettings(
      timeBootMs: timeBootMs,
      modeId: modeId,
      zoomlevel: zoomlevel,
      focuslevel: focuslevel);
}