FlexifunctionDirectory.parse constructor

FlexifunctionDirectory.parse(
  1. ByteData data_
)

Implementation

factory FlexifunctionDirectory.parse(ByteData data_) {
  if (data_.lengthInBytes < FlexifunctionDirectory.mavlinkEncodedLength) {
    var len =
        FlexifunctionDirectory.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var targetSystem = data_.getUint8(0);
  var targetComponent = data_.getUint8(1);
  var directoryType = data_.getUint8(2);
  var startIndex = data_.getUint8(3);
  var count = data_.getUint8(4);
  var directoryData = MavlinkMessage.asInt8List(data_, 5, 48);

  return FlexifunctionDirectory(
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      directoryType: directoryType,
      startIndex: startIndex,
      count: count,
      directoryData: directoryData);
}