OpenDroneIdSelfId.parse constructor

OpenDroneIdSelfId.parse(
  1. ByteData data_
)

Implementation

factory OpenDroneIdSelfId.parse(ByteData data_) {
  if (data_.lengthInBytes < OpenDroneIdSelfId.mavlinkEncodedLength) {
    var len = OpenDroneIdSelfId.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var targetSystem = data_.getUint8(0);
  var targetComponent = data_.getUint8(1);
  var idOrMac = MavlinkMessage.asUint8List(data_, 2, 20);
  var descriptionType = data_.getUint8(22);
  var description = MavlinkMessage.asInt8List(data_, 23, 23);

  return OpenDroneIdSelfId(
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      idOrMac: idOrMac,
      descriptionType: descriptionType,
      description: description);
}