Data16.parse constructor

Data16.parse(
  1. ByteData data_
)

Implementation

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

  return Data16(type: type, len: len, data: data);
}