TerrainRequest.parse constructor

TerrainRequest.parse(
  1. ByteData data_
)

Implementation

factory TerrainRequest.parse(ByteData data_) {
  if (data_.lengthInBytes < TerrainRequest.mavlinkEncodedLength) {
    var len = TerrainRequest.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var mask = data_.getUint64(0, Endian.little);
  var lat = data_.getInt32(8, Endian.little);
  var lon = data_.getInt32(12, Endian.little);
  var gridSpacing = data_.getUint16(16, Endian.little);

  return TerrainRequest(
      mask: mask, lat: lat, lon: lon, gridSpacing: gridSpacing);
}