Gps2Raw.parse constructor
Gps2Raw.parse(
- ByteData data_
Implementation
factory Gps2Raw.parse(ByteData data_) {
if (data_.lengthInBytes < Gps2Raw.mavlinkEncodedLength) {
var len = Gps2Raw.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 lat = data_.getInt32(8, Endian.little);
var lon = data_.getInt32(12, Endian.little);
var alt = data_.getInt32(16, Endian.little);
var dgpsAge = data_.getUint32(20, Endian.little);
var eph = data_.getUint16(24, Endian.little);
var epv = data_.getUint16(26, Endian.little);
var vel = data_.getUint16(28, Endian.little);
var cog = data_.getUint16(30, Endian.little);
var fixType = data_.getUint8(32);
var satellitesVisible = data_.getUint8(33);
var dgpsNumch = data_.getUint8(34);
var yaw = data_.getUint16(35, Endian.little);
var altEllipsoid = data_.getInt32(37, Endian.little);
var hAcc = data_.getUint32(41, Endian.little);
var vAcc = data_.getUint32(45, Endian.little);
var velAcc = data_.getUint32(49, Endian.little);
var hdgAcc = data_.getUint32(53, Endian.little);
return Gps2Raw(
timeUsec: timeUsec,
lat: lat,
lon: lon,
alt: alt,
dgpsAge: dgpsAge,
eph: eph,
epv: epv,
vel: vel,
cog: cog,
fixType: fixType,
satellitesVisible: satellitesVisible,
dgpsNumch: dgpsNumch,
yaw: yaw,
altEllipsoid: altEllipsoid,
hAcc: hAcc,
vAcc: vAcc,
velAcc: velAcc,
hdgAcc: hdgAcc);
}