TerrainCheck.parse constructor

TerrainCheck.parse(
  1. ByteData data_
)

Implementation

factory TerrainCheck.parse(ByteData data_) {
  if (data_.lengthInBytes < TerrainCheck.mavlinkEncodedLength) {
    var len = TerrainCheck.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var lat = data_.getInt32(0, Endian.little);
  var lon = data_.getInt32(4, Endian.little);

  return TerrainCheck(lat: lat, lon: lon);
}