Timesync.parse constructor

Timesync.parse(
  1. ByteData data_
)

Implementation

factory Timesync.parse(ByteData data_) {
  if (data_.lengthInBytes < Timesync.mavlinkEncodedLength) {
    var len = Timesync.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var tc1 = data_.getInt64(0, Endian.little);
  var ts1 = data_.getInt64(8, Endian.little);
  var targetSystem = data_.getUint8(16);
  var targetComponent = data_.getUint8(17);

  return Timesync(
      tc1: tc1,
      ts1: ts1,
      targetSystem: targetSystem,
      targetComponent: targetComponent);
}