Storm32GimbalManagerStatus.parse constructor

Storm32GimbalManagerStatus.parse(
  1. ByteData data_
)

Implementation

factory Storm32GimbalManagerStatus.parse(ByteData data_) {
  if (data_.lengthInBytes < Storm32GimbalManagerStatus.mavlinkEncodedLength) {
    var len =
        Storm32GimbalManagerStatus.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var deviceFlags = data_.getUint16(0, Endian.little);
  var managerFlags = data_.getUint16(2, Endian.little);
  var gimbalId = data_.getUint8(4);
  var supervisor = data_.getUint8(5);
  var profile = data_.getUint8(6);

  return Storm32GimbalManagerStatus(
      deviceFlags: deviceFlags,
      managerFlags: managerFlags,
      gimbalId: gimbalId,
      supervisor: supervisor,
      profile: profile);
}