OpenDroneIdOperatorId.parse constructor

OpenDroneIdOperatorId.parse(
  1. ByteData data_
)

Implementation

factory OpenDroneIdOperatorId.parse(ByteData data_) {
  if (data_.lengthInBytes < OpenDroneIdOperatorId.mavlinkEncodedLength) {
    var len =
        OpenDroneIdOperatorId.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 operatorIdType = data_.getUint8(22);
  var operatorId = MavlinkMessage.asInt8List(data_, 23, 20);

  return OpenDroneIdOperatorId(
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      idOrMac: idOrMac,
      operatorIdType: operatorIdType,
      operatorId: operatorId);
}