OsdParamConfig.parse constructor

OsdParamConfig.parse(
  1. ByteData data_
)

Implementation

factory OsdParamConfig.parse(ByteData data_) {
  if (data_.lengthInBytes < OsdParamConfig.mavlinkEncodedLength) {
    var len = OsdParamConfig.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var requestId = data_.getUint32(0, Endian.little);
  var minValue = data_.getFloat32(4, Endian.little);
  var maxValue = data_.getFloat32(8, Endian.little);
  var increment = data_.getFloat32(12, Endian.little);
  var targetSystem = data_.getUint8(16);
  var targetComponent = data_.getUint8(17);
  var osdScreen = data_.getUint8(18);
  var osdIndex = data_.getUint8(19);
  var paramId = MavlinkMessage.asInt8List(data_, 20, 16);
  var configType = data_.getUint8(36);

  return OsdParamConfig(
      requestId: requestId,
      minValue: minValue,
      maxValue: maxValue,
      increment: increment,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      osdScreen: osdScreen,
      osdIndex: osdIndex,
      paramId: paramId,
      configType: configType);
}