ParamMapRc.parse constructor

ParamMapRc.parse(
  1. ByteData data_
)

Implementation

factory ParamMapRc.parse(ByteData data_) {
  if (data_.lengthInBytes < ParamMapRc.mavlinkEncodedLength) {
    var len = ParamMapRc.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var paramValue0 = data_.getFloat32(0, Endian.little);
  var scale = data_.getFloat32(4, Endian.little);
  var paramValueMin = data_.getFloat32(8, Endian.little);
  var paramValueMax = data_.getFloat32(12, Endian.little);
  var paramIndex = data_.getInt16(16, Endian.little);
  var targetSystem = data_.getUint8(18);
  var targetComponent = data_.getUint8(19);
  var paramId = MavlinkMessage.asInt8List(data_, 20, 16);
  var parameterRcChannelIndex = data_.getUint8(36);

  return ParamMapRc(
      paramValue0: paramValue0,
      scale: scale,
      paramValueMin: paramValueMin,
      paramValueMax: paramValueMax,
      paramIndex: paramIndex,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      paramId: paramId,
      parameterRcChannelIndex: parameterRcChannelIndex);
}