ParamRequestRead.parse constructor

ParamRequestRead.parse(
  1. ByteData data_
)

Implementation

factory ParamRequestRead.parse(ByteData data_) {
  if (data_.lengthInBytes < ParamRequestRead.mavlinkEncodedLength) {
    var len = ParamRequestRead.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var paramIndex = data_.getInt16(0, Endian.little);
  var targetSystem = data_.getUint8(2);
  var targetComponent = data_.getUint8(3);
  var paramId = MavlinkMessage.asInt8List(data_, 4, 16);

  return ParamRequestRead(
      paramIndex: paramIndex,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      paramId: paramId);
}