CurrentMode.parse constructor
CurrentMode.parse(
- ByteData data_
Implementation
factory CurrentMode.parse(ByteData data_) {
if (data_.lengthInBytes < CurrentMode.mavlinkEncodedLength) {
var len = CurrentMode.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 intendedCustomMode = data_.getUint32(4, Endian.little);
var standardMode = data_.getUint8(8);
return CurrentMode(
customMode: customMode,
intendedCustomMode: intendedCustomMode,
standardMode: standardMode);
}