OsdParamShowConfig.parse constructor

OsdParamShowConfig.parse(
  1. ByteData data_
)

Implementation

factory OsdParamShowConfig.parse(ByteData data_) {
  if (data_.lengthInBytes < OsdParamShowConfig.mavlinkEncodedLength) {
    var len = OsdParamShowConfig.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 targetSystem = data_.getUint8(4);
  var targetComponent = data_.getUint8(5);
  var osdScreen = data_.getUint8(6);
  var osdIndex = data_.getUint8(7);

  return OsdParamShowConfig(
      requestId: requestId,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      osdScreen: osdScreen,
      osdIndex: osdIndex);
}