FlexifunctionDirectoryAck.parse constructor

FlexifunctionDirectoryAck.parse(
  1. ByteData data_
)

Implementation

factory FlexifunctionDirectoryAck.parse(ByteData data_) {
  if (data_.lengthInBytes < FlexifunctionDirectoryAck.mavlinkEncodedLength) {
    var len =
        FlexifunctionDirectoryAck.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var result = data_.getUint16(0, Endian.little);
  var targetSystem = data_.getUint8(2);
  var targetComponent = data_.getUint8(3);
  var directoryType = data_.getUint8(4);
  var startIndex = data_.getUint8(5);
  var count = data_.getUint8(6);

  return FlexifunctionDirectoryAck(
      result: result,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      directoryType: directoryType,
      startIndex: startIndex,
      count: count);
}