GpsRtcmData.parse constructor

GpsRtcmData.parse(
  1. ByteData data_
)

Implementation

factory GpsRtcmData.parse(ByteData data_) {
  if (data_.lengthInBytes < GpsRtcmData.mavlinkEncodedLength) {
    var len = GpsRtcmData.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var flags = data_.getUint8(0);
  var len = data_.getUint8(1);
  var data = MavlinkMessage.asUint8List(data_, 2, 180);

  return GpsRtcmData(flags: flags, len: len, data: data);
}