SetMode.parse constructor

SetMode.parse(
  1. ByteData data_
)

Implementation

factory SetMode.parse(ByteData data_) {
  if (data_.lengthInBytes < SetMode.mavlinkEncodedLength) {
    var len = SetMode.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var customMode = data_.getUint32(0, Endian.little);
  var targetSystem = data_.getUint8(4);
  var baseMode = data_.getUint8(5);

  return SetMode(
      customMode: customMode, targetSystem: targetSystem, baseMode: baseMode);
}