DebugFloatArray.parse constructor

DebugFloatArray.parse(
  1. ByteData data_
)

Implementation

factory DebugFloatArray.parse(ByteData data_) {
  if (data_.lengthInBytes < DebugFloatArray.mavlinkEncodedLength) {
    var len = DebugFloatArray.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var timeUsec = data_.getUint64(0, Endian.little);
  var arrayId = data_.getUint16(8, Endian.little);
  var name = MavlinkMessage.asInt8List(data_, 10, 10);
  var data = MavlinkMessage.asFloat32List(data_, 20, 58);

  return DebugFloatArray(
      timeUsec: timeUsec, arrayId: arrayId, name: name, data: data);
}