GpsGlobalOrigin.parse constructor

GpsGlobalOrigin.parse(
  1. ByteData data_
)

Implementation

factory GpsGlobalOrigin.parse(ByteData data_) {
  if (data_.lengthInBytes < GpsGlobalOrigin.mavlinkEncodedLength) {
    var len = GpsGlobalOrigin.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var latitude = data_.getInt32(0, Endian.little);
  var longitude = data_.getInt32(4, Endian.little);
  var altitude = data_.getInt32(8, Endian.little);
  var timeUsec = data_.getUint64(12, Endian.little);

  return GpsGlobalOrigin(
      latitude: latitude,
      longitude: longitude,
      altitude: altitude,
      timeUsec: timeUsec);
}