SetGpsGlobalOrigin.parse constructor

SetGpsGlobalOrigin.parse(
  1. ByteData data_
)

Implementation

factory SetGpsGlobalOrigin.parse(ByteData data_) {
  if (data_.lengthInBytes < SetGpsGlobalOrigin.mavlinkEncodedLength) {
    var len = SetGpsGlobalOrigin.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 targetSystem = data_.getUint8(12);
  var timeUsec = data_.getUint64(13, Endian.little);

  return SetGpsGlobalOrigin(
      latitude: latitude,
      longitude: longitude,
      altitude: altitude,
      targetSystem: targetSystem,
      timeUsec: timeUsec);
}