ParamExtValue.parse constructor

ParamExtValue.parse(
  1. ByteData data_
)

Implementation

factory ParamExtValue.parse(ByteData data_) {
  if (data_.lengthInBytes < ParamExtValue.mavlinkEncodedLength) {
    var len = ParamExtValue.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var paramCount = data_.getUint16(0, Endian.little);
  var paramIndex = data_.getUint16(2, Endian.little);
  var paramId = MavlinkMessage.asInt8List(data_, 4, 16);
  var paramValue = MavlinkMessage.asInt8List(data_, 20, 128);
  var paramType = data_.getUint8(148);

  return ParamExtValue(
      paramCount: paramCount,
      paramIndex: paramIndex,
      paramId: paramId,
      paramValue: paramValue,
      paramType: paramType);
}