UalbertaSysStatus.parse constructor

UalbertaSysStatus.parse(
  1. ByteData data_
)

Implementation

factory UalbertaSysStatus.parse(ByteData data_) {
  if (data_.lengthInBytes < UalbertaSysStatus.mavlinkEncodedLength) {
    var len = UalbertaSysStatus.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var mode = data_.getUint8(0);
  var navMode = data_.getUint8(1);
  var pilot = data_.getUint8(2);

  return UalbertaSysStatus(mode: mode, navMode: navMode, pilot: pilot);
}