From 0bd28959278aeb5c6df0b888dcaf5dc84c25ac9b Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sun, 4 Jan 2026 10:27:13 +1100 Subject: [PATCH 01/34] sort javadocs --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7a1f55e..1b3b305 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ 4.0.0 io.mapsmessaging mavlink - 1.0.0 + 1.0.1-SNAPSHOT jar Mavlink parser, message formatter and schema From ece0418974c39ce42ace5e4d635927cce976b4f6 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sun, 4 Jan 2026 10:29:25 +1100 Subject: [PATCH 02/34] fix read me --- README.md | 75 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index be7862e..2fb3d62 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,33 @@ # MAVLink Payload Codec (Java) -This repository provides a lightweight, schema-driven MAVLink payload +This repository provides a lightweight, schema-driven MAVLink **payload** encoder and decoder for Java. -It parses MAVLink XML dialects (including `` handling), compiles -message definitions, and provides fast, thread-safe encoding and decoding -of MAVLink message **payloads**. +It parses MAVLink XML dialects (including `{@code }` handling), +compiles message definitions, and provides fast, thread-safe encoding and +decoding of MAVLink message **payloads only**. -This library is intentionally limited in scope. +This library is intentionally limited in scope and designed to be composed +into larger MAVLink-capable systems. +--- -## Scope (Important) +## Scope (Read This First) This library operates **only on MAVLink message payloads**. -It does **not**: +It **does**: + +- Parse MAVLink XML dialects +- Compile message definitions into an immutable registry +- Encode Java field maps into MAVLink payload bytes +- Decode MAVLink payload bytes into typed field maps +- Correctly handle MAVLink field ordering, arrays, enums, and extensions + +It **does not**: - Parse or generate MAVLink v1/v2 frames -- Handle headers, CRCs, signing, or message framing +- Handle headers, CRCs, signing, or framing - Manage system IDs, component IDs, or sequence numbers - Implement any transport (UART, UDP, TCP, etc.) @@ -25,10 +35,11 @@ If you need a full MAVLink stack, this library is not it. This library is designed to sit **under** a framing and transport layer. +--- ## Features -- MAVLink XML dialect parsing with `` support +- MAVLink XML dialect parsing with `{@code }` support - Canonical dialect compilation (e.g. `common.xml`) - Immutable, thread-safe compiled registries - Correct MAVLink field ordering and packing rules @@ -38,6 +49,7 @@ This library is designed to sit **under** a framing and transport layer. - Safe failure on invalid or truncated payloads - No shared mutable state at runtime +--- ## Getting Started @@ -51,6 +63,9 @@ MavlinkCodec codec = loader.getDialectOrThrow("common"); ``` +The built-in `common` dialect is loaded eagerly and is always available. + +--- ## Encoding a Payload @@ -70,6 +85,7 @@ Map values = Map.of( byte[] payload = codec.encodePayload(1, values); ``` +--- ## Decoding a Payload @@ -80,6 +96,10 @@ Map decoded = int load = (int) decoded.get("load"); ``` +Field values are returned using standard Java types based on the MAVLink +message definition. + +--- ## Loading Custom Dialects @@ -92,8 +112,11 @@ try (InputStream xml = Files.newInputStream(Path.of("custom.xml"))) { } ``` -Dialects are compiled once and cached by name. +- Dialects are compiled once +- Compiled codecs are cached by name +- Subsequent lookups are lock-free +--- ## Thread Safety @@ -107,16 +130,20 @@ A single codec instance may be safely: - Cached globally - Used in high-throughput systems +--- ## Error Handling -- Unknown message IDs result in `IOException` -- Invalid field types result in `IOException` -- Invalid enum values result in `IOException` -- Truncated or malformed payloads result in `IOException` +All parsing and encoding errors are reported explicitly: + +- Unknown message IDs → `IOException` +- Invalid field types → `IOException` +- Invalid enum values → `IOException` +- Truncated or malformed payloads → `IOException` -No unchecked exceptions escape parsing paths. +No unchecked exceptions escape payload encode/decode paths. +--- ## Design Philosophy @@ -126,13 +153,7 @@ No unchecked exceptions escape parsing paths. - Explicit errors over silent failure - Practical MAVLink usage, not theoretical completeness - -## License - -Apache License 2.0 - -See the `LICENSE` file for details. - +--- ## Intended Users @@ -143,5 +164,13 @@ This library is intended for: - Telemetry ingestion pipelines - MAVLink-aware tooling that does not want transport coupling -If you want a full MAVLink stack, use something else. +If you want a full MAVLink stack, use something else. If you want a clean, deterministic payload codec, this is it. + +--- + +## License + +Apache License 2.0 + +See the `LICENSE` file for details. From 1997aae6b56027b88c13f9ca06b8f8dac659089f Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sun, 4 Jan 2026 14:38:45 +1100 Subject: [PATCH 03/34] simply unpack the framing --- README.md | 6 +-- .../mavlink/MavlinkFrameCodec.java | 31 ++++++++++++++ .../mavlink/MavlinkFrameEnvelope.java | 40 +++++++++++++++++++ 3 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 src/main/java/io/mapsmessaging/mavlink/MavlinkFrameEnvelope.java diff --git a/README.md b/README.md index 2fb3d62..fcae0d7 100644 --- a/README.md +++ b/README.md @@ -26,12 +26,11 @@ It **does**: It **does not**: -- Parse or generate MAVLink v1/v2 frames -- Handle headers, CRCs, signing, or framing - Manage system IDs, component IDs, or sequence numbers - Implement any transport (UART, UDP, TCP, etc.) -If you need a full MAVLink stack, this library is not it. +Frame parsing, CRC handling, and framing are provided by the framework layer +built on top of this codec. This library is designed to sit **under** a framing and transport layer. @@ -174,3 +173,4 @@ If you want a clean, deterministic payload codec, this is it. Apache License 2.0 See the `LICENSE` file for details. + diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java index ba7b761..b189a42 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java @@ -103,6 +103,37 @@ public Optional tryUnpackFrame(ByteBuffer networkOwnedBuffer) { return framer.tryDecode(networkOwnedBuffer); } + /** + * Attempts to decode a single MAVLink frame and returns header + raw payload bytes only. + * + *

This does NOT decode payload fields. It is intended for routing decisions based on header metadata.

+ * + * @param networkOwnedBuffer network buffer in write-mode (may be flipped/compacted internally) + * @return envelope containing header fields + raw payload bytes if a complete valid frame is available + */ + public Optional tryUnpackHeaderAndPayload(ByteBuffer networkOwnedBuffer) { + Optional decoded = framer.tryDecode(networkOwnedBuffer); + if (decoded.isEmpty()) { + return Optional.empty(); + } + + MavlinkFrame frame = decoded.get(); + byte[] payload = Objects.requireNonNull(frame.getPayload(), "frame.payload"); + + MavlinkFrameEnvelope envelope = new MavlinkFrameEnvelope( + frame.getVersion(), + frame.getMessageId(), + frame.getSystemId(), + frame.getComponentId(), + frame.getSequence(), + frame.getPayloadLength(), + payload, + frame.isSigned() + ); + + return Optional.of(envelope); + } + /** * Packs a MAVLink frame into the provided output buffer at its current position. * diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameEnvelope.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameEnvelope.java new file mode 100644 index 0000000..7ce1fa6 --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameEnvelope.java @@ -0,0 +1,40 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package io.mapsmessaging.mavlink; + +import io.mapsmessaging.mavlink.message.MavlinkVersion; +import lombok.Value; + +@Value +public class MavlinkFrameEnvelope { + + MavlinkVersion version; + int messageId; + + int systemId; + int componentId; + int sequence; + + int payloadLength; + byte[] payload; + + boolean signed; +} From dc98e972a533e6ff9f10aa5e54c949292ea200aa Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sun, 4 Jan 2026 14:41:28 +1100 Subject: [PATCH 04/34] clean code --- .../java/io/mapsmessaging/mavlink/MavlinkCodec.java | 3 ++- .../io/mapsmessaging/mavlink/MavlinkFrameCodec.java | 2 +- .../mavlink/MavlinkMessageFormatLoader.java | 11 ++++------- .../mavlink/framing/MavlinkFramePacker.java | 6 ++---- .../mavlink/message/MavlinkMessageRegistry.java | 1 - .../mavlink/message/fields/ArrayFieldCodec.java | 1 - .../parser/ClasspathMavlinkIncludeResolver.java | 3 ++- 7 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkCodec.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkCodec.java index b34d154..41737b3 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkCodec.java @@ -3,10 +3,11 @@ import io.mapsmessaging.mavlink.codec.MavlinkPayloadPacker; import io.mapsmessaging.mavlink.codec.MavlinkPayloadParser; import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; +import lombok.Getter; + import java.io.IOException; import java.util.Map; import java.util.Objects; -import lombok.Getter; /** * MAVLink payload codec for a specific dialect. * diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java index b189a42..6a8be74 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java @@ -23,9 +23,9 @@ import io.mapsmessaging.mavlink.framing.MavlinkDialectRegistry; import io.mapsmessaging.mavlink.framing.MavlinkFrameFramer; import io.mapsmessaging.mavlink.framing.MavlinkFramePacker; +import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; import io.mapsmessaging.mavlink.message.MavlinkFrame; import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; import io.mapsmessaging.mavlink.message.MavlinkVersion; import java.io.IOException; diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java index cf278a5..2d10e22 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java @@ -23,19 +23,16 @@ import io.mapsmessaging.mavlink.codec.MavlinkPayloadPacker; import io.mapsmessaging.mavlink.codec.MavlinkPayloadParser; import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; -import io.mapsmessaging.mavlink.parser.ClasspathMavlinkIncludeResolver; -import io.mapsmessaging.mavlink.parser.MavlinkDialectDefinition; -import io.mapsmessaging.mavlink.parser.MavlinkDialectLoader; -import io.mapsmessaging.mavlink.parser.MavlinkIncludeResolver; -import io.mapsmessaging.mavlink.parser.MavlinkXmlParser; +import io.mapsmessaging.mavlink.parser.*; +import org.xml.sax.SAXException; + +import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; import java.io.InputStream; import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; -import javax.xml.parsers.ParserConfigurationException; -import org.xml.sax.SAXException; /** * Loads and caches MAVLink dialect definitions and builds {@link MavlinkCodec} instances for them. diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java index 403e42d..06f6ea4 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java @@ -122,10 +122,8 @@ private void packV2(ByteBuffer out, MavlinkFrame frame) { boolean signed = frame.isSigned(); byte[] signature = frame.getSignature(); - if (signed) { - if (signature == null || signature.length != V2_SIGNATURE_LENGTH) { - throw new IllegalArgumentException("Signed v2 frame must have signature[13]"); - } + if (signed && signature == null || signature.length != V2_SIGNATURE_LENGTH) { + throw new IllegalArgumentException("Signed v2 frame must have signature[13]"); } int required = 1 + MAVLINK_V2_HEADER_LENGTH + payloadLength + CRC_LENGTH + (signed ? V2_SIGNATURE_LENGTH : 0); diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageRegistry.java b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageRegistry.java index f5176f9..79ae94c 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageRegistry.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageRegistry.java @@ -22,7 +22,6 @@ import io.mapsmessaging.mavlink.message.fields.MavlinkFieldCodecFactory; import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; import io.mapsmessaging.mavlink.parser.MavlinkDialectDefinition; -import lombok.Data; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java index bbd53f9..4ce6507 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java @@ -19,7 +19,6 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; -import java.util.ArrayList; import java.util.List; public class ArrayFieldCodec extends AbstractMavlinkFieldCodec { diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathMavlinkIncludeResolver.java b/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathMavlinkIncludeResolver.java index 676784c..2356447 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathMavlinkIncludeResolver.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathMavlinkIncludeResolver.java @@ -17,6 +17,7 @@ package io.mapsmessaging.mavlink.parser; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.Objects; @@ -33,7 +34,7 @@ public ClasspathMavlinkIncludeResolver(ClassLoader classLoader, String basePath) @Override public InputStream open(String includeName) throws IOException { - String path = basePath.endsWith("/") ? (basePath + includeName) : (basePath + "/" + includeName); + String path = basePath.endsWith("/") ? (basePath + includeName) : (basePath + File.separator + includeName); return classLoader.getResourceAsStream(path); } } From ba5eb2ba724410592dd9407fd267f2eeceebd9b1 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sun, 4 Jan 2026 14:53:04 +1100 Subject: [PATCH 05/34] fix issue in cleanup --- .../io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java index 06f6ea4..ebfc106 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java @@ -122,7 +122,7 @@ private void packV2(ByteBuffer out, MavlinkFrame frame) { boolean signed = frame.isSigned(); byte[] signature = frame.getSignature(); - if (signed && signature == null || signature.length != V2_SIGNATURE_LENGTH) { + if (signed && (signature == null || signature.length != V2_SIGNATURE_LENGTH)) { throw new IllegalArgumentException("Signed v2 frame must have signature[13]"); } From e1b44a7e8c2fae79881fc7138b7186b3aafb8cd4 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sun, 4 Jan 2026 20:08:13 +1100 Subject: [PATCH 06/34] align the flip() with maps --- .../io/mapsmessaging/mavlink/framing/MavlinkFrameFramer.java | 2 -- .../mavlink/MavlinkFrameRoundTripAllMessagesTest.java | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameFramer.java b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameFramer.java index 48f9946..701f984 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameFramer.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameFramer.java @@ -45,8 +45,6 @@ public MavlinkFrameFramer(MavlinkDialectRegistry dialectRegistry) { } public Optional tryDecode(ByteBuffer networkOwnedBuffer) { - networkOwnedBuffer.flip(); - try { if (!networkOwnedBuffer.hasRemaining()) { return Optional.empty(); diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java index dc9c32a..d420c47 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java @@ -64,7 +64,7 @@ private static void frameRoundTripForMessageV2( ByteBuffer networkOwned = ByteBuffer.allocate(out.remaining() + 16); networkOwned.put(out); - + networkOwned.flip(); Optional decodedOpt = frameCodec.tryUnpackFrame(networkOwned); assertTrue(decodedOpt.isPresent(), "Expected to decode a frame"); From 8f8aae313827eaeb730b487e20c2c4fd4e6b4851 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sun, 4 Jan 2026 20:29:16 +1100 Subject: [PATCH 07/34] fix crc --- .../mapsmessaging/mavlink/message/X25Crc.java | 30 +++++++++---------- .../io/mapsmessaging/mavlink/X25CrcTest.java | 2 +- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/main/java/io/mapsmessaging/mavlink/message/X25Crc.java b/src/main/java/io/mapsmessaging/mavlink/message/X25Crc.java index a3bee19..31384e5 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/X25Crc.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/X25Crc.java @@ -18,17 +18,14 @@ package io.mapsmessaging.mavlink.message; /** - * CRC-16/X.25 implementation. - *

+ * MAVLink CRC-16/X25 implementation. + * * Parameters: - * Name : X.25 * Poly : 0x1021 (reflected as 0x8408) * Init : 0xFFFF * RefIn : true * RefOut : true - * XorOut : 0xFFFF - *

- * This matches the CRC used by MAVLink v1 and v2. + * XorOut : 0x0000 (IMPORTANT: MAVLink does NOT apply final XOR) */ public final class X25Crc { @@ -41,9 +38,6 @@ public X25Crc() { reset(); } - /** - * Convenience one-shot calculation. - */ public static int calculate(byte[] buffer, int offset, int length) { X25Crc crc = new X25Crc(); crc.update(buffer, offset, length); @@ -52,7 +46,7 @@ public static int calculate(byte[] buffer, int offset, int length) { public static int calculate(byte[] buffer) { if (buffer == null) { - return INITIAL_CRC ^ 0xFFFF; + return INITIAL_CRC; } return calculate(buffer, 0, buffer.length); } @@ -68,6 +62,7 @@ public void update(byte value) { public void update(int value) { int data = value & 0xFF; currentCrc ^= data; + for (int bitIndex = 0; bitIndex < 8; bitIndex++) { if ((currentCrc & 0x0001) != 0) { currentCrc = (currentCrc >>> 1) ^ POLYNOMIAL; @@ -75,6 +70,8 @@ public void update(int value) { currentCrc = currentCrc >>> 1; } } + + currentCrc = currentCrc & 0xFFFF; } public void update(byte[] buffer) { @@ -88,6 +85,7 @@ public void update(byte[] buffer, int offset, int length) { if (buffer == null) { return; } + int endIndex = offset + length; for (int index = offset; index < endIndex; index++) { update(buffer[index] & 0xFF); @@ -95,19 +93,19 @@ public void update(byte[] buffer, int offset, int length) { } /** - * Returns the final CRC value (after applying XorOut). + * MAVLink final CRC (no xor-out). */ public int getCrc() { - return currentCrc ^ 0xFFFF; + return currentCrc & 0xFFFF; } - /** - * Returns the final CRC as a 16-bit value (lower 16 bits). - */ public short getCrcAsShort() { - return (short) (getCrc() & 0xFFFF); + return (short) (currentCrc & 0xFFFF); } + /** + * Same as getCrc(); kept for compatibility if callers used it. + */ public int getRawCrc() { return currentCrc & 0xFFFF; } diff --git a/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java b/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java index 33e5e87..f126feb 100644 --- a/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java @@ -38,7 +38,7 @@ void testKnownVector_123456789() { crc.update(data); int crcValue = crc.getCrc() & 0xFFFF; - assertEquals(0x906E, crcValue, "CRC-16/X.25 of '123456789' must be 0x906E"); + assertEquals(0x6F91, crcValue, "CRC-16/X.25 of '123456789' must be 0x906E"); } @Test From 5e81a26aafcac3448e27a2a5d64fab238a85a699 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sun, 4 Jan 2026 21:03:28 +1100 Subject: [PATCH 08/34] compute the extra crc --- .../parser/MavlinkExtraCrcCalculator.java | 49 +++++++++++++++++++ .../mavlink/parser/MavlinkXmlParser.java | 2 + .../io/mapsmessaging/mavlink/X25CrcTest.java | 34 +++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 src/main/java/io/mapsmessaging/mavlink/parser/MavlinkExtraCrcCalculator.java diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkExtraCrcCalculator.java b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkExtraCrcCalculator.java new file mode 100644 index 0000000..219eb10 --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkExtraCrcCalculator.java @@ -0,0 +1,49 @@ +package io.mapsmessaging.mavlink.parser; + +import io.mapsmessaging.mavlink.message.MavlinkMessageDefinition; +import io.mapsmessaging.mavlink.message.X25Crc; +import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; + +import java.nio.charset.StandardCharsets; +import java.util.List; + +public final class MavlinkExtraCrcCalculator { + + private MavlinkExtraCrcCalculator() { + } + + public static int computeExtraCrc(MavlinkMessageDefinition messageDefinition) { + X25Crc crc = new X25Crc(); + String messageName = messageDefinition.getName(); + List wireOrderedFields = messageDefinition.getFields(); + accumulateTokenWithSpace(crc, messageName); + + for (MavlinkFieldDefinition field : wireOrderedFields) { + if (field.isExtension()) { + continue; + } + + accumulateTokenWithSpace(crc, field.getType()); + accumulateTokenWithSpace(crc, field.getName()); + + if (field.isArray()) { + crc.update(field.getArrayLength() & 0xFF); + } + } + + int crc16 = crc.getCrc() & 0xFFFF; + return ((crc16 & 0xFF) ^ (crc16 >>> 8)) & 0xFF; + } + + private static void accumulateTokenWithSpace(X25Crc crc, String token) { + if (token == null) { + return; + } + + byte[] bytes = token.getBytes(StandardCharsets.US_ASCII); + for (byte value : bytes) { + crc.update(value); + } + crc.update((byte) ' '); + } +} diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkXmlParser.java b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkXmlParser.java index b7c88cb..c251b16 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkXmlParser.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkXmlParser.java @@ -199,6 +199,8 @@ private MavlinkMessageDefinition parseMessage(Element messageElement) { List fields = parseMessageFields(messageElement); messageDefinition.setXmlOrderedFields(fields); + int extraCrc = MavlinkExtraCrcCalculator.computeExtraCrc(messageDefinition); + messageDefinition.setExtraCrc(extraCrc); return messageDefinition; } diff --git a/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java b/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java index f126feb..de4254f 100644 --- a/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java @@ -23,6 +23,7 @@ import io.mapsmessaging.mavlink.message.X25Crc; import org.junit.jupiter.api.Test; +import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -41,6 +42,39 @@ void testKnownVector_123456789() { assertEquals(0x6F91, crcValue, "CRC-16/X.25 of '123456789' must be 0x906E"); } + @Test + void testMavlink2FrameCrc_attitudeQuaternion_31() { + int[] signed = new int[] { + -3, 32, 0, 0, -56, 1, 1, 31, 0, 0, + 24, 35, 27, 0, 126, 45, 42, 63, -11, -55, 33, 56, -13, 23, -48, -72, 83, 63, 63, 63, -58, 54, 67, -70, 122, 57, 32, -71, 77, -44, 43, -71, + 75, -68 + }; + + + + byte[] frame = new byte[signed.length]; + + for (int index = 0; index < signed.length; index++) { + frame[index] = (byte) signed[index]; + } + int payloadLength = frame[1] & 0xFF; + assertEquals(32, payloadLength); + int receivedCrc = (frame[42] & 0xFF) | ((frame[43] & 0xFF) << 8); + assertEquals(0xBC4B, receivedCrc); + + // MAVLink2 CRC input = bytes from LEN (index 1) through payload end (index 41), then CRC_EXTRA + int crcInputOffset = 1; + int crcInputLength = 9 + payloadLength; // LEN..MSGID(3) is 9 bytes, then payload + X25Crc crc = new X25Crc(); + crc.update(frame, crcInputOffset, crcInputLength); + + int crcExtra = 246; // MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC :contentReference[oaicite:1]{index=1} + crc.update(crcExtra); + + int computed = crc.getCrc(); + assertEquals(receivedCrc, computed, "Computed CRC must match the frame CRC"); + } + @Test void testHeartbeatExtraCrc() { // HEARTBEAT extra CRC is 50 (0x32) according to MAVLink tables. From cacd50660f0854f7bc681267b376159ccc693847 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sun, 4 Jan 2026 21:12:21 +1100 Subject: [PATCH 09/34] compute the extra crc --- .../mavlink/message/MavlinkCompiledMessage.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledMessage.java b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledMessage.java index 347b78f..18e013f 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledMessage.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledMessage.java @@ -31,7 +31,10 @@ public class MavlinkCompiledMessage { private List compiledFields; private int payloadSizeBytes; private int minimumPayloadSizeBytes; - private int crcExtra; + + public int getCrcExtra(){ + return messageDefinition.getExtraCrc(); + } @Override public String toString() { @@ -45,7 +48,7 @@ public String toString() { .append(", minPayloadSize=") .append(minimumPayloadSizeBytes) .append(", crcExtra=") - .append(crcExtra) + .append(messageDefinition.getExtraCrc()) .append("]\n"); for (MavlinkCompiledField compiledField : compiledFields) { From e994a6c25a3105774648025bddb3e06ae4649ec1 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Mon, 5 Jan 2026 09:33:06 +1100 Subject: [PATCH 10/34] windows fails to load from the jar --- .../mavlink/parser/ClasspathMavlinkIncludeResolver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathMavlinkIncludeResolver.java b/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathMavlinkIncludeResolver.java index 2356447..a35d47b 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathMavlinkIncludeResolver.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathMavlinkIncludeResolver.java @@ -34,7 +34,7 @@ public ClasspathMavlinkIncludeResolver(ClassLoader classLoader, String basePath) @Override public InputStream open(String includeName) throws IOException { - String path = basePath.endsWith("/") ? (basePath + includeName) : (basePath + File.separator + includeName); + String path = basePath.endsWith("/") ? (basePath + includeName) : (basePath + "/" + includeName); return classLoader.getResourceAsStream(path); } } From 010a59097ce4ffb6e3396929fbb0d86f7421d7b0 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Mon, 5 Jan 2026 11:32:51 +1100 Subject: [PATCH 11/34] parse V1 correctly --- .../framing/MavlinkV1FrameHandler.java | 8 +++---- .../mavlink/parser/MavlinkXmlParser.java | 3 --- .../mapsmessaging/mavlink/HeartbeatTest.java | 22 +++++++++++++++++++ 3 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV1FrameHandler.java b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV1FrameHandler.java index fe2cd98..f98e0b8 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV1FrameHandler.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV1FrameHandler.java @@ -39,7 +39,7 @@ public MavlinkV1FrameHandler(MavlinkDialectRegistry dialectRegistry) { @Override public int minimumBytesRequiredForHeader() { - return 1 + HEADER_LENGTH; + return HEADER_LENGTH; } @Override @@ -49,7 +49,7 @@ public int peekPayloadLength(ByteBuffer buffer, int frameStartIndex) { @Override public int computeTotalFrameLength(ByteBuffer buffer, int frameStartIndex, int payloadLength) { - return 1 + HEADER_LENGTH + payloadLength + CRC_LENGTH; + return HEADER_LENGTH + payloadLength + CRC_LENGTH; } @Override @@ -72,13 +72,13 @@ public Optional tryDecode(ByteBuffer candidateFrame) { return Optional.empty(); } - int payloadStartIndex = frameStartIndex + 1 + HEADER_LENGTH; + int payloadStartIndex = frameStartIndex + HEADER_LENGTH; int crcStartIndex = payloadStartIndex + payloadLength; int receivedChecksum = ByteBufferUtils.readUnsignedLittleEndianShort(candidateFrame, crcStartIndex); int crcExtra = dialectRegistry.crcExtra(MavlinkVersion.V1, messageId); - int computedChecksum = CrcHelper.computeChecksumFromWritten(candidateFrame, frameStartIndex + 1, (HEADER_LENGTH-1) + payloadLength, crcExtra); + int computedChecksum = CrcHelper.computeChecksumFromWritten(candidateFrame, frameStartIndex + 1, (HEADER_LENGTH) + payloadLength-1, crcExtra); if (computedChecksum != receivedChecksum) { return Optional.empty(); } diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkXmlParser.java b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkXmlParser.java index c251b16..27813bd 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkXmlParser.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkXmlParser.java @@ -198,9 +198,6 @@ private MavlinkMessageDefinition parseMessage(Element messageElement) { List fields = parseMessageFields(messageElement); messageDefinition.setXmlOrderedFields(fields); - - int extraCrc = MavlinkExtraCrcCalculator.computeExtraCrc(messageDefinition); - messageDefinition.setExtraCrc(extraCrc); return messageDefinition; } diff --git a/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java b/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java new file mode 100644 index 0000000..bbb8948 --- /dev/null +++ b/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java @@ -0,0 +1,22 @@ +package io.mapsmessaging.mavlink; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.nio.ByteBuffer; + +class HeartbeatTest { + + @Test + void validateV1Heartbeat() throws Exception { + int[] load = new int[]{0xfe,0x09,0x81,0xff,0xbe,0x00,0x00,0x00,0x00,0x00,0x06,0x08,0xc0,0x04,0x03,0xa4,0xe2}; + byte[] buffer = new byte[load.length]; + for(int x=0;x Date: Mon, 5 Jan 2026 13:45:51 +1100 Subject: [PATCH 12/34] generate json schemas --- README.md | 1 + pom.xml | 8 + .../message/MavlinkMessageRegistry.java | 12 ++ .../message/fields/MavlinkWireType.java | 11 ++ .../schema/MavlinkJsonSchemaBuilder.java | 138 ++++++++++++++++++ ...avlinkPayloadJsonSchemaValidationTest.java | 78 ++++++++++ 6 files changed, 248 insertions(+) create mode 100644 src/main/java/io/mapsmessaging/mavlink/schema/MavlinkJsonSchemaBuilder.java create mode 100644 src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java diff --git a/README.md b/README.md index fcae0d7..952de07 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ It **does**: - Encode Java field maps into MAVLink payload bytes - Decode MAVLink payload bytes into typed field maps - Correctly handle MAVLink field ordering, arrays, enums, and extensions +- Creates JsonSchemas to match the fields that it parses to and from It **does not**: diff --git a/pom.xml b/pom.xml index 1b3b305..4b4585b 100644 --- a/pom.xml +++ b/pom.xml @@ -378,6 +378,14 @@ 6.0.1 + + com.networknt + json-schema-validator + 1.5.1 + test + + + diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageRegistry.java b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageRegistry.java index 79ae94c..7b3db45 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageRegistry.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageRegistry.java @@ -17,11 +17,13 @@ package io.mapsmessaging.mavlink.message; +import com.google.gson.JsonObject; import io.mapsmessaging.mavlink.message.fields.AbstractMavlinkFieldCodec; import io.mapsmessaging.mavlink.message.fields.MavlinkEnumDefinition; import io.mapsmessaging.mavlink.message.fields.MavlinkFieldCodecFactory; import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; import io.mapsmessaging.mavlink.parser.MavlinkDialectDefinition; +import io.mapsmessaging.mavlink.schema.MavlinkJsonSchemaBuilder; import lombok.Getter; import lombok.Setter; @@ -39,22 +41,29 @@ public class MavlinkMessageRegistry { private Map enumsByName; + private Map jsonSchema; + + + public static MavlinkMessageRegistry fromDialectDefinition(MavlinkDialectDefinition dialectDefinition) { MavlinkMessageRegistry registry = new MavlinkMessageRegistry(); registry.setDialectName(dialectDefinition.getName()); List compiledMessageList = new ArrayList<>(); Map compiledByIdMap = new HashMap<>(); + Map schemaMap = new HashMap<>(); for (MavlinkMessageDefinition messageDefinition : dialectDefinition.getMessages()) { MavlinkCompiledMessage compiledMessage = compileMessage(messageDefinition); compiledMessageList.add(compiledMessage); compiledByIdMap.put(compiledMessage.getMessageId(), compiledMessage); + schemaMap.put(compiledMessage.getMessageId(), MavlinkJsonSchemaBuilder.buildSchema(compiledMessage, dialectDefinition.getEnumsByName())); } registry.setCompiledMessages(compiledMessageList); registry.setCompiledMessagesById(compiledByIdMap); registry.setEnumsByName(new HashMap<>(dialectDefinition.getEnumsByName())); + registry.setJsonSchema(schemaMap); return registry; } @@ -71,6 +80,9 @@ private void setCompiledMessages(List compiledMessageLis this.compiledMessages = Collections.unmodifiableList(new ArrayList<>(compiledMessageList)); } + private void setJsonSchema(Map jsonSchemaMap ){ + this.jsonSchema = Collections.unmodifiableMap(new HashMap<>(jsonSchemaMap)); + } private static MavlinkCompiledMessage compileMessage(MavlinkMessageDefinition messageDefinition) { MavlinkCompiledMessage compiledMessage = new MavlinkCompiledMessage(); diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkWireType.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkWireType.java index 4bd830a..b7d5c18 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkWireType.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkWireType.java @@ -75,4 +75,15 @@ public static MavlinkWireType fromXmlType(String xmlType) { }; } + public boolean isChar(){ + return wireName.equals("char"); + } + + public boolean isFloat(){ + return wireName.equals("float"); + } + + public boolean isDouble(){ + return wireName.equals("double"); + } } \ No newline at end of file diff --git a/src/main/java/io/mapsmessaging/mavlink/schema/MavlinkJsonSchemaBuilder.java b/src/main/java/io/mapsmessaging/mavlink/schema/MavlinkJsonSchemaBuilder.java new file mode 100644 index 0000000..8f73a5d --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/schema/MavlinkJsonSchemaBuilder.java @@ -0,0 +1,138 @@ +package io.mapsmessaging.mavlink.schema; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import io.mapsmessaging.mavlink.message.MavlinkCompiledField; +import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; +import io.mapsmessaging.mavlink.message.fields.MavlinkEnumDefinition; +import io.mapsmessaging.mavlink.message.fields.MavlinkEnumEntry; +import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; +import io.mapsmessaging.mavlink.message.fields.MavlinkWireType; + +import java.util.Map; + +public final class MavlinkJsonSchemaBuilder { + + private MavlinkJsonSchemaBuilder() { + } + + public static JsonObject buildSchema( + MavlinkCompiledMessage message, + Map enumsByName) { + + JsonObject schema = new JsonObject(); + schema.addProperty("$schema", "https://json-schema.org/draft/2020-12/schema"); + schema.addProperty("title", message.getName()); + schema.addProperty("type", "object"); + schema.addProperty("description", + message.getMessageDefinition().getDescription()); + + JsonObject properties = new JsonObject(); + JsonArray required = new JsonArray(); + + for (MavlinkCompiledField compiledField : message.getCompiledFields()) { + MavlinkFieldDefinition field = compiledField.getFieldDefinition(); + + JsonObject fieldSchema = buildFieldSchema(field, enumsByName); + properties.add(field.getName(), fieldSchema); + + if (!field.isExtension()) { + required.add(field.getName()); + } + } + + schema.add("properties", properties); + if (!required.isEmpty()) { + schema.add("required", required); + } + + schema.addProperty("additionalProperties", false); + schema.addProperty("x-message-id", message.getMessageId()); + schema.addProperty("x-crc-extra", message.getCrcExtra()); + + return schema; + } + + private static JsonObject buildFieldSchema( + MavlinkFieldDefinition field, + Map enumsByName) { + + JsonObject schema = new JsonObject(); + + if (field.getDescription() != null) { + schema.addProperty("description", field.getDescription()); + } + + MavlinkWireType wireType = field.getWireType(); + + // char[N] → string + if (field.isArray() && wireType.isChar()) { + schema.addProperty("type", "string"); + schema.addProperty("maxLength", field.getArrayLength()); + return schema; + } + + // Arrays + if (field.isArray()) { + schema.addProperty("type", "array"); + schema.addProperty("minItems", field.getArrayLength()); + schema.addProperty("maxItems", field.getArrayLength()); + + JsonObject itemSchema = scalarSchema(field, enumsByName); + schema.add("items", itemSchema); + return schema; + } + + // Scalar + return scalarSchema(field, enumsByName); + } + + private static JsonObject scalarSchema( + MavlinkFieldDefinition field, + Map enumsByName) { + + JsonObject schema = new JsonObject(); + MavlinkWireType wireType = field.getWireType(); + + if (wireType.isFloat() || wireType.isDouble()) { + schema.addProperty("type", "number"); + } else { + schema.addProperty("type", "integer"); + } + + if (field.getEnumName() != null) { + MavlinkEnumDefinition enumDef = enumsByName.get(field.getEnumName()); + if (enumDef != null) { + applyEnum(schema, enumDef); + } + } + + return schema; + } + + private static void applyEnum( + JsonObject schema, + MavlinkEnumDefinition enumDef) { + + schema.addProperty("x-enum-name", enumDef.getName()); + + if (enumDef.isBitmask()) { + schema.addProperty("description", + "Bitmask enum: " + enumDef.getName()); + return; + } + + JsonArray oneOf = new JsonArray(); + for (MavlinkEnumEntry entry : enumDef.getEntries()) { + JsonObject option = new JsonObject(); + option.addProperty("const", entry.getValue()); + option.addProperty("title", entry.getName()); + if (entry.getDescription() != null) { + option.addProperty("description", entry.getDescription()); + } + oneOf.add(option); + } + + schema.add("oneOf", oneOf); + } +} diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java new file mode 100644 index 0000000..bca06dc --- /dev/null +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java @@ -0,0 +1,78 @@ +package io.mapsmessaging.mavlink; + + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.networknt.schema.JsonSchema; +import com.networknt.schema.JsonSchemaFactory; +import com.networknt.schema.SpecVersion; +import com.networknt.schema.ValidationMessage; +import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; +import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; +import org.junit.jupiter.api.DynamicTest; +import org.junit.jupiter.api.TestFactory; + +import java.util.Map; +import java.util.Set; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.*; + +class MavlinkPayloadJsonSchemaValidationTest extends BaseRoudTripTest { + + private static final Gson GSON = new Gson(); + private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + + @TestFactory + Stream allMessages_payload_toJson_validatesAgainstSchema() throws Exception { + MavlinkCodec payloadCodec = MavlinkTestSupport.codec(); + MavlinkMessageRegistry registry = payloadCodec.getRegistry(); + + return registry.getCompiledMessages().stream() + .map(msg -> DynamicTest.dynamicTest( + msg.getMessageId() + " " + msg.getName(), + () -> payloadToJsonValidates(payloadCodec, registry, msg) + )); + } + + private static void payloadToJsonValidates( + MavlinkCodec payloadCodec, + MavlinkMessageRegistry registry, + MavlinkCompiledMessage msg + ) throws Exception { + + Map values = + RandomValueFactory.buildValues(registry, msg, MavlinkRoundTripAllMessagesTest.ExtensionMode.SOME_PRESENT, BASE_SEED); + + byte[] payload = payloadCodec.encodePayload(msg.getMessageId(), values); + assertNotNull(payload); + + Map parsed = payloadCodec.parsePayload(msg.getMessageId(), payload); + assertNotNull(parsed); + + JsonObject jsonObject = GSON.toJsonTree(parsed).getAsJsonObject(); + + // Build schema for this message + JsonObject schemaObject = + io.mapsmessaging.mavlink.schema.MavlinkJsonSchemaBuilder.buildSchema(msg, registry.getEnumsByName()); + + JsonSchema schema = compileSchema(schemaObject); + Set errors = schema.validate(toJsonNode(jsonObject)); + + assertTrue(errors.isEmpty(), + () -> "Schema validation failed for msgId=" + msg.getMessageId() + " " + msg.getName() + "\n" + + String.join("\n", errors.stream().map(ValidationMessage::getMessage).toList())); + } + + private static JsonSchema compileSchema(JsonObject schemaObject) throws Exception { + JsonSchemaFactory factory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V202012); + JsonNode schemaNode = toJsonNode(schemaObject); + return factory.getSchema(schemaNode); + } + + private static JsonNode toJsonNode(JsonObject gsonObject) throws Exception { + return OBJECT_MAPPER.readTree(GSON.toJson(gsonObject)); + } +} From 0f984a2a2f09a1497cef9065f6c93c91cf20b313 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Mon, 5 Jan 2026 16:19:33 +1100 Subject: [PATCH 13/34] update copyright --- .../mapsmessaging/mavlink/MavlinkCodec.java | 19 ++++++++++++++++ .../mavlink/MavlinkFrameCodec.java | 1 - .../mavlink/MavlinkFrameEnvelope.java | 1 - .../mavlink/MavlinkMessageFormatLoader.java | 1 - .../mavlink/codec/MavlinkFrameEncoder.java | 22 ++++++++++--------- .../mavlink/codec/MavlinkFrameFactory.java | 22 ++++++++++--------- .../mavlink/codec/MavlinkJsonCodec.java | 22 ++++++++++--------- .../codec/MavlinkJsonValuesExtractor.java | 22 ++++++++++--------- .../mavlink/codec/MavlinkMapConverter.java | 22 ++++++++++--------- .../mavlink/codec/MavlinkPayloadPacker.java | 19 ++++++++++++++++ .../mavlink/codec/MavlinkPayloadParser.java | 3 +-- .../mavlink/framing/ByteBufferUtils.java | 22 ++++++++++--------- .../mavlink/framing/CrcHelper.java | 19 ++++++++++++++++ .../framing/MavlinkDialectRegistry.java | 22 ++++++++++--------- .../mavlink/framing/MavlinkFrameDecoder.java | 19 ++++++++++++++++ .../mavlink/framing/MavlinkFrameFramer.java | 22 ++++++++++--------- .../mavlink/framing/MavlinkFrameHandler.java | 22 ++++++++++--------- .../mavlink/framing/MavlinkFramePacker.java | 22 ++++++++++--------- .../framing/MavlinkV1FrameHandler.java | 22 ++++++++++--------- .../framing/MavlinkV2FrameHandler.java | 22 ++++++++++--------- .../mavlink/message/MavlinkCompiledField.java | 22 ++++++++++--------- .../message/MavlinkCompiledMessage.java | 22 ++++++++++--------- .../mavlink/message/MavlinkEnumResolver.java | 22 ++++++++++--------- .../mavlink/message/MavlinkFrame.java | 22 ++++++++++--------- .../mavlink/message/MavlinkFrameParser.java | 22 ++++++++++--------- .../message/MavlinkMessageDefinition.java | 22 ++++++++++--------- .../message/MavlinkMessageRegistry.java | 22 ++++++++++--------- .../mavlink/message/MavlinkVersion.java | 22 ++++++++++--------- .../mapsmessaging/mavlink/message/X25Crc.java | 22 ++++++++++--------- .../fields/AbstractMavlinkFieldCodec.java | 22 ++++++++++--------- .../message/fields/ArrayFieldCodec.java | 22 ++++++++++--------- .../message/fields/CharFieldCodec.java | 22 ++++++++++--------- .../message/fields/DoubleFieldCodec.java | 22 ++++++++++--------- .../message/fields/FloatFieldCodec.java | 22 ++++++++++--------- .../message/fields/Int16FieldCodec.java | 22 ++++++++++--------- .../message/fields/Int32FieldCodec.java | 22 ++++++++++--------- .../message/fields/Int64FieldCodec.java | 22 ++++++++++--------- .../message/fields/Int8FieldCodec.java | 22 ++++++++++--------- .../message/fields/MavlinkEnumDefinition.java | 22 ++++++++++--------- .../message/fields/MavlinkEnumEntry.java | 22 ++++++++++--------- .../fields/MavlinkFieldCodecFactory.java | 22 ++++++++++--------- .../fields/MavlinkFieldDefinition.java | 22 ++++++++++--------- .../message/fields/MavlinkWireType.java | 22 ++++++++++--------- .../message/fields/UInt16FieldCodec.java | 22 ++++++++++--------- .../message/fields/UInt32FieldCodec.java | 22 ++++++++++--------- .../message/fields/UInt64FieldCodec.java | 22 ++++++++++--------- .../message/fields/UInt8FieldCodec.java | 22 ++++++++++--------- .../ClasspathMavlinkIncludeResolver.java | 22 ++++++++++--------- .../parser/MavlinkDialectDefinition.java | 3 +-- .../mavlink/parser/MavlinkDialectLoader.java | 22 ++++++++++--------- .../parser/MavlinkExtraCrcCalculator.java | 19 ++++++++++++++++ .../parser/MavlinkIncludeResolver.java | 22 ++++++++++--------- .../mavlink/parser/MavlinkXmlParser.java | 3 +-- .../schema/MavlinkJsonSchemaBuilder.java | 19 ++++++++++++++++ .../mavlink/BaseRoudTripTest.java | 19 ++++++++++++++++ .../mapsmessaging/mavlink/HeartbeatTest.java | 19 ++++++++++++++++ .../MavlinkFrameRoundTripAllMessagesTest.java | 19 ++++++++++++++++ ...avlinkPayloadJsonSchemaValidationTest.java | 19 ++++++++++++++++ .../MavlinkRoundTripAllMessagesTest.java | 19 ++++++++++++++++ .../mavlink/MavlinkTestSupport.java | 19 ++++++++++++++++ .../mavlink/TestMavlinkCharArrays.java | 19 ++++++++++++++++ .../mavlink/TestMavlinkConcurrency.java | 19 ++++++++++++++++ .../mavlink/TestMavlinkExtensions.java | 19 ++++++++++++++++ .../mavlink/TestMavlinkNumericArrays.java | 19 ++++++++++++++++ .../TestMavlinkRegistryInvariants.java | 19 ++++++++++++++++ .../mavlink/TestMavlinkRobustness.java | 19 ++++++++++++++++ .../mavlink/TestMavlinkXmlParserIncludes.java | 19 ++++++++++++++++ .../io/mapsmessaging/mavlink/X25CrcTest.java | 3 +-- 68 files changed, 869 insertions(+), 431 deletions(-) diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkCodec.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkCodec.java index 41737b3..b3b5521 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkCodec.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink; import io.mapsmessaging.mavlink.codec.MavlinkPayloadPacker; diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java index 6a8be74..29198d6 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java @@ -15,7 +15,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package io.mapsmessaging.mavlink; diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameEnvelope.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameEnvelope.java index 7ce1fa6..e96fbaa 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameEnvelope.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameEnvelope.java @@ -15,7 +15,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package io.mapsmessaging.mavlink; diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java index 2d10e22..1a8743e 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java @@ -15,7 +15,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package io.mapsmessaging.mavlink; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameEncoder.java b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameEncoder.java index b25cb14..8969fa5 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameEncoder.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameEncoder.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.codec; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameFactory.java b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameFactory.java index cc41ccd..9a2bd6a 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameFactory.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameFactory.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.codec; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkJsonCodec.java b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkJsonCodec.java index b2d84bf..4ad7ea2 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkJsonCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkJsonCodec.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.codec; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkJsonValuesExtractor.java b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkJsonValuesExtractor.java index 79ad817..ae5f2ab 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkJsonValuesExtractor.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkJsonValuesExtractor.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.codec; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkMapConverter.java b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkMapConverter.java index 0d00fe8..a8ce233 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkMapConverter.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkMapConverter.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.codec; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadPacker.java b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadPacker.java index d224fb6..349f7c2 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadPacker.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadPacker.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink.codec; import io.mapsmessaging.mavlink.message.MavlinkCompiledField; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadParser.java b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadParser.java index dfee1df..40c97e2 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadParser.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadParser.java @@ -1,7 +1,7 @@ /* * * Copyright [ 2020 - 2024 ] Matthew Buckton - * Copyright [ 2024 - 2025 ] MapsMessaging B.V. + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * * Licensed under the Apache License, Version 2.0 with the Commons Clause * (the "License"); you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package io.mapsmessaging.mavlink.codec; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/ByteBufferUtils.java b/src/main/java/io/mapsmessaging/mavlink/framing/ByteBufferUtils.java index 48b0915..b9ea22f 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/ByteBufferUtils.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/ByteBufferUtils.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/CrcHelper.java b/src/main/java/io/mapsmessaging/mavlink/framing/CrcHelper.java index eddc483..d3b3e36 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/CrcHelper.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/CrcHelper.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink.framing; import io.mapsmessaging.mavlink.message.X25Crc; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkDialectRegistry.java b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkDialectRegistry.java index 10c7df1..b3539e0 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkDialectRegistry.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkDialectRegistry.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameDecoder.java b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameDecoder.java index 6132d1e..2bba84c 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameDecoder.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameDecoder.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink.framing; import io.mapsmessaging.mavlink.message.MavlinkFrame; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameFramer.java b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameFramer.java index 701f984..4ca0880 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameFramer.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameFramer.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameHandler.java b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameHandler.java index 040f4f6..c22c656 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameHandler.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameHandler.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java index ebfc106..91fecbf 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV1FrameHandler.java b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV1FrameHandler.java index f98e0b8..2003f23 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV1FrameHandler.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV1FrameHandler.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV2FrameHandler.java b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV2FrameHandler.java index 3715745..b9deea0 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV2FrameHandler.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV2FrameHandler.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledField.java b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledField.java index 2a035da..24b6741 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledField.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledField.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledMessage.java b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledMessage.java index 18e013f..268de60 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledMessage.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledMessage.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkEnumResolver.java b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkEnumResolver.java index 1c3f8cb..6c368d9 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkEnumResolver.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkEnumResolver.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkFrame.java b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkFrame.java index 6e129ee..871ab2c 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkFrame.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkFrame.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkFrameParser.java b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkFrameParser.java index a01113a..eb0b953 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkFrameParser.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkFrameParser.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageDefinition.java b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageDefinition.java index 7362e21..7d6f600 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageDefinition.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageDefinition.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageRegistry.java b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageRegistry.java index 7b3db45..bb51cb5 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageRegistry.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageRegistry.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkVersion.java b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkVersion.java index 3876e73..cbde5bb 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkVersion.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkVersion.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/X25Crc.java b/src/main/java/io/mapsmessaging/mavlink/message/X25Crc.java index 31384e5..a92b2af 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/X25Crc.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/X25Crc.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/AbstractMavlinkFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/AbstractMavlinkFieldCodec.java index 23d3bfc..c0738ee 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/AbstractMavlinkFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/AbstractMavlinkFieldCodec.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java index 4ce6507..c32ffb6 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java index 8e40507..85ec564 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/DoubleFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/DoubleFieldCodec.java index 1a84568..3c617ed 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/DoubleFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/DoubleFieldCodec.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/FloatFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/FloatFieldCodec.java index 4b8242e..58af855 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/FloatFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/FloatFieldCodec.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int16FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int16FieldCodec.java index 921de5d..8d4e9d2 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int16FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int16FieldCodec.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int32FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int32FieldCodec.java index deeea11..afdf39a 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int32FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int32FieldCodec.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int64FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int64FieldCodec.java index 7488a15..59e91df 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int64FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int64FieldCodec.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int8FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int8FieldCodec.java index c6da4f4..e7e4e50 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int8FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int8FieldCodec.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkEnumDefinition.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkEnumDefinition.java index 8ca3f80..bdf3c29 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkEnumDefinition.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkEnumDefinition.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkEnumEntry.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkEnumEntry.java index 328f125..c7ee10d 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkEnumEntry.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkEnumEntry.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkFieldCodecFactory.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkFieldCodecFactory.java index 49e3f09..4e8cfe5 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkFieldCodecFactory.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkFieldCodecFactory.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkFieldDefinition.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkFieldDefinition.java index 56ebde3..986fac3 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkFieldDefinition.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkFieldDefinition.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkWireType.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkWireType.java index b7d5c18..5d1c02f 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkWireType.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkWireType.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt16FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt16FieldCodec.java index 845f357..a8193ff 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt16FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt16FieldCodec.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt32FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt32FieldCodec.java index 64c2bdf..e8d0662 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt32FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt32FieldCodec.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt64FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt64FieldCodec.java index 93dccf7..000206f 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt64FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt64FieldCodec.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt8FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt8FieldCodec.java index 7660301..90dae5e 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt8FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt8FieldCodec.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathMavlinkIncludeResolver.java b/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathMavlinkIncludeResolver.java index a35d47b..98f5af0 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathMavlinkIncludeResolver.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathMavlinkIncludeResolver.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.parser; diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkDialectDefinition.java b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkDialectDefinition.java index f4b7662..19c19c1 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkDialectDefinition.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkDialectDefinition.java @@ -1,7 +1,7 @@ /* * * Copyright [ 2020 - 2024 ] Matthew Buckton - * Copyright [ 2024 - 2025 ] MapsMessaging B.V. + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * * Licensed under the Apache License, Version 2.0 with the Commons Clause * (the "License"); you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package io.mapsmessaging.mavlink.parser; diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkDialectLoader.java b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkDialectLoader.java index 6e87494..5630270 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkDialectLoader.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkDialectLoader.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.parser; diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkExtraCrcCalculator.java b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkExtraCrcCalculator.java index 219eb10..c213134 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkExtraCrcCalculator.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkExtraCrcCalculator.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink.parser; import io.mapsmessaging.mavlink.message.MavlinkMessageDefinition; diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkIncludeResolver.java b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkIncludeResolver.java index 3999eed..1bc0acf 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkIncludeResolver.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkIncludeResolver.java @@ -1,18 +1,20 @@ /* * - * Copyright [ 2020 - 2026 ] [Matthew Buckton] + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package io.mapsmessaging.mavlink.parser; diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkXmlParser.java b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkXmlParser.java index 27813bd..519b3b7 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkXmlParser.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkXmlParser.java @@ -1,7 +1,7 @@ /* * * Copyright [ 2020 - 2024 ] Matthew Buckton - * Copyright [ 2024 - 2025 ] MapsMessaging B.V. + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * * Licensed under the Apache License, Version 2.0 with the Commons Clause * (the "License"); you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package io.mapsmessaging.mavlink.parser; diff --git a/src/main/java/io/mapsmessaging/mavlink/schema/MavlinkJsonSchemaBuilder.java b/src/main/java/io/mapsmessaging/mavlink/schema/MavlinkJsonSchemaBuilder.java index 8f73a5d..3379311 100644 --- a/src/main/java/io/mapsmessaging/mavlink/schema/MavlinkJsonSchemaBuilder.java +++ b/src/main/java/io/mapsmessaging/mavlink/schema/MavlinkJsonSchemaBuilder.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink.schema; import com.google.gson.JsonArray; diff --git a/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java b/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java index 6eef298..b544bed 100644 --- a/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink; import io.mapsmessaging.mavlink.message.MavlinkCompiledField; diff --git a/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java b/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java index bbb8948..9943007 100644 --- a/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink; import org.junit.jupiter.api.Assertions; diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java index d420c47..9963b40 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink; import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java index bca06dc..a3cfad9 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink; diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java index 090b204..9fc0f20 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink; import io.mapsmessaging.mavlink.message.MavlinkCompiledField; diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java index 310237f..6093702 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink; import io.mapsmessaging.mavlink.message.MavlinkCompiledField; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkCharArrays.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkCharArrays.java index aedfdf3..c0b1d74 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkCharArrays.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkCharArrays.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink; import io.mapsmessaging.mavlink.message.MavlinkCompiledField; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkConcurrency.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkConcurrency.java index 392f6a7..9eb2f99 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkConcurrency.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkConcurrency.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink; import org.junit.jupiter.api.Test; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkExtensions.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkExtensions.java index ea315e5..962d0ff 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkExtensions.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkExtensions.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink; import io.mapsmessaging.mavlink.message.MavlinkCompiledField; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkNumericArrays.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkNumericArrays.java index 8a0eede..35f76bc 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkNumericArrays.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkNumericArrays.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRegistryInvariants.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRegistryInvariants.java index 717ff7c..a7ce7a0 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRegistryInvariants.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRegistryInvariants.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink; import io.mapsmessaging.mavlink.message.MavlinkCompiledField; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java index 5f7dc27..0407489 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkXmlParserIncludes.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkXmlParserIncludes.java index d27d1cd..90b3104 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkXmlParserIncludes.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkXmlParserIncludes.java @@ -1,3 +1,22 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.mapsmessaging.mavlink; import io.mapsmessaging.mavlink.parser.*; diff --git a/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java b/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java index de4254f..317fa73 100644 --- a/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java @@ -1,7 +1,7 @@ /* * * Copyright [ 2020 - 2024 ] Matthew Buckton - * Copyright [ 2024 - 2025 ] MapsMessaging B.V. + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * * Licensed under the Apache License, Version 2.0 with the Commons Clause * (the "License"); you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package io.mapsmessaging.mavlink; From f6b117d66abfc0d77a8c84ae2f76b7362ae65faf Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Tue, 6 Jan 2026 15:39:59 +1100 Subject: [PATCH 14/34] fix(parsing): truncated packets MavLink allows truncated packets IF the framing is correct --- .../mavlink/codec/MavlinkPayloadParser.java | 70 +++-- .../mapsmessaging/mavlink/HeartbeatTest.java | 264 ++++++++++++++++++ .../mavlink/TestMavlinkRobustness.java | 22 -- 3 files changed, 310 insertions(+), 46 deletions(-) diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadParser.java b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadParser.java index 40c97e2..74c7fd1 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadParser.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadParser.java @@ -56,51 +56,44 @@ public Map parsePayload(int messageId, byte[] payload) throws IO ByteBuffer buffer = ByteBuffer.wrap(payload); buffer.order(ByteOrder.LITTLE_ENDIAN); + boolean truncated = false; + for (MavlinkCompiledField compiledField : compiledMessage.getCompiledFields()) { MavlinkFieldDefinition fieldDefinition = compiledField.getFieldDefinition(); AbstractMavlinkFieldCodec fieldCodec = compiledField.getFieldCodec(); String fieldName = fieldDefinition.getName(); - int fieldSize = compiledField.getSizeInBytes(); - // Base fields MUST be present if (!fieldDefinition.isExtension()) { - if (buffer.remaining() < fieldSize) { - throw new IOException( - "Payload too short for base field '" + fieldName + - "' in message " + compiledMessage.getName() + - " remaining=" + buffer.remaining() + - " required=" + fieldSize - ); + if (truncated || buffer.remaining() < fieldSize) { + truncated = true; + result.put(fieldName, zeroValue(fieldDefinition)); + continue; } } else { - // Extension fields are optional: if not enough bytes left, treat as absent - if (buffer.remaining() < fieldSize) { - // you can either omit it or explicitly put null; your choice + // Extension fields: absent if not enough bytes (or if we've already truncated) + if (truncated || buffer.remaining() < fieldSize) { result.put(fieldName, null); continue; } } + // Normal decode path (enough bytes available) if (!fieldDefinition.isArray()) { - Object value = fieldCodec.decode(buffer); - result.put(fieldName, value); + result.put(fieldName, fieldCodec.decode(buffer)); continue; } int len = fieldDefinition.getArrayLength(); - if (fieldDefinition.getWireType() == MavlinkWireType.CHAR) { - // MAVLink strings: fixed-size, null-terminated, null-padded - byte[] bytes; - String v = (String) fieldCodec.decode(buffer); // codec returns Byte - bytes = v.getBytes(StandardCharsets.UTF_8); - int end = bytes.length; - while (end > 0 && bytes[end - 1] == 0) { - end--; + // read fixed-size char[N] bytes; codec may or may not do this correctly + byte[] raw = new byte[len]; + buffer.get(raw); + int end = 0; + while (end < raw.length && raw[end] != 0) { + end++; } - String value = new String(bytes, 0, end, StandardCharsets.UTF_8); - result.put(fieldName, value); + result.put(fieldName, new String(raw, 0, end, StandardCharsets.UTF_8)); } else { List values = new ArrayList<>(len); for (int i = 0; i < len; i++) { @@ -112,4 +105,33 @@ public Map parsePayload(int messageId, byte[] payload) throws IO return result; } + + private Object zeroValue(MavlinkFieldDefinition fieldDefinition) { + if (!fieldDefinition.isArray()) { + // Scalars: 0 / 0.0 / false, etc. + return switch (fieldDefinition.getWireType()) { + case FLOAT, DOUBLE -> 0.0; + case CHAR -> ""; // should never happen for non-array in MAVLink, but safe + default -> 0L; // ints: you can use Long universally in your map + }; + } + + int len = fieldDefinition.getArrayLength(); + + if (fieldDefinition.getWireType() == MavlinkWireType.CHAR) { + return ""; + } + + // Numeric arrays: list of zeros + List zeros = new ArrayList<>(len); + Object z = switch (fieldDefinition.getWireType()) { + case FLOAT, DOUBLE -> 0.0; + default -> 0L; + }; + for (int i = 0; i < len; i++) { + zeros.add(z); + } + return zeros; + } + } diff --git a/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java b/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java index 9943007..dc5343c 100644 --- a/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java @@ -19,10 +19,14 @@ package io.mapsmessaging.mavlink; +import io.mapsmessaging.mavlink.message.MavlinkFrame; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import java.nio.ByteBuffer; +import java.util.List; +import java.util.Map; +import java.util.Optional; class HeartbeatTest { @@ -38,4 +42,264 @@ void validateV1Heartbeat() throws Exception { MavlinkFrameCodec frameCodec = new MavlinkFrameCodec(payloadCodec); Assertions.assertNotNull(frameCodec.tryUnpackFrame(input).get()); } + + + @Test + void validateTruncatedPackets() throws Exception { + MavlinkCodec payloadCodec = MavlinkTestSupport.codec(); + MavlinkFrameCodec frameCodec = new MavlinkFrameCodec(payloadCodec); + + List frames = List.of( + new int[]{0xfd, 0x13, 0x00, 0x00, 0x47, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x1b, 0x97, 0x7f, 0x3f, 0xf2, 0x0a, 0x4d, 0x40, 0xdf, 0xf2, 0xb7, 0x3b, 0xeb, 0x00, 0x48, 0x28, 0x1d}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x53, 0x01, 0x01, 0x53, 0x00, 0x00, 0x80, 0x4b, 0xda, 0x00, 0xba, 0x05, 0xee, 0xbe, 0x08, 0xd5, 0x28, 0x3b, 0xed, 0x48, 0x3c, 0x3a, 0x55, 0xa7, 0x62, 0x3f, 0xd0, 0x05, 0x68, 0x3b, 0x20, 0xe5, 0x0e, 0xbb, 0xf1, 0xa7, 0xd2, 0x3b, 0xb2, 0x7d, 0x3a, 0x3f, 0x77, 0xd1}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xee, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x88, 0x4e, 0x80, 0x3f, 0x1f, 0xca, 0x4d, 0x40, 0xa3, 0xf5, 0xe1, 0xba, 0x1c, 0x00, 0x48, 0x9a, 0xcc}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0xf0, 0x01, 0x01, 0x68, 0x01, 0x00, 0x40, 0xfa, 0xfc, 0x6f, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0xe8, 0x5f}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xf9, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x55, 0x62, 0x80, 0x3f, 0xbe, 0xfb, 0x4d, 0x40, 0x84, 0x7d, 0x7c, 0xbb, 0x1c, 0x00, 0x48, 0x02, 0x17}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x05, 0x01, 0x01, 0x53, 0x00, 0x00, 0x90, 0x48, 0xe1, 0x00, 0x8b, 0xf0, 0x77, 0x3f, 0xda, 0x13, 0x3c, 0x3a, 0x89, 0xfe, 0x94, 0xbb, 0xcb, 0xe3, 0x7e, 0x3e, 0xfe, 0xb5, 0xe4, 0x3a, 0x69, 0xe5, 0x06, 0xbb, 0x74, 0x60, 0xba, 0x3b, 0x54, 0x66, 0x3a, 0x3f, 0x95, 0xcb}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0x0a, 0x01, 0x01, 0x65, 0x32, 0x00, 0x34, 0xa4, 0x40, 0x1c, 0x24, 0xd0, 0x18, 0x05, 0x62, 0x87, 0x4d, 0x40, 0x00, 0x00, 0x40, 0x40, 0x10, 0x69, 0x40, 0x40, 0x00, 0xff, 0x7f, 0x47, 0xcc, 0x74, 0x64, 0x00, 0xfb, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0xd8, 0x17}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0x0b, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0xb5, 0xbb}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0x0d, 0x01, 0x01, 0x24, 0x00, 0x00, 0x20, 0x82, 0x03, 0x70, 0x02, 0x03, 0x00, 0x03, 0xff, 0x02, 0x03, 0x03, 0xaa, 0xe6}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x0f, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x11, 0x93, 0x80, 0x3f, 0xb2, 0x01, 0x4e, 0x40, 0xbf, 0xf0, 0xd4, 0xbb, 0x1c, 0x00, 0x48, 0x94, 0x61}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0x10, 0x01, 0x01, 0x08, 0x00, 0x00, 0xc0, 0x91, 0x03, 0x70, 0x03, 0x00, 0x00, 0x00, 0xd5, 0x09, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x10, 0x30, 0x0d, 0x00, 0xc1, 0x3f, 0x82, 0x1e}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x12, 0x01, 0x01, 0x68, 0x01, 0x00, 0x00, 0xab, 0x04, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x99, 0x0a}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x19, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x56, 0xa2, 0x80, 0x3f, 0x27, 0xca, 0x4d, 0x40, 0xe1, 0xf8, 0xc4, 0xbb, 0x1c, 0x00, 0x48, 0x41, 0x28}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x26, 0x01, 0x01, 0x53, 0x00, 0x00, 0x88, 0x4a, 0xe1, 0x00, 0x44, 0xd8, 0x77, 0x3f, 0xc9, 0xef, 0x75, 0x3a, 0x6e, 0xfe, 0xa8, 0xbb, 0x9e, 0x2c, 0x80, 0x3e, 0x63, 0xea, 0x00, 0x39, 0x59, 0x76, 0x64, 0xbb, 0x8f, 0xc6, 0xbf, 0x3b, 0xef, 0x85, 0x3a, 0x3f, 0x7b, 0x69}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x27, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x29, 0xaa, 0x80, 0x3f, 0x2f, 0xb4, 0x4d, 0x40, 0x1f, 0xfd, 0x3c, 0xbb, 0x1c, 0x00, 0x48, 0x6b, 0xab}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x29, 0x01, 0x01, 0x68, 0x01, 0x00, 0x80, 0x3c, 0x0c, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x1c, 0x97}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x31, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x44, 0x93, 0x80, 0x3f, 0x9e, 0xbd, 0x4d, 0x40, 0x1b, 0xb8, 0x3a, 0xbb, 0x1d, 0x00, 0x48, 0x49, 0xa5}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x3e, 0x01, 0x01, 0x53, 0x00, 0x00, 0x78, 0x4c, 0xe1, 0x00, 0xf2, 0xbf, 0x77, 0x3f, 0xda, 0xfa, 0x0f, 0x3a, 0xe0, 0xbe, 0xa6, 0xbb, 0x81, 0xe8, 0x80, 0x3e, 0xae, 0xc2, 0xa3, 0xb9, 0x9d, 0x45, 0x58, 0x3a, 0x2d, 0x8d, 0xc1, 0x3b, 0x86, 0x8a, 0x3a, 0x3f, 0x68, 0xd7}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0x47, 0x01, 0x01, 0x65, 0x32, 0x00, 0x60, 0xa4, 0x40, 0x1c, 0xb1, 0xcf, 0x18, 0x05, 0xb0, 0xf3, 0x5b, 0x40, 0x00, 0x00, 0x40, 0x40, 0x8e, 0x12, 0x40, 0x40, 0x00, 0xff, 0x7f, 0x47, 0x30, 0x75, 0x62, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0x27, 0x21}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0x48, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0x5e, 0x13}, + new int[]{0xfd, 0x0a, 0x00, 0x00, 0x49, 0x01, 0x01, 0x04, 0x00, 0x00, 0x00, 0xd4, 0x12, 0x70, 0x03, 0x00, 0x00, 0x00, 0xc0, 0x05, 0x87, 0x7a}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0x4b, 0x01, 0x01, 0x24, 0x00, 0x00, 0x60, 0xc4, 0x12, 0x70, 0x02, 0x03, 0x01, 0x03, 0xff, 0x02, 0x03, 0x03, 0xe7, 0xe5}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x4d, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x9e, 0x45, 0x80, 0x3f, 0x30, 0xab, 0x4d, 0x40, 0x5d, 0x04, 0x21, 0xbb, 0x1d, 0x00, 0x48, 0x54, 0xd0}, + new int[]{0xfd, 0x14, 0x00, 0x00, 0x4e, 0x01, 0x01, 0xf1, 0x00, 0x00, 0x00, 0xd4, 0x12, 0x70, 0x03, 0x00, 0x00, 0x00, 0xdb, 0x79, 0xeb, 0x2c, 0xc4, 0xe2, 0x85, 0x3a, 0x35, 0x5c, 0xf9, 0x3b, 0x1b, 0x3d}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0x4f, 0x01, 0x01, 0x08, 0x00, 0x00, 0x00, 0xd4, 0x12, 0x70, 0x03, 0x00, 0x00, 0x00, 0xe5, 0x08, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x4f, 0x30, 0x0d, 0x00, 0xc2, 0x3f, 0x9a, 0xa9}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x51, 0x01, 0x01, 0x68, 0x01, 0x00, 0x40, 0xed, 0x13, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x9e, 0x5f}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x58, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x0c, 0xec, 0x7f, 0x3f, 0xb0, 0x9e, 0x4d, 0x40, 0xfc, 0xe6, 0xc3, 0xba, 0x1d, 0x00, 0x48, 0x9a, 0x08}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x63, 0x01, 0x01, 0x53, 0x00, 0x00, 0x70, 0x4e, 0xe1, 0x00, 0x3e, 0xa8, 0x77, 0x3f, 0x9b, 0xff, 0xfb, 0x39, 0xc8, 0x52, 0x9f, 0xbb, 0xcb, 0x9e, 0x81, 0x3e, 0x38, 0x7a, 0x85, 0x3a, 0x9c, 0xa2, 0x13, 0x3a, 0xa9, 0x65, 0xb9, 0x3b, 0x7d, 0x6e, 0x3a, 0x3f, 0x95, 0x19}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x64, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xc7, 0x06, 0x80, 0x3f, 0x53, 0xa7, 0x4d, 0x40, 0xec, 0x23, 0x23, 0xba, 0x1d, 0x00, 0x48, 0x64, 0x97}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x66, 0x01, 0x01, 0x68, 0x01, 0x00, 0xc0, 0x7e, 0x1b, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x3f, 0xb2}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x6f, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x54, 0x06, 0x80, 0x3f, 0x89, 0xd4, 0x4d, 0x40, 0xfb, 0xd6, 0x87, 0xba, 0x1d, 0x00, 0x48, 0x63, 0xf9}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x7b, 0x01, 0x01, 0x53, 0x00, 0x00, 0x60, 0x50, 0xe1, 0x00, 0x0e, 0x90, 0x77, 0x3f, 0x3e, 0x8d, 0xbe, 0xb8, 0xaa, 0xa2, 0x8f, 0xbb, 0x4a, 0x58, 0x82, 0x3e, 0xc5, 0x9d, 0x1b, 0xbb, 0x4c, 0x8d, 0x60, 0x3b, 0xa4, 0xb0, 0xba, 0x3b, 0x73, 0x30, 0x3a, 0x3f, 0xfd, 0x1c}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0x80, 0x01, 0x01, 0x65, 0x32, 0x00, 0x92, 0xa4, 0x40, 0x1c, 0x3c, 0xcf, 0x18, 0x05, 0xd8, 0xa1, 0x4f, 0x40, 0x00, 0x00, 0x40, 0x40, 0xc5, 0x7c, 0x40, 0x40, 0x00, 0xff, 0x7f, 0x47, 0xf8, 0x75, 0x61, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0x27, 0xb5}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0x81, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0xc8, 0x94}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0x83, 0x01, 0x01, 0x24, 0x00, 0x00, 0xa0, 0x06, 0x22, 0x70, 0x02, 0x03, 0xff, 0x02, 0xfe, 0x02, 0x02, 0x03, 0x41, 0xd6}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x85, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x59, 0x58, 0x7f, 0x3f, 0x67, 0x15, 0x4e, 0x40, 0xb0, 0x18, 0x9c, 0xbb, 0x1d, 0x00, 0x48, 0x79, 0xdc}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0x86, 0x01, 0x01, 0x08, 0x00, 0x00, 0x40, 0x16, 0x22, 0x70, 0x03, 0x00, 0x00, 0x00, 0xfd, 0x09, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x86, 0x30, 0x0d, 0x00, 0xc4, 0x3f, 0x94, 0x39}, + new int[]{0xfd, 0x02, 0x00, 0x00, 0x87, 0x01, 0x01, 0x9b, 0x01, 0x00, 0xaf, 0x08, 0x3a, 0x88}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x89, 0x01, 0x01, 0x68, 0x01, 0x00, 0x80, 0x2f, 0x23, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0xcd, 0x6e}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x90, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x95, 0x14, 0x7f, 0x3f, 0xf5, 0x6b, 0x4e, 0x40, 0xbf, 0x0d, 0x17, 0xbc, 0x1d, 0x00, 0x48, 0x69, 0xe3}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x9c, 0x01, 0x01, 0x53, 0x00, 0x00, 0x58, 0x52, 0xe1, 0x00, 0x52, 0x78, 0x77, 0x3f, 0x84, 0x8e, 0x4b, 0xb9, 0x19, 0xd6, 0x02, 0xbb, 0xf8, 0x0f, 0x83, 0x3e, 0x25, 0x4f, 0x49, 0x3b, 0x76, 0x5f, 0x07, 0x3c, 0x66, 0x3b, 0xc0, 0x3b, 0x02, 0x3f, 0x3a, 0x3f, 0x2e, 0x24}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x9d, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x49, 0x05, 0x80, 0x3f, 0x98, 0x8a, 0x4e, 0x40, 0xaf, 0x50, 0x5e, 0xbc, 0x1d, 0x00, 0x48, 0x26, 0xcf}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0xa0, 0x01, 0x01, 0x68, 0x01, 0x00, 0x00, 0xc1, 0x2a, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x6a, 0x96}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xa8, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x13, 0x80, 0x80, 0x3f, 0x7c, 0x93, 0x4e, 0x40, 0xe4, 0x62, 0x79, 0xbc, 0x1d, 0x00, 0x48, 0x1c, 0x20}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0xb5, 0x01, 0x01, 0x53, 0x00, 0x00, 0x48, 0x54, 0xe1, 0x00, 0xfb, 0x5e, 0x77, 0x3f, 0x7e, 0x28, 0xd2, 0xb8, 0xaf, 0xc8, 0xea, 0xba, 0xf8, 0xce, 0x83, 0x3e, 0xba, 0xa8, 0xd8, 0xba, 0x45, 0x26, 0x6a, 0x3a, 0x41, 0x73, 0xc5, 0x3b, 0x28, 0x78, 0x3a, 0x3f, 0x0b, 0x9a}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0xbe, 0x01, 0x01, 0x65, 0x32, 0x00, 0xbf, 0xa4, 0x40, 0x1c, 0xcc, 0xce, 0x18, 0x05, 0x4e, 0xbc, 0x51, 0x40, 0x00, 0x00, 0x40, 0x40, 0x45, 0xde, 0x40, 0x40, 0x00, 0xff, 0x7f, 0x47, 0x30, 0x75, 0x63, 0x00, 0xfd, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0x5a, 0xf1}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0xbf, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0x4f, 0xde}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0xc1, 0x01, 0x01, 0x24, 0x00, 0x00, 0xe0, 0x48, 0x31, 0x70, 0x03, 0x03, 0x00, 0x03, 0xff, 0x02, 0x03, 0x03, 0xfa, 0x20}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xc3, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x39, 0x81, 0x80, 0x3f, 0xe7, 0x76, 0x4e, 0x40, 0x02, 0x77, 0x7b, 0xbc, 0x1d, 0x00, 0x48, 0x7a, 0x0e}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0xc4, 0x01, 0x01, 0x08, 0x00, 0x00, 0x80, 0x58, 0x31, 0x70, 0x03, 0x00, 0x00, 0x00, 0xf3, 0x08, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xc4, 0x30, 0x0d, 0x00, 0xc5, 0x3f, 0x12, 0xc2}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0xc6, 0x01, 0x01, 0x68, 0x01, 0x00, 0x20, 0x62, 0x32, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0xb7, 0x91}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xcd, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x84, 0x2b, 0x80, 0x3f, 0xa5, 0x20, 0x4e, 0x40, 0x99, 0x87, 0x4f, 0xbc, 0x1d, 0x00, 0x48, 0xc9, 0x0b}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0xd8, 0x01, 0x01, 0x53, 0x00, 0x00, 0x40, 0x56, 0xe1, 0x00, 0x42, 0x46, 0x77, 0x3f, 0xa6, 0xfb, 0x10, 0xb8, 0x7c, 0x44, 0x5e, 0xbb, 0xec, 0x85, 0x84, 0x3e, 0xf8, 0xe2, 0xa1, 0xba, 0xe2, 0xea, 0xc1, 0xbb, 0xe6, 0xa4, 0xae, 0x3b, 0xdf, 0x98, 0x3a, 0x3f, 0x5b, 0x48}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xd9, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xf5, 0x02, 0x80, 0x3f, 0x60, 0xf3, 0x4d, 0x40, 0xf8, 0x3b, 0x05, 0xbc, 0x1e, 0x00, 0x48, 0x0f, 0x55}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0xdb, 0x01, 0x01, 0x68, 0x01, 0x00, 0x40, 0x03, 0x3a, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x9e, 0x8e}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xe4, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x0c, 0x1d, 0x80, 0x3f, 0x96, 0xff, 0x4d, 0x40, 0xd8, 0x15, 0xb8, 0xbb, 0x1e, 0x00, 0x48, 0x4d, 0x0a}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0xf0, 0x01, 0x01, 0x53, 0x00, 0x00, 0x30, 0x58, 0xe1, 0x00, 0x07, 0x2d, 0x77, 0x3f, 0x01, 0xb0, 0x92, 0x39, 0xcb, 0xee, 0x76, 0xbb, 0xf9, 0x40, 0x85, 0x3e, 0xac, 0xad, 0xab, 0x39, 0x26, 0x5d, 0x52, 0x39, 0xa8, 0x49, 0xbb, 0x3b, 0x4c, 0x5b, 0x3a, 0x3f, 0x78, 0xb6}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0xf5, 0x01, 0x01, 0x65, 0x32, 0x00, 0xe8, 0xa4, 0x40, 0x1c, 0x5c, 0xce, 0x18, 0x05, 0xb0, 0xf3, 0x5b, 0x40, 0x00, 0x00, 0x40, 0x40, 0x0c, 0x7e, 0x40, 0x40, 0x00, 0xff, 0x7f, 0x47, 0x68, 0x74, 0x66, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0xed, 0xfc}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0xf6, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0x43, 0x3b}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0xf8, 0x01, 0x01, 0x24, 0x00, 0x00, 0x20, 0x8b, 0x40, 0x70, 0x03, 0x03, 0xff, 0x02, 0xff, 0x02, 0x02, 0x03, 0x10, 0x8d}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xfa, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x90, 0x36, 0x80, 0x3f, 0xae, 0x16, 0x4e, 0x40, 0x7b, 0x0b, 0xeb, 0xbb, 0x1e, 0x00, 0x48, 0x3f, 0xff}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0xfb, 0x01, 0x01, 0x08, 0x00, 0x00, 0xc0, 0x9a, 0x40, 0x70, 0x03, 0x00, 0x00, 0x00, 0xf3, 0x09, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xfb, 0x30, 0x0d, 0x00, 0xc6, 0x3f, 0x79, 0xb5}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0xfd, 0x01, 0x01, 0x68, 0x01, 0x00, 0x00, 0xb4, 0x41, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0xee, 0x6d}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x04, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xb3, 0x43, 0x80, 0x3f, 0xfe, 0xe7, 0x4d, 0x40, 0xb7, 0x22, 0xfc, 0xbb, 0x1e, 0x00, 0x48, 0x7e, 0x0e}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x10, 0x01, 0x01, 0x53, 0x00, 0x00, 0x28, 0x5a, 0xe1, 0x00, 0xe4, 0x13, 0x77, 0x3f, 0x1c, 0x70, 0x19, 0x3a, 0x1a, 0xd3, 0xb8, 0xbb, 0x77, 0xf6, 0x85, 0x3e, 0xaa, 0x69, 0xc0, 0xb9, 0xda, 0x28, 0xe1, 0xbb, 0xcf, 0xcb, 0xb8, 0x3b, 0x06, 0xcb, 0x3a, 0x3f, 0x61, 0x4b}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x11, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xe7, 0x16, 0x80, 0x3f, 0x15, 0x89, 0x4d, 0x40, 0xed, 0x35, 0x6e, 0xbb, 0x1e, 0x00, 0x48, 0x33, 0x01}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x14, 0x01, 0x01, 0x68, 0x01, 0x00, 0x80, 0x45, 0x49, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x1b, 0x98}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x1c, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x8f, 0x23, 0x80, 0x3f, 0xc3, 0x4d, 0x4d, 0x40, 0x47, 0x49, 0x12, 0x3b, 0x1e, 0x00, 0x48, 0xd6, 0xd6}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x29, 0x01, 0x01, 0x53, 0x00, 0x00, 0x18, 0x5c, 0xe1, 0x00, 0x8a, 0xfa, 0x76, 0x3f, 0x5a, 0x38, 0x38, 0x3a, 0x0f, 0xe1, 0xcf, 0xbb, 0xcb, 0xae, 0x86, 0x3e, 0x73, 0xc2, 0x94, 0xba, 0xf8, 0xfd, 0x74, 0xbb, 0x2c, 0x81, 0xb8, 0x3b, 0x6e, 0x75, 0x3a, 0x3f, 0x63, 0x8d}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0x32, 0x01, 0x01, 0x65, 0x32, 0x00, 0x13, 0xa5, 0x40, 0x1c, 0xe7, 0xcd, 0x18, 0x05, 0xff, 0x1f, 0x4b, 0x40, 0x00, 0x00, 0x40, 0x40, 0x79, 0xbd, 0x3f, 0x40, 0x00, 0xff, 0x7f, 0x47, 0x68, 0x74, 0x62, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0x07, 0x9a}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0x33, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0x6f, 0xca}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0x35, 0x01, 0x01, 0x24, 0x00, 0x00, 0x60, 0xcd, 0x4f, 0x70, 0x03, 0x03, 0x00, 0x03, 0xff, 0x02, 0x03, 0x03, 0xff, 0x06}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x37, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x6b, 0xf8, 0x7f, 0x3f, 0x1b, 0x56, 0x4d, 0x40, 0x42, 0x86, 0x92, 0x3b, 0x1e, 0x00, 0x48, 0xda, 0xd8}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0x38, 0x01, 0x01, 0x08, 0x00, 0x00, 0x00, 0xdd, 0x4f, 0x70, 0x03, 0x00, 0x00, 0x00, 0xe5, 0x08, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x38, 0x31, 0x0d, 0x00, 0xc7, 0x3f, 0x21, 0x71}, + new int[]{0xfd, 0x02, 0x00, 0x00, 0x39, 0x01, 0x01, 0x9b, 0x01, 0x00, 0xaf, 0x08, 0x95, 0x9f}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x3b, 0x01, 0x01, 0x68, 0x01, 0x00, 0x40, 0xf6, 0x50, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0xcb, 0x2c}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x42, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x5c, 0x8d, 0x7f, 0x3f, 0x77, 0x7d, 0x4d, 0x40, 0x52, 0x92, 0x86, 0x3b, 0x1e, 0x00, 0x48, 0x7a, 0x65}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x4d, 0x01, 0x01, 0x53, 0x00, 0x00, 0x10, 0x5e, 0xe1, 0x00, 0xd2, 0xe1, 0x76, 0x3f, 0x3a, 0x58, 0x57, 0x3a, 0xdb, 0xba, 0xca, 0xbb, 0x12, 0x64, 0x87, 0x3e, 0x80, 0x8e, 0x01, 0x3b, 0xc6, 0x7e, 0x87, 0x39, 0x2c, 0xb0, 0xbb, 0x3b, 0x9f, 0x37, 0x3a, 0x3f, 0xcd, 0x04}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x4e, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xbc, 0xe0, 0x7f, 0x3f, 0x97, 0xc4, 0x4d, 0x40, 0x58, 0x45, 0xa3, 0x39, 0x1e, 0x00, 0x48, 0xfa, 0xa4}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x50, 0x01, 0x01, 0x68, 0x01, 0x00, 0xc0, 0x87, 0x58, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0xda, 0x0f}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x59, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xba, 0x2b, 0x80, 0x3f, 0x53, 0xe5, 0x4d, 0x40, 0xa7, 0x63, 0x63, 0xbb, 0x1e, 0x00, 0x48, 0x05, 0x42}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x65, 0x01, 0x01, 0x53, 0x00, 0x00, 0x00, 0x60, 0xe1, 0x00, 0x4d, 0xc8, 0x76, 0x3f, 0xa9, 0x12, 0x54, 0x3a, 0xc9, 0xb1, 0xb6, 0xbb, 0x73, 0x1f, 0x88, 0x3e, 0xaa, 0x1c, 0x05, 0x3a, 0x4c, 0x13, 0x0c, 0x3b, 0x29, 0x7c, 0xd0, 0x3b, 0xfd, 0x7f, 0x3a, 0x3f, 0x10, 0xf2}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0x6a, 0x01, 0x01, 0x65, 0x32, 0x00, 0x40, 0xa5, 0x40, 0x1c, 0x70, 0xcd, 0x18, 0x05, 0xc4, 0xd6, 0x53, 0x40, 0x00, 0x00, 0x40, 0x40, 0xcf, 0x41, 0x40, 0x40, 0x00, 0xff, 0x7f, 0x47, 0x94, 0x75, 0x63, 0x00, 0xfb, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0x8f, 0x87}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0x6b, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0x56, 0x16}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0x6d, 0x01, 0x01, 0x24, 0x00, 0x00, 0xa0, 0x0f, 0x5f, 0x70, 0x03, 0x03, 0x00, 0x03, 0xff, 0x02, 0x03, 0x03, 0x62, 0x17}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x6f, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x03, 0x38, 0x80, 0x3f, 0x71, 0xda, 0x4d, 0x40, 0x63, 0xd8, 0xa6, 0xbb, 0x1e, 0x00, 0x48, 0x34, 0x6a}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0x70, 0x01, 0x01, 0x08, 0x00, 0x00, 0x40, 0x1f, 0x5f, 0x70, 0x03, 0x00, 0x00, 0x00, 0xd5, 0x09, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x70, 0x31, 0x0d, 0x00, 0xc8, 0x3f, 0xcd, 0xbf}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x72, 0x01, 0x01, 0x68, 0x01, 0x00, 0x80, 0x38, 0x60, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x52, 0xd0}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x79, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x75, 0x47, 0x80, 0x3f, 0x08, 0xaf, 0x4d, 0x40, 0x36, 0xcf, 0x8a, 0xbb, 0x1e, 0x00, 0x48, 0xca, 0x29}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x85, 0x01, 0x01, 0x53, 0x00, 0x00, 0xf8, 0x61, 0xe1, 0x00, 0x73, 0xaf, 0x76, 0x3f, 0x02, 0x7e, 0x93, 0x39, 0xad, 0xea, 0x95, 0xbb, 0xca, 0xd5, 0x88, 0x3e, 0xe3, 0x6e, 0x0c, 0xbb, 0x78, 0x76, 0x7e, 0x3b, 0x1f, 0xe7, 0xc7, 0x3b, 0xfa, 0x90, 0x3a, 0x3f, 0xe9, 0x0e}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x86, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x07, 0x03, 0x80, 0x3f, 0x53, 0x8c, 0x4d, 0x40, 0xc5, 0xf3, 0x42, 0xba, 0x1e, 0x00, 0x48, 0x1a, 0x1d}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x89, 0x01, 0x01, 0x68, 0x01, 0x00, 0x00, 0xca, 0x67, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0xde, 0xb2}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x91, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x53, 0x03, 0x80, 0x3f, 0x89, 0xd1, 0x4d, 0x40, 0x12, 0xaf, 0x19, 0x3a, 0x1f, 0x00, 0x48, 0x37, 0x7b}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x9e, 0x01, 0x01, 0x53, 0x00, 0x00, 0xe8, 0x63, 0xe1, 0x00, 0xdf, 0x95, 0x76, 0x3f, 0x31, 0x33, 0xe1, 0x38, 0xe9, 0xd7, 0x90, 0xbb, 0x16, 0x8e, 0x89, 0x3e, 0xae, 0x1f, 0xc3, 0xba, 0x38, 0x3b, 0x54, 0x3a, 0x9d, 0x10, 0xc3, 0x3b, 0xc1, 0x0e, 0x3a, 0x3f, 0xc5, 0x5e}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0xa7, 0x01, 0x01, 0x65, 0x32, 0x00, 0x6c, 0xa5, 0x40, 0x1c, 0x01, 0xcd, 0x18, 0x05, 0xec, 0xf4, 0x5e, 0x40, 0x00, 0x00, 0x40, 0x40, 0x59, 0x99, 0x40, 0x40, 0x00, 0xff, 0x7f, 0x47, 0xf8, 0x75, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0x59, 0x26}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0xa8, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0x27, 0xdc}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0xaa, 0x01, 0x01, 0x24, 0x00, 0x00, 0xe0, 0x51, 0x6e, 0x70, 0x01, 0x03, 0xff, 0x02, 0xfd, 0x02, 0x02, 0x03, 0x56, 0x40}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xac, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x8a, 0xc5, 0x7f, 0x3f, 0xfb, 0x31, 0x4e, 0x40, 0x21, 0x97, 0xa2, 0xbb, 0x1f, 0x00, 0x48, 0x1d, 0x4c}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0xad, 0x01, 0x01, 0x08, 0x00, 0x00, 0x80, 0x61, 0x6e, 0x70, 0x03, 0x00, 0x00, 0x00, 0xe5, 0x08, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xad, 0x31, 0x0d, 0x00, 0xc9, 0x3f, 0x85, 0x9a}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0xaf, 0x01, 0x01, 0x68, 0x01, 0x00, 0xc0, 0x7a, 0x6f, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0xe1, 0x62}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xb6, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x11, 0x03, 0x80, 0x3f, 0x36, 0x4f, 0x4e, 0x40, 0xfb, 0x73, 0x2d, 0xbc, 0x1f, 0x00, 0x48, 0x30, 0xb9}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0xc1, 0x01, 0x01, 0x53, 0x00, 0x00, 0xe0, 0x65, 0xe1, 0x00, 0x6e, 0x7c, 0x76, 0x3f, 0x10, 0x62, 0xf8, 0x39, 0x5f, 0xa8, 0x9a, 0xbb, 0x47, 0x43, 0x8a, 0x3e, 0xe0, 0x84, 0x8f, 0x3a, 0x2c, 0x43, 0x05, 0xbb, 0x94, 0x76, 0xbb, 0x3b, 0xed, 0x7d, 0x3a, 0x3f, 0x4b, 0xc6}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xc2, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xb1, 0x23, 0x80, 0x3f, 0x59, 0x38, 0x4e, 0x40, 0x98, 0xdb, 0x39, 0xbc, 0x1f, 0x00, 0x48, 0xee, 0x9d}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0xc4, 0x01, 0x01, 0x68, 0x01, 0x00, 0x40, 0x0c, 0x77, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x25, 0x15}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xcd, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x4a, 0x5d, 0x80, 0x3f, 0x2b, 0x27, 0x4e, 0x40, 0x19, 0x10, 0x22, 0xbc, 0x1f, 0x00, 0x48, 0x1a, 0xae}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0xd9, 0x01, 0x01, 0x53, 0x00, 0x00, 0xd0, 0x67, 0xe1, 0x00, 0x30, 0x62, 0x76, 0x3f, 0xd7, 0xa9, 0x15, 0x3a, 0x71, 0x66, 0xa1, 0xbb, 0x67, 0xfd, 0x8a, 0x3e, 0x95, 0x04, 0x03, 0x39, 0x49, 0x6f, 0xc4, 0xb9, 0x35, 0x62, 0xc0, 0x3b, 0xca, 0x8a, 0x3a, 0x3f, 0x35, 0x6d}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0xde, 0x01, 0x01, 0x65, 0x32, 0x00, 0x97, 0xa5, 0x40, 0x1c, 0x92, 0xcc, 0x18, 0x05, 0x4e, 0xd4, 0x4d, 0x40, 0x00, 0x00, 0x40, 0x40, 0x49, 0x6f, 0x40, 0x40, 0x00, 0xff, 0x7f, 0x47, 0x94, 0x75, 0x60, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0x6f, 0xf6}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0xdf, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0xac, 0x73}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0xe1, 0x01, 0x01, 0x24, 0x00, 0x00, 0x20, 0x94, 0x7d, 0x70, 0x03, 0x03, 0x00, 0x03, 0xff, 0x02, 0x03, 0x03, 0x03, 0xb1}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xe3, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x2c, 0x4e, 0x80, 0x3f, 0xeb, 0x07, 0x4e, 0x40, 0xe7, 0xe6, 0x0e, 0xbc, 0x1f, 0x00, 0x48, 0xc9, 0xa0}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0xe4, 0x01, 0x01, 0x08, 0x00, 0x00, 0xc0, 0xa3, 0x7d, 0x70, 0x03, 0x00, 0x00, 0x00, 0xc7, 0x09, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xe4, 0x31, 0x0d, 0x00, 0xca, 0x3f, 0x2a, 0xfc}, + new int[]{0xfd, 0x02, 0x00, 0x00, 0xe5, 0x01, 0x01, 0x9b, 0x01, 0x00, 0xaf, 0x08, 0x9a, 0x02}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0xe7, 0x01, 0x01, 0x68, 0x01, 0x00, 0x00, 0xbd, 0x7e, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0xe2, 0xf3}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xee, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x48, 0x6d, 0x7f, 0x3f, 0x29, 0xcb, 0x4d, 0x40, 0x7b, 0x45, 0xc4, 0xbb, 0x1f, 0x00, 0x48, 0xcd, 0x99}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0xf9, 0x01, 0x01, 0x53, 0x00, 0x00, 0xc8, 0x69, 0xe1, 0x00, 0x27, 0x49, 0x76, 0x3f, 0xe9, 0x8c, 0x8e, 0xb9, 0xed, 0xae, 0xaf, 0xbb, 0x6b, 0xad, 0x8b, 0x3e, 0x8f, 0x04, 0xa5, 0xbb, 0x3e, 0x38, 0xad, 0xb9, 0x77, 0x36, 0xbc, 0x3b, 0x1f, 0x97, 0x3a, 0x3f, 0xba, 0x71}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xfa, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x5f, 0x54, 0x7e, 0x3f, 0xf8, 0xa3, 0x4d, 0x40, 0xbb, 0x6a, 0x2b, 0xbb, 0x1f, 0x00, 0x48, 0xc0, 0x0b}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0xfe, 0x01, 0x01, 0x68, 0x01, 0x00, 0x80, 0x4e, 0x86, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x86, 0x6a}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x06, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x58, 0xf5, 0x7d, 0x3f, 0xe5, 0x9b, 0x4d, 0x40, 0xbf, 0xe0, 0x1e, 0xba, 0x1f, 0x00, 0x48, 0x39, 0xf1}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x13, 0x01, 0x01, 0x53, 0x00, 0x00, 0xb8, 0x6b, 0xe1, 0x00, 0xf3, 0x2f, 0x76, 0x3f, 0x9b, 0x61, 0xf5, 0xb8, 0x94, 0x3e, 0x9e, 0xbb, 0xff, 0x5f, 0x8c, 0x3e, 0x19, 0x42, 0x2d, 0x3b, 0x28, 0xcd, 0x0c, 0x3b, 0x70, 0xa7, 0xc1, 0x3b, 0xd1, 0x7a, 0x3a, 0x3f, 0x74, 0x58}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0x1c, 0x01, 0x01, 0x65, 0x32, 0x00, 0xc8, 0xa5, 0x40, 0x1c, 0x1f, 0xcc, 0x18, 0x05, 0x9d, 0x88, 0x50, 0x40, 0x00, 0x00, 0x40, 0x40, 0xab, 0xfb, 0x3f, 0x40, 0x00, 0xff, 0x7f, 0x47, 0x94, 0x75, 0x61, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0x31, 0x02}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0x1d, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0xbf, 0xce}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0x1f, 0x01, 0x01, 0x24, 0x00, 0x00, 0x60, 0xd6, 0x8c, 0x70, 0x02, 0x03, 0x00, 0x03, 0xff, 0x02, 0x03, 0x03, 0xe8, 0x1e}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x21, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x5f, 0x91, 0x7e, 0x3f, 0x4d, 0x94, 0x4d, 0x40, 0xa1, 0x73, 0xea, 0xb8, 0x1f, 0x00, 0x48, 0x15, 0x8a}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0x22, 0x01, 0x01, 0x08, 0x00, 0x00, 0x00, 0xe6, 0x8c, 0x70, 0x03, 0x00, 0x00, 0x00, 0x1b, 0x09, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x22, 0x32, 0x0d, 0x00, 0xcb, 0x3f, 0x9b, 0xeb}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x24, 0x01, 0x01, 0x68, 0x01, 0x00, 0x40, 0xff, 0x8d, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x47, 0x68}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x2b, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xb4, 0x0d, 0x7f, 0x3f, 0xb9, 0x6d, 0x4d, 0x40, 0x1e, 0xe4, 0x31, 0x3a, 0x1f, 0x00, 0x48, 0x7a, 0x9b}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x35, 0x01, 0x01, 0x53, 0x00, 0x00, 0xb0, 0x6d, 0xe1, 0x00, 0xe3, 0x15, 0x76, 0x3f, 0x60, 0xd4, 0xbd, 0x39, 0x84, 0x99, 0xc3, 0xbb, 0x59, 0x13, 0x8d, 0x3e, 0x16, 0x13, 0x08, 0xba, 0xa2, 0xc5, 0xb3, 0xbb, 0x56, 0x6a, 0xbd, 0x3b, 0x29, 0xbb, 0x3a, 0x3f, 0xf0, 0x7e}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x36, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xaf, 0x55, 0x7f, 0x3f, 0x97, 0x20, 0x4d, 0x40, 0xb8, 0x20, 0x88, 0x3b, 0x1f, 0x00, 0x48, 0x4b, 0x69}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x39, 0x01, 0x01, 0x68, 0x01, 0x00, 0xc0, 0x90, 0x95, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0xee, 0x06}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x42, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x87, 0xce, 0x7f, 0x3f, 0xcf, 0xe5, 0x4c, 0x40, 0x5d, 0xf0, 0x02, 0x3c, 0x20, 0x00, 0x48, 0xb5, 0xf3}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x4e, 0x01, 0x01, 0x53, 0x00, 0x00, 0xa0, 0x6f, 0xe1, 0x00, 0x10, 0xfb, 0x75, 0x3f, 0x2b, 0xb3, 0x1b, 0x3a, 0x8e, 0x1a, 0xd5, 0xbb, 0x68, 0xcc, 0x8d, 0x3e, 0xf3, 0x5a, 0xac, 0xba, 0x2b, 0xde, 0xd3, 0xba, 0x2d, 0x53, 0xc6, 0x3b, 0x55, 0x9c, 0x3a, 0x3f, 0x5d, 0x96}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0x53, 0x01, 0x01, 0x65, 0x32, 0x00, 0xf7, 0xa5, 0x40, 0x1c, 0xae, 0xcb, 0x18, 0x05, 0xec, 0x0c, 0x5b, 0x40, 0x00, 0x00, 0x40, 0x40, 0xf0, 0x2d, 0x3f, 0x40, 0x00, 0xff, 0x7f, 0x47, 0x5c, 0x76, 0x61, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0x2a, 0xe0}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0x54, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0xb3, 0x2b}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0x56, 0x01, 0x01, 0x24, 0x00, 0x00, 0xa0, 0x18, 0x9c, 0x70, 0x03, 0x03, 0x00, 0x03, 0xff, 0x02, 0x03, 0x03, 0x52, 0xa2}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x58, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xae, 0xc1, 0x7f, 0x3f, 0x92, 0xc6, 0x4c, 0x40, 0x1b, 0x62, 0x42, 0x3c, 0x20, 0x00, 0x48, 0xfe, 0x10}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0x59, 0x01, 0x01, 0x08, 0x00, 0x00, 0x40, 0x28, 0x9c, 0x70, 0x03, 0x00, 0x00, 0x00, 0xc7, 0x09, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x59, 0x32, 0x0d, 0x00, 0xcc, 0x3f, 0x27, 0x93}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x5b, 0x01, 0x01, 0x68, 0x01, 0x00, 0x80, 0x41, 0x9d, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0xa9, 0x32}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x62, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xe2, 0xd9, 0x7f, 0x3f, 0x4b, 0xec, 0x4c, 0x40, 0x8f, 0x78, 0x4b, 0x3c, 0x20, 0x00, 0x48, 0xb4, 0x7a}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x6d, 0x01, 0x01, 0x53, 0x00, 0x00, 0x98, 0x71, 0xe1, 0x00, 0x67, 0xe1, 0x75, 0x3f, 0xde, 0x96, 0x37, 0x39, 0xa0, 0x1b, 0x90, 0xbb, 0x71, 0x83, 0x8e, 0x3e, 0x8c, 0xe0, 0x0d, 0xba, 0xaf, 0xf0, 0x00, 0x3c, 0xc6, 0x6e, 0xd0, 0x3b, 0xf8, 0x5c, 0x3a, 0x3f, 0x9d, 0x67}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x6e, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x85, 0x1d, 0x80, 0x3f, 0x0e, 0x13, 0x4d, 0x40, 0xe7, 0xb3, 0x22, 0x3c, 0x20, 0x00, 0x48, 0x3d, 0x87}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x72, 0x01, 0x01, 0x68, 0x01, 0x00, 0x00, 0xd3, 0xa4, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x6c, 0xc5}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x7a, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x24, 0xe4, 0x7f, 0x3f, 0x33, 0x12, 0x4d, 0x40, 0xc4, 0x16, 0x07, 0x3c, 0x20, 0x00, 0x48, 0xd5, 0xdc}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x87, 0x01, 0x01, 0x53, 0x00, 0x00, 0x88, 0x73, 0xe1, 0x00, 0xaf, 0xc6, 0x75, 0x3f, 0x80, 0xc8, 0x47, 0xb8, 0x7d, 0xc0, 0x36, 0xbb, 0x0f, 0x3e, 0x8f, 0x3e, 0x41, 0xf3, 0x2a, 0x3b, 0xc4, 0x58, 0xc4, 0x3b, 0x50, 0xb5, 0xc4, 0x3b, 0xc8, 0x90, 0x3a, 0x3f, 0xa5, 0xdb}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0x90, 0x01, 0x01, 0x65, 0x32, 0x00, 0x2b, 0xa6, 0x40, 0x1c, 0x41, 0xcb, 0x18, 0x05, 0xb1, 0x53, 0x4c, 0x40, 0x00, 0x00, 0x40, 0x40, 0x32, 0x60, 0x3f, 0x40, 0x00, 0xff, 0x7f, 0x47, 0x88, 0x77, 0x69, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0xae, 0x09}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0x91, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0x9f, 0xda}, + new int[]{0xfd, 0x0a, 0x00, 0x00, 0x92, 0x01, 0x01, 0x04, 0x00, 0x00, 0x80, 0x6a, 0xab, 0x70, 0x03, 0x00, 0x00, 0x00, 0xc1, 0x05, 0xe3, 0xcd}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0x94, 0x01, 0x01, 0x24, 0x00, 0x00, 0xe0, 0x5a, 0xab, 0x70, 0x03, 0x03, 0x00, 0x03, 0xff, 0x02, 0x03, 0x03, 0x3c, 0x89}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x96, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xec, 0x42, 0x80, 0x3f, 0xd4, 0xf8, 0x4c, 0x40, 0x96, 0x32, 0x0f, 0x3c, 0x20, 0x00, 0x48, 0xb9, 0x46}, + new int[]{0xfd, 0x14, 0x00, 0x00, 0x97, 0x01, 0x01, 0xf1, 0x00, 0x00, 0x80, 0x6a, 0xab, 0x70, 0x03, 0x00, 0x00, 0x00, 0xd3, 0x3e, 0x10, 0x2d, 0x6e, 0x17, 0x81, 0x3a, 0x8b, 0x14, 0xea, 0x3b, 0x63, 0x64}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0x98, 0x01, 0x01, 0x08, 0x00, 0x00, 0x80, 0x6a, 0xab, 0x70, 0x03, 0x00, 0x00, 0x00, 0xe5, 0x08, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x98, 0x32, 0x0d, 0x00, 0xcd, 0x3f, 0x77, 0x45}, + new int[]{0xfd, 0x02, 0x00, 0x00, 0x99, 0x01, 0x01, 0x9b, 0x01, 0x00, 0xaf, 0x08, 0x7b, 0xac}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x9b, 0x01, 0x01, 0x68, 0x01, 0x00, 0xc0, 0x83, 0xac, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0xdb, 0x8d}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xa2, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x86, 0xf1, 0x80, 0x3f, 0x4d, 0xdf, 0x4c, 0x40, 0xac, 0x12, 0x26, 0x3c, 0x20, 0x00, 0x48, 0x49, 0x52}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0xac, 0x01, 0x01, 0x53, 0x00, 0x00, 0x80, 0x75, 0xe1, 0x00, 0x68, 0xab, 0x75, 0x3f, 0x45, 0x61, 0x6a, 0x39, 0xd8, 0x3c, 0x8a, 0xba, 0x4b, 0xfa, 0x8f, 0x3e, 0xd2, 0xb2, 0x2f, 0x3b, 0x64, 0x19, 0xaf, 0x3b, 0x45, 0xc4, 0xb6, 0x3b, 0x99, 0x50, 0x3a, 0x3f, 0x42, 0x3e}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xad, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xf2, 0x4e, 0x81, 0x3f, 0xf4, 0x07, 0x4d, 0x40, 0x08, 0x69, 0x36, 0x3c, 0x20, 0x00, 0x48, 0xb6, 0xce}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0xb0, 0x01, 0x01, 0x68, 0x01, 0x00, 0x40, 0x15, 0xb4, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x8e, 0xa4}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xb9, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x22, 0x49, 0x81, 0x3f, 0xe0, 0x49, 0x4d, 0x40, 0xbb, 0xcb, 0xff, 0x3b, 0x20, 0x00, 0x48, 0x64, 0x4d}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0xc5, 0x01, 0x01, 0x53, 0x00, 0x00, 0x70, 0x77, 0xe1, 0x00, 0x0c, 0x8f, 0x75, 0x3f, 0x16, 0x15, 0x1a, 0x3a, 0x1c, 0x63, 0x3a, 0xbb, 0xa4, 0xb9, 0x90, 0x3e, 0x2d, 0xa3, 0xd1, 0x38, 0x46, 0xbb, 0x18, 0xbc, 0xc6, 0x74, 0xb4, 0x3b, 0xc4, 0x5d, 0x3a, 0x3f, 0x97, 0x81}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0xca, 0x01, 0x01, 0x65, 0x32, 0x00, 0x62, 0xa6, 0x40, 0x1c, 0xd0, 0xca, 0x18, 0x05, 0x62, 0x3f, 0x59, 0x40, 0x00, 0x00, 0x40, 0x40, 0x96, 0xca, 0x3f, 0x40, 0x00, 0xff, 0x7f, 0x47, 0x30, 0x75, 0x64, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0x21, 0xbd}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0xcb, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0x62, 0xe8}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0xcd, 0x01, 0x01, 0x24, 0x00, 0x00, 0x20, 0x9d, 0xba, 0x70, 0x02, 0x03, 0x00, 0x03, 0xfe, 0x02, 0x03, 0x03, 0xe3, 0x98}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xcf, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xc8, 0x24, 0x81, 0x3f, 0x38, 0x63, 0x4d, 0x40, 0xa9, 0x2c, 0x8a, 0x3b, 0x20, 0x00, 0x48, 0x1f, 0xce}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0xd0, 0x01, 0x01, 0x08, 0x00, 0x00, 0xc0, 0xac, 0xba, 0x70, 0x03, 0x00, 0x00, 0x00, 0x0b, 0x0a, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0xd0, 0x32, 0x0d, 0x00, 0xcf, 0x3f, 0xfa, 0x86}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0xd2, 0x01, 0x01, 0x68, 0x01, 0x00, 0x00, 0xc6, 0xbb, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x0d, 0x83}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xd9, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x45, 0x01, 0x81, 0x3f, 0x08, 0x40, 0x4d, 0x40, 0x2b, 0xbd, 0x4d, 0x3b, 0x20, 0x00, 0x48, 0x87, 0x6e}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0xe4, 0x01, 0x01, 0x53, 0x00, 0x00, 0x68, 0x79, 0xe1, 0x00, 0xd5, 0x72, 0x75, 0x3f, 0x2e, 0xd3, 0x92, 0x3a, 0xa7, 0xd2, 0xc0, 0xbb, 0x3a, 0x72, 0x91, 0x3e, 0x43, 0x76, 0xee, 0xba, 0x06, 0xb0, 0x17, 0xbc, 0xcf, 0xb1, 0xad, 0x3b, 0x04, 0x9d, 0x3a, 0x3f, 0xf1, 0xd4}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xe5, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x02, 0xae, 0x80, 0x3f, 0xce, 0x18, 0x4d, 0x40, 0x42, 0xfb, 0xc2, 0x3b, 0x21, 0x00, 0x48, 0x3b, 0x7c}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0xe8, 0x01, 0x01, 0x68, 0x01, 0x00, 0x80, 0x57, 0xc3, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x5f, 0x0c}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xf1, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x38, 0x9a, 0x80, 0x3f, 0x40, 0x07, 0x4d, 0x40, 0xa0, 0x8d, 0xf1, 0x3b, 0x21, 0x00, 0x48, 0x34, 0xd2}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0xfe, 0x01, 0x01, 0x53, 0x00, 0x00, 0x58, 0x7b, 0xe1, 0x00, 0xb4, 0x56, 0x75, 0x3f, 0x19, 0xa5, 0x95, 0x3a, 0x62, 0x23, 0xcc, 0xbb, 0xa0, 0x2e, 0x92, 0x3e, 0x47, 0x9f, 0xc9, 0xba, 0xb4, 0xe8, 0x55, 0xba, 0x4a, 0x05, 0xc8, 0x3b, 0xb8, 0x8b, 0x3a, 0x3f, 0x66, 0x2d}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0x07, 0x01, 0x01, 0x65, 0x32, 0x00, 0x8e, 0xa6, 0x40, 0x1c, 0x5e, 0xca, 0x18, 0x05, 0x9d, 0x70, 0x54, 0x40, 0x00, 0x00, 0x40, 0x40, 0x78, 0x5f, 0x3f, 0x40, 0x00, 0xff, 0x7f, 0x47, 0x94, 0x75, 0x63, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0x2c, 0xce}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0x08, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0x13, 0x22}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0x0a, 0x01, 0x01, 0x24, 0x00, 0x00, 0x60, 0xdf, 0xc9, 0x70, 0x03, 0x03, 0x01, 0x03, 0xff, 0x02, 0x03, 0x03, 0xfe, 0x37}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x0c, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xeb, 0x75, 0x80, 0x3f, 0x1a, 0xf8, 0x4c, 0x40, 0x48, 0x60, 0x16, 0x3c, 0x21, 0x00, 0x48, 0x45, 0x1f}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0x0d, 0x01, 0x01, 0x08, 0x00, 0x00, 0x00, 0xef, 0xc9, 0x70, 0x03, 0x00, 0x00, 0x00, 0xe5, 0x08, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0d, 0x33, 0x0d, 0x00, 0xd0, 0x3f, 0x1f, 0xa6}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x0f, 0x01, 0x01, 0x68, 0x01, 0x00, 0x40, 0x08, 0xcb, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x7b, 0x91}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x16, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xd9, 0x17, 0x80, 0x3f, 0x5f, 0x31, 0x4d, 0x40, 0x65, 0x76, 0x1b, 0x3c, 0x21, 0x00, 0x48, 0xee, 0x43}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x20, 0x01, 0x01, 0x53, 0x00, 0x00, 0x50, 0x7d, 0xe1, 0x00, 0x9c, 0x3b, 0x75, 0x3f, 0x6e, 0x9e, 0x60, 0x3a, 0xcb, 0x98, 0xcb, 0xbb, 0x34, 0xe4, 0x92, 0x3e, 0x88, 0x2e, 0x6a, 0x37, 0xb5, 0x62, 0x88, 0xb9, 0x45, 0x07, 0xc4, 0x3b, 0x7f, 0x55, 0x3a, 0x3f, 0x49, 0x65}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x21, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xe0, 0xfd, 0x7f, 0x3f, 0x78, 0x54, 0x4d, 0x40, 0x37, 0x8c, 0xbc, 0x3b, 0x21, 0x00, 0x48, 0x2d, 0xb8}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x24, 0x01, 0x01, 0x68, 0x01, 0x00, 0xc0, 0x99, 0xd2, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x2a, 0xb9}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x2d, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x6a, 0xf9, 0x7f, 0x3f, 0xaa, 0x41, 0x4d, 0x40, 0xcc, 0xa8, 0x84, 0x3b, 0x21, 0x00, 0x48, 0x29, 0x1d}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x39, 0x01, 0x01, 0x53, 0x00, 0x00, 0x40, 0x7f, 0xe1, 0x00, 0xfa, 0x1f, 0x75, 0x3f, 0x2f, 0x13, 0x1c, 0x3a, 0x32, 0xb7, 0xa9, 0xbb, 0x03, 0x9f, 0x93, 0x3e, 0xea, 0x95, 0x92, 0xb8, 0xb9, 0x62, 0x46, 0x3b, 0x03, 0x9d, 0xc7, 0x3b, 0x80, 0xa8, 0x3a, 0x3f, 0xf8, 0x09}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0x3e, 0x01, 0x01, 0x65, 0x32, 0x00, 0xc2, 0xa6, 0x40, 0x1c, 0xef, 0xc9, 0x18, 0x05, 0x3a, 0xd9, 0x59, 0x40, 0x00, 0x00, 0x40, 0x40, 0xa8, 0x6e, 0x3f, 0x40, 0x00, 0xff, 0x7f, 0x47, 0x5c, 0x76, 0x62, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0xbc, 0x9c}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0x3f, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0xd5, 0xbc}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0x41, 0x01, 0x01, 0x24, 0x00, 0x00, 0xa0, 0x21, 0xd9, 0x70, 0x03, 0x03, 0x01, 0x03, 0xff, 0x02, 0x04, 0x03, 0x57, 0x5a}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x43, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xca, 0x0e, 0x80, 0x3f, 0x4a, 0x07, 0x4d, 0x40, 0x82, 0xdd, 0xce, 0x3b, 0x21, 0x00, 0x48, 0x2c, 0xd4}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0x44, 0x01, 0x01, 0x08, 0x00, 0x00, 0x40, 0x31, 0xd9, 0x70, 0x03, 0x00, 0x00, 0x00, 0xc7, 0x09, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x44, 0x33, 0x0d, 0x00, 0xd1, 0x3f, 0x2d, 0x3e}, + new int[]{0xfd, 0x02, 0x00, 0x00, 0x45, 0x01, 0x01, 0x9b, 0x01, 0x00, 0xaf, 0x08, 0x74, 0x31}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x47, 0x01, 0x01, 0x68, 0x01, 0x00, 0x80, 0x4a, 0xda, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0xd1, 0xfe}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x4e, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x25, 0xf8, 0x7f, 0x3f, 0x10, 0xfe, 0x4c, 0x40, 0xab, 0xa8, 0x18, 0x3c, 0x21, 0x00, 0x48, 0x89, 0x7a}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x59, 0x01, 0x01, 0x53, 0x00, 0x00, 0x38, 0x81, 0xe1, 0x00, 0xd0, 0x04, 0x75, 0x3f, 0xfd, 0x54, 0xbc, 0x39, 0x19, 0x50, 0x82, 0xbb, 0x82, 0x55, 0x94, 0x3e, 0x8a, 0x21, 0xba, 0x3a, 0xbe, 0x0b, 0xb3, 0x3b, 0xed, 0x1a, 0xca, 0x3b, 0x72, 0x4c, 0x3a, 0x3f, 0x8f, 0x7d}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x5a, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xf8, 0x11, 0x80, 0x3f, 0x82, 0x29, 0x4d, 0x40, 0x12, 0x32, 0x12, 0x3c, 0x21, 0x00, 0x48, 0xb9, 0xbc}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x5c, 0x01, 0x01, 0x68, 0x01, 0x00, 0x00, 0xdc, 0xe1, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x7b, 0xa1}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x66, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x07, 0x50, 0x80, 0x3f, 0x84, 0x66, 0x4d, 0x40, 0x81, 0xf6, 0xb4, 0x3b, 0x21, 0x00, 0x48, 0xaf, 0x3e}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x73, 0x01, 0x01, 0x53, 0x00, 0x00, 0x28, 0x83, 0xe1, 0x00, 0x59, 0xe8, 0x74, 0x3f, 0xc6, 0x60, 0xce, 0x39, 0x3a, 0xd8, 0x45, 0xbb, 0x97, 0x12, 0x95, 0x3e, 0xea, 0x5c, 0xf6, 0x3a, 0x4c, 0x94, 0x0c, 0x3b, 0x79, 0x62, 0xbb, 0x3b, 0xea, 0x50, 0x3a, 0x3f, 0x65, 0xc1}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0x7c, 0x01, 0x01, 0x65, 0x32, 0x00, 0xf2, 0xa6, 0x40, 0x1c, 0x81, 0xc9, 0x18, 0x05, 0xff, 0xa7, 0x5e, 0x40, 0x00, 0x00, 0x40, 0x40, 0xd8, 0xfe, 0x3f, 0x40, 0x00, 0xff, 0x7f, 0x47, 0xc0, 0x76, 0x65, 0x00, 0xfd, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0x99, 0x32}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0x7d, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0x5c, 0x63}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0x7f, 0x01, 0x01, 0x24, 0x00, 0x00, 0xe0, 0x63, 0xe8, 0x70, 0x02, 0x03, 0x00, 0x03, 0xff, 0x02, 0x03, 0x03, 0x3c, 0xb9}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x81, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x52, 0x87, 0x80, 0x3f, 0x7a, 0x97, 0x4d, 0x40, 0x04, 0x4e, 0xb0, 0x3a, 0x21, 0x00, 0x48, 0xf6, 0x93}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0x82, 0x01, 0x01, 0x08, 0x00, 0x00, 0x80, 0x73, 0xe8, 0x70, 0x03, 0x00, 0x00, 0x00, 0xf3, 0x08, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x82, 0x33, 0x0d, 0x00, 0xd2, 0x3f, 0x09, 0xcc}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x84, 0x01, 0x01, 0x68, 0x01, 0x00, 0xc0, 0x8c, 0xe9, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x6c, 0x78}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x8b, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x0f, 0x8c, 0x80, 0x3f, 0x1c, 0xba, 0x4d, 0x40, 0x87, 0x86, 0x9b, 0xba, 0x21, 0x00, 0x48, 0xbd, 0xc1}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x95, 0x01, 0x01, 0x53, 0x00, 0x00, 0x20, 0x85, 0xe1, 0x00, 0x51, 0xcc, 0x74, 0x3f, 0x63, 0x16, 0xbc, 0x39, 0xc4, 0x3e, 0x71, 0xbb, 0x54, 0xc9, 0x95, 0x3e, 0x01, 0xe4, 0x04, 0xbb, 0x8f, 0xa4, 0xfe, 0xba, 0xef, 0xa9, 0xb8, 0x3b, 0x8f, 0x5a, 0x3a, 0x3f, 0xb0, 0xa5}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x96, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x12, 0x56, 0x80, 0x3f, 0xfb, 0xd7, 0x4d, 0x40, 0xfd, 0x85, 0x5a, 0xbb, 0x22, 0x00, 0x48, 0xf3, 0xbd}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x98, 0x01, 0x01, 0x68, 0x01, 0x00, 0x40, 0x1e, 0xf1, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x02, 0x2b}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xa2, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xe9, 0x1b, 0x80, 0x3f, 0xac, 0xf0, 0x4d, 0x40, 0x75, 0x27, 0xa7, 0xbb, 0x22, 0x00, 0x48, 0xa6, 0x3d}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0xae, 0x01, 0x01, 0x53, 0x00, 0x00, 0x10, 0x87, 0xe1, 0x00, 0xa7, 0xaf, 0x74, 0x3f, 0xe8, 0x34, 0x9e, 0x39, 0x10, 0xd9, 0xa6, 0xbb, 0x78, 0x81, 0x96, 0x3e, 0x08, 0xb1, 0x32, 0xbb, 0x9a, 0x64, 0x8b, 0xbb, 0x17, 0xd1, 0xc3, 0x3b, 0x3e, 0x4f, 0x3a, 0x3f, 0x26, 0x55}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0xb3, 0x01, 0x01, 0x65, 0x32, 0x00, 0x27, 0xa7, 0x40, 0x1c, 0x0f, 0xc9, 0x18, 0x05, 0x3a, 0xd9, 0x59, 0x40, 0x00, 0x00, 0x40, 0x40, 0xba, 0x7b, 0x40, 0x40, 0x00, 0xff, 0x7f, 0x47, 0xc0, 0x76, 0x61, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0x25, 0x1b}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0xb4, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0xca, 0xe4}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0xb6, 0x01, 0x01, 0x24, 0x00, 0x00, 0x20, 0xa6, 0xf7, 0x70, 0x02, 0x03, 0x00, 0x03, 0xfe, 0x02, 0x02, 0x03, 0xd6, 0x70}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xb8, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x8a, 0x87, 0x7f, 0x3f, 0x5c, 0x14, 0x4e, 0x40, 0xf5, 0x2a, 0xd7, 0xbb, 0x22, 0x00, 0x48, 0xb4, 0xba}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0xb9, 0x01, 0x01, 0x08, 0x00, 0x00, 0xc0, 0xb5, 0xf7, 0x70, 0x03, 0x00, 0x00, 0x00, 0xc7, 0x09, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xb9, 0x33, 0x0d, 0x00, 0xd3, 0x3f, 0xab, 0x81}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0xbb, 0x01, 0x01, 0x68, 0x01, 0x00, 0x00, 0xcf, 0xf8, 0x70, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x88, 0x9d}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xc2, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xe7, 0x5c, 0x7f, 0x3f, 0xab, 0x13, 0x4e, 0x40, 0x2f, 0x22, 0x0b, 0xbc, 0x22, 0x00, 0x48, 0x27, 0x6b}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0xcd, 0x01, 0x01, 0x53, 0x00, 0x00, 0x08, 0x89, 0xe1, 0x00, 0xc5, 0x93, 0x74, 0x3f, 0xf0, 0x4a, 0x02, 0x3a, 0x5f, 0x80, 0xad, 0xbb, 0xd0, 0x35, 0x97, 0x3e, 0xb4, 0x39, 0x14, 0x3a, 0xe5, 0x2d, 0x0e, 0xbb, 0x8f, 0x8f, 0xc0, 0x3b, 0x06, 0xbc, 0x3a, 0x3f, 0x0a, 0x9b}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xce, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x67, 0x95, 0x7f, 0x3f, 0x66, 0xca, 0x4d, 0x40, 0xdb, 0x32, 0xf1, 0xbb, 0x22, 0x00, 0x48, 0xa3, 0x7c}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0xd0, 0x01, 0x01, 0x68, 0x01, 0x00, 0x80, 0x60, 0x00, 0x71, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x0c, 0xe6}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xda, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xf2, 0x60, 0x7f, 0x3f, 0x26, 0x78, 0x4d, 0x40, 0x5d, 0xbc, 0x31, 0xbb, 0x22, 0x00, 0x48, 0x10, 0xc0}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0xe7, 0x01, 0x01, 0x53, 0x00, 0x00, 0xf8, 0x8a, 0xe1, 0x00, 0x8f, 0x77, 0x74, 0x3f, 0xe3, 0xc0, 0xb5, 0x39, 0x49, 0x32, 0x96, 0xbb, 0x71, 0xed, 0x97, 0x3e, 0x44, 0xb9, 0xe1, 0x3a, 0xbd, 0x92, 0x67, 0x3b, 0x8e, 0x53, 0xc1, 0x3b, 0xf4, 0x8f, 0x3a, 0x3f, 0xea, 0x6b}, + new int[]{0xfd, 0x3a, 0x00, 0x00, 0xf0, 0x01, 0x01, 0x65, 0x32, 0x00, 0x5a, 0xa7, 0x40, 0x1c, 0xa2, 0xc8, 0x18, 0x05, 0x13, 0xa3, 0x52, 0x40, 0x00, 0x00, 0x40, 0x40, 0x87, 0xbf, 0x3f, 0x40, 0x00, 0xff, 0x7f, 0x47, 0x24, 0x77, 0x63, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x05, 0x00, 0x03, 0xfb, 0x34}, + new int[]{0xfd, 0x19, 0x00, 0x00, 0xf1, 0x01, 0x01, 0x68, 0x32, 0x00, 0x3f, 0x5b, 0x40, 0x1c, 0x88, 0x0a, 0x18, 0x05, 0x00, 0x00, 0x7a, 0xc4, 0x00, 0x00, 0x7a, 0xc4, 0x27, 0x8a, 0x59, 0x3e, 0x80, 0x52, 0xd5, 0xa3, 0x01, 0x7c, 0x77}, + new int[]{0xfd, 0x0c, 0x00, 0x00, 0xf3, 0x01, 0x01, 0x24, 0x00, 0x00, 0x60, 0xe8, 0x06, 0x71, 0x03, 0x03, 0x00, 0x03, 0xff, 0x02, 0x04, 0x03, 0xbb, 0x5a}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0xf5, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x60, 0xae, 0x7f, 0x3f, 0x29, 0x58, 0x4d, 0x40, 0x2c, 0xb6, 0x35, 0x3b, 0x22, 0x00, 0x48, 0x8f, 0x47}, + new int[]{0xfd, 0x16, 0x00, 0x00, 0xf6, 0x01, 0x01, 0x08, 0x00, 0x00, 0x00, 0xf8, 0x06, 0x71, 0x03, 0x00, 0x00, 0x00, 0x04, 0x09, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xf6, 0x33, 0x0d, 0x00, 0xd4, 0x3f, 0xe1, 0x5a}, + new int[]{0xfd, 0x02, 0x00, 0x00, 0xf7, 0x01, 0x01, 0x9b, 0x01, 0x00, 0xaf, 0x08, 0xf4, 0x66}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0xf9, 0x01, 0x01, 0x68, 0x01, 0x00, 0x40, 0x11, 0x08, 0x71, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x85, 0x9f}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x00, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xf5, 0xb3, 0x7f, 0x3f, 0xf1, 0x7a, 0x4d, 0x40, 0x3e, 0xe8, 0x64, 0x3b, 0x22, 0x00, 0x48, 0xab, 0xcf}, + new int[]{0xfd, 0x24, 0x00, 0x00, 0x0a, 0x01, 0x01, 0x53, 0x00, 0x00, 0xf0, 0x8c, 0xe1, 0x00, 0xa3, 0x5b, 0x74, 0x3f, 0xb8, 0x1e, 0x5d, 0xb9, 0x69, 0x68, 0x75, 0xbb, 0x45, 0xa2, 0x98, 0x3e, 0xc8, 0x7e, 0x23, 0xbb, 0x15, 0x1a, 0x7f, 0x3b, 0x6b, 0x32, 0xcd, 0x3b, 0x9d, 0x50, 0x3a, 0x3f, 0x4e, 0xa6}, + new int[]{0xfd, 0x13, 0x00, 0x00, 0x0b, 0x01, 0x01, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x9d, 0x46, 0x7f, 0x3f, 0x0d, 0x99, 0x4d, 0x40, 0x14, 0xb4, 0xda, 0x3a, 0x22, 0x00, 0x48, 0x95, 0x44}, + new int[]{0xfd, 0x18, 0x00, 0x00, 0x0d, 0x01, 0x01, 0x68, 0x01, 0x00, 0xc0, 0xa2, 0x0f, 0x71, 0x03, 0x00, 0x00, 0x00, 0x66, 0xf9, 0x2a, 0x43, 0xd6, 0xd8, 0x40, 0x1c, 0xe3, 0xfa, 0x18, 0x05, 0xff, 0x94, 0x4d, 0x40, 0x53, 0x94} + ); + + for (int i = 0; i < frames.size(); i++) { + ByteBuffer input = ByteBuffer.wrap(toByteArray(frames.get(i))); + Optional frame = frameCodec.tryUnpackFrame(input); + + Assertions.assertTrue(frame.isPresent(), "Frame #" + i + " did not unpack. Remaining=" + input.remaining()); + MavlinkFrame payloadFrame = frame.get(); + Map obj = payloadCodec.parsePayload(payloadFrame.getMessageId(), payloadFrame.getPayload()); + Assertions.assertTrue(!obj.isEmpty()); + } + } + + private static byte[] toByteArray(int[] values) { + byte[] buffer = new byte[values.length]; + for (int i = 0; i < values.length; i++) { + buffer[i] = (byte) values[i]; + } + return buffer; + } + + } diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java index 0407489..86afe64 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java @@ -47,28 +47,6 @@ void decode_unknownMessageId_throwsIOException() throws Exception { assertThrows(IOException.class, () -> codec.parsePayload(999999, new byte[] { 0x01, 0x02 })); } - @Test - void decode_truncatedPayload_throwsIOException() throws Exception { - MavlinkCodec codec = MavlinkTestSupport.codec(); - - // SYS_STATUS is a good stable target - byte[] payload = codec.encodePayload(1, Map.of( - "onboard_control_sensors_present", 1, - "onboard_control_sensors_enabled", 1, - "onboard_control_sensors_health", 1, - "load", 250, - "voltage_battery", 12000, - "current_battery", 100, - "battery_remaining", 90 - )); - - assertTrue(payload.length > 1); - - byte[] truncated = java.util.Arrays.copyOf(payload, payload.length - 1); - - assertThrows(IOException.class, () -> codec.parsePayload(1, truncated)); - } - @Test void decode_oversizedPayload_isHandledDeterministically() throws Exception { MavlinkCodec codec = MavlinkTestSupport.codec(); From cba220816262e3511c304fa186ac6842a1751c64 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Fri, 16 Jan 2026 13:47:32 +1100 Subject: [PATCH 15/34] fix(framing): Add V2 signature validation and signing Add the ability to validate V2 frames and to sign V2 frames --- pom.xml | 8 + .../mapsmessaging/mavlink/MavlinkCodec.java | 20 +-- .../mavlink/MavlinkFrameCodec.java | 65 +++++---- .../mavlink/MavlinkFrameEnvelope.java | 4 +- .../mavlink/MavlinkMessageFormatLoader.java | 42 +++--- ...inkFrameEncoder.java => FrameEncoder.java} | 8 +- ...inkFrameFactory.java => FrameFactory.java} | 14 +- .../{MavlinkJsonCodec.java => JsonCodec.java} | 28 ++-- ...xtractor.java => JsonValuesExtractor.java} | 10 +- ...inkMapConverter.java => MapConverter.java} | 10 +- ...kPayloadPacker.java => PayloadPacker.java} | 66 ++++----- ...kPayloadParser.java => PayloadParser.java} | 28 ++-- ...lectRegistry.java => DialectRegistry.java} | 8 +- ...inkFrameDecoder.java => FrameDecoder.java} | 6 +- ...vlinkFrameFramer.java => FrameFramer.java} | 20 +-- ...inkFrameHandler.java => FrameHandler.java} | 6 +- ...vlinkFramePacker.java => FramePacker.java} | 58 +++++--- .../mavlink/framing/SigningKeyProvider.java | 25 ++++ ...1FrameHandler.java => V1FrameHandler.java} | 20 +-- ...2FrameHandler.java => V2FrameHandler.java} | 82 ++++++++--- .../mavlink/framing/V2FrameSigning.java | 111 ++++++++++++++ .../mavlink/framing/V2SignatureGenerator.java | 92 ++++++++++++ ...kCompiledField.java => CompiledField.java} | 6 +- ...piledMessage.java => CompiledMessage.java} | 8 +- ...inkEnumResolver.java => EnumResolver.java} | 24 +-- .../mapsmessaging/mavlink/message/Frame.java | 137 ++++++++++++++++++ ...vlinkFrameParser.java => FrameParser.java} | 16 +- .../mavlink/message/MavlinkFrame.java | 39 ----- ...Definition.java => MessageDefinition.java} | 34 ++--- ...sageRegistry.java => MessageRegistry.java} | 50 +++---- .../{MavlinkVersion.java => Version.java} | 2 +- .../fields/AbstractMavlinkFieldCodec.java | 6 +- .../message/fields/ArrayFieldCodec.java | 4 +- .../message/fields/CharFieldCodec.java | 2 +- .../message/fields/DoubleFieldCodec.java | 2 +- ...numDefinition.java => EnumDefinition.java} | 24 +-- .../{MavlinkEnumEntry.java => EnumEntry.java} | 2 +- ...decFactory.java => FieldCodecFactory.java} | 8 +- ...ldDefinition.java => FieldDefinition.java} | 4 +- .../message/fields/FloatFieldCodec.java | 2 +- .../message/fields/Int16FieldCodec.java | 2 +- .../message/fields/Int32FieldCodec.java | 2 +- .../message/fields/Int64FieldCodec.java | 2 +- .../message/fields/Int8FieldCodec.java | 2 +- .../message/fields/UInt16FieldCodec.java | 2 +- .../message/fields/UInt32FieldCodec.java | 2 +- .../message/fields/UInt64FieldCodec.java | 2 +- .../message/fields/UInt8FieldCodec.java | 2 +- .../{MavlinkWireType.java => WireType.java} | 6 +- ...ver.java => ClasspathIncludeResolver.java} | 5 +- ...Definition.java => DialectDefinition.java} | 12 +- ...kDialectLoader.java => DialectLoader.java} | 34 ++--- ...alculator.java => ExtraCrcCalculator.java} | 14 +- ...ludeResolver.java => IncludeResolver.java} | 2 +- .../{MavlinkXmlParser.java => XmlParser.java} | 76 +++++----- ...emaBuilder.java => JsonSchemaBuilder.java} | 42 +++--- .../signing/MapSigningKeyProvider.java | 63 ++++++++ .../mavlink/signing/NoSigningKeyProvider.java | 34 +++++ .../signing/StaticSigningKeyProvider.java | 50 +++++++ .../mavlink/BaseRoudTripTest.java | 54 +++---- .../mapsmessaging/mavlink/HeartbeatTest.java | 6 +- .../MavlinkFrameRoundTripAllMessagesTest.java | 80 +++++++--- ...avlinkPayloadJsonSchemaValidationTest.java | 13 +- .../MavlinkRoundTripAllMessagesTest.java | 38 ++--- .../mavlink/MavlinkTestSupport.java | 38 ++--- .../mavlink/TestMavlinkCharArrays.java | 36 ++--- .../mavlink/TestMavlinkExtensions.java | 46 +++--- .../mavlink/TestMavlinkNumericArrays.java | 35 +++-- .../TestMavlinkRegistryInvariants.java | 40 ++--- .../mavlink/TestMavlinkRobustness.java | 4 +- .../mavlink/TestMavlinkXmlParserIncludes.java | 8 +- 71 files changed, 1224 insertions(+), 629 deletions(-) rename src/main/java/io/mapsmessaging/mavlink/codec/{MavlinkFrameEncoder.java => FrameEncoder.java} (92%) rename src/main/java/io/mapsmessaging/mavlink/codec/{MavlinkFrameFactory.java => FrameFactory.java} (71%) rename src/main/java/io/mapsmessaging/mavlink/codec/{MavlinkJsonCodec.java => JsonCodec.java} (73%) rename src/main/java/io/mapsmessaging/mavlink/codec/{MavlinkJsonValuesExtractor.java => JsonValuesExtractor.java} (89%) rename src/main/java/io/mapsmessaging/mavlink/codec/{MavlinkMapConverter.java => MapConverter.java} (78%) rename src/main/java/io/mapsmessaging/mavlink/codec/{MavlinkPayloadPacker.java => PayloadPacker.java} (69%) rename src/main/java/io/mapsmessaging/mavlink/codec/{MavlinkPayloadParser.java => PayloadParser.java} (80%) rename src/main/java/io/mapsmessaging/mavlink/framing/{MavlinkDialectRegistry.java => DialectRegistry.java} (78%) rename src/main/java/io/mapsmessaging/mavlink/framing/{MavlinkFrameDecoder.java => FrameDecoder.java} (84%) rename src/main/java/io/mapsmessaging/mavlink/framing/{MavlinkFrameFramer.java => FrameFramer.java} (83%) rename src/main/java/io/mapsmessaging/mavlink/framing/{MavlinkFrameHandler.java => FrameHandler.java} (86%) rename src/main/java/io/mapsmessaging/mavlink/framing/{MavlinkFramePacker.java => FramePacker.java} (77%) create mode 100644 src/main/java/io/mapsmessaging/mavlink/framing/SigningKeyProvider.java rename src/main/java/io/mapsmessaging/mavlink/framing/{MavlinkV1FrameHandler.java => V1FrameHandler.java} (85%) rename src/main/java/io/mapsmessaging/mavlink/framing/{MavlinkV2FrameHandler.java => V2FrameHandler.java} (60%) create mode 100644 src/main/java/io/mapsmessaging/mavlink/framing/V2FrameSigning.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/framing/V2SignatureGenerator.java rename src/main/java/io/mapsmessaging/mavlink/message/{MavlinkCompiledField.java => CompiledField.java} (88%) rename src/main/java/io/mapsmessaging/mavlink/message/{MavlinkCompiledMessage.java => CompiledMessage.java} (88%) rename src/main/java/io/mapsmessaging/mavlink/message/{MavlinkEnumResolver.java => EnumResolver.java} (81%) create mode 100644 src/main/java/io/mapsmessaging/mavlink/message/Frame.java rename src/main/java/io/mapsmessaging/mavlink/message/{MavlinkFrameParser.java => FrameParser.java} (93%) delete mode 100644 src/main/java/io/mapsmessaging/mavlink/message/MavlinkFrame.java rename src/main/java/io/mapsmessaging/mavlink/message/{MavlinkMessageDefinition.java => MessageDefinition.java} (69%) rename src/main/java/io/mapsmessaging/mavlink/message/{MavlinkMessageRegistry.java => MessageRegistry.java} (57%) rename src/main/java/io/mapsmessaging/mavlink/message/{MavlinkVersion.java => Version.java} (96%) rename src/main/java/io/mapsmessaging/mavlink/message/fields/{MavlinkEnumDefinition.java => EnumDefinition.java} (78%) rename src/main/java/io/mapsmessaging/mavlink/message/fields/{MavlinkEnumEntry.java => EnumEntry.java} (97%) rename src/main/java/io/mapsmessaging/mavlink/message/fields/{MavlinkFieldCodecFactory.java => FieldCodecFactory.java} (90%) rename src/main/java/io/mapsmessaging/mavlink/message/fields/{MavlinkFieldDefinition.java => FieldDefinition.java} (96%) rename src/main/java/io/mapsmessaging/mavlink/message/fields/{MavlinkWireType.java => WireType.java} (94%) rename src/main/java/io/mapsmessaging/mavlink/parser/{ClasspathMavlinkIncludeResolver.java => ClasspathIncludeResolver.java} (87%) rename src/main/java/io/mapsmessaging/mavlink/parser/{MavlinkDialectDefinition.java => DialectDefinition.java} (71%) rename src/main/java/io/mapsmessaging/mavlink/parser/{MavlinkDialectLoader.java => DialectLoader.java} (77%) rename src/main/java/io/mapsmessaging/mavlink/parser/{MavlinkExtraCrcCalculator.java => ExtraCrcCalculator.java} (78%) rename src/main/java/io/mapsmessaging/mavlink/parser/{MavlinkIncludeResolver.java => IncludeResolver.java} (95%) rename src/main/java/io/mapsmessaging/mavlink/parser/{MavlinkXmlParser.java => XmlParser.java} (75%) rename src/main/java/io/mapsmessaging/mavlink/schema/{MavlinkJsonSchemaBuilder.java => JsonSchemaBuilder.java} (75%) create mode 100644 src/main/java/io/mapsmessaging/mavlink/signing/MapSigningKeyProvider.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/signing/NoSigningKeyProvider.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/signing/StaticSigningKeyProvider.java diff --git a/pom.xml b/pom.xml index 4b4585b..e80b7eb 100644 --- a/pom.xml +++ b/pom.xml @@ -370,6 +370,14 @@ 2.13.2 + + + io.swagger.core.v3 + swagger-annotations + 2.2.41 + compile + + junit-jupiter-engine diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkCodec.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkCodec.java index b3b5521..0b03d6a 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkCodec.java @@ -19,9 +19,9 @@ package io.mapsmessaging.mavlink; -import io.mapsmessaging.mavlink.codec.MavlinkPayloadPacker; -import io.mapsmessaging.mavlink.codec.MavlinkPayloadParser; -import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; +import io.mapsmessaging.mavlink.codec.PayloadPacker; +import io.mapsmessaging.mavlink.codec.PayloadParser; +import io.mapsmessaging.mavlink.message.MessageRegistry; import lombok.Getter; import java.io.IOException; @@ -38,7 +38,7 @@ * see {@link MavlinkFrameCodec}.

* *

Each instance is bound to a single dialect via its - * {@link MavlinkMessageRegistry}.

+ * {@link MessageRegistry}.

*/ public final class MavlinkCodec { @@ -52,10 +52,10 @@ public final class MavlinkCodec { * Compiled message registry for the dialect. */ @Getter - private final MavlinkMessageRegistry registry; + private final MessageRegistry registry; - private final MavlinkPayloadPacker payloadPacker; - private final MavlinkPayloadParser payloadParser; + private final PayloadPacker payloadPacker; + private final PayloadParser payloadParser; /** * Creates a payload codec for a specific MAVLink dialect. @@ -68,9 +68,9 @@ public final class MavlinkCodec { */ public MavlinkCodec( String name, - MavlinkMessageRegistry registry, - MavlinkPayloadPacker payloadPacker, - MavlinkPayloadParser payloadParser + MessageRegistry registry, + PayloadPacker payloadPacker, + PayloadParser payloadParser ) { this.name = Objects.requireNonNull(name, "name"); this.registry = Objects.requireNonNull(registry, "registry"); diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java index 29198d6..f511695 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java @@ -19,13 +19,12 @@ package io.mapsmessaging.mavlink; -import io.mapsmessaging.mavlink.framing.MavlinkDialectRegistry; -import io.mapsmessaging.mavlink.framing.MavlinkFrameFramer; -import io.mapsmessaging.mavlink.framing.MavlinkFramePacker; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; -import io.mapsmessaging.mavlink.message.MavlinkFrame; -import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; -import io.mapsmessaging.mavlink.message.MavlinkVersion; +import io.mapsmessaging.mavlink.framing.*; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.Frame; +import io.mapsmessaging.mavlink.message.MessageRegistry; +import io.mapsmessaging.mavlink.message.Version; +import io.mapsmessaging.mavlink.signing.NoSigningKeyProvider; import java.io.IOException; import java.nio.ByteBuffer; @@ -38,8 +37,8 @@ * *

This codec combines:

*
    - *
  • Frame decoding from a streaming network buffer via {@link MavlinkFrameFramer}
  • - *
  • Frame packing (including CRC) via {@link MavlinkFramePacker}
  • + *
  • Frame decoding from a streaming network buffer via {@link FrameFramer}
  • + *
  • Frame packing (including CRC) via {@link FramePacker}
  • *
  • Payload field encoding/decoding via {@link MavlinkCodec}
  • *
* @@ -47,29 +46,33 @@ *
    *
  • {@link #tryUnpackFrame(ByteBuffer)} consumes a network-owned {@link ByteBuffer} in write-mode and * may {@code flip}/{@code compact} internally.
  • - *
  • {@link #packFrame(ByteBuffer, MavlinkFrame)} writes a complete MAVLink frame into the provided output + *
  • {@link #packFrame(ByteBuffer, Frame)} writes a complete MAVLink frame into the provided output * buffer at its current position.
  • *
*/ public final class MavlinkFrameCodec { private final MavlinkCodec payloadCodec; - private final MavlinkFrameFramer framer; - private final MavlinkFramePacker packer; + private final FrameFramer framer; + private final FramePacker packer; + + public MavlinkFrameCodec(MavlinkCodec payloadCodec) { + this(payloadCodec, new NoSigningKeyProvider()); + } /** * Creates a frame codec for the dialect contained in the provided payload codec. * * @param payloadCodec codec providing the dialect name, message registry, and payload encode/decode * @throws NullPointerException if {@code payloadCodec} is {@code null} */ - public MavlinkFrameCodec(MavlinkCodec payloadCodec) { + public MavlinkFrameCodec(MavlinkCodec payloadCodec, SigningKeyProvider signingKeyProvider) { this.payloadCodec = Objects.requireNonNull(payloadCodec, "payloadCodec"); - MavlinkDialectRegistry dialectRegistry = new RegistryAdapter(payloadCodec.getRegistry()); + DialectRegistry dialectRegistry = new RegistryAdapter(payloadCodec.getRegistry()); - this.framer = new MavlinkFrameFramer(dialectRegistry); - this.packer = new MavlinkFramePacker(dialectRegistry); + this.framer = new FrameFramer(dialectRegistry, signingKeyProvider); + this.packer = new FramePacker(dialectRegistry, signingKeyProvider); } /** @@ -86,7 +89,7 @@ public String getDialectName() { * * @return message registry */ - public MavlinkMessageRegistry getRegistry() { + public MessageRegistry getRegistry() { return payloadCodec.getRegistry(); } @@ -98,7 +101,7 @@ public MavlinkMessageRegistry getRegistry() { * @param networkOwnedBuffer network buffer in write-mode (may be flipped/compacted internally) * @return decoded frame if available and valid */ - public Optional tryUnpackFrame(ByteBuffer networkOwnedBuffer) { + public Optional tryUnpackFrame(ByteBuffer networkOwnedBuffer) { return framer.tryDecode(networkOwnedBuffer); } @@ -111,12 +114,12 @@ public Optional tryUnpackFrame(ByteBuffer networkOwnedBuffer) { * @return envelope containing header fields + raw payload bytes if a complete valid frame is available */ public Optional tryUnpackHeaderAndPayload(ByteBuffer networkOwnedBuffer) { - Optional decoded = framer.tryDecode(networkOwnedBuffer); + Optional decoded = framer.tryDecode(networkOwnedBuffer); if (decoded.isEmpty()) { return Optional.empty(); } - MavlinkFrame frame = decoded.get(); + Frame frame = decoded.get(); byte[] payload = Objects.requireNonNull(frame.getPayload(), "frame.payload"); MavlinkFrameEnvelope envelope = new MavlinkFrameEnvelope( @@ -141,7 +144,7 @@ public Optional tryUnpackHeaderAndPayload(ByteBuffer netwo * @param out output buffer to write into (at current position) * @param frame frame to pack */ - public void packFrame(ByteBuffer out, MavlinkFrame frame) { + public void packFrame(ByteBuffer out, Frame frame) { packer.pack(out, frame); } @@ -153,7 +156,7 @@ public void packFrame(ByteBuffer out, MavlinkFrame frame) { * @throws IOException if payload decoding fails for the message type * @throws NullPointerException if {@code frame} or its payload is {@code null} */ - public Map parsePayload(MavlinkFrame frame) throws IOException { + public Map parsePayload(Frame frame) throws IOException { Objects.requireNonNull(frame, "frame"); byte[] payload = Objects.requireNonNull(frame.getPayload(), "frame.payload"); @@ -182,7 +185,7 @@ public byte[] encodePayload(int messageId, Map values) throws IO * @throws IOException if payload encoding fails * @throws NullPointerException if {@code frame} or {@code values} is {@code null} */ - public void encodePayloadIntoFrame(MavlinkFrame frame, int messageId, Map values) throws IOException { + public void encodePayloadIntoFrame(Frame frame, int messageId, Map values) throws IOException { Objects.requireNonNull(frame, "frame"); Objects.requireNonNull(values, "values"); @@ -196,11 +199,11 @@ public void encodePayloadIntoFrame(MavlinkFrame frame, int messageId, MapThe loader provides a built-in {@code "common"} dialect that is loaded eagerly at startup * (fail-fast). Additional dialects may be loaded at runtime from an {@link InputStream} with a - * caller-supplied {@link MavlinkIncludeResolver} for resolving {@code } directives.

+ * caller-supplied {@link IncludeResolver} for resolving {@code } directives.

* *

Dialects are cached by name and can be retrieved via {@link #getDialect(String)} or * {@link #getDialectOrThrow(String)}.

@@ -117,7 +117,7 @@ public MavlinkCodec getDialectOrThrow(String dialectName) throws IOException { * *

This method is not public by design. Public callers should either use built-ins via * {@link #getDialectOrThrow(String)}, or load custom dialects via - * {@link #loadDialect(String, InputStream, MavlinkIncludeResolver)}.

+ * {@link #loadDialect(String, InputStream, IncludeResolver)}.

* * @param dialectName dialect name used for caching and lookup * @param classpathXml classpath resource path for the dialect XML @@ -137,14 +137,14 @@ protected MavlinkCodec loadDialectFromClasspath(String dialectName, String class throw new IOException("Unable to load MAVLink dialect resource: " + classpathXml); } - MavlinkXmlParser mavlinkXmlParser = new MavlinkXmlParser(); - MavlinkDialectLoader mavlinkDialectLoader = new MavlinkDialectLoader(mavlinkXmlParser); + XmlParser mavlinkXmlParser = new XmlParser(); + DialectLoader dialectLoader = new DialectLoader(mavlinkXmlParser); - MavlinkIncludeResolver includeResolver = - new ClasspathMavlinkIncludeResolver(classLoader, "mavlink"); + IncludeResolver includeResolver = + new ClasspathIncludeResolver(classLoader, "mavlink"); - MavlinkDialectDefinition dialectDefinition = - mavlinkDialectLoader.load(normalizedDialectName, inputStream, includeResolver); + DialectDefinition dialectDefinition = + dialectLoader.load(normalizedDialectName, inputStream, includeResolver); return buildCodec(normalizedDialectName, dialectDefinition); } @@ -153,7 +153,7 @@ protected MavlinkCodec loadDialectFromClasspath(String dialectName, String class /** * Loads a dialect from an arbitrary stream and caches the resulting codec under the dialect name. * - *

{@code } directives are resolved using the provided {@link MavlinkIncludeResolver}.

+ *

{@code } directives are resolved using the provided {@link IncludeResolver}.

* * @param dialectName dialect name used for caching and lookup * @param inputStream dialect XML stream (not closed by this method) @@ -163,7 +163,7 @@ protected MavlinkCodec loadDialectFromClasspath(String dialectName, String class * @throws ParserConfigurationException if the XML parser cannot be configured * @throws SAXException if the dialect XML is invalid */ - public MavlinkCodec loadDialect(String dialectName, InputStream inputStream, MavlinkIncludeResolver includeResolver) + public MavlinkCodec loadDialect(String dialectName, InputStream inputStream, IncludeResolver includeResolver) throws IOException, ParserConfigurationException, SAXException { String normalizedDialectName = normalizeDialectName(dialectName); @@ -171,11 +171,11 @@ public MavlinkCodec loadDialect(String dialectName, InputStream inputStream, Mav Objects.requireNonNull(inputStream, "inputStream"); Objects.requireNonNull(includeResolver, "includeResolver"); - MavlinkXmlParser mavlinkXmlParser = new MavlinkXmlParser(); - MavlinkDialectLoader mavlinkDialectLoader = new MavlinkDialectLoader(mavlinkXmlParser); + XmlParser mavlinkXmlParser = new XmlParser(); + DialectLoader dialectLoader = new DialectLoader(mavlinkXmlParser); - MavlinkDialectDefinition dialectDefinition = - mavlinkDialectLoader.load(normalizedDialectName, inputStream, includeResolver); + DialectDefinition dialectDefinition = + dialectLoader.load(normalizedDialectName, inputStream, includeResolver); MavlinkCodec codec = buildCodec(normalizedDialectName, dialectDefinition); dialects.put(normalizedDialectName, codec); @@ -183,11 +183,11 @@ public MavlinkCodec loadDialect(String dialectName, InputStream inputStream, Mav return codec; } - private MavlinkCodec buildCodec(String dialectName, MavlinkDialectDefinition dialectDefinition) { - MavlinkMessageRegistry registry = MavlinkMessageRegistry.fromDialectDefinition(dialectDefinition); + private MavlinkCodec buildCodec(String dialectName, DialectDefinition dialectDefinition) { + MessageRegistry registry = MessageRegistry.fromDialectDefinition(dialectDefinition); - MavlinkPayloadPacker payloadPacker = new MavlinkPayloadPacker(registry); - MavlinkPayloadParser payloadParser = new MavlinkPayloadParser(registry); + PayloadPacker payloadPacker = new PayloadPacker(registry); + PayloadParser payloadParser = new PayloadParser(registry); return new MavlinkCodec(dialectName, registry, payloadPacker, payloadParser); } diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameEncoder.java b/src/main/java/io/mapsmessaging/mavlink/codec/FrameEncoder.java similarity index 92% rename from src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameEncoder.java rename to src/main/java/io/mapsmessaging/mavlink/codec/FrameEncoder.java index 8969fa5..174dab7 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameEncoder.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/FrameEncoder.java @@ -19,13 +19,13 @@ package io.mapsmessaging.mavlink.codec; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; +import io.mapsmessaging.mavlink.message.CompiledMessage; import io.mapsmessaging.mavlink.message.X25Crc; import java.nio.ByteBuffer; import java.nio.ByteOrder; -public class MavlinkFrameEncoder { +public class FrameEncoder { private static final byte MAVLINK2_STX = (byte) 0xFD; private static final int MAVLINK2_HEADER_LENGTH = 10; @@ -37,7 +37,7 @@ public byte[] encodeV2Frame( int componentId, int messageId, byte[] payload, - MavlinkCompiledMessage compiledMessage + CompiledMessage compiledMessage ) { int payloadLength = payload.length; int frameLength = MAVLINK2_HEADER_LENGTH + payloadLength + MAVLINK2_CHECKSUM_LENGTH; @@ -77,7 +77,7 @@ private void writeHeader( buffer.put((byte) ((messageId >> 16) & 0xFF)); } - private short computeCrc(byte[] frameBytesWithoutCrc, MavlinkCompiledMessage compiledMessage) { + private short computeCrc(byte[] frameBytesWithoutCrc, CompiledMessage compiledMessage) { int start = 1; int lengthForCrc = frameBytesWithoutCrc.length - 1; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameFactory.java b/src/main/java/io/mapsmessaging/mavlink/codec/FrameFactory.java similarity index 71% rename from src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameFactory.java rename to src/main/java/io/mapsmessaging/mavlink/codec/FrameFactory.java index 9a2bd6a..7db07fa 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameFactory.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/FrameFactory.java @@ -19,18 +19,18 @@ package io.mapsmessaging.mavlink.codec; -import io.mapsmessaging.mavlink.message.MavlinkFrame; -import io.mapsmessaging.mavlink.message.MavlinkFrameParser; +import io.mapsmessaging.mavlink.message.Frame; +import io.mapsmessaging.mavlink.message.FrameParser; -public class MavlinkFrameFactory { +public class FrameFactory { - private final MavlinkFrameParser frameParser; + private final FrameParser frameParser; - public MavlinkFrameFactory() { - this.frameParser = new MavlinkFrameParser(); + public FrameFactory() { + this.frameParser = new FrameParser(); } - public MavlinkFrame parse(byte[] payload) { + public Frame parse(byte[] payload) { return frameParser.parse(payload); } } diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkJsonCodec.java b/src/main/java/io/mapsmessaging/mavlink/codec/JsonCodec.java similarity index 73% rename from src/main/java/io/mapsmessaging/mavlink/codec/MavlinkJsonCodec.java rename to src/main/java/io/mapsmessaging/mavlink/codec/JsonCodec.java index 4ad7ea2..cc4ad33 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkJsonCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/JsonCodec.java @@ -22,36 +22,36 @@ import com.google.gson.Gson; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; -import io.mapsmessaging.mavlink.message.MavlinkFrame; -import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.Frame; +import io.mapsmessaging.mavlink.message.MessageRegistry; import java.io.IOException; import java.util.Map; import java.util.Objects; -public class MavlinkJsonCodec { +public class JsonCodec { private static final Gson GSON = new Gson(); private final String dialectName; - private final MavlinkPayloadPacker packer; - private final MavlinkMapConverter mapConverter; - private final MavlinkJsonValuesExtractor valuesExtractor; - private final MavlinkFrameEncoder frameEncoder; + private final PayloadPacker packer; + private final MapConverter mapConverter; + private final JsonValuesExtractor valuesExtractor; + private final FrameEncoder frameEncoder; - public MavlinkJsonCodec(String dialectName, MavlinkPayloadPacker packer, MavlinkMapConverter mapConverter) { + public JsonCodec(String dialectName, PayloadPacker packer, MapConverter mapConverter) { this.dialectName = Objects.requireNonNull(dialectName, "dialectName"); this.packer = Objects.requireNonNull(packer, "packer"); this.mapConverter = Objects.requireNonNull(mapConverter, "mapConverter"); - this.valuesExtractor = new MavlinkJsonValuesExtractor(); - this.frameEncoder = new MavlinkFrameEncoder(); + this.valuesExtractor = new JsonValuesExtractor(); + this.frameEncoder = new FrameEncoder(); } - public JsonObject toJson(MavlinkFrame frame) throws IOException { + public JsonObject toJson(Frame frame) throws IOException { Map map = mapConverter.convert(frame); String json = GSON.toJson(map); return JsonParser.parseString(json).getAsJsonObject(); @@ -70,8 +70,8 @@ public byte[] fromJson(JsonObject jsonObject) throws IOException { int componentId = jsonObject.has("componentId") ? jsonObject.get("componentId").getAsInt() : 1; int sequence = jsonObject.has("sequence") ? jsonObject.get("sequence").getAsInt() : 0; - MavlinkMessageRegistry registry = packer.getMessageRegistry(); - MavlinkCompiledMessage compiledMessage = registry.getCompiledMessagesById().get(messageId); + MessageRegistry registry = packer.getMessageRegistry(); + CompiledMessage compiledMessage = registry.getCompiledMessagesById().get(messageId); if (compiledMessage == null) { throw new IOException("Unknown MAVLink message id: " + messageId + " for dialect " + dialectName); } diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkJsonValuesExtractor.java b/src/main/java/io/mapsmessaging/mavlink/codec/JsonValuesExtractor.java similarity index 89% rename from src/main/java/io/mapsmessaging/mavlink/codec/MavlinkJsonValuesExtractor.java rename to src/main/java/io/mapsmessaging/mavlink/codec/JsonValuesExtractor.java index ae5f2ab..2944da9 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkJsonValuesExtractor.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/JsonValuesExtractor.java @@ -23,20 +23,20 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; -import io.mapsmessaging.mavlink.message.MavlinkCompiledField; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; +import io.mapsmessaging.mavlink.message.CompiledField; +import io.mapsmessaging.mavlink.message.CompiledMessage; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -public class MavlinkJsonValuesExtractor { +public class JsonValuesExtractor { - public Map extractValues(JsonObject jsonObject, MavlinkCompiledMessage compiledMessage) { + public Map extractValues(JsonObject jsonObject, CompiledMessage compiledMessage) { Map values = new HashMap<>(); - for (MavlinkCompiledField compiledField : compiledMessage.getCompiledFields()) { + for (CompiledField compiledField : compiledMessage.getCompiledFields()) { String fieldName = compiledField.getFieldDefinition().getName(); if (!jsonObject.has(fieldName)) { continue; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkMapConverter.java b/src/main/java/io/mapsmessaging/mavlink/codec/MapConverter.java similarity index 78% rename from src/main/java/io/mapsmessaging/mavlink/codec/MavlinkMapConverter.java rename to src/main/java/io/mapsmessaging/mavlink/codec/MapConverter.java index a8ce233..5dd6b52 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkMapConverter.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/MapConverter.java @@ -19,21 +19,21 @@ package io.mapsmessaging.mavlink.codec; -import io.mapsmessaging.mavlink.message.MavlinkFrame; +import io.mapsmessaging.mavlink.message.Frame; import java.io.IOException; import java.util.Map; import java.util.Objects; -public class MavlinkMapConverter { +public class MapConverter { - private final MavlinkPayloadParser payloadParser; + private final PayloadParser payloadParser; - public MavlinkMapConverter(MavlinkPayloadParser payloadParser) { + public MapConverter(PayloadParser payloadParser) { this.payloadParser = Objects.requireNonNull(payloadParser, "payloadParser"); } - public Map convert(MavlinkFrame frame) throws IOException { + public Map convert(Frame frame) throws IOException { return payloadParser.parsePayload(frame.getMessageId(), frame.getPayload()); } } diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadPacker.java b/src/main/java/io/mapsmessaging/mavlink/codec/PayloadPacker.java similarity index 69% rename from src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadPacker.java rename to src/main/java/io/mapsmessaging/mavlink/codec/PayloadPacker.java index 349f7c2..5106de4 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadPacker.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/PayloadPacker.java @@ -19,13 +19,13 @@ package io.mapsmessaging.mavlink.codec; -import io.mapsmessaging.mavlink.message.MavlinkCompiledField; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; -import io.mapsmessaging.mavlink.message.MavlinkEnumResolver; -import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; +import io.mapsmessaging.mavlink.message.CompiledField; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.EnumResolver; +import io.mapsmessaging.mavlink.message.MessageRegistry; import io.mapsmessaging.mavlink.message.fields.AbstractMavlinkFieldCodec; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; -import io.mapsmessaging.mavlink.message.fields.MavlinkWireType; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; +import io.mapsmessaging.mavlink.message.fields.WireType; import lombok.Getter; import java.io.IOException; @@ -36,18 +36,18 @@ import java.util.List; import java.util.Map; -public class MavlinkPayloadPacker { +public class PayloadPacker { @Getter - private final MavlinkMessageRegistry messageRegistry; + private final MessageRegistry messageRegistry; - public MavlinkPayloadPacker(MavlinkMessageRegistry messageRegistry) { + public PayloadPacker(MessageRegistry messageRegistry) { this.messageRegistry = messageRegistry; } public byte[] packPayload(int messageId, Map values) throws IOException { - MavlinkCompiledMessage compiledMessage = getCompiledMessage(messageId); - List compiledFields = compiledMessage.getCompiledFields(); + CompiledMessage compiledMessage = getCompiledMessage(messageId); + List compiledFields = compiledMessage.getCompiledFields(); int lastExtensionIndex = findLastIncludedExtensionIndex(compiledFields, values); int payloadSize = computeTotalPotentialPayloadSize(compiledFields); @@ -66,18 +66,18 @@ public byte[] packPayload(int messageId, Map values) throws IOEx return out; } - private MavlinkCompiledMessage getCompiledMessage(int messageId) throws IOException { - MavlinkCompiledMessage compiledMessage = messageRegistry.getCompiledMessagesById().get(messageId); + private CompiledMessage getCompiledMessage(int messageId) throws IOException { + CompiledMessage compiledMessage = messageRegistry.getCompiledMessagesById().get(messageId); if (compiledMessage == null) { throw new IOException("Unknown MAVLink message id: " + messageId); } return compiledMessage; } - private int findLastIncludedExtensionIndex(List compiledFields, Map values) { + private int findLastIncludedExtensionIndex(List compiledFields, Map values) { int lastExtensionIndex = -1; for (int i = 0; i < compiledFields.size(); i++) { - MavlinkFieldDefinition field = compiledFields.get(i).getFieldDefinition(); + FieldDefinition field = compiledFields.get(i).getFieldDefinition(); if (!field.isExtension()) { continue; } @@ -89,11 +89,11 @@ private int findLastIncludedExtensionIndex(List compiledFi return lastExtensionIndex; } - private int computePayloadSize(List compiledFields, int lastExtensionIndex) { + private int computePayloadSize(List compiledFields, int lastExtensionIndex) { int size = 0; for (int i = 0; i < compiledFields.size(); i++) { - MavlinkCompiledField compiledField = compiledFields.get(i); - MavlinkFieldDefinition field = compiledField.getFieldDefinition(); + CompiledField compiledField = compiledFields.get(i); + FieldDefinition field = compiledField.getFieldDefinition(); if (!field.isExtension()) { size += compiledField.getSizeInBytes(); @@ -110,9 +110,9 @@ private int computePayloadSize(List compiledFields, int la return size; } - private int computeTotalPotentialPayloadSize(List compiledFields) { + private int computeTotalPotentialPayloadSize(List compiledFields) { int size = 0; - for (MavlinkCompiledField compiledField : compiledFields) { + for (CompiledField compiledField : compiledFields) { size += compiledField.getSizeInBytes(); } return size; @@ -125,14 +125,14 @@ private ByteBuffer allocate(int payloadSize) { } private void encodePayload( - List compiledFields, + List compiledFields, int lastExtensionIndex, Map values, ByteBuffer buffer) throws IOException { for (int i = 0; i < compiledFields.size(); i++) { - MavlinkCompiledField compiledField = compiledFields.get(i); - MavlinkFieldDefinition field = compiledField.getFieldDefinition(); + CompiledField compiledField = compiledFields.get(i); + FieldDefinition field = compiledField.getFieldDefinition(); if (field.isExtension() && i > lastExtensionIndex) { break; @@ -145,7 +145,7 @@ private void encodePayload( continue; } - value = MavlinkEnumResolver.resolveEnumValue(messageRegistry, field, value); + value = EnumResolver.resolveEnumValue(messageRegistry, field, value); if (!field.isArray()) { encodeScalar(compiledField, buffer, value); @@ -157,7 +157,7 @@ private void encodePayload( } } - private void encodeScalar(MavlinkCompiledField compiledField, ByteBuffer buffer, Object value) throws IOException { + private void encodeScalar(CompiledField compiledField, ByteBuffer buffer, Object value) throws IOException { try { compiledField.getFieldCodec().encode(buffer, value); } catch (Exception e) { @@ -167,10 +167,10 @@ private void encodeScalar(MavlinkCompiledField compiledField, ByteBuffer buffer, } } - private void encodeArray(MavlinkCompiledField compiledField, ByteBuffer buffer, Object value) throws IOException { - MavlinkFieldDefinition field = compiledField.getFieldDefinition(); + private void encodeArray(CompiledField compiledField, ByteBuffer buffer, Object value) throws IOException { + FieldDefinition field = compiledField.getFieldDefinition(); - if (field.getWireType() == MavlinkWireType.CHAR) { + if (field.getWireType() == WireType.CHAR) { encodeCharArray(compiledField, buffer, value); return; } @@ -179,8 +179,8 @@ private void encodeArray(MavlinkCompiledField compiledField, ByteBuffer buffer, encodeTypedArray(compiledField, buffer, elements); } - private void encodeCharArray(MavlinkCompiledField compiledField, ByteBuffer buffer, Object value) throws IOException { - MavlinkFieldDefinition field = compiledField.getFieldDefinition(); + private void encodeCharArray(CompiledField compiledField, ByteBuffer buffer, Object value) throws IOException { + FieldDefinition field = compiledField.getFieldDefinition(); int len = field.getArrayLength(); byte[] src; @@ -198,8 +198,8 @@ private void encodeCharArray(MavlinkCompiledField compiledField, ByteBuffer buff zeroBytes(buffer, len - copyLen); } - private void encodeTypedArray(MavlinkCompiledField compiledField, ByteBuffer buffer, List elements) throws IOException { - MavlinkFieldDefinition field = compiledField.getFieldDefinition(); + private void encodeTypedArray(CompiledField compiledField, ByteBuffer buffer, List elements) throws IOException { + FieldDefinition field = compiledField.getFieldDefinition(); AbstractMavlinkFieldCodec codec = compiledField.getFieldCodec(); int len = field.getArrayLength(); @@ -236,7 +236,7 @@ private List toElements(Object value, String fieldName) throws IOException { (value == null ? "null" : value.getClass().getName())); } - private void zeroFill(MavlinkCompiledField compiledField, ByteBuffer buffer) { + private void zeroFill(CompiledField compiledField, ByteBuffer buffer) { zeroBytes(buffer, compiledField.getSizeInBytes()); } diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadParser.java b/src/main/java/io/mapsmessaging/mavlink/codec/PayloadParser.java similarity index 80% rename from src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadParser.java rename to src/main/java/io/mapsmessaging/mavlink/codec/PayloadParser.java index 74c7fd1..48457ce 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkPayloadParser.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/PayloadParser.java @@ -20,12 +20,12 @@ package io.mapsmessaging.mavlink.codec; -import io.mapsmessaging.mavlink.message.MavlinkCompiledField; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; -import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; +import io.mapsmessaging.mavlink.message.CompiledField; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.MessageRegistry; import io.mapsmessaging.mavlink.message.fields.AbstractMavlinkFieldCodec; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; -import io.mapsmessaging.mavlink.message.fields.MavlinkWireType; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; +import io.mapsmessaging.mavlink.message.fields.WireType; import java.io.IOException; import java.nio.ByteBuffer; @@ -36,16 +36,16 @@ import java.util.List; import java.util.Map; -public class MavlinkPayloadParser { +public class PayloadParser { - private final MavlinkMessageRegistry messageRegistry; + private final MessageRegistry messageRegistry; - public MavlinkPayloadParser(MavlinkMessageRegistry messageRegistry) { + public PayloadParser(MessageRegistry messageRegistry) { this.messageRegistry = messageRegistry; } public Map parsePayload(int messageId, byte[] payload) throws IOException { - MavlinkCompiledMessage compiledMessage = + CompiledMessage compiledMessage = messageRegistry.getCompiledMessagesById().get(messageId); if (compiledMessage == null) { throw new IllegalArgumentException("Unknown MAVLink message id: " + messageId); @@ -58,8 +58,8 @@ public Map parsePayload(int messageId, byte[] payload) throws IO boolean truncated = false; - for (MavlinkCompiledField compiledField : compiledMessage.getCompiledFields()) { - MavlinkFieldDefinition fieldDefinition = compiledField.getFieldDefinition(); + for (CompiledField compiledField : compiledMessage.getCompiledFields()) { + FieldDefinition fieldDefinition = compiledField.getFieldDefinition(); AbstractMavlinkFieldCodec fieldCodec = compiledField.getFieldCodec(); String fieldName = fieldDefinition.getName(); int fieldSize = compiledField.getSizeInBytes(); @@ -85,7 +85,7 @@ public Map parsePayload(int messageId, byte[] payload) throws IO } int len = fieldDefinition.getArrayLength(); - if (fieldDefinition.getWireType() == MavlinkWireType.CHAR) { + if (fieldDefinition.getWireType() == WireType.CHAR) { // read fixed-size char[N] bytes; codec may or may not do this correctly byte[] raw = new byte[len]; buffer.get(raw); @@ -106,7 +106,7 @@ public Map parsePayload(int messageId, byte[] payload) throws IO return result; } - private Object zeroValue(MavlinkFieldDefinition fieldDefinition) { + private Object zeroValue(FieldDefinition fieldDefinition) { if (!fieldDefinition.isArray()) { // Scalars: 0 / 0.0 / false, etc. return switch (fieldDefinition.getWireType()) { @@ -118,7 +118,7 @@ private Object zeroValue(MavlinkFieldDefinition fieldDefinition) { int len = fieldDefinition.getArrayLength(); - if (fieldDefinition.getWireType() == MavlinkWireType.CHAR) { + if (fieldDefinition.getWireType() == WireType.CHAR) { return ""; } diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkDialectRegistry.java b/src/main/java/io/mapsmessaging/mavlink/framing/DialectRegistry.java similarity index 78% rename from src/main/java/io/mapsmessaging/mavlink/framing/MavlinkDialectRegistry.java rename to src/main/java/io/mapsmessaging/mavlink/framing/DialectRegistry.java index b3539e0..199e5a7 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkDialectRegistry.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/DialectRegistry.java @@ -19,11 +19,11 @@ package io.mapsmessaging.mavlink.framing; -import io.mapsmessaging.mavlink.message.MavlinkVersion; +import io.mapsmessaging.mavlink.message.Version; -public interface MavlinkDialectRegistry { +public interface DialectRegistry { - int crcExtra(MavlinkVersion version, int messageId); + int crcExtra(Version version, int messageId); - int minimumPayloadLength(MavlinkVersion version, int messageId); + int minimumPayloadLength(Version version, int messageId); } diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameDecoder.java b/src/main/java/io/mapsmessaging/mavlink/framing/FrameDecoder.java similarity index 84% rename from src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameDecoder.java rename to src/main/java/io/mapsmessaging/mavlink/framing/FrameDecoder.java index 2bba84c..29ff010 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameDecoder.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/FrameDecoder.java @@ -19,11 +19,11 @@ package io.mapsmessaging.mavlink.framing; -import io.mapsmessaging.mavlink.message.MavlinkFrame; +import io.mapsmessaging.mavlink.message.Frame; import java.nio.ByteBuffer; import java.util.Optional; -public interface MavlinkFrameDecoder { - Optional decode(ByteBuffer candidateFrame); +public interface FrameDecoder { + Optional decode(ByteBuffer candidateFrame); } diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameFramer.java b/src/main/java/io/mapsmessaging/mavlink/framing/FrameFramer.java similarity index 83% rename from src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameFramer.java rename to src/main/java/io/mapsmessaging/mavlink/framing/FrameFramer.java index 4ca0880..baf80bf 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameFramer.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/FrameFramer.java @@ -19,7 +19,7 @@ package io.mapsmessaging.mavlink.framing; -import io.mapsmessaging.mavlink.message.MavlinkFrame; +import io.mapsmessaging.mavlink.message.Frame; import java.nio.ByteBuffer; import java.util.Optional; @@ -32,21 +32,21 @@ * - This method flips to read-mode, consumes at most one valid frame, then compacts. * - Leftover (partial) bytes are moved to index 0 by compact(). */ -public final class MavlinkFrameFramer { +public final class FrameFramer { private static final int MAVLINK_V1_STX = 0xFE; private static final int MAVLINK_V2_STX = 0xFD; private static final int MAVLINK_MAX_PAYLOAD_LENGTH = 255; - private final MavlinkFrameHandler mavlinkV1FrameHandler; - private final MavlinkFrameHandler mavlinkV2FrameHandler; + private final FrameHandler mavlinkV1FrameHandler; + private final FrameHandler mavlinkV2FrameHandler; - public MavlinkFrameFramer(MavlinkDialectRegistry dialectRegistry) { - this.mavlinkV1FrameHandler = new MavlinkV1FrameHandler(dialectRegistry); - this.mavlinkV2FrameHandler = new MavlinkV2FrameHandler(dialectRegistry); + public FrameFramer(DialectRegistry dialectRegistry, SigningKeyProvider signingKeyProvider) { + this.mavlinkV1FrameHandler = new V1FrameHandler(dialectRegistry); + this.mavlinkV2FrameHandler = new V2FrameHandler(dialectRegistry, signingKeyProvider); } - public Optional tryDecode(ByteBuffer networkOwnedBuffer) { + public Optional tryDecode(ByteBuffer networkOwnedBuffer) { try { if (!networkOwnedBuffer.hasRemaining()) { return Optional.empty(); @@ -58,7 +58,7 @@ public Optional tryDecode(ByteBuffer networkOwnedBuffer) { while (scanIndex < bufferLimit) { int startByte = networkOwnedBuffer.get(scanIndex) & 0xFF; - MavlinkFrameHandler handler = null; + FrameHandler handler = null; if (startByte == MAVLINK_V1_STX) { handler = mavlinkV1FrameHandler; } else if (startByte == MAVLINK_V2_STX) { @@ -95,7 +95,7 @@ public Optional tryDecode(ByteBuffer networkOwnedBuffer) { candidateFrame.position(scanIndex); candidateFrame.limit(scanIndex + totalFrameLength); - Optional decodedFrame = handler.tryDecode(candidateFrame); + Optional decodedFrame = handler.tryDecode(candidateFrame); if (decodedFrame.isPresent()) { networkOwnedBuffer.position(scanIndex + totalFrameLength); return decodedFrame; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameHandler.java b/src/main/java/io/mapsmessaging/mavlink/framing/FrameHandler.java similarity index 86% rename from src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameHandler.java rename to src/main/java/io/mapsmessaging/mavlink/framing/FrameHandler.java index c22c656..9e8a8f3 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFrameHandler.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/FrameHandler.java @@ -19,12 +19,12 @@ package io.mapsmessaging.mavlink.framing; -import io.mapsmessaging.mavlink.message.MavlinkFrame; +import io.mapsmessaging.mavlink.message.Frame; import java.nio.ByteBuffer; import java.util.Optional; -public interface MavlinkFrameHandler { +public interface FrameHandler { int minimumBytesRequiredForHeader(); @@ -32,5 +32,5 @@ public interface MavlinkFrameHandler { int computeTotalFrameLength(ByteBuffer buffer, int frameStartIndex, int payloadLength); - Optional tryDecode(ByteBuffer candidateFrame); + Optional tryDecode(ByteBuffer candidateFrame); } diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java b/src/main/java/io/mapsmessaging/mavlink/framing/FramePacker.java similarity index 77% rename from src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java rename to src/main/java/io/mapsmessaging/mavlink/framing/FramePacker.java index 91fecbf..3dcb0de 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkFramePacker.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/FramePacker.java @@ -19,12 +19,12 @@ package io.mapsmessaging.mavlink.framing; -import io.mapsmessaging.mavlink.message.MavlinkFrame; -import io.mapsmessaging.mavlink.message.MavlinkVersion; +import io.mapsmessaging.mavlink.message.Frame; +import io.mapsmessaging.mavlink.message.Version; import java.nio.ByteBuffer; -public final class MavlinkFramePacker { +public final class FramePacker { private static final int MAVLINK_V1_STX = 0xFE; private static final int MAVLINK_V2_STX = 0xFD; @@ -39,17 +39,20 @@ public final class MavlinkFramePacker { private static final int V2_SIGNATURE_LENGTH = 13; private static final int V2_INCOMPAT_FLAG_SIGNED = 0x01; - private final MavlinkDialectRegistry dialectRegistry; + private final DialectRegistry dialectRegistry; + private final SigningKeyProvider signingKeyProvider; - public MavlinkFramePacker(MavlinkDialectRegistry dialectRegistry) { + + public FramePacker(DialectRegistry dialectRegistry, SigningKeyProvider signingKeyProvider) { this.dialectRegistry = dialectRegistry; + this.signingKeyProvider = signingKeyProvider; } /** * Packs the supplied MAVLink frame into the provided buffer at the current position. * The buffer must be in write-mode and have sufficient remaining space. */ - public void pack(ByteBuffer out, MavlinkFrame frame) { + public void pack(ByteBuffer out, Frame frame) { if (out == null) { throw new IllegalArgumentException("out must not be null"); } @@ -78,7 +81,7 @@ public void pack(ByteBuffer out, MavlinkFrame frame) { } } - private void packV1(ByteBuffer out, MavlinkFrame frame) { + private void packV1(ByteBuffer out, Frame frame) { int payloadLength = frame.getPayloadLength(); byte[] payload = frame.getPayload() == null ? new byte[0] : frame.getPayload(); @@ -100,7 +103,7 @@ private void packV1(ByteBuffer out, MavlinkFrame frame) { out.put(payload, 0, payloadLength); - int crcExtra = dialectRegistry.crcExtra(MavlinkVersion.V1, frame.getMessageId()); + int crcExtra = dialectRegistry.crcExtra(Version.V1, frame.getMessageId()); int checksum = CrcHelper.computeChecksumFromWritten(out, startPosition + 1, MAVLINK_V1_HEADER_LENGTH + payloadLength, crcExtra); out.put((byte) (checksum & 0xFF)); @@ -113,7 +116,7 @@ private void packV1(ByteBuffer out, MavlinkFrame frame) { frame.setSignature(null); } - private void packV2(ByteBuffer out, MavlinkFrame frame) { + private void packV2(ByteBuffer out, Frame frame) { int payloadLength = frame.getPayloadLength(); byte[] payload = frame.getPayload() == null ? new byte[0] : frame.getPayload(); @@ -122,11 +125,6 @@ private void packV2(ByteBuffer out, MavlinkFrame frame) { } boolean signed = frame.isSigned(); - byte[] signature = frame.getSignature(); - - if (signed && (signature == null || signature.length != V2_SIGNATURE_LENGTH)) { - throw new IllegalArgumentException("Signed v2 frame must have signature[13]"); - } int required = 1 + MAVLINK_V2_HEADER_LENGTH + payloadLength + CRC_LENGTH + (signed ? V2_SIGNATURE_LENGTH : 0); requireRemaining(out, required); @@ -154,20 +152,46 @@ private void packV2(ByteBuffer out, MavlinkFrame frame) { out.put(payload, 0, payloadLength); - int crcExtra = dialectRegistry.crcExtra(MavlinkVersion.V2, frame.getMessageId()); - int checksum = CrcHelper.computeChecksumFromWritten(out, startPosition + 1, (MAVLINK_V2_HEADER_LENGTH-1) + payloadLength, crcExtra); + int crcExtra = dialectRegistry.crcExtra(Version.V2, frame.getMessageId()); + int checksum = CrcHelper.computeChecksumFromWritten( + out, + startPosition + 1, + (MAVLINK_V2_HEADER_LENGTH - 1) + payloadLength, + crcExtra + ); out.put((byte) (checksum & 0xFF)); out.put((byte) ((checksum >>> 8) & 0xFF)); + byte[] signature = null; if (signed) { + int linkId = 0; + long timestampMicros = System.currentTimeMillis() * 1000L; + + byte[] signingKey = signingKeyProvider.getSigningKey(frame.getSystemId(), frame.getComponentId(), linkId); + if (signingKey == null || signingKey.length != 32) { + throw new IllegalArgumentException("Signed v2 frame requires 32-byte signing key"); + } + + int crcStartIndex = out.position() - CRC_LENGTH; + + signature = V2SignatureGenerator.buildSignature( + out, + startPosition, + crcStartIndex, + linkId, + timestampMicros, + signingKey + ); + out.put(signature, 0, V2_SIGNATURE_LENGTH); } frame.setChecksum(checksum); frame.setIncompatibilityFlags(incompatibilityFlags); + frame.setSignature(signature); + frame.setValidated(signed); } - private static void requireRemaining(ByteBuffer out, int required) { if (out.remaining() < required) { throw new IllegalArgumentException("Insufficient space in output buffer. required=" + required + " remaining=" + out.remaining()); diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/SigningKeyProvider.java b/src/main/java/io/mapsmessaging/mavlink/framing/SigningKeyProvider.java new file mode 100644 index 0000000..3accbd3 --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/framing/SigningKeyProvider.java @@ -0,0 +1,25 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.mapsmessaging.mavlink.framing; + +public interface SigningKeyProvider { + boolean canValidate(); + byte[] getSigningKey(int systemId, int componentId, int linkId); +} diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV1FrameHandler.java b/src/main/java/io/mapsmessaging/mavlink/framing/V1FrameHandler.java similarity index 85% rename from src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV1FrameHandler.java rename to src/main/java/io/mapsmessaging/mavlink/framing/V1FrameHandler.java index 2003f23..d2436bc 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV1FrameHandler.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/V1FrameHandler.java @@ -19,23 +19,23 @@ package io.mapsmessaging.mavlink.framing; -import io.mapsmessaging.mavlink.message.MavlinkFrame; -import io.mapsmessaging.mavlink.message.MavlinkVersion; +import io.mapsmessaging.mavlink.message.Frame; +import io.mapsmessaging.mavlink.message.Version; import io.mapsmessaging.mavlink.message.X25Crc; import java.nio.ByteBuffer; import java.util.Optional; -public final class MavlinkV1FrameHandler implements MavlinkFrameHandler { +public final class V1FrameHandler implements FrameHandler { private static final int STX = 0xFE; private static final int HEADER_LENGTH = 6; // LEN, SEQ, SYSID, COMPID, MSGID private static final int CRC_LENGTH = 2; - private final MavlinkDialectRegistry dialectRegistry; + private final DialectRegistry dialectRegistry; - public MavlinkV1FrameHandler(MavlinkDialectRegistry dialectRegistry) { + public V1FrameHandler(DialectRegistry dialectRegistry) { this.dialectRegistry = dialectRegistry; } @@ -55,7 +55,7 @@ public int computeTotalFrameLength(ByteBuffer buffer, int frameStartIndex, int p } @Override - public Optional tryDecode(ByteBuffer candidateFrame) { + public Optional tryDecode(ByteBuffer candidateFrame) { int frameStartIndex = candidateFrame.position(); int stx = candidateFrame.get(frameStartIndex) & 0xFF; @@ -69,7 +69,7 @@ public Optional tryDecode(ByteBuffer candidateFrame) { int componentId = candidateFrame.get(frameStartIndex + 4) & 0xFF; int messageId = candidateFrame.get(frameStartIndex + 5) & 0xFF; - int minimumPayloadLength = dialectRegistry.minimumPayloadLength(MavlinkVersion.V1, messageId); + int minimumPayloadLength = dialectRegistry.minimumPayloadLength(Version.V1, messageId); if (payloadLength < minimumPayloadLength) { return Optional.empty(); } @@ -79,7 +79,7 @@ public Optional tryDecode(ByteBuffer candidateFrame) { int receivedChecksum = ByteBufferUtils.readUnsignedLittleEndianShort(candidateFrame, crcStartIndex); - int crcExtra = dialectRegistry.crcExtra(MavlinkVersion.V1, messageId); + int crcExtra = dialectRegistry.crcExtra(Version.V1, messageId); int computedChecksum = CrcHelper.computeChecksumFromWritten(candidateFrame, frameStartIndex + 1, (HEADER_LENGTH) + payloadLength-1, crcExtra); if (computedChecksum != receivedChecksum) { return Optional.empty(); @@ -87,8 +87,8 @@ public Optional tryDecode(ByteBuffer candidateFrame) { byte[] payload = ByteBufferUtils.copyBytes(candidateFrame, payloadStartIndex, payloadLength); - MavlinkFrame frame = new MavlinkFrame(); - frame.setVersion(MavlinkVersion.V1); + Frame frame = new Frame(); + frame.setVersion(Version.V1); frame.setSequence(sequence); frame.setSystemId(systemId); frame.setComponentId(componentId); diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV2FrameHandler.java b/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameHandler.java similarity index 60% rename from src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV2FrameHandler.java rename to src/main/java/io/mapsmessaging/mavlink/framing/V2FrameHandler.java index b9deea0..920ea74 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/MavlinkV2FrameHandler.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameHandler.java @@ -19,27 +19,31 @@ package io.mapsmessaging.mavlink.framing; -import io.mapsmessaging.mavlink.message.MavlinkFrame; -import io.mapsmessaging.mavlink.message.MavlinkVersion; -import io.mapsmessaging.mavlink.message.X25Crc; +import io.mapsmessaging.mavlink.message.Frame; +import io.mapsmessaging.mavlink.message.Version; import java.nio.ByteBuffer; +import java.util.Arrays; import java.util.Optional; -public final class MavlinkV2FrameHandler implements MavlinkFrameHandler { +public final class V2FrameHandler implements FrameHandler { private static final int STX = 0xFD; public static final int INCOMPAT_FLAG_SIGNED = 0x01; private static final int HEADER_LENGTH = 10; // LEN, INC, COMP, SEQ, SYSID, COMPID, MSGID(3) - private static final int CRC_LENGTH = 2; - private static final int SIGNATURE_LENGTH = 13; - private final MavlinkDialectRegistry dialectRegistry; + static final int CRC_LENGTH = 2; + static final int SIGNATURE_LENGTH = 13; - public MavlinkV2FrameHandler(MavlinkDialectRegistry dialectRegistry) { + private final DialectRegistry dialectRegistry; + private final SigningKeyProvider signingKeyProvider; + + public V2FrameHandler(DialectRegistry dialectRegistry, + SigningKeyProvider signingKeyProvider) { this.dialectRegistry = dialectRegistry; + this.signingKeyProvider = signingKeyProvider; } @Override @@ -61,7 +65,7 @@ public int computeTotalFrameLength(ByteBuffer buffer, int frameStartIndex, int p } @Override - public Optional tryDecode(ByteBuffer candidateFrame) { + public Optional tryDecode(ByteBuffer candidateFrame) { int frameStartIndex = candidateFrame.position(); int stx = candidateFrame.get(frameStartIndex) & 0xFF; @@ -80,7 +84,7 @@ public Optional tryDecode(ByteBuffer candidateFrame) { int messageId = ByteBufferUtils.readUnsigned24BitLittleEndian(candidateFrame, frameStartIndex + 7); - int minimumPayloadLength = dialectRegistry.minimumPayloadLength(MavlinkVersion.V2, messageId); + int minimumPayloadLength = dialectRegistry.minimumPayloadLength(Version.V2, messageId); if (payloadLength < minimumPayloadLength) { return Optional.empty(); } @@ -91,7 +95,7 @@ public Optional tryDecode(ByteBuffer candidateFrame) { int receivedChecksum = ByteBufferUtils.readUnsignedLittleEndianShort(candidateFrame, crcStartIndex); - int crcExtra = dialectRegistry.crcExtra(MavlinkVersion.V2, messageId); + int crcExtra = dialectRegistry.crcExtra(Version.V2, messageId); int checksum = CrcHelper.computeChecksumFromWritten(candidateFrame, frameStartIndex+1, (HEADER_LENGTH-1) + payloadLength, crcExtra); if (checksum != receivedChecksum) { @@ -101,13 +105,21 @@ public Optional tryDecode(ByteBuffer candidateFrame) { byte[] payload = ByteBufferUtils.copyBytes(candidateFrame, payloadStartIndex, payloadLength); byte[] signature = null; + boolean validated = false; if (signed) { int signatureStartIndex = crcStartIndex + CRC_LENGTH; signature = ByteBufferUtils.copyBytes(candidateFrame, signatureStartIndex, SIGNATURE_LENGTH); + if (signingKeyProvider.canValidate()) { + if (!validateSignature(candidateFrame, frameStartIndex, crcStartIndex, systemId, componentId, signature)) { + return Optional.empty(); + } else { + validated = true; + } + } } - MavlinkFrame frame = new MavlinkFrame(); - frame.setVersion(MavlinkVersion.V2); + Frame frame = new Frame(); + frame.setVersion(Version.V2); frame.setSequence(sequence); frame.setSystemId(systemId); frame.setComponentId(componentId); @@ -119,14 +131,50 @@ public Optional tryDecode(ByteBuffer candidateFrame) { frame.setIncompatibilityFlags(incompatibilityFlags); frame.setCompatibilityFlags(compatibilityFlags); frame.setSignature(signature); + frame.setValidated(validated); return Optional.of(frame); } - private static void updateCrcFromCandidate(X25Crc crc, ByteBuffer candidateFrame, int index, int length) { - int endIndex = index + length; - for (int currentIndex = index; currentIndex < endIndex; currentIndex++) { - crc.update(candidateFrame.get(currentIndex)); + private boolean validateSignature(ByteBuffer candidateFrame, + int frameStartIndex, + int crcStartIndex, + int systemId, + int componentId, + byte[] receivedSignatureBlock) { + + if (receivedSignatureBlock == null || receivedSignatureBlock.length != SIGNATURE_LENGTH) { + return false; + } + + int linkId = receivedSignatureBlock[0] & 0xFF; + long timestamp = readUnsigned48BitLittleEndian(receivedSignatureBlock, 1); + + byte[] signingKey = signingKeyProvider.getSigningKey(systemId, componentId, linkId); + if (signingKey == null || signingKey.length == 0) { + return false; } + + byte[] expectedSignatureBlock = V2SignatureGenerator.buildSignature( + candidateFrame, + frameStartIndex, + crcStartIndex, + linkId, + timestamp, + signingKey + ); + + return Arrays.equals(expectedSignatureBlock, receivedSignatureBlock); + } + + private static long readUnsigned48BitLittleEndian(byte[] source, int offset) { + long value = 0; + value |= (source[offset] & 0xFFL); + value |= ((source[offset + 1] & 0xFFL) << 8); + value |= ((source[offset + 2] & 0xFFL) << 16); + value |= ((source[offset + 3] & 0xFFL) << 24); + value |= ((source[offset + 4] & 0xFFL) << 32); + value |= ((source[offset + 5] & 0xFFL) << 40); + return value; } } diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameSigning.java b/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameSigning.java new file mode 100644 index 0000000..bfcbae5 --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameSigning.java @@ -0,0 +1,111 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.mapsmessaging.mavlink.framing; + +import java.nio.ByteBuffer; +import java.util.Arrays; + +import static io.mapsmessaging.mavlink.framing.V2FrameHandler.CRC_LENGTH; +import static io.mapsmessaging.mavlink.framing.V2FrameHandler.SIGNATURE_LENGTH; + +public final class V2FrameSigning { + + private V2FrameSigning() { + } + + public static ByteBuffer appendSignature(ByteBuffer unsignedFrame, + int linkId, + long timestamp, + byte[] signingKey) { + if (unsignedFrame == null) { + throw new IllegalArgumentException("unsignedFrame must not be null"); + } + if (signingKey == null || signingKey.length != 32) { + throw new IllegalArgumentException("signingKey must be 32 bytes"); + } + + ByteBuffer readOnly = unsignedFrame.duplicate(); + + int frameStartIndex = readOnly.position(); + int frameLimit = readOnly.limit(); + + if (frameLimit - frameStartIndex < 1 + 10 + CRC_LENGTH) { + throw new IllegalArgumentException("Frame too short"); + } + + int crcStartIndex = frameLimit - CRC_LENGTH; + + byte[] signatureBlock = V2SignatureGenerator.buildSignature( + readOnly, + frameStartIndex, + crcStartIndex, + linkId, + timestamp, + signingKey + ); + + ByteBuffer signedFrame = ByteBuffer.allocate((frameLimit - frameStartIndex) + SIGNATURE_LENGTH); + signedFrame.put(readOnly.duplicate()); + signedFrame.put(signatureBlock); + signedFrame.flip(); + return signedFrame; + } + + public static boolean validateSignature(ByteBuffer signedFrame, + int frameStartIndex, + int crcStartIndex, + int systemId, + int componentId, + SigningKeyProvider signingKeyProvider) { + int signatureStartIndex = crcStartIndex + CRC_LENGTH; + + byte[] receivedSignatureBlock = ByteBufferUtils.copyBytes(signedFrame, signatureStartIndex, SIGNATURE_LENGTH); + + int linkId = receivedSignatureBlock[0] & 0xFF; + long timestamp = readUnsigned48BitLittleEndian(receivedSignatureBlock, 1); + + byte[] signingKey = signingKeyProvider.getSigningKey(systemId, componentId, linkId); + if (signingKey == null || signingKey.length != 32) { + return false; + } + + byte[] expectedSignatureBlock = V2SignatureGenerator.buildSignature( + signedFrame, + frameStartIndex, + crcStartIndex, + linkId, + timestamp, + signingKey + ); + + return Arrays.equals(expectedSignatureBlock, receivedSignatureBlock); + } + + private static long readUnsigned48BitLittleEndian(byte[] source, int offset) { + long value = 0; + value |= (source[offset] & 0xFFL); + value |= ((source[offset + 1] & 0xFFL) << 8); + value |= ((source[offset + 2] & 0xFFL) << 16); + value |= ((source[offset + 3] & 0xFFL) << 24); + value |= ((source[offset + 4] & 0xFFL) << 32); + value |= ((source[offset + 5] & 0xFFL) << 40); + return value; + } +} diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/V2SignatureGenerator.java b/src/main/java/io/mapsmessaging/mavlink/framing/V2SignatureGenerator.java new file mode 100644 index 0000000..dc4aa84 --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/framing/V2SignatureGenerator.java @@ -0,0 +1,92 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mapsmessaging.mavlink.framing; + +import java.nio.ByteBuffer; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; + +import static io.mapsmessaging.mavlink.framing.V2FrameHandler.CRC_LENGTH; +import static io.mapsmessaging.mavlink.framing.V2FrameHandler.SIGNATURE_LENGTH; + +public final class V2SignatureGenerator { + + public static byte[] buildSignature(ByteBuffer candidateFrame, + int frameStartIndex, + int crcStartIndex, + int linkId, + long timestamp, + byte[] signingKey) { + + if (signingKey == null || signingKey.length == 0) { + throw new IllegalArgumentException("signingKey must be provided"); + } + + int packetEndExclusive = crcStartIndex + CRC_LENGTH; + int packetLength = packetEndExclusive - frameStartIndex; + + if (packetLength <= 0) { + throw new IllegalArgumentException("Invalid frameStartIndex or crcStartIndex"); + } + + byte[] packetBytes = new byte[packetLength]; + ByteBuffer readOnly = candidateFrame.duplicate(); + readOnly.position(frameStartIndex); + readOnly.get(packetBytes); + + byte[] digest = sha256(packetBytes, signingKey); + byte[] signatureBytes = Arrays.copyOf(digest, 6); + + byte[] signatureBlock = new byte[SIGNATURE_LENGTH]; + signatureBlock[0] = (byte) linkId; + + writeUnsigned48BitLittleEndian(signatureBlock, 1, timestamp); + + System.arraycopy(signatureBytes, 0, signatureBlock, 7, 6); + return signatureBlock; + } + + private static void writeUnsigned48BitLittleEndian(byte[] target, int offset, long value) { + long masked = value & 0xFFFFFFFFFFFFL; + + target[offset] = (byte) (masked); + target[offset + 1] = (byte) (masked >>> 8); + target[offset + 2] = (byte) (masked >>> 16); + target[offset + 3] = (byte) (masked >>> 24); + target[offset + 4] = (byte) (masked >>> 32); + target[offset + 5] = (byte) (masked >>> 40); + } + + private static byte[] sha256(byte[] packetBytes, byte[] signingKey) { + MessageDigest digest; + try { + digest = MessageDigest.getInstance("SHA-256"); + } catch (NoSuchAlgorithmException e) { + throw new IllegalStateException("SHA-256 not available", e); + } + + digest.update(packetBytes); + digest.update(signingKey); + return digest.digest(); + } + + private V2SignatureGenerator() { + } +} diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledField.java b/src/main/java/io/mapsmessaging/mavlink/message/CompiledField.java similarity index 88% rename from src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledField.java rename to src/main/java/io/mapsmessaging/mavlink/message/CompiledField.java index 24b6741..bbb8300 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledField.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/CompiledField.java @@ -21,13 +21,13 @@ import io.mapsmessaging.mavlink.message.fields.AbstractMavlinkFieldCodec; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; import lombok.Data; @Data -public class MavlinkCompiledField { +public class CompiledField { - private MavlinkFieldDefinition fieldDefinition; + private FieldDefinition fieldDefinition; private AbstractMavlinkFieldCodec fieldCodec; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledMessage.java b/src/main/java/io/mapsmessaging/mavlink/message/CompiledMessage.java similarity index 88% rename from src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledMessage.java rename to src/main/java/io/mapsmessaging/mavlink/message/CompiledMessage.java index 268de60..433f20e 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkCompiledMessage.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/CompiledMessage.java @@ -25,12 +25,12 @@ import java.util.List; @Data -public class MavlinkCompiledMessage { +public class CompiledMessage { private int messageId; private String name; - private MavlinkMessageDefinition messageDefinition; - private List compiledFields; + private MessageDefinition messageDefinition; + private List compiledFields; private int payloadSizeBytes; private int minimumPayloadSizeBytes; @@ -53,7 +53,7 @@ public String toString() { .append(messageDefinition.getExtraCrc()) .append("]\n"); - for (MavlinkCompiledField compiledField : compiledFields) { + for (CompiledField compiledField : compiledFields) { builder.append(" ").append(compiledField.toString()).append("\n"); } return builder.toString(); diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkEnumResolver.java b/src/main/java/io/mapsmessaging/mavlink/message/EnumResolver.java similarity index 81% rename from src/main/java/io/mapsmessaging/mavlink/message/MavlinkEnumResolver.java rename to src/main/java/io/mapsmessaging/mavlink/message/EnumResolver.java index 6c368d9..fb50ca2 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkEnumResolver.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/EnumResolver.java @@ -20,23 +20,23 @@ package io.mapsmessaging.mavlink.message; -import io.mapsmessaging.mavlink.message.fields.MavlinkEnumDefinition; -import io.mapsmessaging.mavlink.message.fields.MavlinkEnumEntry; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; +import io.mapsmessaging.mavlink.message.fields.EnumDefinition; +import io.mapsmessaging.mavlink.message.fields.EnumEntry; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Objects; -public final class MavlinkEnumResolver { +public final class EnumResolver { - private MavlinkEnumResolver() { + private EnumResolver() { } public static Object resolveEnumValue( - MavlinkMessageRegistry registry, - MavlinkFieldDefinition field, + MessageRegistry registry, + FieldDefinition field, Object value ) throws IOException { @@ -52,7 +52,7 @@ public static Object resolveEnumValue( throw new IOException("Enum field '" + field.getName() + "' cannot be null"); } - MavlinkEnumDefinition enumDef = registry.getEnumsByName().get(enumName); + EnumDefinition enumDef = registry.getEnumsByName().get(enumName); if (enumDef == null) { throw new IOException("Enum '" + enumName + "' not registered"); } @@ -62,7 +62,7 @@ public static Object resolveEnumValue( } if (value instanceof String s) { - MavlinkEnumEntry entry = enumDef.getByName(s); + EnumEntry entry = enumDef.getByName(s); if (entry == null) { throw new IOException( "Unknown enum value '" + s + "' for enum '" + enumName + "'"); @@ -84,11 +84,11 @@ public static Object resolveEnumValue( int mask = 0; List res = new ArrayList<>(); for (Object element : arr) { - MavlinkEnumEntry entry; + EnumEntry entry; if(element instanceof Number index){ - List entries = enumDef.getByBitmask(index.longValue()); + List entries = enumDef.getByBitmask(index.longValue()); mask = 0; - for(MavlinkEnumEntry mavlinkEnumEntry:entries){ + for(EnumEntry mavlinkEnumEntry:entries){ mask |= mavlinkEnumEntry.getValue(); } res.add(mask); diff --git a/src/main/java/io/mapsmessaging/mavlink/message/Frame.java b/src/main/java/io/mapsmessaging/mavlink/message/Frame.java new file mode 100644 index 0000000..5ca5947 --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/message/Frame.java @@ -0,0 +1,137 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.mapsmessaging.mavlink.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema( + title = "MAVLink Frame", + description = "Decoded MAVLink frame with header, payload, checksum, and optional signature" +) +public class Frame { + + @Schema( + description = "MAVLink protocol version", + example = "V2", + requiredMode = Schema.RequiredMode.REQUIRED + ) + private Version version; + + @Schema( + description = "Packet sequence number", + example = "42", + minimum = "0", + maximum = "255", + requiredMode = Schema.RequiredMode.REQUIRED + ) + private int sequence; + + @Schema( + description = "Source system ID", + example = "1", + minimum = "0", + maximum = "255", + requiredMode = Schema.RequiredMode.REQUIRED + ) + private int systemId; + + @Schema( + description = "Source component ID", + example = "1", + minimum = "0", + maximum = "255", + requiredMode = Schema.RequiredMode.REQUIRED + ) + private int componentId; + + @Schema( + description = "MAVLink message ID", + example = "33", + minimum = "0", + requiredMode = Schema.RequiredMode.REQUIRED + ) + private int messageId; + + @Schema( + description = "Payload length in bytes", + example = "12", + minimum = "0", + maximum = "255", + requiredMode = Schema.RequiredMode.REQUIRED + ) + private int payloadLength; + + @Schema( + description = "Raw payload bytes", + requiredMode = Schema.RequiredMode.REQUIRED + ) + private byte[] payload; + + @Schema( + description = "CRC checksum (X25) as unsigned 16-bit value", + example = "54321", + minimum = "0", + maximum = "65535", + requiredMode = Schema.RequiredMode.REQUIRED + ) + private int checksum; + + @Schema( + description = "True if the frame includes a MAVLink v2 signature", + example = "true", + requiredMode = Schema.RequiredMode.REQUIRED + ) + private boolean signed; + + @Schema( + description = "MAVLink v2 incompatibility flags", + example = "1", + minimum = "0", + maximum = "255", + requiredMode = Schema.RequiredMode.REQUIRED + ) + private byte incompatibilityFlags; + + @Schema( + description = "MAVLink v2 compatibility flags", + example = "0", + minimum = "0", + maximum = "255", + requiredMode = Schema.RequiredMode.REQUIRED + ) + private byte compatibilityFlags; + + @Schema( + description = "MAVLink v2 signature block (13 bytes) if present", + requiredMode = Schema.RequiredMode.NOT_REQUIRED, + nullable = true + ) + private byte[] signature; + + @Schema( + description = "True if CRC and (if present) signature validation succeeded", + example = "true", + requiredMode = Schema.RequiredMode.REQUIRED, + defaultValue = "false" + ) + private boolean validated = false; +} \ No newline at end of file diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkFrameParser.java b/src/main/java/io/mapsmessaging/mavlink/message/FrameParser.java similarity index 93% rename from src/main/java/io/mapsmessaging/mavlink/message/MavlinkFrameParser.java rename to src/main/java/io/mapsmessaging/mavlink/message/FrameParser.java index eb0b953..971032a 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkFrameParser.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/FrameParser.java @@ -21,7 +21,7 @@ import java.util.Arrays; -public class MavlinkFrameParser { +public class FrameParser { private static final int MAVLINK_V1_STX = 0xFE; private static final int MAVLINK_V2_STX = 0xFD; @@ -32,7 +32,7 @@ public class MavlinkFrameParser { private static final int MAVLINK_V2_SIGNATURE_LENGTH = 13; private static final int MAVLINK_V2_SIGNING_FLAG = 0x01; - public MavlinkFrame parse(byte[] frameBytes) { + public Frame parse(byte[] frameBytes) { if (frameBytes == null || frameBytes.length == 0) { throw new IllegalArgumentException("Empty MAVLink frame"); } @@ -48,7 +48,7 @@ public MavlinkFrame parse(byte[] frameBytes) { throw new IllegalArgumentException("Unsupported MAVLink STX byte: 0x" + Integer.toHexString(startOfText)); } - private MavlinkFrame parseV1(byte[] frameBytes) { + private Frame parseV1(byte[] frameBytes) { if (frameBytes.length < MAVLINK_V1_MIN_LENGTH) { throw new IllegalArgumentException("MAVLink v1 frame too short: " + frameBytes.length); } @@ -61,8 +61,8 @@ private MavlinkFrame parseV1(byte[] frameBytes) { ); } - MavlinkFrame frame = new MavlinkFrame(); - frame.setVersion(MavlinkVersion.V1); + Frame frame = new Frame(); + frame.setVersion(Version.V1); int sequence = frameBytes[2] & 0xFF; int systemId = frameBytes[3] & 0xFF; @@ -89,7 +89,7 @@ private MavlinkFrame parseV1(byte[] frameBytes) { return frame; } - private MavlinkFrame parseV2(byte[] frameBytes) { + private Frame parseV2(byte[] frameBytes) { if (frameBytes.length < MAVLINK_V2_MIN_LENGTH) { throw new IllegalArgumentException("MAVLink v2 frame too short: " + frameBytes.length); } @@ -128,8 +128,8 @@ private MavlinkFrame parseV2(byte[] frameBytes) { ); } - MavlinkFrame frame = new MavlinkFrame(); - frame.setVersion(MavlinkVersion.V2); + Frame frame = new Frame(); + frame.setVersion(Version.V2); frame.setSequence(sequence); frame.setSystemId(systemId); frame.setComponentId(componentId); diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkFrame.java b/src/main/java/io/mapsmessaging/mavlink/message/MavlinkFrame.java deleted file mode 100644 index 871ab2c..0000000 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkFrame.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Copyright [ 2020 - 2024 ] Matthew Buckton - * Copyright [ 2024 - 2026 ] MapsMessaging B.V. - * - * Licensed under the Apache License, Version 2.0 with the Commons Clause - * (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * https://commonsclause.com/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.mapsmessaging.mavlink.message; - -import lombok.Data; - -@Data -public class MavlinkFrame { - - private MavlinkVersion version; - private int sequence; - private int systemId; - private int componentId; - private int messageId; - private int payloadLength; - private byte[] payload; - private int checksum; - private boolean signed; - private byte incompatibilityFlags; - private byte compatibilityFlags; - private byte[] signature; -} \ No newline at end of file diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageDefinition.java b/src/main/java/io/mapsmessaging/mavlink/message/MessageDefinition.java similarity index 69% rename from src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageDefinition.java rename to src/main/java/io/mapsmessaging/mavlink/message/MessageDefinition.java index 7d6f600..b6c5735 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageDefinition.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/MessageDefinition.java @@ -19,8 +19,8 @@ package io.mapsmessaging.mavlink.message; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; -import io.mapsmessaging.mavlink.message.fields.MavlinkWireType; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; +import io.mapsmessaging.mavlink.message.fields.WireType; import lombok.Getter; import lombok.Setter; @@ -30,7 +30,7 @@ @Getter @Setter -public class MavlinkMessageDefinition { +public class MessageDefinition { private int messageId; private String name; @@ -39,7 +39,7 @@ public class MavlinkMessageDefinition { /** * Wire-order, immutable after setXmlOrderedFields(). */ - private List fields = List.of(); + private List fields = List.of(); private int extraCrc; @@ -53,29 +53,29 @@ public String toString() { .append(", description=") .append(description) .append("\n"); - for (MavlinkFieldDefinition field : fields) { + for (FieldDefinition field : fields) { builder.append(field.toString()).append("\n"); } return builder.toString(); } - public void setXmlOrderedFields(List xmlOrdered) { + public void setXmlOrderedFields(List xmlOrdered) { if (xmlOrdered == null || xmlOrdered.isEmpty()) { fields = List.of(); computeExtraCrc(); return; } - List ordered = orderForWire(xmlOrdered); + List ordered = orderForWire(xmlOrdered); fields = List.copyOf(ordered); // locked computeExtraCrc(); } - private List orderForWire(List xmlOrdered) { - List base = new ArrayList<>(); - List extensions = new ArrayList<>(); + private List orderForWire(List xmlOrdered) { + List base = new ArrayList<>(); + List extensions = new ArrayList<>(); - for (MavlinkFieldDefinition field : xmlOrdered) { + for (FieldDefinition field : xmlOrdered) { if (field.isExtension()) { extensions.add(field); } else { @@ -83,14 +83,14 @@ private List orderForWire(List x } } - Comparator comparator = Comparator - .comparingInt((MavlinkFieldDefinition f) -> f.getWireType().getSizeInBytes()).reversed() - .thenComparingInt(MavlinkFieldDefinition::getIndex); // xml order tie-breaker + Comparator comparator = Comparator + .comparingInt((FieldDefinition f) -> f.getWireType().getSizeInBytes()).reversed() + .thenComparingInt(FieldDefinition::getIndex); // xml order tie-breaker base.sort(comparator); extensions.sort(comparator); - List ordered = new ArrayList<>(base.size() + extensions.size()); + List ordered = new ArrayList<>(base.size() + extensions.size()); ordered.addAll(base); ordered.addAll(extensions); @@ -103,12 +103,12 @@ private void computeExtraCrc() { crcCharArray(crc, getName().toCharArray()); - for (MavlinkFieldDefinition field : fields) { + for (FieldDefinition field : fields) { if (field.isExtension()) { continue; } - MavlinkWireType fieldType = MavlinkWireType.fromXmlType(field.getType()); + WireType fieldType = WireType.fromXmlType(field.getType()); crcCharArray(crc, fieldType.getWireName().toCharArray()); crcCharArray(crc, field.getName().toCharArray()); if (field.isArray()) { diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageRegistry.java b/src/main/java/io/mapsmessaging/mavlink/message/MessageRegistry.java similarity index 57% rename from src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageRegistry.java rename to src/main/java/io/mapsmessaging/mavlink/message/MessageRegistry.java index bb51cb5..c8e0280 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkMessageRegistry.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/MessageRegistry.java @@ -21,45 +21,45 @@ import com.google.gson.JsonObject; import io.mapsmessaging.mavlink.message.fields.AbstractMavlinkFieldCodec; -import io.mapsmessaging.mavlink.message.fields.MavlinkEnumDefinition; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldCodecFactory; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; -import io.mapsmessaging.mavlink.parser.MavlinkDialectDefinition; -import io.mapsmessaging.mavlink.schema.MavlinkJsonSchemaBuilder; +import io.mapsmessaging.mavlink.message.fields.EnumDefinition; +import io.mapsmessaging.mavlink.message.fields.FieldCodecFactory; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; +import io.mapsmessaging.mavlink.parser.DialectDefinition; +import io.mapsmessaging.mavlink.schema.JsonSchemaBuilder; import lombok.Getter; import lombok.Setter; import java.util.*; @Getter -public class MavlinkMessageRegistry { +public class MessageRegistry { @Setter private String dialectName; - private List compiledMessages; + private List compiledMessages; - private Map compiledMessagesById; + private Map compiledMessagesById; - private Map enumsByName; + private Map enumsByName; private Map jsonSchema; - public static MavlinkMessageRegistry fromDialectDefinition(MavlinkDialectDefinition dialectDefinition) { - MavlinkMessageRegistry registry = new MavlinkMessageRegistry(); + public static MessageRegistry fromDialectDefinition(DialectDefinition dialectDefinition) { + MessageRegistry registry = new MessageRegistry(); registry.setDialectName(dialectDefinition.getName()); - List compiledMessageList = new ArrayList<>(); - Map compiledByIdMap = new HashMap<>(); + List compiledMessageList = new ArrayList<>(); + Map compiledByIdMap = new HashMap<>(); Map schemaMap = new HashMap<>(); - for (MavlinkMessageDefinition messageDefinition : dialectDefinition.getMessages()) { - MavlinkCompiledMessage compiledMessage = compileMessage(messageDefinition); + for (MessageDefinition messageDefinition : dialectDefinition.getMessages()) { + CompiledMessage compiledMessage = compileMessage(messageDefinition); compiledMessageList.add(compiledMessage); compiledByIdMap.put(compiledMessage.getMessageId(), compiledMessage); - schemaMap.put(compiledMessage.getMessageId(), MavlinkJsonSchemaBuilder.buildSchema(compiledMessage, dialectDefinition.getEnumsByName())); + schemaMap.put(compiledMessage.getMessageId(), JsonSchemaBuilder.buildSchema(compiledMessage, dialectDefinition.getEnumsByName())); } registry.setCompiledMessages(compiledMessageList); @@ -70,15 +70,15 @@ public static MavlinkMessageRegistry fromDialectDefinition(MavlinkDialectDefinit return registry; } - private void setEnumsByName(Map stringMavlinkEnumDefinitionHashMap) { + private void setEnumsByName(Map stringMavlinkEnumDefinitionHashMap) { this.enumsByName = Collections.unmodifiableMap(new HashMap<>(stringMavlinkEnumDefinitionHashMap)); } - private void setCompiledMessagesById(Map compiledByIdMap) { + private void setCompiledMessagesById(Map compiledByIdMap) { this.compiledMessagesById = Collections.unmodifiableMap(new HashMap<>(compiledByIdMap)); } - private void setCompiledMessages(List compiledMessageList) { + private void setCompiledMessages(List compiledMessageList) { this.compiledMessages = Collections.unmodifiableList(new ArrayList<>(compiledMessageList)); } @@ -86,19 +86,19 @@ private void setJsonSchema(Map jsonSchemaMap ){ this.jsonSchema = Collections.unmodifiableMap(new HashMap<>(jsonSchemaMap)); } - private static MavlinkCompiledMessage compileMessage(MavlinkMessageDefinition messageDefinition) { - MavlinkCompiledMessage compiledMessage = new MavlinkCompiledMessage(); + private static CompiledMessage compileMessage(MessageDefinition messageDefinition) { + CompiledMessage compiledMessage = new CompiledMessage(); compiledMessage.setMessageId(messageDefinition.getMessageId()); compiledMessage.setName(messageDefinition.getName()); compiledMessage.setMessageDefinition(messageDefinition); - List compiledFields = new ArrayList<>(); + List compiledFields = new ArrayList<>(); int currentOffset = 0; - for (MavlinkFieldDefinition fieldDefinition : messageDefinition.getFields()) { - AbstractMavlinkFieldCodec fieldCodec = MavlinkFieldCodecFactory.createCodec(fieldDefinition); + for (FieldDefinition fieldDefinition : messageDefinition.getFields()) { + AbstractMavlinkFieldCodec fieldCodec = FieldCodecFactory.createCodec(fieldDefinition); - MavlinkCompiledField compiledField = new MavlinkCompiledField(); + CompiledField compiledField = new CompiledField(); compiledField.setFieldDefinition(fieldDefinition); compiledField.setFieldCodec(fieldCodec); compiledField.setOffsetInPayload(currentOffset); diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkVersion.java b/src/main/java/io/mapsmessaging/mavlink/message/Version.java similarity index 96% rename from src/main/java/io/mapsmessaging/mavlink/message/MavlinkVersion.java rename to src/main/java/io/mapsmessaging/mavlink/message/Version.java index cbde5bb..8736469 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MavlinkVersion.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/Version.java @@ -19,6 +19,6 @@ package io.mapsmessaging.mavlink.message; -public enum MavlinkVersion { +public enum Version { V1, V2 } diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/AbstractMavlinkFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/AbstractMavlinkFieldCodec.java index c0738ee..085aaf0 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/AbstractMavlinkFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/AbstractMavlinkFieldCodec.java @@ -24,13 +24,13 @@ public abstract class AbstractMavlinkFieldCodec { - private final MavlinkWireType wireType; + private final WireType wireType; - protected AbstractMavlinkFieldCodec(MavlinkWireType wireType) { + protected AbstractMavlinkFieldCodec(WireType wireType) { this.wireType = wireType; } - public MavlinkWireType getWireType() { + public WireType getWireType() { return wireType; } diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java index c32ffb6..9c9bfcb 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java @@ -45,7 +45,7 @@ public int getSizeInBytes() { public Object decode(ByteBuffer buffer) { buffer.order(ByteOrder.LITTLE_ENDIAN); - if (treatAsString && getWireType() == MavlinkWireType.CHAR) { + if (treatAsString && getWireType() == WireType.CHAR) { byte[] temp = new byte[arrayLength]; buffer.get(temp); int end = 0; @@ -62,7 +62,7 @@ public Object decode(ByteBuffer buffer) { public void encode(ByteBuffer buffer, Object value) { buffer.order(ByteOrder.LITTLE_ENDIAN); - if (treatAsString && getWireType() == MavlinkWireType.CHAR) { + if (treatAsString && getWireType() == WireType.CHAR) { String text = value == null ? "" : value.toString(); byte[] bytes = text.getBytes(); int length = Math.min(bytes.length, arrayLength); diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java index 85ec564..fe0e385 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java @@ -25,7 +25,7 @@ public class CharFieldCodec extends AbstractMavlinkFieldCodec { public CharFieldCodec() { - super(MavlinkWireType.CHAR); + super(WireType.CHAR); } @Override diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/DoubleFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/DoubleFieldCodec.java index 3c617ed..4534e4e 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/DoubleFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/DoubleFieldCodec.java @@ -25,7 +25,7 @@ public class DoubleFieldCodec extends AbstractMavlinkFieldCodec { public DoubleFieldCodec() { - super(MavlinkWireType.DOUBLE); + super(WireType.DOUBLE); } @Override diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkEnumDefinition.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/EnumDefinition.java similarity index 78% rename from src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkEnumDefinition.java rename to src/main/java/io/mapsmessaging/mavlink/message/fields/EnumDefinition.java index bdf3c29..18cc395 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkEnumDefinition.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/EnumDefinition.java @@ -30,7 +30,7 @@ @AllArgsConstructor @NoArgsConstructor -public class MavlinkEnumDefinition { +public class EnumDefinition { @Getter @Setter private String name; @@ -40,21 +40,21 @@ public class MavlinkEnumDefinition { @Getter @Setter private String description; - private List entries = new ArrayList<>(); + private List entries = new ArrayList<>(); - public List getEntries() { + public List getEntries() { return Collections.unmodifiableList(entries); } - public void setEntries(List list) { + public void setEntries(List list) { entries = Collections.unmodifiableList(list); } - public MavlinkEnumEntry getByName(String name) { + public EnumEntry getByName(String name) { if (name == null) { return null; } - for (MavlinkEnumEntry entry : entries) { + for (EnumEntry entry : entries) { if (name.equals(entry.getName())) { return entry; } @@ -66,8 +66,8 @@ public boolean hasEntry(String name) { return getByName(name) != null; } - public MavlinkEnumEntry getByValue(long value) { - for (MavlinkEnumEntry entry : entries) { + public EnumEntry getByValue(long value) { + for (EnumEntry entry : entries) { if (entry.getValue() == value) { return entry; } @@ -75,14 +75,14 @@ public MavlinkEnumEntry getByValue(long value) { return null; } - public List getByBitmask(long mask) { + public List getByBitmask(long mask) { if (!bitmask || mask == 0) { return List.of(); } - List result = new ArrayList<>(); + List result = new ArrayList<>(); - for (MavlinkEnumEntry entry : entries) { + for (EnumEntry entry : entries) { long value = entry.getValue(); if ((mask & value) == value) { result.add(entry); @@ -98,7 +98,7 @@ public String toString() { builder.append(name) .append(", bitmask=").append(bitmask) .append(", description=").append(description).append("\n"); - for (MavlinkEnumEntry entry : entries) { + for (EnumEntry entry : entries) { builder.append(entry.toString()).append("\n"); } return builder.toString(); diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkEnumEntry.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/EnumEntry.java similarity index 97% rename from src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkEnumEntry.java rename to src/main/java/io/mapsmessaging/mavlink/message/fields/EnumEntry.java index c7ee10d..2391172 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkEnumEntry.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/EnumEntry.java @@ -22,7 +22,7 @@ import lombok.Data; @Data -public class MavlinkEnumEntry { +public class EnumEntry { private long value; private String name; private String description; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkFieldCodecFactory.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/FieldCodecFactory.java similarity index 90% rename from src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkFieldCodecFactory.java rename to src/main/java/io/mapsmessaging/mavlink/message/fields/FieldCodecFactory.java index 4e8cfe5..66c453b 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkFieldCodecFactory.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/FieldCodecFactory.java @@ -20,12 +20,12 @@ package io.mapsmessaging.mavlink.message.fields; -public final class MavlinkFieldCodecFactory { +public final class FieldCodecFactory { - private MavlinkFieldCodecFactory() { + private FieldCodecFactory() { } - public static AbstractMavlinkFieldCodec createCodec(MavlinkFieldDefinition fieldDefinition) { + public static AbstractMavlinkFieldCodec createCodec(FieldDefinition fieldDefinition) { String typeString = fieldDefinition.getType(); String baseType = typeString; int arrayLength = 0; @@ -42,7 +42,7 @@ public static AbstractMavlinkFieldCodec createCodec(MavlinkFieldDefinition field AbstractMavlinkFieldCodec scalarCodec = createScalarCodec(baseType); if (arrayLength > 0) { - boolean treatAsString = scalarCodec.getWireType() == MavlinkWireType.CHAR; + boolean treatAsString = scalarCodec.getWireType() == WireType.CHAR; return new ArrayFieldCodec(scalarCodec, arrayLength, treatAsString); } diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkFieldDefinition.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/FieldDefinition.java similarity index 96% rename from src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkFieldDefinition.java rename to src/main/java/io/mapsmessaging/mavlink/message/fields/FieldDefinition.java index 986fac3..5fc864f 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkFieldDefinition.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/FieldDefinition.java @@ -23,7 +23,7 @@ import lombok.Data; @Data -public class MavlinkFieldDefinition { +public class FieldDefinition { private int index; private String type; // XML base type ("uint8_t", "char") private String name; @@ -31,7 +31,7 @@ public class MavlinkFieldDefinition { private String description; private String enumName; - private MavlinkWireType wireType; + private WireType wireType; private boolean extension; private boolean array; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/FloatFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/FloatFieldCodec.java index 58af855..2f2c7eb 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/FloatFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/FloatFieldCodec.java @@ -25,7 +25,7 @@ public class FloatFieldCodec extends AbstractMavlinkFieldCodec { public FloatFieldCodec() { - super(MavlinkWireType.FLOAT); + super(WireType.FLOAT); } @Override diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int16FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int16FieldCodec.java index 8d4e9d2..cf54f7f 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int16FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int16FieldCodec.java @@ -25,7 +25,7 @@ public class Int16FieldCodec extends AbstractMavlinkFieldCodec { public Int16FieldCodec() { - super(MavlinkWireType.INT16); + super(WireType.INT16); } @Override diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int32FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int32FieldCodec.java index afdf39a..1e3a844 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int32FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int32FieldCodec.java @@ -26,7 +26,7 @@ public class Int32FieldCodec extends AbstractMavlinkFieldCodec { public Int32FieldCodec() { - super(MavlinkWireType.INT32); + super(WireType.INT32); } @Override diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int64FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int64FieldCodec.java index 59e91df..137cc8f 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int64FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int64FieldCodec.java @@ -25,7 +25,7 @@ public class Int64FieldCodec extends AbstractMavlinkFieldCodec { public Int64FieldCodec() { - super(MavlinkWireType.INT64); + super(WireType.INT64); } @Override diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int8FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int8FieldCodec.java index e7e4e50..9df3b3c 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int8FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int8FieldCodec.java @@ -25,7 +25,7 @@ public class Int8FieldCodec extends AbstractMavlinkFieldCodec { public Int8FieldCodec() { - super(MavlinkWireType.INT8); + super(WireType.INT8); } @Override diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt16FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt16FieldCodec.java index a8193ff..045198c 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt16FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt16FieldCodec.java @@ -26,7 +26,7 @@ public class UInt16FieldCodec extends AbstractMavlinkFieldCodec { public UInt16FieldCodec() { - super(MavlinkWireType.UINT16); + super(WireType.UINT16); } @Override diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt32FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt32FieldCodec.java index e8d0662..b148487 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt32FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt32FieldCodec.java @@ -25,7 +25,7 @@ public class UInt32FieldCodec extends AbstractMavlinkFieldCodec { public UInt32FieldCodec() { - super(MavlinkWireType.UINT32); + super(WireType.UINT32); } @Override diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt64FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt64FieldCodec.java index 000206f..23ff4e1 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt64FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt64FieldCodec.java @@ -25,7 +25,7 @@ public class UInt64FieldCodec extends AbstractMavlinkFieldCodec { public UInt64FieldCodec() { - super(MavlinkWireType.UINT64); + super(WireType.UINT64); } @Override diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt8FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt8FieldCodec.java index 90dae5e..ccd9975 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt8FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt8FieldCodec.java @@ -26,7 +26,7 @@ public class UInt8FieldCodec extends AbstractMavlinkFieldCodec { public UInt8FieldCodec() { - super(MavlinkWireType.UINT8); + super(WireType.UINT8); } @Override diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkWireType.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/WireType.java similarity index 94% rename from src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkWireType.java rename to src/main/java/io/mapsmessaging/mavlink/message/fields/WireType.java index 5d1c02f..5922320 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/MavlinkWireType.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/WireType.java @@ -21,7 +21,7 @@ import lombok.Getter; -public enum MavlinkWireType { +public enum WireType { INT8(1, "int8_t"), UINT8(1, "uint8_t"), @@ -41,12 +41,12 @@ public enum MavlinkWireType { @Getter private final String wireName; - MavlinkWireType(int sizeInBytes, String wireName) { + WireType(int sizeInBytes, String wireName) { this.sizeInBytes = sizeInBytes; this.wireName = wireName; } - public static MavlinkWireType fromXmlType(String xmlType) { + public static WireType fromXmlType(String xmlType) { if (xmlType == null) { throw new IllegalArgumentException("MAVLink XML type is null"); } diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathMavlinkIncludeResolver.java b/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathIncludeResolver.java similarity index 87% rename from src/main/java/io/mapsmessaging/mavlink/parser/ClasspathMavlinkIncludeResolver.java rename to src/main/java/io/mapsmessaging/mavlink/parser/ClasspathIncludeResolver.java index 98f5af0..8e6389c 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathMavlinkIncludeResolver.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathIncludeResolver.java @@ -19,17 +19,16 @@ package io.mapsmessaging.mavlink.parser; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.Objects; -public class ClasspathMavlinkIncludeResolver implements MavlinkIncludeResolver { +public class ClasspathIncludeResolver implements IncludeResolver { private final ClassLoader classLoader; private final String basePath; - public ClasspathMavlinkIncludeResolver(ClassLoader classLoader, String basePath) { + public ClasspathIncludeResolver(ClassLoader classLoader, String basePath) { this.classLoader = Objects.requireNonNull(classLoader, "classLoader"); this.basePath = Objects.requireNonNull(basePath, "basePath"); } diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkDialectDefinition.java b/src/main/java/io/mapsmessaging/mavlink/parser/DialectDefinition.java similarity index 71% rename from src/main/java/io/mapsmessaging/mavlink/parser/MavlinkDialectDefinition.java rename to src/main/java/io/mapsmessaging/mavlink/parser/DialectDefinition.java index 19c19c1..93fb5a0 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkDialectDefinition.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/DialectDefinition.java @@ -20,17 +20,17 @@ package io.mapsmessaging.mavlink.parser; -import io.mapsmessaging.mavlink.message.MavlinkMessageDefinition; -import io.mapsmessaging.mavlink.message.fields.MavlinkEnumDefinition; +import io.mapsmessaging.mavlink.message.MessageDefinition; +import io.mapsmessaging.mavlink.message.fields.EnumDefinition; import lombok.Data; import java.util.List; import java.util.Map; @Data -public class MavlinkDialectDefinition { +public class DialectDefinition { private String name; - private List messages; - private Map messagesById; - private Map enumsByName; + private List messages; + private Map messagesById; + private Map enumsByName; } diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkDialectLoader.java b/src/main/java/io/mapsmessaging/mavlink/parser/DialectLoader.java similarity index 77% rename from src/main/java/io/mapsmessaging/mavlink/parser/MavlinkDialectLoader.java rename to src/main/java/io/mapsmessaging/mavlink/parser/DialectLoader.java index 5630270..abb114a 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkDialectLoader.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/DialectLoader.java @@ -19,8 +19,8 @@ package io.mapsmessaging.mavlink.parser; -import io.mapsmessaging.mavlink.message.MavlinkMessageDefinition; -import io.mapsmessaging.mavlink.message.fields.MavlinkEnumDefinition; +import io.mapsmessaging.mavlink.message.MessageDefinition; +import io.mapsmessaging.mavlink.message.fields.EnumDefinition; import lombok.RequiredArgsConstructor; import org.w3c.dom.Document; import org.xml.sax.SAXException; @@ -31,9 +31,9 @@ import java.util.*; @RequiredArgsConstructor -public class MavlinkDialectLoader { +public class DialectLoader { - private final MavlinkXmlParser parser; + private final XmlParser parser; /** * Loads a dialect XML, recursively resolving directives. @@ -41,7 +41,7 @@ public class MavlinkDialectLoader { * Merge order: * includes (deep-first) then current document overrides. */ - public MavlinkDialectDefinition load(String dialectName, InputStream rootXml, MavlinkIncludeResolver includeResolver) + public DialectDefinition load(String dialectName, InputStream rootXml, IncludeResolver includeResolver) throws ParserConfigurationException, SAXException, IOException { Objects.requireNonNull(dialectName, "dialectName"); @@ -55,15 +55,15 @@ public MavlinkDialectDefinition load(String dialectName, InputStream rootXml, Ma return loadDocumentRecursive(dialectName, rootDoc, includeResolver, visiting, visited); } - private MavlinkDialectDefinition loadDocumentRecursive( + private DialectDefinition loadDocumentRecursive( String dialectName, Document document, - MavlinkIncludeResolver includeResolver, + IncludeResolver includeResolver, Set visiting, Set visited) throws ParserConfigurationException, SAXException, IOException { // Start with an empty dialect we will fill by merging includes + current doc - MavlinkDialectDefinition merged = emptyDialect(dialectName); + DialectDefinition merged = emptyDialect(dialectName); // 1) Load includes first (depth-first) List includes = parser.parseIncludes(document); @@ -80,7 +80,7 @@ private MavlinkDialectDefinition loadDocumentRecursive( throw new IOException("Unable to resolve : " + includeName); } Document includeDoc = parser.parseDocument(includeStream); - MavlinkDialectDefinition includeDialect = + DialectDefinition includeDialect = loadDocumentRecursive(dialectName, includeDoc, includeResolver, visiting, visited); mergeInto(merged, includeDialect); } finally { @@ -90,7 +90,7 @@ private MavlinkDialectDefinition loadDocumentRecursive( } // 2) Parse current document and overlay it (current wins) - MavlinkDialectDefinition current = parser.parse(document, dialectName); + DialectDefinition current = parser.parse(document, dialectName); mergeInto(merged, current); // 3) Normalize lists/maps once at the end @@ -99,8 +99,8 @@ private MavlinkDialectDefinition loadDocumentRecursive( return merged; } - private MavlinkDialectDefinition emptyDialect(String dialectName) { - MavlinkDialectDefinition def = new MavlinkDialectDefinition(); + private DialectDefinition emptyDialect(String dialectName) { + DialectDefinition def = new DialectDefinition(); def.setName(dialectName); def.setEnumsByName(new LinkedHashMap<>()); def.setMessages(new ArrayList<>()); @@ -111,14 +111,14 @@ private MavlinkDialectDefinition emptyDialect(String dialectName) { /** * Merge source into target. Target wins on conflicts (because caller controls order). */ - private void mergeInto(MavlinkDialectDefinition target, MavlinkDialectDefinition source) { + private void mergeInto(DialectDefinition target, DialectDefinition source) { if (source == null) { return; } // Enums by name if (source.getEnumsByName() != null) { - for (Map.Entry e : source.getEnumsByName().entrySet()) { + for (Map.Entry e : source.getEnumsByName().entrySet()) { if (e.getKey() == null) { continue; } @@ -128,7 +128,7 @@ private void mergeInto(MavlinkDialectDefinition target, MavlinkDialectDefinition // Messages by id (canonical) if (source.getMessagesById() != null) { - for (Map.Entry e : source.getMessagesById().entrySet()) { + for (Map.Entry e : source.getMessagesById().entrySet()) { if (e.getKey() == null || e.getKey() < 0) { continue; } @@ -140,11 +140,11 @@ private void mergeInto(MavlinkDialectDefinition target, MavlinkDialectDefinition /** * Rebuild the messages list from messagesById, in id order, stable. */ - private void normalize(MavlinkDialectDefinition def) { + private void normalize(DialectDefinition def) { List ids = new ArrayList<>(def.getMessagesById().keySet()); ids.sort(Integer::compareTo); - List messages = new ArrayList<>(ids.size()); + List messages = new ArrayList<>(ids.size()); for (Integer id : ids) { messages.add(def.getMessagesById().get(id)); } diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkExtraCrcCalculator.java b/src/main/java/io/mapsmessaging/mavlink/parser/ExtraCrcCalculator.java similarity index 78% rename from src/main/java/io/mapsmessaging/mavlink/parser/MavlinkExtraCrcCalculator.java rename to src/main/java/io/mapsmessaging/mavlink/parser/ExtraCrcCalculator.java index c213134..7502df0 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkExtraCrcCalculator.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/ExtraCrcCalculator.java @@ -19,25 +19,25 @@ package io.mapsmessaging.mavlink.parser; -import io.mapsmessaging.mavlink.message.MavlinkMessageDefinition; +import io.mapsmessaging.mavlink.message.MessageDefinition; import io.mapsmessaging.mavlink.message.X25Crc; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; import java.nio.charset.StandardCharsets; import java.util.List; -public final class MavlinkExtraCrcCalculator { +public final class ExtraCrcCalculator { - private MavlinkExtraCrcCalculator() { + private ExtraCrcCalculator() { } - public static int computeExtraCrc(MavlinkMessageDefinition messageDefinition) { + public static int computeExtraCrc(MessageDefinition messageDefinition) { X25Crc crc = new X25Crc(); String messageName = messageDefinition.getName(); - List wireOrderedFields = messageDefinition.getFields(); + List wireOrderedFields = messageDefinition.getFields(); accumulateTokenWithSpace(crc, messageName); - for (MavlinkFieldDefinition field : wireOrderedFields) { + for (FieldDefinition field : wireOrderedFields) { if (field.isExtension()) { continue; } diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkIncludeResolver.java b/src/main/java/io/mapsmessaging/mavlink/parser/IncludeResolver.java similarity index 95% rename from src/main/java/io/mapsmessaging/mavlink/parser/MavlinkIncludeResolver.java rename to src/main/java/io/mapsmessaging/mavlink/parser/IncludeResolver.java index 1bc0acf..1b525e8 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkIncludeResolver.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/IncludeResolver.java @@ -23,6 +23,6 @@ import java.io.InputStream; @FunctionalInterface -public interface MavlinkIncludeResolver { +public interface IncludeResolver { InputStream open(String includeName) throws IOException; } diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkXmlParser.java b/src/main/java/io/mapsmessaging/mavlink/parser/XmlParser.java similarity index 75% rename from src/main/java/io/mapsmessaging/mavlink/parser/MavlinkXmlParser.java rename to src/main/java/io/mapsmessaging/mavlink/parser/XmlParser.java index 519b3b7..0fa517f 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/MavlinkXmlParser.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/XmlParser.java @@ -19,11 +19,11 @@ package io.mapsmessaging.mavlink.parser; -import io.mapsmessaging.mavlink.message.MavlinkMessageDefinition; -import io.mapsmessaging.mavlink.message.fields.MavlinkEnumDefinition; -import io.mapsmessaging.mavlink.message.fields.MavlinkEnumEntry; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; -import io.mapsmessaging.mavlink.message.fields.MavlinkWireType; +import io.mapsmessaging.mavlink.message.MessageDefinition; +import io.mapsmessaging.mavlink.message.fields.EnumDefinition; +import io.mapsmessaging.mavlink.message.fields.EnumEntry; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; +import io.mapsmessaging.mavlink.message.fields.WireType; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -40,18 +40,18 @@ import java.util.List; import java.util.Map; -public class MavlinkXmlParser { +public class XmlParser { - public MavlinkDialectDefinition parse(InputStream inputStream, String dialectName) + public DialectDefinition parse(InputStream inputStream, String dialectName) throws ParserConfigurationException, SAXException, IOException { Document document = parseDocument(inputStream); return parse(document, dialectName); } - public MavlinkDialectDefinition parse(Document document, String dialectName) { - Map enumsByName = parseEnums(document); - List messages = parseMessages(document); - Map messagesById = indexMessagesById(messages); + public DialectDefinition parse(Document document, String dialectName) { + Map enumsByName = parseEnums(document); + List messages = parseMessages(document); + Map messagesById = indexMessagesById(messages); return buildDialectDefinition(dialectName, enumsByName, messages, messagesById); } @@ -86,13 +86,13 @@ protected Document parseDocument(InputStream inputStream) return document; } - private MavlinkDialectDefinition buildDialectDefinition( + private DialectDefinition buildDialectDefinition( String dialectName, - Map enumsByName, - List messages, - Map messagesById) { + Map enumsByName, + List messages, + Map messagesById) { - MavlinkDialectDefinition dialectDefinition = new MavlinkDialectDefinition(); + DialectDefinition dialectDefinition = new DialectDefinition(); dialectDefinition.setName(dialectName); dialectDefinition.setEnumsByName(enumsByName); dialectDefinition.setMessages(messages); @@ -100,16 +100,16 @@ private MavlinkDialectDefinition buildDialectDefinition( return dialectDefinition; } - private Map indexMessagesById(List messageDefinitions) { - Map byId = new LinkedHashMap<>(); - for (MavlinkMessageDefinition messageDefinition : messageDefinitions) { + private Map indexMessagesById(List messageDefinitions) { + Map byId = new LinkedHashMap<>(); + for (MessageDefinition messageDefinition : messageDefinitions) { byId.put(messageDefinition.getMessageId(), messageDefinition); } return byId; } - private Map parseEnums(Document document) { - Map enumMap = new LinkedHashMap<>(); + private Map parseEnums(Document document) { + Map enumMap = new LinkedHashMap<>(); NodeList enumNodes = document.getElementsByTagName("enum"); for (int i = 0; i < enumNodes.getLength(); i++) { Node node = enumNodes.item(i); @@ -117,7 +117,7 @@ private Map parseEnums(Document document) { continue; } - MavlinkEnumDefinition enumDefinition = parseEnum(enumElement); + EnumDefinition enumDefinition = parseEnum(enumElement); if (enumDefinition.getName() != null && !enumDefinition.getName().isEmpty()) { enumMap.put(enumDefinition.getName(), enumDefinition); } @@ -126,8 +126,8 @@ private Map parseEnums(Document document) { return enumMap; } - private MavlinkEnumDefinition parseEnum(Element enumElement) { - MavlinkEnumDefinition def = new MavlinkEnumDefinition(); + private EnumDefinition parseEnum(Element enumElement) { + EnumDefinition def = new EnumDefinition(); def.setName(enumElement.getAttribute("name")); def.setBitmask(parseBitmask(enumElement.getAttribute("bitmask"))); @@ -141,8 +141,8 @@ private boolean parseBitmask(String bitmaskValue) { return "true".equalsIgnoreCase(bitmaskValue) || "1".equals(bitmaskValue); } - private List parseEnumEntries(Element enumElement) { - List entries = new ArrayList<>(); + private List parseEnumEntries(Element enumElement) { + List entries = new ArrayList<>(); NodeList children = enumElement.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { @@ -160,8 +160,8 @@ private List parseEnumEntries(Element enumElement) { return entries; } - private MavlinkEnumEntry parseEnumEntry(Element entryElement) { - MavlinkEnumEntry entry = new MavlinkEnumEntry(); + private EnumEntry parseEnumEntry(Element entryElement) { + EnumEntry entry = new EnumEntry(); String valueAttribute = entryElement.getAttribute("value"); if (valueAttribute != null && !valueAttribute.isEmpty()) { @@ -173,8 +173,8 @@ private MavlinkEnumEntry parseEnumEntry(Element entryElement) { return entry; } - private List parseMessages(Document document) { - List messages = new ArrayList<>(); + private List parseMessages(Document document) { + List messages = new ArrayList<>(); NodeList messageNodes = document.getElementsByTagName("message"); for (int i = 0; i < messageNodes.getLength(); i++) { @@ -188,20 +188,20 @@ private List parseMessages(Document document) { return messages; } - private MavlinkMessageDefinition parseMessage(Element messageElement) { - MavlinkMessageDefinition messageDefinition = new MavlinkMessageDefinition(); + private MessageDefinition parseMessage(Element messageElement) { + MessageDefinition messageDefinition = new MessageDefinition(); messageDefinition.setMessageId(parseIntAttribute(messageElement, "id")); messageDefinition.setName(messageElement.getAttribute("name")); messageDefinition.setDescription(getFirstChildTextContent(messageElement, "description")); - List fields = parseMessageFields(messageElement); + List fields = parseMessageFields(messageElement); messageDefinition.setXmlOrderedFields(fields); return messageDefinition; } - private List parseMessageFields(Element messageElement) { - List fieldDefinitions = new ArrayList<>(); + private List parseMessageFields(Element messageElement) { + List fieldDefinitions = new ArrayList<>(); NodeList childNodes = messageElement.getChildNodes(); int fieldIndex = 0; @@ -230,8 +230,8 @@ private List parseMessageFields(Element messageElement) return fieldDefinitions; } - private MavlinkFieldDefinition parseField(Element fieldElement, int fieldIndex, boolean inExtensions) { - MavlinkFieldDefinition fieldDefinition = new MavlinkFieldDefinition(); + private FieldDefinition parseField(Element fieldElement, int fieldIndex, boolean inExtensions) { + FieldDefinition fieldDefinition = new FieldDefinition(); fieldDefinition.setIndex(fieldIndex); String rawType = fieldElement.getAttribute("type"); @@ -245,7 +245,7 @@ private MavlinkFieldDefinition parseField(Element fieldElement, int fieldIndex, fieldDefinition.setUnits(fieldElement.getAttribute("units")); fieldDefinition.setDescription(safeText(fieldElement)); - fieldDefinition.setWireType(MavlinkWireType.fromXmlType(rawType)); + fieldDefinition.setWireType(WireType.fromXmlType(rawType)); fieldDefinition.setExtension(inExtensions); String enumName = fieldElement.getAttribute("enum"); diff --git a/src/main/java/io/mapsmessaging/mavlink/schema/MavlinkJsonSchemaBuilder.java b/src/main/java/io/mapsmessaging/mavlink/schema/JsonSchemaBuilder.java similarity index 75% rename from src/main/java/io/mapsmessaging/mavlink/schema/MavlinkJsonSchemaBuilder.java rename to src/main/java/io/mapsmessaging/mavlink/schema/JsonSchemaBuilder.java index 3379311..6ddbc91 100644 --- a/src/main/java/io/mapsmessaging/mavlink/schema/MavlinkJsonSchemaBuilder.java +++ b/src/main/java/io/mapsmessaging/mavlink/schema/JsonSchemaBuilder.java @@ -21,23 +21,23 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; -import io.mapsmessaging.mavlink.message.MavlinkCompiledField; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; -import io.mapsmessaging.mavlink.message.fields.MavlinkEnumDefinition; -import io.mapsmessaging.mavlink.message.fields.MavlinkEnumEntry; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; -import io.mapsmessaging.mavlink.message.fields.MavlinkWireType; +import io.mapsmessaging.mavlink.message.CompiledField; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.fields.EnumDefinition; +import io.mapsmessaging.mavlink.message.fields.EnumEntry; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; +import io.mapsmessaging.mavlink.message.fields.WireType; import java.util.Map; -public final class MavlinkJsonSchemaBuilder { +public final class JsonSchemaBuilder { - private MavlinkJsonSchemaBuilder() { + private JsonSchemaBuilder() { } public static JsonObject buildSchema( - MavlinkCompiledMessage message, - Map enumsByName) { + CompiledMessage message, + Map enumsByName) { JsonObject schema = new JsonObject(); schema.addProperty("$schema", "https://json-schema.org/draft/2020-12/schema"); @@ -49,8 +49,8 @@ public static JsonObject buildSchema( JsonObject properties = new JsonObject(); JsonArray required = new JsonArray(); - for (MavlinkCompiledField compiledField : message.getCompiledFields()) { - MavlinkFieldDefinition field = compiledField.getFieldDefinition(); + for (CompiledField compiledField : message.getCompiledFields()) { + FieldDefinition field = compiledField.getFieldDefinition(); JsonObject fieldSchema = buildFieldSchema(field, enumsByName); properties.add(field.getName(), fieldSchema); @@ -73,8 +73,8 @@ public static JsonObject buildSchema( } private static JsonObject buildFieldSchema( - MavlinkFieldDefinition field, - Map enumsByName) { + FieldDefinition field, + Map enumsByName) { JsonObject schema = new JsonObject(); @@ -82,7 +82,7 @@ private static JsonObject buildFieldSchema( schema.addProperty("description", field.getDescription()); } - MavlinkWireType wireType = field.getWireType(); + WireType wireType = field.getWireType(); // char[N] → string if (field.isArray() && wireType.isChar()) { @@ -107,11 +107,11 @@ private static JsonObject buildFieldSchema( } private static JsonObject scalarSchema( - MavlinkFieldDefinition field, - Map enumsByName) { + FieldDefinition field, + Map enumsByName) { JsonObject schema = new JsonObject(); - MavlinkWireType wireType = field.getWireType(); + WireType wireType = field.getWireType(); if (wireType.isFloat() || wireType.isDouble()) { schema.addProperty("type", "number"); @@ -120,7 +120,7 @@ private static JsonObject scalarSchema( } if (field.getEnumName() != null) { - MavlinkEnumDefinition enumDef = enumsByName.get(field.getEnumName()); + EnumDefinition enumDef = enumsByName.get(field.getEnumName()); if (enumDef != null) { applyEnum(schema, enumDef); } @@ -131,7 +131,7 @@ private static JsonObject scalarSchema( private static void applyEnum( JsonObject schema, - MavlinkEnumDefinition enumDef) { + EnumDefinition enumDef) { schema.addProperty("x-enum-name", enumDef.getName()); @@ -142,7 +142,7 @@ private static void applyEnum( } JsonArray oneOf = new JsonArray(); - for (MavlinkEnumEntry entry : enumDef.getEntries()) { + for (EnumEntry entry : enumDef.getEntries()) { JsonObject option = new JsonObject(); option.addProperty("const", entry.getValue()); option.addProperty("title", entry.getName()); diff --git a/src/main/java/io/mapsmessaging/mavlink/signing/MapSigningKeyProvider.java b/src/main/java/io/mapsmessaging/mavlink/signing/MapSigningKeyProvider.java new file mode 100644 index 0000000..7c7f851 --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/signing/MapSigningKeyProvider.java @@ -0,0 +1,63 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.mapsmessaging.mavlink.signing; + +import io.mapsmessaging.mavlink.framing.SigningKeyProvider; +import lombok.Value; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public class MapSigningKeyProvider implements SigningKeyProvider { + + private final Map signingKeys; + + public MapSigningKeyProvider() { + signingKeys = new ConcurrentHashMap<>(); + } + + public void register(int systemId, int componentId, int linkId, byte[] signature) { + SigningKey signingKey = new SigningKey(systemId, componentId, linkId); + signingKeys.put(signingKey, signature); + } + + public void unregister(int systemId, int componentId, int linkId) { + signingKeys.remove(new SigningKey(systemId, componentId, linkId)); + + } + + @Override + public boolean canValidate() { + return true; + } + + @Override + public byte[] getSigningKey(int systemId, int componentId, int linkId) { + SigningKey signingKey = new SigningKey(systemId, componentId, linkId); + return signingKeys.get(signingKey); + } + + @Value + private static class SigningKey{ + int systemId; + int componentId; + int linkId; + } +} \ No newline at end of file diff --git a/src/main/java/io/mapsmessaging/mavlink/signing/NoSigningKeyProvider.java b/src/main/java/io/mapsmessaging/mavlink/signing/NoSigningKeyProvider.java new file mode 100644 index 0000000..47199ef --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/signing/NoSigningKeyProvider.java @@ -0,0 +1,34 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.mapsmessaging.mavlink.signing; + +import io.mapsmessaging.mavlink.framing.SigningKeyProvider; + +public class NoSigningKeyProvider implements SigningKeyProvider { + @Override + public boolean canValidate() { + return false; + } + + @Override + public byte[] getSigningKey(int systemId, int componentId, int linkId) { + return new byte[0]; + } +} diff --git a/src/main/java/io/mapsmessaging/mavlink/signing/StaticSigningKeyProvider.java b/src/main/java/io/mapsmessaging/mavlink/signing/StaticSigningKeyProvider.java new file mode 100644 index 0000000..4d275c9 --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/signing/StaticSigningKeyProvider.java @@ -0,0 +1,50 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.mapsmessaging.mavlink.signing; + + +import io.mapsmessaging.mavlink.framing.SigningKeyProvider; + +import java.util.Arrays; + +public final class StaticSigningKeyProvider implements SigningKeyProvider { + + private final byte[] signingKey; + + public StaticSigningKeyProvider(byte[] signingKey) { + if (signingKey == null) { + throw new IllegalArgumentException("signingKey must not be null"); + } + if (signingKey.length != 32) { + throw new IllegalArgumentException("signingKey must be 32 bytes"); + } + this.signingKey = Arrays.copyOf(signingKey, signingKey.length); + } + + @Override + public boolean canValidate() { + return true; + } + + @Override + public byte[] getSigningKey(int systemId, int componentId, int linkId) { + return Arrays.copyOf(signingKey, signingKey.length); + } +} diff --git a/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java b/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java index b544bed..f558f3f 100644 --- a/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java @@ -19,12 +19,12 @@ package io.mapsmessaging.mavlink; -import io.mapsmessaging.mavlink.message.MavlinkCompiledField; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; -import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; -import io.mapsmessaging.mavlink.message.fields.MavlinkEnumDefinition; -import io.mapsmessaging.mavlink.message.fields.MavlinkEnumEntry; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; +import io.mapsmessaging.mavlink.message.CompiledField; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.MessageRegistry; +import io.mapsmessaging.mavlink.message.fields.EnumDefinition; +import io.mapsmessaging.mavlink.message.fields.EnumEntry; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; import org.junit.jupiter.api.Test; import java.io.IOException; @@ -49,18 +49,18 @@ static final class RandomValueFactory { protected RandomValueFactory() {} static Map buildValues( - MavlinkMessageRegistry registry, - MavlinkCompiledMessage msg, + MessageRegistry registry, + CompiledMessage msg, MavlinkRoundTripAllMessagesTest.ExtensionMode extensionMode, long baseSeed ) throws IOException { Map values = new LinkedHashMap<>(); - List fields = msg.getCompiledFields(); + List fields = msg.getCompiledFields(); for (int i = 0; i < fields.size(); i++) { - MavlinkCompiledField cf = fields.get(i); - MavlinkFieldDefinition fd = MavlinkTestSupport.fieldDefinition(cf); + CompiledField cf = fields.get(i); + FieldDefinition fd = MavlinkTestSupport.fieldDefinition(cf); if (fd.isExtension() && extensionMode == MavlinkRoundTripAllMessagesTest.ExtensionMode.OMIT_ALL) { continue; @@ -82,9 +82,9 @@ static Map buildValues( return values; } - static MavlinkFieldDefinition fieldByName(MavlinkCompiledMessage msg, String fieldName) { - for (MavlinkCompiledField cf : msg.getCompiledFields()) { - MavlinkFieldDefinition fd = MavlinkTestSupport.fieldDefinition(cf); + static FieldDefinition fieldByName(CompiledMessage msg, String fieldName) { + for (CompiledField cf : msg.getCompiledFields()) { + FieldDefinition fd = MavlinkTestSupport.fieldDefinition(cf); if (fieldName.equals(fd.getName())) { return fd; } @@ -93,9 +93,9 @@ static MavlinkFieldDefinition fieldByName(MavlinkCompiledMessage msg, String fie } protected static Object generateValueForField( - MavlinkMessageRegistry registry, + MessageRegistry registry, int messageId, - MavlinkFieldDefinition fd, + FieldDefinition fd, int fieldIndex, long baseSeed ) throws IOException { @@ -117,10 +117,10 @@ protected static Object generateValueForField( return generateScalar(registry, fd, random); } - protected static Object generateScalar(MavlinkMessageRegistry registry, MavlinkFieldDefinition fd, Random random) throws IOException { + protected static Object generateScalar(MessageRegistry registry, FieldDefinition fd, Random random) throws IOException { String enumName = fd.getEnumName(); if (enumName != null && !enumName.isEmpty()) { - MavlinkEnumDefinition def = registry.getEnumsByName().get(enumName); + EnumDefinition def = registry.getEnumsByName().get(enumName); if (def != null && def.getEntries() != null && !def.getEntries().isEmpty()) { if (def.isBitmask()) { return pickBitmask(def, random); @@ -155,25 +155,25 @@ protected static Object generateScalar(MavlinkMessageRegistry registry, MavlinkF }; } - protected static long pickEnumValue(MavlinkEnumDefinition def, Random random) { - List entries = def.getEntries(); - MavlinkEnumEntry entry = entries.get(random.nextInt(entries.size())); + protected static long pickEnumValue(EnumDefinition def, Random random) { + List entries = def.getEntries(); + EnumEntry entry = entries.get(random.nextInt(entries.size())); return entry.getValue(); } - protected static long pickBitmask(MavlinkEnumDefinition def, Random random) { - List entries = def.getEntries(); + protected static long pickBitmask(EnumDefinition def, Random random) { + List entries = def.getEntries(); int count = Math.min(entries.size(), 1 + random.nextInt(3)); long mask = 0L; for (int i = 0; i < count; i++) { - MavlinkEnumEntry entry = entries.get(random.nextInt(entries.size())); + EnumEntry entry = entries.get(random.nextInt(entries.size())); mask |= entry.getValue(); } return mask; } - protected static boolean isCharType(MavlinkFieldDefinition fd) { + protected static boolean isCharType(FieldDefinition fd) { String type = normalizeType(fd.getType()); return "char".equals(type); } @@ -253,10 +253,10 @@ static final class ValueAssertions { protected ValueAssertions() {} static void assertFieldEquals( - MavlinkFieldDefinition fd, + FieldDefinition fd, Object expected, Object actual, - MavlinkCompiledMessage msg + CompiledMessage msg ) { String type = RandomValueFactory.normalizeType(fd.getType()); diff --git a/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java b/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java index dc5343c..dd446fe 100644 --- a/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java @@ -19,7 +19,7 @@ package io.mapsmessaging.mavlink; -import io.mapsmessaging.mavlink.message.MavlinkFrame; +import io.mapsmessaging.mavlink.message.Frame; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -284,10 +284,10 @@ void validateTruncatedPackets() throws Exception { for (int i = 0; i < frames.size(); i++) { ByteBuffer input = ByteBuffer.wrap(toByteArray(frames.get(i))); - Optional frame = frameCodec.tryUnpackFrame(input); + Optional frame = frameCodec.tryUnpackFrame(input); Assertions.assertTrue(frame.isPresent(), "Frame #" + i + " did not unpack. Remaining=" + input.remaining()); - MavlinkFrame payloadFrame = frame.get(); + Frame payloadFrame = frame.get(); Map obj = payloadCodec.parsePayload(payloadFrame.getMessageId(), payloadFrame.getPayload()); Assertions.assertTrue(!obj.isEmpty()); } diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java index 9963b40..f2739b0 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java @@ -19,41 +19,69 @@ package io.mapsmessaging.mavlink; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; -import io.mapsmessaging.mavlink.message.MavlinkFrame; -import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; -import io.mapsmessaging.mavlink.message.MavlinkVersion; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.Frame; +import io.mapsmessaging.mavlink.message.MessageRegistry; +import io.mapsmessaging.mavlink.message.Version; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; +import io.mapsmessaging.mavlink.signing.MapSigningKeyProvider; import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.TestFactory; import java.nio.ByteBuffer; import java.util.Map; import java.util.Optional; +import java.util.Random; import java.util.stream.Stream; import static org.junit.jupiter.api.Assertions.*; class MavlinkFrameRoundTripAllMessagesTest extends BaseRoudTripTest { + private static final byte[] TEST_SIGNING_KEY = buildTestSigningKey(); + + private static byte[] buildTestSigningKey() { + Random random = new Random(); + byte[] key = new byte[32]; + random.nextBytes(key); + return key; + } + @TestFactory - Stream allMessages_frame_roundTrip_v2_fullPayload() throws Exception { + Stream allMessages_frame_roundTrip_v2_unsigned_fullPayload() throws Exception { + return buildRoundTripTests(false); + } + + @TestFactory + Stream allMessages_frame_roundTrip_v2_signed_fullPayload() throws Exception { + return buildRoundTripTests(true); + } + + private Stream buildRoundTripTests(boolean signFrames) throws Exception { MavlinkCodec payloadCodec = MavlinkTestSupport.codec(); - MavlinkFrameCodec frameCodec = new MavlinkFrameCodec(payloadCodec); - MavlinkMessageRegistry registry = payloadCodec.getRegistry(); + + + MapSigningKeyProvider signingKeyProvider = new MapSigningKeyProvider(); + signingKeyProvider.register (1, 1, 0, TEST_SIGNING_KEY); + MavlinkFrameCodec frameCodec = new MavlinkFrameCodec(payloadCodec, signingKeyProvider); + + MessageRegistry registry = payloadCodec.getRegistry(); + + String suffix = signFrames ? "signed" : "unsigned"; return registry.getCompiledMessages().stream() .map(msg -> DynamicTest.dynamicTest( - msg.getMessageId() + " " + msg.getName(), - () -> frameRoundTripForMessageV2(frameCodec, payloadCodec, registry, msg) + msg.getMessageId() + " " + msg.getName() + " (" + suffix + ")", + () -> frameRoundTripForMessageV2(frameCodec, payloadCodec, registry, msg, signFrames) )); } private static void frameRoundTripForMessageV2( MavlinkFrameCodec frameCodec, MavlinkCodec payloadCodec, - MavlinkMessageRegistry registry, - MavlinkCompiledMessage msg + MessageRegistry registry, + CompiledMessage msg, + boolean signFrame ) throws Exception { Map values = @@ -62,8 +90,8 @@ private static void frameRoundTripForMessageV2( byte[] payload = payloadCodec.encodePayload(msg.getMessageId(), values); assertNotNull(payload); - MavlinkFrame frame = new MavlinkFrame(); - frame.setVersion(MavlinkVersion.V2); + Frame frame = new Frame(); + frame.setVersion(Version.V2); frame.setSequence(42); frame.setSystemId(1); frame.setComponentId(1); @@ -71,8 +99,8 @@ private static void frameRoundTripForMessageV2( frame.setPayload(payload); frame.setPayloadLength(payload.length); - frame.setSigned(false); - frame.setIncompatibilityFlags((byte) 0); + frame.setSigned(signFrame); + frame.setIncompatibilityFlags(signFrame ? (byte) 1 : (byte) 0); frame.setCompatibilityFlags((byte) 0); frame.setSignature(null); @@ -84,10 +112,22 @@ private static void frameRoundTripForMessageV2( ByteBuffer networkOwned = ByteBuffer.allocate(out.remaining() + 16); networkOwned.put(out); networkOwned.flip(); - Optional decodedOpt = frameCodec.tryUnpackFrame(networkOwned); + + Optional decodedOpt = frameCodec.tryUnpackFrame(networkOwned); assertTrue(decodedOpt.isPresent(), "Expected to decode a frame"); - MavlinkFrame decoded = decodedOpt.get(); + Frame decoded = decodedOpt.get(); + + if (signFrame) { + assertTrue(decoded.isSigned(), "Expected signed frame"); + assertTrue(decoded.isValidated(), "Expected signature validation to succeed"); + assertNotNull(decoded.getSignature(), "Expected signature bytes"); + assertEquals(13, decoded.getSignature().length, "Expected 13-byte MAVLink v2 signature block"); + } else { + assertFalse(decoded.isSigned(), "Expected unsigned frame"); + assertFalse(decoded.isValidated(), "Expected validated=false for unsigned frame"); + assertNull(decoded.getSignature(), "Expected signature to be null for unsigned frame"); + } assertEquals(frame.getVersion(), decoded.getVersion()); assertEquals(frame.getSequence(), decoded.getSequence()); @@ -106,8 +146,8 @@ private static void frameRoundTripForMessageV2( Object actual = output.get(fieldName); assertNotNull(actual, "Missing field after decode: " + fieldName); - MavlinkFieldDefinition fd = RandomValueFactory.fieldByName(msg, fieldName); - ValueAssertions.assertFieldEquals(fd, expected, actual, msg); + FieldDefinition fieldDefinition = RandomValueFactory.fieldByName(msg, fieldName); + ValueAssertions.assertFieldEquals(fieldDefinition, expected, actual, msg); } } } diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java index a3cfad9..73018ec 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java @@ -28,8 +28,9 @@ import com.networknt.schema.JsonSchemaFactory; import com.networknt.schema.SpecVersion; import com.networknt.schema.ValidationMessage; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; -import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.MessageRegistry; +import io.mapsmessaging.mavlink.schema.JsonSchemaBuilder; import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.TestFactory; @@ -47,7 +48,7 @@ class MavlinkPayloadJsonSchemaValidationTest extends BaseRoudTripTest { @TestFactory Stream allMessages_payload_toJson_validatesAgainstSchema() throws Exception { MavlinkCodec payloadCodec = MavlinkTestSupport.codec(); - MavlinkMessageRegistry registry = payloadCodec.getRegistry(); + MessageRegistry registry = payloadCodec.getRegistry(); return registry.getCompiledMessages().stream() .map(msg -> DynamicTest.dynamicTest( @@ -58,8 +59,8 @@ Stream allMessages_payload_toJson_validatesAgainstSchema() throws E private static void payloadToJsonValidates( MavlinkCodec payloadCodec, - MavlinkMessageRegistry registry, - MavlinkCompiledMessage msg + MessageRegistry registry, + CompiledMessage msg ) throws Exception { Map values = @@ -75,7 +76,7 @@ private static void payloadToJsonValidates( // Build schema for this message JsonObject schemaObject = - io.mapsmessaging.mavlink.schema.MavlinkJsonSchemaBuilder.buildSchema(msg, registry.getEnumsByName()); + JsonSchemaBuilder.buildSchema(msg, registry.getEnumsByName()); JsonSchema schema = compileSchema(schemaObject); Set errors = schema.validate(toJsonNode(jsonObject)); diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java index 9fc0f20..3bc0c09 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java @@ -19,10 +19,10 @@ package io.mapsmessaging.mavlink; -import io.mapsmessaging.mavlink.message.MavlinkCompiledField; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; -import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; +import io.mapsmessaging.mavlink.message.CompiledField; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.MessageRegistry; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.TestFactory; @@ -38,7 +38,7 @@ class MavlinkRoundTripAllMessagesTest extends BaseRoudTripTest { @TestFactory Stream allMessages_baseFields_roundTrip() throws Exception { MavlinkCodec codec = MavlinkTestSupport.codec(); - MavlinkMessageRegistry registry = codec.getRegistry(); + MessageRegistry registry = codec.getRegistry(); return registry.getCompiledMessages().stream() .map(msg -> DynamicTest.dynamicTest( @@ -50,7 +50,7 @@ Stream allMessages_baseFields_roundTrip() throws Exception { @TestFactory Stream allMessages_extensions_omitted_vs_present_payloadSizing() throws Exception { MavlinkCodec codec = MavlinkTestSupport.codec(); - MavlinkMessageRegistry registry = codec.getRegistry(); + MessageRegistry registry = codec.getRegistry(); return registry.getCompiledMessages().stream() .filter(msg -> msg.getCompiledFields().stream().anyMatch(cf -> MavlinkTestSupport.fieldDefinition(cf).isExtension())) @@ -63,7 +63,7 @@ Stream allMessages_extensions_omitted_vs_present_payloadSizing() th @TestFactory Stream parallel_encode_decode_sanity_no_shared_state_per_message() throws Exception { MavlinkCodec codec = MavlinkTestSupport.codec(); - MavlinkMessageRegistry registry = codec.getRegistry(); + MessageRegistry registry = codec.getRegistry(); int threads = Math.max(2, Runtime.getRuntime().availableProcessors() / 2); int tasksPerMessage = 8; // tune: enough to shake shared state without being silly @@ -77,8 +77,8 @@ Stream parallel_encode_decode_sanity_no_shared_state_per_message() private static void runParallelRoundTrips( MavlinkCodec codec, - MavlinkMessageRegistry registry, - MavlinkCompiledMessage msg, + MessageRegistry registry, + CompiledMessage msg, int threads, int tasksPerMessage ) throws Exception { @@ -107,7 +107,7 @@ private static void runParallelRoundTrips( fail("Missing field after decode: message " + msg.getMessageId() + " (" + msg.getName() + ") field=" + fieldName); } - MavlinkFieldDefinition fd = RandomValueFactory.fieldByName(msg, fieldName); + FieldDefinition fd = RandomValueFactory.fieldByName(msg, fieldName); ValueAssertions.assertFieldEquals(fd, expected, actual, msg); } return null; @@ -124,8 +124,8 @@ private static void runParallelRoundTrips( } private static void roundTripForMessage( MavlinkCodec codec, - MavlinkMessageRegistry registry, - MavlinkCompiledMessage msg, + MessageRegistry registry, + CompiledMessage msg, ExtensionMode extensionMode ) throws Exception { @@ -150,15 +150,15 @@ private static void roundTripForMessage( fail("Missing field after decode for message " + msg.getMessageId() + " (" + msg.getName() + "): " + fieldName); } - MavlinkFieldDefinition fd = RandomValueFactory.fieldByName(msg, fieldName); + FieldDefinition fd = RandomValueFactory.fieldByName(msg, fieldName); ValueAssertions.assertFieldEquals(fd, expected, actual, msg); } } private static void extensionSizingForMessage( MavlinkCodec codec, - MavlinkMessageRegistry registry, - MavlinkCompiledMessage msg + MessageRegistry registry, + CompiledMessage msg ) throws Exception { int baseSize = PayloadSizing.computeBaseSize(msg); @@ -181,7 +181,7 @@ private static void extensionSizingForMessage( Object actual = decoded.get(name); assertNotNull(actual, "Missing base field after extension decode: " + name); - MavlinkFieldDefinition fd = RandomValueFactory.fieldByName(msg, name); + FieldDefinition fd = RandomValueFactory.fieldByName(msg, name); ValueAssertions.assertFieldEquals(fd, expected, actual, msg); } } @@ -195,10 +195,10 @@ static final class PayloadSizing { private PayloadSizing() {} - static int computeBaseSize(MavlinkCompiledMessage msg) { + static int computeBaseSize(CompiledMessage msg) { int size = 0; - for (MavlinkCompiledField cf : msg.getCompiledFields()) { - MavlinkFieldDefinition fd = MavlinkTestSupport.fieldDefinition(cf); + for (CompiledField cf : msg.getCompiledFields()) { + FieldDefinition fd = MavlinkTestSupport.fieldDefinition(cf); if (fd.isExtension()) { break; } diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java index 6093702..a6e3566 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java @@ -19,10 +19,10 @@ package io.mapsmessaging.mavlink; -import io.mapsmessaging.mavlink.message.MavlinkCompiledField; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; -import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; +import io.mapsmessaging.mavlink.message.CompiledField; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.MessageRegistry; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; import java.lang.reflect.Field; import java.util.Comparator; @@ -40,23 +40,23 @@ public static MavlinkCodec codec() throws Exception { return loader.getDialectOrThrow("common"); } - public static MavlinkMessageRegistry registry(MavlinkCodec codec) { + public static MessageRegistry registry(MavlinkCodec codec) { return codec.getRegistry(); } - public static MavlinkFieldDefinition fieldDefinition(MavlinkCompiledField compiledField) { + public static FieldDefinition fieldDefinition(CompiledField compiledField) { try { - Field field = MavlinkCompiledField.class.getDeclaredField("fieldDefinition"); + Field field = CompiledField.class.getDeclaredField("fieldDefinition"); field.setAccessible(true); - return (MavlinkFieldDefinition) field.get(compiledField); + return (FieldDefinition) field.get(compiledField); } catch (Exception exception) { throw new IllegalStateException("Cannot access MavlinkCompiledField.fieldDefinition", exception); } } - public static int offset(MavlinkCompiledField compiledField) { + public static int offset(CompiledField compiledField) { try { - Field field = MavlinkCompiledField.class.getDeclaredField("offsetInPayload"); + Field field = CompiledField.class.getDeclaredField("offsetInPayload"); field.setAccessible(true); return (int) field.get(compiledField); } catch (Exception exception) { @@ -64,9 +64,9 @@ public static int offset(MavlinkCompiledField compiledField) { } } - public static int size(MavlinkCompiledField compiledField) { + public static int size(CompiledField compiledField) { try { - Field field = MavlinkCompiledField.class.getDeclaredField("sizeInBytes"); + Field field = CompiledField.class.getDeclaredField("sizeInBytes"); field.setAccessible(true); return (int) field.get(compiledField); } catch (Exception exception) { @@ -74,33 +74,33 @@ public static int size(MavlinkCompiledField compiledField) { } } - public static Optional firstMessageWithExtensions(MavlinkMessageRegistry registry) { + public static Optional firstMessageWithExtensions(MessageRegistry registry) { return registry.getCompiledMessages().stream() .filter(message -> message.getCompiledFields().stream().anyMatch(field -> fieldDefinition(field).isExtension())) .findFirst(); } - public static Optional firstMessageWithArray(MavlinkMessageRegistry registry) { + public static Optional firstMessageWithArray(MessageRegistry registry) { return registry.getCompiledMessages().stream() .filter(message -> message.getCompiledFields().stream().anyMatch(field -> fieldDefinition(field).isArray())) .findFirst(); } - public static Optional firstMessageWithEnum(MavlinkMessageRegistry registry) { + public static Optional firstMessageWithEnum(MessageRegistry registry) { return registry.getCompiledMessages().stream() .filter(message -> message.getCompiledFields().stream().anyMatch(field -> { - MavlinkFieldDefinition definition = fieldDefinition(field); + FieldDefinition definition = fieldDefinition(field); String enumName = definition.getEnumName(); return enumName != null && !enumName.isEmpty(); })) .findFirst(); } - public static Map payloadWithScalar(MavlinkFieldDefinition field, Number value) { + public static Map payloadWithScalar(FieldDefinition field, Number value) { return Map.of(field.getName(), value); } - public static Map payloadWithArrayFilled(MavlinkFieldDefinition field, Number value) { + public static Map payloadWithArrayFilled(FieldDefinition field, Number value) { int arrayLength = field.getArrayLength(); List list = java.util.stream.IntStream.range(0, arrayLength) .mapToObj(index -> value) @@ -108,7 +108,7 @@ public static Map payloadWithArrayFilled(MavlinkFieldDefinition return Map.of(field.getName(), list); } - public static List fieldsSortedByOffset(MavlinkCompiledMessage message) { + public static List fieldsSortedByOffset(CompiledMessage message) { return message.getCompiledFields().stream() .sorted(Comparator.comparingInt(MavlinkTestSupport::offset)) .toList(); diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkCharArrays.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkCharArrays.java index c0b1d74..bbacea6 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkCharArrays.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkCharArrays.java @@ -19,11 +19,11 @@ package io.mapsmessaging.mavlink; -import io.mapsmessaging.mavlink.message.MavlinkCompiledField; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; -import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; -import io.mapsmessaging.mavlink.message.fields.MavlinkWireType; +import io.mapsmessaging.mavlink.message.CompiledField; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.MessageRegistry; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; +import io.mapsmessaging.mavlink.message.fields.WireType; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -39,18 +39,18 @@ class TestMavlinkCharArrays { @Test void charArray_stringIsTruncatedAndNullPadded() throws Exception { MavlinkCodec codec = MavlinkTestSupport.codec(); - MavlinkMessageRegistry registry = codec.getRegistry(); + MessageRegistry registry = codec.getRegistry(); - MavlinkCompiledMessage message = MavlinkTestSupport.firstMessageWithArray(registry) + CompiledMessage message = MavlinkTestSupport.firstMessageWithArray(registry) .orElseThrow(() -> new IllegalStateException("No message with array fields found")); - MavlinkCompiledField charArrayField = findFirstCharArrayField(message); + CompiledField charArrayField = findFirstCharArrayField(message); if (charArrayField == null) { return; // no char arrays in this dialect revision, skip } int messageId = message.getMessageId(); - MavlinkFieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(charArrayField); + FieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(charArrayField); String longText = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; Map values = new HashMap<>(); @@ -85,18 +85,18 @@ void charArray_stringIsTruncatedAndNullPadded() throws Exception { @Test void charArray_byteArrayAccepted() throws Exception { MavlinkCodec codec = MavlinkTestSupport.codec(); - MavlinkMessageRegistry registry = codec.getRegistry(); + MessageRegistry registry = codec.getRegistry(); - MavlinkCompiledMessage message = MavlinkTestSupport.firstMessageWithArray(registry) + CompiledMessage message = MavlinkTestSupport.firstMessageWithArray(registry) .orElseThrow(() -> new IllegalStateException("No message with array fields found")); - MavlinkCompiledField charArrayField = findFirstCharArrayField(message); + CompiledField charArrayField = findFirstCharArrayField(message); if (charArrayField == null) { return; } int messageId = message.getMessageId(); - MavlinkFieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(charArrayField); + FieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(charArrayField); byte[] input = "HELLO".getBytes(StandardCharsets.UTF_8); @@ -111,11 +111,11 @@ void charArray_byteArrayAccepted() throws Exception { Assertions.assertNotNull(decoded.get(fieldDefinition.getName())); } - private MavlinkCompiledField findFirstCharArrayField(MavlinkCompiledMessage message) { - List fields = message.getCompiledFields(); - for (MavlinkCompiledField compiledField : fields) { - MavlinkFieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(compiledField); - if (fieldDefinition.isArray() && fieldDefinition.getWireType() == MavlinkWireType.CHAR) { + private CompiledField findFirstCharArrayField(CompiledMessage message) { + List fields = message.getCompiledFields(); + for (CompiledField compiledField : fields) { + FieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(compiledField); + if (fieldDefinition.isArray() && fieldDefinition.getWireType() == WireType.CHAR) { return compiledField; } } diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkExtensions.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkExtensions.java index 962d0ff..562a278 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkExtensions.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkExtensions.java @@ -19,10 +19,10 @@ package io.mapsmessaging.mavlink; -import io.mapsmessaging.mavlink.message.MavlinkCompiledField; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; -import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; +import io.mapsmessaging.mavlink.message.CompiledField; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.MessageRegistry; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -35,17 +35,17 @@ class TestMavlinkExtensions { @Test void extensionFields_omitted_doNotIncreasePayloadSize() throws Exception { MavlinkCodec codec = MavlinkTestSupport.codec(); - MavlinkMessageRegistry registry = codec.getRegistry(); + MessageRegistry registry = codec.getRegistry(); - MavlinkCompiledMessage message = MavlinkTestSupport.firstMessageWithExtensions(registry) + CompiledMessage message = MavlinkTestSupport.firstMessageWithExtensions(registry) .orElseThrow(() -> new IllegalStateException("No message with extensions found in dialect")); int messageId = message.getMessageId(); - List compiledFields = message.getCompiledFields(); + List compiledFields = message.getCompiledFields(); int baseSize = 0; - for (MavlinkCompiledField compiledField : compiledFields) { - MavlinkFieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(compiledField); + for (CompiledField compiledField : compiledFields) { + FieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(compiledField); if (fieldDefinition.isExtension()) { break; } @@ -60,13 +60,13 @@ void extensionFields_omitted_doNotIncreasePayloadSize() throws Exception { @Test void extensionFields_present_extendPayloadToLastPresentExtension() throws Exception { MavlinkCodec codec = MavlinkTestSupport.codec(); - MavlinkMessageRegistry registry = codec.getRegistry(); + MessageRegistry registry = codec.getRegistry(); - MavlinkCompiledMessage message = MavlinkTestSupport.firstMessageWithExtensions(registry) + CompiledMessage message = MavlinkTestSupport.firstMessageWithExtensions(registry) .orElseThrow(() -> new IllegalStateException("No message with extensions found in dialect")); int messageId = message.getMessageId(); - List fields = message.getCompiledFields(); + List fields = message.getCompiledFields(); int firstExtensionIndex = -1; int lastExtensionIndex = -1; @@ -82,8 +82,8 @@ void extensionFields_present_extendPayloadToLastPresentExtension() throws Except Assertions.assertTrue(firstExtensionIndex >= 0, "Expected at least one extension field"); - MavlinkCompiledField firstExtensionField = fields.get(firstExtensionIndex); - MavlinkFieldDefinition firstExtensionDefinition = MavlinkTestSupport.fieldDefinition(firstExtensionField); + CompiledField firstExtensionField = fields.get(firstExtensionIndex); + FieldDefinition firstExtensionDefinition = MavlinkTestSupport.fieldDefinition(firstExtensionField); Map values = new HashMap<>(); values.put(firstExtensionDefinition.getName(), numericSampleValue(firstExtensionDefinition)); @@ -92,8 +92,8 @@ void extensionFields_present_extendPayloadToLastPresentExtension() throws Except int expectedSize = 0; for (int index = 0; index < fields.size(); index++) { - MavlinkCompiledField compiledField = fields.get(index); - MavlinkFieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(compiledField); + CompiledField compiledField = fields.get(index); + FieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(compiledField); expectedSize += MavlinkTestSupport.size(compiledField); @@ -106,8 +106,8 @@ void extensionFields_present_extendPayloadToLastPresentExtension() throws Except "Payload should extend exactly through the last included extension field for message " + messageId); if (lastExtensionIndex > firstExtensionIndex) { - MavlinkCompiledField lastExtensionField = fields.get(lastExtensionIndex); - MavlinkFieldDefinition lastExtensionDefinition = MavlinkTestSupport.fieldDefinition(lastExtensionField); + CompiledField lastExtensionField = fields.get(lastExtensionIndex); + FieldDefinition lastExtensionDefinition = MavlinkTestSupport.fieldDefinition(lastExtensionField); Map later = new HashMap<>(); later.put(lastExtensionDefinition.getName(), numericSampleValue(lastExtensionDefinition)); @@ -127,13 +127,13 @@ void extensionFields_present_extendPayloadToLastPresentExtension() throws Except @Test void extensionFields_middleOmitted_zeroFilledIfLaterExtensionPresent() throws Exception { MavlinkCodec codec = MavlinkTestSupport.codec(); - MavlinkMessageRegistry registry = codec.getRegistry(); + MessageRegistry registry = codec.getRegistry(); - MavlinkCompiledMessage message = MavlinkTestSupport.firstMessageWithExtensions(registry) + CompiledMessage message = MavlinkTestSupport.firstMessageWithExtensions(registry) .orElseThrow(() -> new IllegalStateException("No message with extensions found in dialect")); int messageId = message.getMessageId(); - List fields = message.getCompiledFields(); + List fields = message.getCompiledFields(); List extensionIndexes = new java.util.ArrayList<>(); for (int index = 0; index < fields.size(); index++) { @@ -149,7 +149,7 @@ void extensionFields_middleOmitted_zeroFilledIfLaterExtensionPresent() throws Ex int earlierIndex = extensionIndexes.get(0); int laterIndex = extensionIndexes.get(extensionIndexes.size() - 1); - MavlinkFieldDefinition later = MavlinkTestSupport.fieldDefinition(fields.get(laterIndex)); + FieldDefinition later = MavlinkTestSupport.fieldDefinition(fields.get(laterIndex)); Map values = new HashMap<>(); values.put(later.getName(), numericSampleValue(later)); @@ -170,7 +170,7 @@ void extensionFields_middleOmitted_zeroFilledIfLaterExtensionPresent() throws Ex Assertions.assertNotNull(decoded); } - private Number numericSampleValue(MavlinkFieldDefinition fieldDefinition) { + private Number numericSampleValue(FieldDefinition fieldDefinition) { // We don't know the exact wire type here without importing codec internals, // but for most numeric fields a small positive int is safe. return 1; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkNumericArrays.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkNumericArrays.java index 35f76bc..f63ab8b 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkNumericArrays.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkNumericArrays.java @@ -20,12 +20,11 @@ package io.mapsmessaging.mavlink; -import io.mapsmessaging.mavlink.message.MavlinkCompiledField; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; -import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; -import io.mapsmessaging.mavlink.message.fields.MavlinkWireType; -import org.junit.jupiter.api.Assertions; +import io.mapsmessaging.mavlink.message.CompiledField; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.MessageRegistry; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; +import io.mapsmessaging.mavlink.message.fields.WireType; import org.junit.jupiter.api.Test; import java.util.ArrayList; @@ -40,18 +39,18 @@ class TestMavlinkNumericArrays { @Test void numericArray_listShorterThanLength_zeroPadsRemainder() throws Exception { MavlinkCodec codec = MavlinkTestSupport.codec(); - MavlinkMessageRegistry registry = codec.getRegistry(); + MessageRegistry registry = codec.getRegistry(); - MavlinkCompiledMessage message = MavlinkTestSupport.firstMessageWithArray(registry) + CompiledMessage message = MavlinkTestSupport.firstMessageWithArray(registry) .orElseThrow(() -> new IllegalStateException("No message with array fields found")); - MavlinkCompiledField numericArray = findFirstNumericArrayField(message); + CompiledField numericArray = findFirstNumericArrayField(message); if (numericArray == null) { return; } int messageId = message.getMessageId(); - MavlinkFieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(numericArray); + FieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(numericArray); List shortList = List.of(1, 2); @@ -71,18 +70,18 @@ void numericArray_listShorterThanLength_zeroPadsRemainder() throws Exception { @Test void numericArray_listLongerThanLength_isTruncated() throws Exception { MavlinkCodec codec = MavlinkTestSupport.codec(); - MavlinkMessageRegistry registry = codec.getRegistry(); + MessageRegistry registry = codec.getRegistry(); - MavlinkCompiledMessage message = MavlinkTestSupport.firstMessageWithArray(registry) + CompiledMessage message = MavlinkTestSupport.firstMessageWithArray(registry) .orElseThrow(() -> new IllegalStateException("No message with array fields found")); - MavlinkCompiledField numericArray = findFirstNumericArrayField(message); + CompiledField numericArray = findFirstNumericArrayField(message); if (numericArray == null) { return; } int messageId = message.getMessageId(); - MavlinkFieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(numericArray); + FieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(numericArray); int length = fieldDefinition.getArrayLength(); @@ -102,16 +101,16 @@ void numericArray_listLongerThanLength_isTruncated() throws Exception { assertNotNull(decoded.get(fieldDefinition.getName())); } - private MavlinkCompiledField findFirstNumericArrayField(MavlinkCompiledMessage message) { - for (MavlinkCompiledField compiledField : message.getCompiledFields()) { - MavlinkFieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(compiledField); + private CompiledField findFirstNumericArrayField(CompiledMessage message) { + for (CompiledField compiledField : message.getCompiledFields()) { + FieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(compiledField); if (!fieldDefinition.isArray()) { continue; } if (fieldDefinition.getWireType() == null) { continue; } - if (fieldDefinition.getWireType() == MavlinkWireType.CHAR) { + if (fieldDefinition.getWireType() == WireType.CHAR) { continue; } return compiledField; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRegistryInvariants.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRegistryInvariants.java index a7ce7a0..b9aba8f 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRegistryInvariants.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRegistryInvariants.java @@ -19,10 +19,10 @@ package io.mapsmessaging.mavlink; -import io.mapsmessaging.mavlink.message.MavlinkCompiledField; -import io.mapsmessaging.mavlink.message.MavlinkCompiledMessage; -import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; -import io.mapsmessaging.mavlink.message.fields.MavlinkFieldDefinition; +import io.mapsmessaging.mavlink.message.CompiledField; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.MessageRegistry; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -34,11 +34,11 @@ class TestMavlinkRegistryInvariants { @Test void registryHasNoDuplicateMessageIdsAndLooksSane() throws Exception { MavlinkCodec codec = MavlinkTestSupport.codec(); - MavlinkMessageRegistry registry = MavlinkTestSupport.registry(codec); + MessageRegistry registry = MavlinkTestSupport.registry(codec); Assertions.assertEquals("common", codec.getName()); - List messages = registry.getCompiledMessages(); + List messages = registry.getCompiledMessages(); Assertions.assertNotNull(messages); Assertions.assertTrue( messages.size() >= 220 && messages.size() <= 260, @@ -46,7 +46,7 @@ void registryHasNoDuplicateMessageIdsAndLooksSane() throws Exception { ); Set ids = new HashSet<>(); - for (MavlinkCompiledMessage message : messages) { + for (CompiledMessage message : messages) { Assertions.assertTrue(ids.add(message.getMessageId()), "Duplicate messageId: " + message.getMessageId()); Assertions.assertNotNull(message.getName()); Assertions.assertTrue(message.getPayloadSizeBytes() >= 0); @@ -63,14 +63,14 @@ void registryHasNoDuplicateMessageIdsAndLooksSane() throws Exception { @Test void compiledFieldLayoutIsMonotonicAndMatchesPayloadSize() throws Exception { MavlinkCodec codec = MavlinkTestSupport.codec(); - MavlinkMessageRegistry registry = MavlinkTestSupport.registry(codec); + MessageRegistry registry = MavlinkTestSupport.registry(codec); - for (MavlinkCompiledMessage message : registry.getCompiledMessages()) { - List fields = MavlinkTestSupport.fieldsSortedByOffset(message); + for (CompiledMessage message : registry.getCompiledMessages()) { + List fields = MavlinkTestSupport.fieldsSortedByOffset(message); Set names = new HashSet<>(); - for (MavlinkCompiledField field : fields) { - MavlinkFieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(field); + for (CompiledField field : fields) { + FieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(field); Assertions.assertTrue( names.add(fieldDefinition.getName()), @@ -84,8 +84,8 @@ void compiledFieldLayoutIsMonotonicAndMatchesPayloadSize() throws Exception { } for (int i = 1; i < fields.size(); i++) { - MavlinkCompiledField previous = fields.get(i - 1); - MavlinkCompiledField current = fields.get(i); + CompiledField previous = fields.get(i - 1); + CompiledField current = fields.get(i); int previousEnd = MavlinkTestSupport.offset(previous) + MavlinkTestSupport.size(previous); @@ -100,7 +100,7 @@ void compiledFieldLayoutIsMonotonicAndMatchesPayloadSize() throws Exception { ); } - MavlinkCompiledField last = fields.get(fields.size() - 1); + CompiledField last = fields.get(fields.size() - 1); int computedPayloadSize = MavlinkTestSupport.offset(last) + MavlinkTestSupport.size(last); Assertions.assertEquals( @@ -114,14 +114,14 @@ void compiledFieldLayoutIsMonotonicAndMatchesPayloadSize() throws Exception { @Test void extensionFieldsAreAllTrailingInPackedOrder() throws Exception { MavlinkCodec codec = MavlinkTestSupport.codec(); - MavlinkMessageRegistry registry = MavlinkTestSupport.registry(codec); + MessageRegistry registry = MavlinkTestSupport.registry(codec); - for (MavlinkCompiledMessage message : registry.getCompiledMessages()) { - List fields = message.getCompiledFields(); // assumes already in packed order + for (CompiledMessage message : registry.getCompiledMessages()) { + List fields = message.getCompiledFields(); // assumes already in packed order boolean sawExtension = false; - for (MavlinkCompiledField field : fields) { - MavlinkFieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(field); + for (CompiledField field : fields) { + FieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(field); if (fieldDefinition.isExtension()) { sawExtension = true; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java index 86afe64..3032b15 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java @@ -20,7 +20,7 @@ package io.mapsmessaging.mavlink; -import io.mapsmessaging.mavlink.message.MavlinkMessageRegistry; +import io.mapsmessaging.mavlink.message.MessageRegistry; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -81,7 +81,7 @@ void commonDialectLoadsAndHasKnownMessageIds() throws Exception { Assertions.assertNotNull(codec); Assertions.assertEquals("common", codec.getName()); - MavlinkMessageRegistry registry = codec.getRegistry(); + MessageRegistry registry = codec.getRegistry(); Assertions.assertNotNull(registry); assertTrue(registry.getCompiledMessagesById().containsKey(0), "HEARTBEAT"); diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkXmlParserIncludes.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkXmlParserIncludes.java index 90b3104..2ef0d97 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkXmlParserIncludes.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkXmlParserIncludes.java @@ -34,11 +34,11 @@ void commonDialect_resolvesIncludes_andContainsKnownMessages() throws Exception try (InputStream stream = classLoader.getResourceAsStream("mavlink/common.xml")) { Assertions.assertNotNull(stream, "Missing resource mavlink/common.xml"); - MavlinkXmlParser parser = new MavlinkXmlParser(); - MavlinkDialectLoader loader = new MavlinkDialectLoader(parser); + XmlParser parser = new XmlParser(); + DialectLoader loader = new DialectLoader(parser); - MavlinkIncludeResolver resolver = new ClasspathMavlinkIncludeResolver(classLoader, "mavlink"); - MavlinkDialectDefinition dialect = loader.load("common", stream, resolver); + IncludeResolver resolver = new ClasspathIncludeResolver(classLoader, "mavlink"); + DialectDefinition dialect = loader.load("common", stream, resolver); Assertions.assertNotNull(dialect); Assertions.assertEquals("common", dialect.getName()); From a5ccd3bc922c277f28aab60fac8c0cb0e95f02bc Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Fri, 16 Jan 2026 22:18:07 +1100 Subject: [PATCH 16/34] add system id context and simple frame based error detection --- .../mavlink/SystemContextManager.java | 83 ++++++ .../mavlink/context/Detection.java | 13 + .../mavlink/context/DetectionSeverity.java | 7 + .../mavlink/context/DetectionType.java | 12 + .../mavlink/context/FrameFailureReason.java | 9 + .../mavlink/context/FrameFingerprint.java | 34 +++ .../context/SequenceProcessingResult.java | 17 ++ .../mavlink/context/SequenceProcessor.java | 264 ++++++++++++++++++ .../context/SequenceProcessorConfig.java | 21 ++ .../context/SequenceRingBuffer256.java | 22 ++ .../mavlink/context/SequenceRingEntry.java | 11 + .../mavlink/context/SequenceStats.java | 15 + .../mavlink/context/SourceStats.java | 19 ++ .../mavlink/context/SweepConfig.java | 15 + .../mavlink/context/SweepResult.java | 9 + .../mavlink/context/SystemContext.java | 117 ++++++++ .../context/SystemContextSnapshot.java | 13 + .../mavlink/SystemContextManagerTest.java | 198 +++++++++++++ 18 files changed, 879 insertions(+) create mode 100644 src/main/java/io/mapsmessaging/mavlink/SystemContextManager.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/Detection.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/DetectionSeverity.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/DetectionType.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/FrameFingerprint.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessingResult.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessor.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessorConfig.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/SequenceRingBuffer256.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/SequenceRingEntry.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/SequenceStats.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/SourceStats.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/SweepConfig.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/SweepResult.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/SystemContext.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/context/SystemContextSnapshot.java create mode 100644 src/test/java/io/mapsmessaging/mavlink/SystemContextManagerTest.java diff --git a/src/main/java/io/mapsmessaging/mavlink/SystemContextManager.java b/src/main/java/io/mapsmessaging/mavlink/SystemContextManager.java new file mode 100644 index 0000000..40e39ca --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/SystemContextManager.java @@ -0,0 +1,83 @@ +package io.mapsmessaging.mavlink; + +import io.mapsmessaging.mavlink.context.*; +import io.mapsmessaging.mavlink.message.Frame; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +@Data +public class SystemContextManager { + + private final Map systemContexts; + private final SequenceProcessor sequenceProcessor; + private final SequenceProcessorConfig sequenceProcessorConfig; + private final SweepConfig sweepConfig; + + public SystemContextManager() { + this(new SequenceProcessorConfig(), new SweepConfig()); + } + + public SystemContextManager(SequenceProcessorConfig sequenceProcessorConfig, SweepConfig sweepConfig) { + this.systemContexts = new ConcurrentHashMap<>(); + this.sequenceProcessorConfig = sequenceProcessorConfig; + this.sequenceProcessor = new SequenceProcessor(sequenceProcessorConfig); + this.sweepConfig = sweepConfig; + } + + public List onValidatedFrame(Frame frame, String streamId, long receivedAtNanos) { + int systemId = frame.getSystemId(); + SystemContext systemContext = systemContexts.computeIfAbsent(systemId, this::createContext); + return systemContext.onValidatedFrame(frame, streamId, receivedAtNanos, sequenceProcessor); + } + + public List onInvalidFrame(int systemId, String streamId, long receivedAtNanos, FrameFailureReason reason) { + SystemContext systemContext = systemContexts.get(systemId); + if (systemContext == null) { + return List.of(); + } + return systemContext.onInvalidFrame(streamId, receivedAtNanos, reason); + } + + public SweepResult sweep(long nowNanos) { + SweepResult result = new SweepResult(); + + int removedSources = 0; + int removedSystems = 0; + + for (Map.Entry entry : systemContexts.entrySet()) { + SystemContext systemContext = entry.getValue(); + + removedSources += systemContext.sweep(nowNanos, sweepConfig, sequenceProcessorConfig); + + if (systemContext.isExpired(nowNanos, sweepConfig)) { + systemContexts.remove(entry.getKey()); + removedSystems++; + } + } + result.setRemovedSystems(removedSystems); + result.setRemovedSources(removedSources); + return result; + } + + private SystemContext createContext(int systemId) { + SystemContext systemContext = new SystemContext(); + systemContext.setSystemId(systemId); + systemContext.setSequenceRingBuffer(new SequenceRingBuffer256()); + systemContext.setSourceStats(new ConcurrentHashMap<>()); + systemContext.setSequenceStats(new SequenceStats()); + systemContext.setLastActivityAtNanos(0L); + return systemContext; + } + + public List snapshotAll() { + List snapshots = new ArrayList<>(); + for (SystemContext systemContext : systemContexts.values()) { + snapshots.add(systemContext.snapshot()); + } + return snapshots; + } +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/Detection.java b/src/main/java/io/mapsmessaging/mavlink/context/Detection.java new file mode 100644 index 0000000..b2b4807 --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/Detection.java @@ -0,0 +1,13 @@ +package io.mapsmessaging.mavlink.context; + +import lombok.Data; + +@Data +public class Detection { + private int systemId; + private String streamId; + private long occurredAtNanos; + private DetectionType type; + private DetectionSeverity severity; + private String details; +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/DetectionSeverity.java b/src/main/java/io/mapsmessaging/mavlink/context/DetectionSeverity.java new file mode 100644 index 0000000..394482c --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/DetectionSeverity.java @@ -0,0 +1,7 @@ +package io.mapsmessaging.mavlink.context; + +public enum DetectionSeverity { + INFO, + WARN, + ALERT +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/DetectionType.java b/src/main/java/io/mapsmessaging/mavlink/context/DetectionType.java new file mode 100644 index 0000000..081b7d2 --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/DetectionType.java @@ -0,0 +1,12 @@ +package io.mapsmessaging.mavlink.context; + +public enum DetectionType { + SEQ_DUPLICATE, + SEQ_REORDER, + SEQ_GAP, + SEQ_RESET_SUSPECTED, + SEQ_SUSPICIOUS_BACKWARDS, + SEQ_SAME_SEQ_DIFFERENT_FINGERPRINT, + SYSTEM_MULTI_SOURCE_ACTIVE, + FRAME_INVALID +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java b/src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java new file mode 100644 index 0000000..6532549 --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java @@ -0,0 +1,9 @@ +package io.mapsmessaging.mavlink.context; + +public enum FrameFailureReason { + CRC_FAILED, + SIGNATURE_FAILED, + CRC_AND_SIGNATURE_FAILED, + MALFORMED, + UNKNOWN +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/FrameFingerprint.java b/src/main/java/io/mapsmessaging/mavlink/context/FrameFingerprint.java new file mode 100644 index 0000000..2f1b345 --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/FrameFingerprint.java @@ -0,0 +1,34 @@ +package io.mapsmessaging.mavlink.context; + +import io.mapsmessaging.mavlink.message.Frame; + +public class FrameFingerprint { + + private FrameFingerprint() { + } + + public static int computeFingerprint(Frame frame) { + int hash = 0x811C9DC5; + + hash = fnv1a(hash, frame.getVersion() == null ? 0 : frame.getVersion().ordinal()); + hash = fnv1a(hash, frame.getSystemId()); + hash = fnv1a(hash, frame.getComponentId()); + hash = fnv1a(hash, frame.getMessageId()); + hash = fnv1a(hash, frame.getPayloadLength()); + + byte[] payload = frame.getPayload(); + if (payload != null) { + int length = Math.min(payload.length, frame.getPayloadLength()); + for (int index = 0; index < length; index++) { + hash = fnv1a(hash, payload[index]); + } + } + + return hash; + } + + private static int fnv1a(int hash, int value) { + int next = hash ^ value; + return next * 16777619; + } +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessingResult.java b/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessingResult.java new file mode 100644 index 0000000..75c4a5d --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessingResult.java @@ -0,0 +1,17 @@ +package io.mapsmessaging.mavlink.context; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class SequenceProcessingResult { + private boolean acceptedAsHead; + private int sequence; + private List detections; + + public SequenceProcessingResult() { + this.detections = new ArrayList<>(); + } +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessor.java b/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessor.java new file mode 100644 index 0000000..8ddded9 --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessor.java @@ -0,0 +1,264 @@ +package io.mapsmessaging.mavlink.context; + +import io.mapsmessaging.mavlink.message.Frame; + +import java.util.Map; + +public record SequenceProcessor(SequenceProcessorConfig config) { + + public SequenceProcessingResult process(SystemContext systemContext, Frame frame, String streamId, long receivedAtNanos) { + SequenceProcessingResult result = new SequenceProcessingResult(); + int sequence = frame.getSequence() & 0xFF; + result.setSequence(sequence); + + int fingerprint = FrameFingerprint.computeFingerprint(frame); + + SequenceRingEntry previousEntryForSequence = systemContext.getSequenceRingBuffer().get(sequence); + if (previousEntryForSequence != null) { + long ageNanos = receivedAtNanos - previousEntryForSequence.getLastSeenAtNanos(); + boolean withinDupWindow = ageNanos >= 0 && ageNanos <= config.getDuplicateTimeWindowNanos(); + + if (withinDupWindow) { + if (previousEntryForSequence.getFingerprint() == fingerprint) { + incrementDuplicate(systemContext, frame, streamId, receivedAtNanos, result); + updateRing(systemContext, sequence, fingerprint, streamId, receivedAtNanos); + detectMultiSourceActive(systemContext, streamId, receivedAtNanos, result); + return result; + } + + Detection detection = new Detection(); + detection.setSystemId(systemContext.getSystemId()); + detection.setStreamId(streamId); + detection.setOccurredAtNanos(receivedAtNanos); + detection.setType(DetectionType.SEQ_SAME_SEQ_DIFFERENT_FINGERPRINT); + detection.setSeverity(DetectionSeverity.ALERT); + detection.setDetails("seq=" + sequence + " previousStream=" + previousEntryForSequence.getStreamId()); + + result.getDetections().add(detection); + + updateRing(systemContext, sequence, fingerprint, streamId, receivedAtNanos); + detectMultiSourceActive(systemContext, streamId, receivedAtNanos, result); + return result; + } + } + + if (!systemContext.isInitialized()) { + systemContext.setInitialized(true); + systemContext.setLastAcceptedSequence(sequence); + systemContext.setLastAcceptedAtNanos(receivedAtNanos); + setLastAcceptedSequenceForSource(systemContext, streamId, sequence); + updateRing(systemContext, sequence, fingerprint, streamId, receivedAtNanos); + detectMultiSourceActive(systemContext, streamId, receivedAtNanos, result); + result.setAcceptedAsHead(true); + return result; + } + + int lastAcceptedSequence = systemContext.getLastAcceptedSequence() & 0xFF; + int delta = (sequence - lastAcceptedSequence) & 0xFF; + + if (delta == 0) { + incrementDuplicate(systemContext, frame, streamId, receivedAtNanos, result); + updateRing(systemContext, sequence, fingerprint, streamId, receivedAtNanos); + detectMultiSourceActive(systemContext, streamId, receivedAtNanos, result); + return result; + } + + if (delta <= 127) { + if (delta > 1) { + int lostPackets = delta - 1; + incrementGap(systemContext, streamId, receivedAtNanos, result, lostPackets); + } + + systemContext.setLastAcceptedSequence(sequence); + systemContext.setLastAcceptedAtNanos(receivedAtNanos); + setLastAcceptedSequenceForSource(systemContext, streamId, sequence); + updateRing(systemContext, sequence, fingerprint, streamId, receivedAtNanos); + detectMultiSourceActive(systemContext, streamId, receivedAtNanos, result); + result.setAcceptedAsHead(true); + return result; + } + + int backwardDistance = 256 - delta; + + boolean withinReorderDistance = backwardDistance <= config.getReorderDistanceWindow(); + long ageSinceHeadNanos = receivedAtNanos - systemContext.getLastAcceptedAtNanos(); + boolean withinReorderTime = ageSinceHeadNanos >= 0 && ageSinceHeadNanos <= config.getReorderTimeWindowNanos(); + + if (withinReorderDistance && withinReorderTime) { + incrementReorder(systemContext, streamId, receivedAtNanos, result, backwardDistance); + updateRing(systemContext, sequence, fingerprint, streamId, receivedAtNanos); + detectMultiSourceActive(systemContext, streamId, receivedAtNanos, result); + return result; + } + + incrementSuspiciousBackward(systemContext, streamId, receivedAtNanos, result, backwardDistance); + + if (looksLikeReset(systemContext, sequence, receivedAtNanos)) { + incrementResetSuspected(systemContext, streamId, receivedAtNanos, result, lastAcceptedSequence, sequence); + } + + updateRing(systemContext, sequence, fingerprint, streamId, receivedAtNanos); + detectMultiSourceActive(systemContext, streamId, receivedAtNanos, result); + + return result; + } + + private void updateRing(SystemContext systemContext, int sequence, int fingerprint, String streamId, long receivedAtNanos) { + SequenceRingEntry entry = new SequenceRingEntry(); + entry.setSequence(sequence); + entry.setFingerprint(fingerprint); + entry.setStreamId(streamId); + entry.setLastSeenAtNanos(receivedAtNanos); + systemContext.getSequenceRingBuffer().put(sequence, entry); + } + + private void setLastAcceptedSequenceForSource(SystemContext systemContext, String streamId, int sequence) { + SourceStats stats = systemContext.getSourceStats().get(streamId); + if (stats == null) { + return; + } + stats.setLastAcceptedSequenceFromSource(sequence); + } + + private void incrementDuplicate(SystemContext systemContext, Frame frame, String streamId, long receivedAtNanos, SequenceProcessingResult result) { + systemContext.getSequenceStats().setDuplicates(systemContext.getSequenceStats().getDuplicates() + 1); + + Detection detection = new Detection(); + detection.setSystemId(systemContext.getSystemId()); + detection.setStreamId(streamId); + detection.setOccurredAtNanos(receivedAtNanos); + detection.setType(DetectionType.SEQ_DUPLICATE); + detection.setSeverity(DetectionSeverity.INFO); + detection.setDetails("seq=" + (frame.getSequence() & 0xFF)); + + result.getDetections().add(detection); + } + + private void incrementGap(SystemContext systemContext, String streamId, long receivedAtNanos, SequenceProcessingResult result, int lostPackets) { + systemContext.getSequenceStats().setGaps(systemContext.getSequenceStats().getGaps() + 1); + systemContext.getSequenceStats().setLostPackets(systemContext.getSequenceStats().getLostPackets() + lostPackets); + + Detection detection = new Detection(); + detection.setSystemId(systemContext.getSystemId()); + detection.setStreamId(streamId); + detection.setOccurredAtNanos(receivedAtNanos); + detection.setType(DetectionType.SEQ_GAP); + detection.setSeverity(DetectionSeverity.WARN); + detection.setDetails("lost=" + lostPackets); + + result.getDetections().add(detection); + } + + private void incrementReorder(SystemContext systemContext, String streamId, long receivedAtNanos, SequenceProcessingResult result, int backwardDistance) { + systemContext.getSequenceStats().setReorders(systemContext.getSequenceStats().getReorders() + 1); + + Detection detection = new Detection(); + detection.setSystemId(systemContext.getSystemId()); + detection.setStreamId(streamId); + detection.setOccurredAtNanos(receivedAtNanos); + detection.setType(DetectionType.SEQ_REORDER); + detection.setSeverity(DetectionSeverity.INFO); + detection.setDetails("back=" + backwardDistance); + + result.getDetections().add(detection); + } + + private void incrementSuspiciousBackward(SystemContext systemContext, String streamId, long receivedAtNanos, SequenceProcessingResult result, int backwardDistance) { + systemContext.getSequenceStats().setSuspiciousBackwards(systemContext.getSequenceStats().getSuspiciousBackwards() + 1); + + Detection detection = new Detection(); + detection.setSystemId(systemContext.getSystemId()); + detection.setStreamId(streamId); + detection.setOccurredAtNanos(receivedAtNanos); + detection.setType(DetectionType.SEQ_SUSPICIOUS_BACKWARDS); + + DetectionSeverity severity = backwardDistance >= config.getSuspiciousBackwardDistance() + ? DetectionSeverity.ALERT + : DetectionSeverity.WARN; + + detection.setSeverity(severity); + detection.setDetails("back=" + backwardDistance); + + result.getDetections().add(detection); + } + + private void incrementResetSuspected(SystemContext systemContext, String streamId, long receivedAtNanos, SequenceProcessingResult result, int lastAcceptedSequence, int sequence) { + systemContext.getSequenceStats().setResetsSuspected(systemContext.getSequenceStats().getResetsSuspected() + 1); + + Detection detection = new Detection(); + detection.setSystemId(systemContext.getSystemId()); + detection.setStreamId(streamId); + detection.setOccurredAtNanos(receivedAtNanos); + detection.setType(DetectionType.SEQ_RESET_SUSPECTED); + detection.setSeverity(DetectionSeverity.WARN); + detection.setDetails("head=" + lastAcceptedSequence + " seq=" + sequence); + + result.getDetections().add(detection); + } + + private boolean looksLikeReset(SystemContext systemContext, int sequence, long receivedAtNanos) { + int lastAcceptedSequence = systemContext.getLastAcceptedSequence() & 0xFF; + + boolean headWasMidRange = lastAcceptedSequence >= 50 && lastAcceptedSequence <= 200; + boolean newIsLow = sequence <= 10; + + if (!headWasMidRange || !newIsLow) { + return false; + } + + long silenceNanos = receivedAtNanos - systemContext.getLastAcceptedAtNanos(); + return silenceNanos > config.getMultiSourceActiveWindowNanos(); + } + + private void detectMultiSourceActive(SystemContext systemContext, String streamId, long receivedAtNanos, SequenceProcessingResult result) { + String primaryStreamId = findPrimaryStreamId(systemContext, receivedAtNanos); + if (primaryStreamId == null) { + markPrimary(systemContext, streamId, receivedAtNanos); + return; + } + + if (primaryStreamId.equals(streamId)) { + return; + } + + systemContext.getSequenceStats().setMultiSourceActive(systemContext.getSequenceStats().getMultiSourceActive() + 1); + + Detection detection = new Detection(); + detection.setSystemId(systemContext.getSystemId()); + detection.setStreamId(streamId); + detection.setOccurredAtNanos(receivedAtNanos); + detection.setType(DetectionType.SYSTEM_MULTI_SOURCE_ACTIVE); + detection.setSeverity(DetectionSeverity.WARN); + detection.setDetails("primary=" + primaryStreamId); + + result.getDetections().add(detection); + } + + private String findPrimaryStreamId(SystemContext systemContext, long receivedAtNanos) { + long activeWindowNanos = config.getMultiSourceActiveWindowNanos(); + + for (Map.Entry entry : systemContext.getSourceStats().entrySet()) { + SourceStats stats = entry.getValue(); + if (!stats.isPrimary()) { + continue; + } + + long ageNanos = receivedAtNanos - stats.getLastSeenAtNanos(); + if (ageNanos >= 0 && ageNanos <= activeWindowNanos) { + return stats.getStreamId(); + } + } + + return null; + } + + private void markPrimary(SystemContext systemContext, String streamId, long receivedAtNanos) { + SourceStats stats = systemContext.getSourceStats().get(streamId); + if (stats == null) { + return; + } + + stats.setPrimary(true); + stats.setPrimarySinceAtNanos(receivedAtNanos); + } +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessorConfig.java b/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessorConfig.java new file mode 100644 index 0000000..6aca599 --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessorConfig.java @@ -0,0 +1,21 @@ +package io.mapsmessaging.mavlink.context; + +import lombok.Data; + +@Data +public class SequenceProcessorConfig { + + private int reorderDistanceWindow; + private long reorderTimeWindowNanos; + private long duplicateTimeWindowNanos; + private int suspiciousBackwardDistance; + private long multiSourceActiveWindowNanos; + + public SequenceProcessorConfig() { + this.reorderDistanceWindow = 20; + this.reorderTimeWindowNanos = 500_000_000L; + this.duplicateTimeWindowNanos = 1_000_000_000L; + this.suspiciousBackwardDistance = 64; + this.multiSourceActiveWindowNanos = 2_000_000_000L; + } +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SequenceRingBuffer256.java b/src/main/java/io/mapsmessaging/mavlink/context/SequenceRingBuffer256.java new file mode 100644 index 0000000..1ffdabd --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/SequenceRingBuffer256.java @@ -0,0 +1,22 @@ +package io.mapsmessaging.mavlink.context; + +import java.util.concurrent.atomic.AtomicReferenceArray; + +public class SequenceRingBuffer256 { + + private final AtomicReferenceArray entries; + + public SequenceRingBuffer256() { + this.entries = new AtomicReferenceArray<>(256); + } + + public SequenceRingEntry get(int sequence) { + int index = sequence & 0xFF; + return entries.get(index); + } + + public void put(int sequence, SequenceRingEntry entry) { + int index = sequence & 0xFF; + entries.set(index, entry); + } +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SequenceRingEntry.java b/src/main/java/io/mapsmessaging/mavlink/context/SequenceRingEntry.java new file mode 100644 index 0000000..a23d18d --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/SequenceRingEntry.java @@ -0,0 +1,11 @@ +package io.mapsmessaging.mavlink.context; + +import lombok.Data; + +@Data +public class SequenceRingEntry { + private int sequence; + private int fingerprint; + private String streamId; + private long lastSeenAtNanos; +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SequenceStats.java b/src/main/java/io/mapsmessaging/mavlink/context/SequenceStats.java new file mode 100644 index 0000000..c5ed6a9 --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/SequenceStats.java @@ -0,0 +1,15 @@ +package io.mapsmessaging.mavlink.context; + +import lombok.Data; + +@Data +public class SequenceStats { + private long duplicates; + private long reorders; + private long gaps; + private long lostPackets; + private long suspiciousBackwards; + private long resetsSuspected; + private long invalidFrames; + private long multiSourceActive; +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SourceStats.java b/src/main/java/io/mapsmessaging/mavlink/context/SourceStats.java new file mode 100644 index 0000000..77247ab --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/SourceStats.java @@ -0,0 +1,19 @@ +package io.mapsmessaging.mavlink.context; + +import lombok.Data; + +@Data +public class SourceStats { + + private final String streamId; + private long lastSeenAtNanos; + private long packetCount; + private long invalidPacketCount; + private boolean primary; + private long primarySinceAtNanos; + private Integer lastAcceptedSequenceFromSource; + + public SourceStats(String streamId) { + this.streamId = streamId; + } +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SweepConfig.java b/src/main/java/io/mapsmessaging/mavlink/context/SweepConfig.java new file mode 100644 index 0000000..586111e --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/SweepConfig.java @@ -0,0 +1,15 @@ +package io.mapsmessaging.mavlink.context; + +import lombok.Data; + +@Data +public class SweepConfig { + + private long systemTtlNanos; + private long sourceTtlNanos; + + public SweepConfig() { + this.systemTtlNanos = 10L * 60L * 1_000_000_000L; + this.sourceTtlNanos = 60L * 1_000_000_000L; + } +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SweepResult.java b/src/main/java/io/mapsmessaging/mavlink/context/SweepResult.java new file mode 100644 index 0000000..01074ac --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/SweepResult.java @@ -0,0 +1,9 @@ +package io.mapsmessaging.mavlink.context; + +import lombok.Data; + +@Data +public class SweepResult { + private int removedSystems; + private int removedSources; +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SystemContext.java b/src/main/java/io/mapsmessaging/mavlink/context/SystemContext.java new file mode 100644 index 0000000..a137f6b --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/SystemContext.java @@ -0,0 +1,117 @@ +package io.mapsmessaging.mavlink.context; + +import io.mapsmessaging.mavlink.message.Frame; +import lombok.Data; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +@Data +public class SystemContext { + + private int systemId; + private boolean initialized; + private int lastAcceptedSequence; + private long lastAcceptedAtNanos; + private long lastActivityAtNanos; + private SequenceRingBuffer256 sequenceRingBuffer; + private Map sourceStats; + private SequenceStats sequenceStats; + + public List onValidatedFrame(Frame frame, String streamId, long receivedAtNanos, SequenceProcessor sequenceProcessor) { + lastActivityAtNanos = receivedAtNanos; + + List detections = new ArrayList<>(); + + SourceStats statsForSource = sourceStats.computeIfAbsent(streamId, key -> new SourceStats(streamId)); + statsForSource.setLastSeenAtNanos(receivedAtNanos); + statsForSource.setPacketCount(statsForSource.getPacketCount() + 1); + + SequenceProcessingResult result = sequenceProcessor.process(this, frame, streamId, receivedAtNanos); + detections.addAll(result.getDetections()); + + return detections; + } + + public List onInvalidFrame(String streamId, long receivedAtNanos, FrameFailureReason reason) { + lastActivityAtNanos = receivedAtNanos; + + List detections = new ArrayList<>(); + + SourceStats statsForSource = sourceStats.computeIfAbsent(streamId, key -> new SourceStats(streamId)); + statsForSource.setLastSeenAtNanos(receivedAtNanos); + statsForSource.setInvalidPacketCount(statsForSource.getInvalidPacketCount() + 1); + + sequenceStats.setInvalidFrames(sequenceStats.getInvalidFrames() + 1); + + Detection detection = new Detection(); + detection.setSystemId(systemId); + detection.setStreamId(streamId); + detection.setOccurredAtNanos(receivedAtNanos); + detection.setType(DetectionType.FRAME_INVALID); + detection.setSeverity(DetectionSeverity.WARN); + detection.setDetails(reason.name()); + + detections.add(detection); + + return detections; + } + + public int sweep(long nowNanos, SweepConfig sweepConfig, SequenceProcessorConfig sequenceProcessorConfig) { + int removedSources = 0; + + long sourceTtlNanos = sweepConfig.getSourceTtlNanos(); + long activeWindowNanos = sequenceProcessorConfig.getMultiSourceActiveWindowNanos(); + + String currentPrimary = null; + + Iterator> iterator = sourceStats.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + SourceStats stats = entry.getValue(); + + long ageNanos = nowNanos - stats.getLastSeenAtNanos(); + if (ageNanos > sourceTtlNanos) { + iterator.remove(); + removedSources++; + continue; + } + + if (stats.isPrimary()) { + long primaryAgeNanos = nowNanos - stats.getLastSeenAtNanos(); + if (primaryAgeNanos <= activeWindowNanos) { + currentPrimary = stats.getStreamId(); + } + } + } + + if (currentPrimary == null) { + for (SourceStats stats : sourceStats.values()) { + if (stats.isPrimary()) { + stats.setPrimary(false); + stats.setPrimarySinceAtNanos(0L); + } + } + } + + return removedSources; + } + + public boolean isExpired(long nowNanos, SweepConfig sweepConfig) { + long ageNanos = nowNanos - lastActivityAtNanos; + return ageNanos > sweepConfig.getSystemTtlNanos(); + } + + public SystemContextSnapshot snapshot() { + SystemContextSnapshot snapshot = new SystemContextSnapshot(); + snapshot.setSystemId(systemId); + snapshot.setInitialized(initialized); + snapshot.setLastAcceptedSequence(lastAcceptedSequence); + snapshot.setLastAcceptedAtNanos(lastAcceptedAtNanos); + snapshot.setSequenceStats(sequenceStats); + snapshot.setSourceCount(sourceStats.size()); + return snapshot; + } +} diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SystemContextSnapshot.java b/src/main/java/io/mapsmessaging/mavlink/context/SystemContextSnapshot.java new file mode 100644 index 0000000..2e0ea2a --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/context/SystemContextSnapshot.java @@ -0,0 +1,13 @@ +package io.mapsmessaging.mavlink.context; + +import lombok.Data; + +@Data +public class SystemContextSnapshot { + private int systemId; + private boolean initialized; + private int lastAcceptedSequence; + private long lastAcceptedAtNanos; + private SequenceStats sequenceStats; + private int sourceCount; +} diff --git a/src/test/java/io/mapsmessaging/mavlink/SystemContextManagerTest.java b/src/test/java/io/mapsmessaging/mavlink/SystemContextManagerTest.java new file mode 100644 index 0000000..4140c36 --- /dev/null +++ b/src/test/java/io/mapsmessaging/mavlink/SystemContextManagerTest.java @@ -0,0 +1,198 @@ +package io.mapsmessaging.mavlink; + +import io.mapsmessaging.mavlink.context.*; +import io.mapsmessaging.mavlink.message.Frame; +import org.junit.jupiter.api.Test; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + +class SystemContextManagerTest { + + @Test + void validatedFrameCreatesContextAndNoDetectionsOnFirstFrame() { + SequenceProcessorConfig sequenceProcessorConfig = new SequenceProcessorConfig(); + SweepConfig sweepConfig = new SweepConfig(); + + SystemContextManager manager = new SystemContextManager(sequenceProcessorConfig, sweepConfig); + + Frame frame = frame(1, 1, 10, 33, payloadOf(1, 2, 3)); + List detections = manager.onValidatedFrame(frame, "udp:10.0.0.1:14550", 1_000L); + + assertNotNull(detections); + assertTrue(detections.isEmpty()); + + assertEquals(1, manager.getSystemContexts().size()); + assertNotNull(manager.getSystemContexts().get(1)); + } + + @Test + void invalidFrameDoesNotCreateContextWhenMissing() { + SequenceProcessorConfig sequenceProcessorConfig = new SequenceProcessorConfig(); + SweepConfig sweepConfig = new SweepConfig(); + + SystemContextManager manager = new SystemContextManager(sequenceProcessorConfig, sweepConfig); + + List detections = manager.onInvalidFrame(42, "udp:10.0.0.1:14550", 1_000L, FrameFailureReason.CRC_FAILED); + + assertNotNull(detections); + assertTrue(detections.isEmpty()); + assertTrue(manager.getSystemContexts().isEmpty()); + } + + @Test + void duplicateIsDetectedWithinDuplicateWindow() { + SequenceProcessorConfig sequenceProcessorConfig = new SequenceProcessorConfig(); + sequenceProcessorConfig.setDuplicateTimeWindowNanos(1_000L); + + SweepConfig sweepConfig = new SweepConfig(); + + SystemContextManager manager = new SystemContextManager(sequenceProcessorConfig, sweepConfig); + + String streamId = "udp:10.0.0.1:14550"; + + Frame first = frame(1, 1, 10, 33, payloadOf(1, 2, 3)); + assertTrue(manager.onValidatedFrame(first, streamId, 10_000L).isEmpty()); + + Frame duplicate = frame(1, 1, 10, 33, payloadOf(1, 2, 3)); + List detections = manager.onValidatedFrame(duplicate, streamId, 10_500L); + + assertEquals(1, detections.size()); + assertEquals(DetectionType.SEQ_DUPLICATE, detections.get(0).getType()); + } + + @Test + void sameSequenceDifferentFingerprintIsAlert() { + SequenceProcessorConfig sequenceProcessorConfig = new SequenceProcessorConfig(); + sequenceProcessorConfig.setDuplicateTimeWindowNanos(10_000L); + + SweepConfig sweepConfig = new SweepConfig(); + + SystemContextManager manager = new SystemContextManager(sequenceProcessorConfig, sweepConfig); + + String streamId = "udp:10.0.0.1:14550"; + + Frame first = frame(1, 1, 10, 33, payloadOf(1, 2, 3)); + assertTrue(manager.onValidatedFrame(first, streamId, 10_000L).isEmpty()); + + Frame conflicting = frame(1, 1, 10, 33, payloadOf(9, 9, 9)); + List detections = manager.onValidatedFrame(conflicting, streamId, 12_000L); + + assertEquals(1, detections.size()); + assertEquals(DetectionType.SEQ_SAME_SEQ_DIFFERENT_FINGERPRINT, detections.get(0).getType()); + assertEquals(DetectionSeverity.ALERT, detections.get(0).getSeverity()); + } + + @Test + void gapIsDetectedWhenSequenceJumpsForward() { + SequenceProcessorConfig sequenceProcessorConfig = new SequenceProcessorConfig(); + SweepConfig sweepConfig = new SweepConfig(); + + SystemContextManager manager = new SystemContextManager(sequenceProcessorConfig, sweepConfig); + + String streamId = "udp:10.0.0.1:14550"; + + Frame first = frame(1, 1, 10, 33, payloadOf(1)); + assertTrue(manager.onValidatedFrame(first, streamId, 10_000L).isEmpty()); + + Frame jump = frame(1, 1, 13, 33, payloadOf(2)); + List detections = manager.onValidatedFrame(jump, streamId, 11_000L); + + assertEquals(1, detections.size()); + assertEquals(DetectionType.SEQ_GAP, detections.get(0).getType()); + assertTrue(detections.get(0).getDetails().contains("lost=2")); + } + + @Test + void reorderIsDetectedWhenBackwardsWithinWindow() { + SequenceProcessorConfig sequenceProcessorConfig = new SequenceProcessorConfig(); + sequenceProcessorConfig.setReorderDistanceWindow(5); + sequenceProcessorConfig.setReorderTimeWindowNanos(10_000L); + + SweepConfig sweepConfig = new SweepConfig(); + + SystemContextManager manager = new SystemContextManager(sequenceProcessorConfig, sweepConfig); + + String streamId = "udp:10.0.0.1:14550"; + + Frame head = frame(1, 1, 20, 33, payloadOf(1)); + assertTrue(manager.onValidatedFrame(head, streamId, 10_000L).isEmpty()); + + Frame forward = frame(1, 1, 21, 33, payloadOf(2)); + assertTrue(manager.onValidatedFrame(forward, streamId, 11_000L).isEmpty()); + + Frame reorder = frame(1, 1, 19, 33, payloadOf(3)); + List detections = manager.onValidatedFrame(reorder, streamId, 12_000L); + + assertEquals(1, detections.size()); + assertEquals(DetectionType.SEQ_REORDER, detections.get(0).getType()); + assertTrue(detections.get(0).getDetails().contains("back=")); + } + + @Test + void sweepRemovesExpiredSystemContexts() { + SequenceProcessorConfig sequenceProcessorConfig = new SequenceProcessorConfig(); + + SweepConfig sweepConfig = new SweepConfig(); + sweepConfig.setSystemTtlNanos(1_000L); + sweepConfig.setSourceTtlNanos(10_000L); + + SystemContextManager manager = new SystemContextManager(sequenceProcessorConfig, sweepConfig); + + Frame frame = frame(1, 1, 10, 33, payloadOf(1, 2, 3)); + manager.onValidatedFrame(frame, "udp:10.0.0.1:14550", 1_000L); + + SweepResult result = manager.sweep(5_000L); + + assertEquals(1, result.getRemovedSystems()); + assertTrue(manager.getSystemContexts().isEmpty()); + } + + @Test + void sweepRemovesExpiredSourcesButKeepsSystemIfActive() { + SequenceProcessorConfig sequenceProcessorConfig = new SequenceProcessorConfig(); + + SweepConfig sweepConfig = new SweepConfig(); + sweepConfig.setSystemTtlNanos(100_000L); + sweepConfig.setSourceTtlNanos(1_000L); + + SystemContextManager manager = new SystemContextManager(sequenceProcessorConfig, sweepConfig); + + Frame frame = frame(1, 1, 10, 33, payloadOf(1)); + + manager.onValidatedFrame(frame, "udp:10.0.0.1:14550", 1_000L); + manager.onValidatedFrame(frame, "udp:10.0.0.2:14550", 1_100L); + + // Keep the system active (touch lastActivity) but age out sources. + manager.onValidatedFrame(frame, "udp:10.0.0.1:14550", 10_000L); + + SweepResult result = manager.sweep(20_000L); + + assertEquals(0, result.getRemovedSystems()); + assertTrue(result.getRemovedSources() >= 1); + assertEquals(1, manager.getSystemContexts().size()); + } + + private Frame frame(int systemId, int componentId, int sequence, int messageId, byte[] payload) { + Frame frame = new Frame(); + frame.setSystemId(systemId); + frame.setComponentId(componentId); + frame.setSequence(sequence); + frame.setMessageId(messageId); + frame.setPayload(payload); + frame.setPayloadLength(payload == null ? 0 : payload.length); + frame.setChecksum(0); + frame.setSigned(false); + frame.setValidated(true); + return frame; + } + + private byte[] payloadOf(int... bytes) { + byte[] payload = new byte[bytes.length]; + for (int index = 0; index < bytes.length; index++) { + payload[index] = (byte) bytes[index]; + } + return payload; + } +} \ No newline at end of file From 282deeae262f1c0a565ca8871d8cc5adbb83ec88 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sat, 17 Jan 2026 12:39:59 +1100 Subject: [PATCH 17/34] Add initial context and spoofing detection for the stream --- .../mavlink/MavlinkEventFactory.java | 60 +++++++++++++++++++ .../mapsmessaging/mavlink/ProcessedFrame.java | 16 +++++ .../mavlink/codec/PayloadParser.java | 3 +- .../mavlink/context/FrameFailureReason.java | 1 + .../mavlink/framing/V1FrameHandler.java | 5 +- .../mavlink/framing/V2FrameHandler.java | 30 +++++----- .../mapsmessaging/mavlink/message/Frame.java | 7 ++- 7 files changed, 100 insertions(+), 22 deletions(-) create mode 100644 src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java create mode 100644 src/main/java/io/mapsmessaging/mavlink/ProcessedFrame.java diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java new file mode 100644 index 0000000..30f702d --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java @@ -0,0 +1,60 @@ +package io.mapsmessaging.mavlink; + +import io.mapsmessaging.mavlink.context.Detection; +import io.mapsmessaging.mavlink.context.FrameFailureReason; +import io.mapsmessaging.mavlink.message.Frame; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +public class MavlinkEventFactory { + + private MavlinkFrameCodec frameCodec; + private SystemContextManager systemContextManager; + + public MavlinkEventFactory() throws IOException { + Optional codec = MavlinkMessageFormatLoader.getInstance().getDialect("common"); + if (codec.isPresent()) { + MavlinkCodec codecInstance = codec.get(); + frameCodec = new MavlinkFrameCodec(codecInstance); + systemContextManager = new SystemContextManager(); + } + else{ + throw new IOException("Mavlink default common codec not found"); + } + } + + public MavlinkEventFactory(MavlinkFrameCodec frameCodec, SystemContextManager systemContextManager){ + this.frameCodec = frameCodec; + this.systemContextManager = systemContextManager; + } + + public Optional unpack(String streamName, ByteBuffer payload) throws IOException { + long timestamp = System.nanoTime(); + + Optional frameOptional = frameCodec.tryUnpackFrame(payload); + if (frameOptional.isEmpty()) { + return Optional.empty(); + } + Frame frame = frameOptional.get(); + FrameFailureReason failureReason = frame.getValidated(); + if (failureReason == FrameFailureReason.OK) { + List detectionList = systemContextManager.onValidatedFrame(frame, streamName, timestamp); + Map fields = frameCodec.parsePayload(frame); + return Optional.of(new ProcessedFrame(frame, fields, true, detectionList)); + } + List detectionList = systemContextManager.onInvalidFrame( + frame.getSystemId(), + streamName, + timestamp, + failureReason + ); + return Optional.of(new ProcessedFrame(frame, Map.of(), false, detectionList)); + } + + + +} diff --git a/src/main/java/io/mapsmessaging/mavlink/ProcessedFrame.java b/src/main/java/io/mapsmessaging/mavlink/ProcessedFrame.java new file mode 100644 index 0000000..3f6f40d --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/ProcessedFrame.java @@ -0,0 +1,16 @@ +package io.mapsmessaging.mavlink; + +import io.mapsmessaging.mavlink.context.Detection; +import io.mapsmessaging.mavlink.message.Frame; +import lombok.Value; + +import java.util.List; +import java.util.Map; + +@Value +public class ProcessedFrame { + Frame frame; + Map fields; + boolean valid; + List detections; +} diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/PayloadParser.java b/src/main/java/io/mapsmessaging/mavlink/codec/PayloadParser.java index 48457ce..fad7b85 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/PayloadParser.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/PayloadParser.java @@ -45,8 +45,7 @@ public PayloadParser(MessageRegistry messageRegistry) { } public Map parsePayload(int messageId, byte[] payload) throws IOException { - CompiledMessage compiledMessage = - messageRegistry.getCompiledMessagesById().get(messageId); + CompiledMessage compiledMessage = messageRegistry.getCompiledMessagesById().get(messageId); if (compiledMessage == null) { throw new IllegalArgumentException("Unknown MAVLink message id: " + messageId); } diff --git a/src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java b/src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java index 6532549..06c0262 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java @@ -1,6 +1,7 @@ package io.mapsmessaging.mavlink.context; public enum FrameFailureReason { + OK, CRC_FAILED, SIGNATURE_FAILED, CRC_AND_SIGNATURE_FAILED, diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/V1FrameHandler.java b/src/main/java/io/mapsmessaging/mavlink/framing/V1FrameHandler.java index d2436bc..71b9e00 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/V1FrameHandler.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/V1FrameHandler.java @@ -19,6 +19,7 @@ package io.mapsmessaging.mavlink.framing; +import io.mapsmessaging.mavlink.context.FrameFailureReason; import io.mapsmessaging.mavlink.message.Frame; import io.mapsmessaging.mavlink.message.Version; import io.mapsmessaging.mavlink.message.X25Crc; @@ -81,8 +82,9 @@ public Optional tryDecode(ByteBuffer candidateFrame) { int crcExtra = dialectRegistry.crcExtra(Version.V1, messageId); int computedChecksum = CrcHelper.computeChecksumFromWritten(candidateFrame, frameStartIndex + 1, (HEADER_LENGTH) + payloadLength-1, crcExtra); + FrameFailureReason v = FrameFailureReason.OK; if (computedChecksum != receivedChecksum) { - return Optional.empty(); + v = FrameFailureReason.CRC_FAILED; } byte[] payload = ByteBufferUtils.copyBytes(candidateFrame, payloadStartIndex, payloadLength); @@ -100,6 +102,7 @@ public Optional tryDecode(ByteBuffer candidateFrame) { frame.setIncompatibilityFlags((byte) 0); frame.setCompatibilityFlags((byte) 0); frame.setSignature(null); + frame.setValidated(v); return Optional.of(frame); } diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameHandler.java b/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameHandler.java index 920ea74..f84d98e 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameHandler.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameHandler.java @@ -19,6 +19,7 @@ package io.mapsmessaging.mavlink.framing; +import io.mapsmessaging.mavlink.context.FrameFailureReason; import io.mapsmessaging.mavlink.message.Frame; import io.mapsmessaging.mavlink.message.Version; @@ -66,6 +67,8 @@ public int computeTotalFrameLength(ByteBuffer buffer, int frameStartIndex, int p @Override public Optional tryDecode(ByteBuffer candidateFrame) { + FrameFailureReason validated = FrameFailureReason.OK; + int frameStartIndex = candidateFrame.position(); int stx = candidateFrame.get(frameStartIndex) & 0xFF; @@ -98,26 +101,22 @@ public Optional tryDecode(ByteBuffer candidateFrame) { int crcExtra = dialectRegistry.crcExtra(Version.V2, messageId); int checksum = CrcHelper.computeChecksumFromWritten(candidateFrame, frameStartIndex+1, (HEADER_LENGTH-1) + payloadLength, crcExtra); + byte[] payload = new byte[0]; + byte[] signature = null; if (checksum != receivedChecksum) { - return Optional.empty(); + validated = FrameFailureReason.CRC_FAILED; } - - byte[] payload = ByteBufferUtils.copyBytes(candidateFrame, payloadStartIndex, payloadLength); - - byte[] signature = null; - boolean validated = false; - if (signed) { - int signatureStartIndex = crcStartIndex + CRC_LENGTH; - signature = ByteBufferUtils.copyBytes(candidateFrame, signatureStartIndex, SIGNATURE_LENGTH); - if (signingKeyProvider.canValidate()) { - if (!validateSignature(candidateFrame, frameStartIndex, crcStartIndex, systemId, componentId, signature)) { - return Optional.empty(); - } else { - validated = true; + else { + payload = ByteBufferUtils.copyBytes(candidateFrame, payloadStartIndex, payloadLength); + if (signed) { + int signatureStartIndex = crcStartIndex + CRC_LENGTH; + signature = ByteBufferUtils.copyBytes(candidateFrame, signatureStartIndex, SIGNATURE_LENGTH); + if (signingKeyProvider.canValidate() && + !validateSignature(candidateFrame, frameStartIndex, crcStartIndex, systemId, componentId, signature)) { + validated = FrameFailureReason.SIGNATURE_FAILED; } } } - Frame frame = new Frame(); frame.setVersion(Version.V2); frame.setSequence(sequence); @@ -132,7 +131,6 @@ public Optional tryDecode(ByteBuffer candidateFrame) { frame.setCompatibilityFlags(compatibilityFlags); frame.setSignature(signature); frame.setValidated(validated); - return Optional.of(frame); } diff --git a/src/main/java/io/mapsmessaging/mavlink/message/Frame.java b/src/main/java/io/mapsmessaging/mavlink/message/Frame.java index 5ca5947..f821fda 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/Frame.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/Frame.java @@ -19,6 +19,7 @@ package io.mapsmessaging.mavlink.message; +import io.mapsmessaging.mavlink.context.FrameFailureReason; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -129,9 +130,9 @@ public class Frame { @Schema( description = "True if CRC and (if present) signature validation succeeded", - example = "true", + example = "OK", requiredMode = Schema.RequiredMode.REQUIRED, - defaultValue = "false" + defaultValue = "OK" ) - private boolean validated = false; + private FrameFailureReason validated = FrameFailureReason.OK; } \ No newline at end of file From b9bb3e295ffcc769427409a2efdb441d5f917534 Mon Sep 17 00:00:00 2001 From: matthew Date: Sat, 17 Jan 2026 14:58:26 +1100 Subject: [PATCH 18/34] fix tests --- .../io/mapsmessaging/mavlink/context/FrameFailureReason.java | 1 + .../java/io/mapsmessaging/mavlink/framing/FramePacker.java | 3 ++- .../io/mapsmessaging/mavlink/framing/V2FrameHandler.java | 3 +++ .../mavlink/MavlinkFrameRoundTripAllMessagesTest.java | 5 +++-- .../io/mapsmessaging/mavlink/SystemContextManagerTest.java | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java b/src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java index 06c0262..5bf3ff0 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java @@ -6,5 +6,6 @@ public enum FrameFailureReason { SIGNATURE_FAILED, CRC_AND_SIGNATURE_FAILED, MALFORMED, + UNSIGNED, UNKNOWN } diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/FramePacker.java b/src/main/java/io/mapsmessaging/mavlink/framing/FramePacker.java index 3dcb0de..3bf661b 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/FramePacker.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/FramePacker.java @@ -19,6 +19,7 @@ package io.mapsmessaging.mavlink.framing; +import io.mapsmessaging.mavlink.context.FrameFailureReason; import io.mapsmessaging.mavlink.message.Frame; import io.mapsmessaging.mavlink.message.Version; @@ -190,7 +191,7 @@ private void packV2(ByteBuffer out, Frame frame) { frame.setChecksum(checksum); frame.setIncompatibilityFlags(incompatibilityFlags); frame.setSignature(signature); - frame.setValidated(signed); + frame.setValidated(FrameFailureReason.OK); } private static void requireRemaining(ByteBuffer out, int required) { if (out.remaining() < required) { diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameHandler.java b/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameHandler.java index f84d98e..303630b 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameHandler.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameHandler.java @@ -116,6 +116,9 @@ public Optional tryDecode(ByteBuffer candidateFrame) { validated = FrameFailureReason.SIGNATURE_FAILED; } } + else{ + validated = FrameFailureReason.UNSIGNED; + } } Frame frame = new Frame(); frame.setVersion(Version.V2); diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java index f2739b0..8ffa3b0 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java @@ -19,6 +19,7 @@ package io.mapsmessaging.mavlink; +import io.mapsmessaging.mavlink.context.FrameFailureReason; import io.mapsmessaging.mavlink.message.CompiledMessage; import io.mapsmessaging.mavlink.message.Frame; import io.mapsmessaging.mavlink.message.MessageRegistry; @@ -120,12 +121,12 @@ private static void frameRoundTripForMessageV2( if (signFrame) { assertTrue(decoded.isSigned(), "Expected signed frame"); - assertTrue(decoded.isValidated(), "Expected signature validation to succeed"); + assertEquals(FrameFailureReason.OK, decoded.getValidated(), "Expected signature validation to succeed"); assertNotNull(decoded.getSignature(), "Expected signature bytes"); assertEquals(13, decoded.getSignature().length, "Expected 13-byte MAVLink v2 signature block"); } else { assertFalse(decoded.isSigned(), "Expected unsigned frame"); - assertFalse(decoded.isValidated(), "Expected validated=false for unsigned frame"); + assertNotEquals(FrameFailureReason.OK, decoded.getValidated(), "Expected validated=false for unsigned frame"); assertNull(decoded.getSignature(), "Expected signature to be null for unsigned frame"); } diff --git a/src/test/java/io/mapsmessaging/mavlink/SystemContextManagerTest.java b/src/test/java/io/mapsmessaging/mavlink/SystemContextManagerTest.java index 4140c36..ac244d0 100644 --- a/src/test/java/io/mapsmessaging/mavlink/SystemContextManagerTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/SystemContextManagerTest.java @@ -184,7 +184,7 @@ private Frame frame(int systemId, int componentId, int sequence, int messageId, frame.setPayloadLength(payload == null ? 0 : payload.length); frame.setChecksum(0); frame.setSigned(false); - frame.setValidated(true); + frame.setValidated(FrameFailureReason.OK); return frame; } From 0cb46d066105c95c75c0d6226353ac7ac7385113 Mon Sep 17 00:00:00 2001 From: matthew Date: Sat, 17 Jan 2026 15:09:11 +1100 Subject: [PATCH 19/34] add message name --- .../mapsmessaging/mavlink/MavlinkEventFactory.java | 12 +++++++++--- .../io/mapsmessaging/mavlink/ProcessedFrame.java | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java index 30f702d..e9a8822 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java @@ -2,6 +2,7 @@ import io.mapsmessaging.mavlink.context.Detection; import io.mapsmessaging.mavlink.context.FrameFailureReason; +import io.mapsmessaging.mavlink.message.CompiledMessage; import io.mapsmessaging.mavlink.message.Frame; import java.io.IOException; @@ -41,10 +42,15 @@ public Optional unpack(String streamName, ByteBuffer payload) th } Frame frame = frameOptional.get(); FrameFailureReason failureReason = frame.getValidated(); + Map fields = frameCodec.parsePayload(frame); + String name = ""; + CompiledMessage message = frameCodec.getRegistry().getCompiledMessagesById().get(frame.getMessageId()); + if(message != null){ + name = message.getName(); + } if (failureReason == FrameFailureReason.OK) { List detectionList = systemContextManager.onValidatedFrame(frame, streamName, timestamp); - Map fields = frameCodec.parsePayload(frame); - return Optional.of(new ProcessedFrame(frame, fields, true, detectionList)); + return Optional.of(new ProcessedFrame(name, frame, fields, true, detectionList)); } List detectionList = systemContextManager.onInvalidFrame( frame.getSystemId(), @@ -52,7 +58,7 @@ public Optional unpack(String streamName, ByteBuffer payload) th timestamp, failureReason ); - return Optional.of(new ProcessedFrame(frame, Map.of(), false, detectionList)); + return Optional.of(new ProcessedFrame(name, frame, Map.of(), false, detectionList)); } diff --git a/src/main/java/io/mapsmessaging/mavlink/ProcessedFrame.java b/src/main/java/io/mapsmessaging/mavlink/ProcessedFrame.java index 3f6f40d..f6ee815 100644 --- a/src/main/java/io/mapsmessaging/mavlink/ProcessedFrame.java +++ b/src/main/java/io/mapsmessaging/mavlink/ProcessedFrame.java @@ -9,6 +9,7 @@ @Value public class ProcessedFrame { + String messageName; Frame frame; Map fields; boolean valid; From 20a928b09a886b581b230c3a1d920fdbc6362249 Mon Sep 17 00:00:00 2001 From: matthew Date: Sat, 17 Jan 2026 16:10:15 +1100 Subject: [PATCH 20/34] add message name --- src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java index e9a8822..8320fa7 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java @@ -48,7 +48,7 @@ public Optional unpack(String streamName, ByteBuffer payload) th if(message != null){ name = message.getName(); } - if (failureReason == FrameFailureReason.OK) { + if (failureReason == FrameFailureReason.OK || failureReason == FrameFailureReason.UNSIGNED) { List detectionList = systemContextManager.onValidatedFrame(frame, streamName, timestamp); return Optional.of(new ProcessedFrame(name, frame, fields, true, detectionList)); } From d24f64b43f365f56e2f2952d981435a099e29b3c Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sat, 17 Jan 2026 19:28:40 +1100 Subject: [PATCH 21/34] cleanup and update copytight --- pom.xml | 16 ++++++++++++-- .../mavlink/MavlinkEventFactory.java | 22 +++++++++++++++++++ .../mavlink/MavlinkFrameEnvelope.java | 13 ++++++----- .../mavlink/MavlinkMessageFormatLoader.java | 14 +++++++----- .../mapsmessaging/mavlink/ProcessedFrame.java | 20 +++++++++++++++++ .../mavlink/SystemContextManager.java | 20 +++++++++++++++++ .../mavlink/codec/FrameEncoder.java | 13 ++++++----- .../mavlink/codec/FrameFactory.java | 13 ++++++----- .../mavlink/codec/JsonCodec.java | 13 ++++++----- .../mavlink/codec/JsonValuesExtractor.java | 13 ++++++----- .../mavlink/codec/MapConverter.java | 13 ++++++----- .../mavlink/{ => codec}/MavlinkCodec.java | 17 +++++++------- .../{ => codec}/MavlinkFrameCodec.java | 16 ++++++++------ .../mavlink/codec/PayloadPacker.java | 13 ++++++----- .../mavlink/codec/PayloadParser.java | 13 ++++++----- .../mavlink/context/Detection.java | 20 +++++++++++++++++ .../mavlink/context/DetectionSeverity.java | 20 +++++++++++++++++ .../mavlink/context/DetectionType.java | 20 +++++++++++++++++ .../mavlink/context/FrameFailureReason.java | 20 +++++++++++++++++ .../mavlink/context/FrameFingerprint.java | 20 +++++++++++++++++ .../context/SequenceProcessingResult.java | 20 +++++++++++++++++ .../mavlink/context/SequenceProcessor.java | 20 +++++++++++++++++ .../context/SequenceProcessorConfig.java | 20 +++++++++++++++++ .../context/SequenceRingBuffer256.java | 20 +++++++++++++++++ .../mavlink/context/SequenceRingEntry.java | 20 +++++++++++++++++ .../mavlink/context/SequenceStats.java | 20 +++++++++++++++++ .../mavlink/context/SourceStats.java | 20 +++++++++++++++++ .../mavlink/context/SweepConfig.java | 20 +++++++++++++++++ .../mavlink/context/SweepResult.java | 20 +++++++++++++++++ .../mavlink/context/SystemContext.java | 20 +++++++++++++++++ .../context/SystemContextSnapshot.java | 20 +++++++++++++++++ .../mavlink/framing/ByteBufferUtils.java | 13 ++++++----- .../mavlink/framing/CrcHelper.java | 13 ++++++----- .../mavlink/framing/DialectRegistry.java | 13 ++++++----- .../mavlink/framing/FrameDecoder.java | 13 ++++++----- .../mavlink/framing/FrameFramer.java | 13 ++++++----- .../mavlink/framing/FrameHandler.java | 13 ++++++----- .../mavlink/framing/FramePacker.java | 13 ++++++----- .../mavlink/framing/SigningKeyProvider.java | 13 ++++++----- .../mavlink/framing/V1FrameHandler.java | 13 ++++++----- .../mavlink/framing/V2FrameHandler.java | 13 ++++++----- .../mavlink/framing/V2FrameSigning.java | 13 ++++++----- .../mavlink/framing/V2SignatureGenerator.java | 13 ++++++----- .../mavlink/message/CompiledField.java | 13 ++++++----- .../mavlink/message/CompiledMessage.java | 13 ++++++----- .../mavlink/message/EnumResolver.java | 13 ++++++----- .../mapsmessaging/mavlink/message/Frame.java | 13 ++++++----- .../mavlink/message/FrameParser.java | 13 ++++++----- .../mavlink/message/MessageDefinition.java | 13 ++++++----- .../mavlink/message/MessageRegistry.java | 13 ++++++----- .../mavlink/message/Version.java | 13 ++++++----- .../mapsmessaging/mavlink/message/X25Crc.java | 13 ++++++----- .../fields/AbstractMavlinkFieldCodec.java | 13 ++++++----- .../message/fields/ArrayFieldCodec.java | 13 ++++++----- .../message/fields/CharFieldCodec.java | 13 ++++++----- .../message/fields/DoubleFieldCodec.java | 13 ++++++----- .../message/fields/EnumDefinition.java | 13 ++++++----- .../mavlink/message/fields/EnumEntry.java | 13 ++++++----- .../message/fields/FieldCodecFactory.java | 13 ++++++----- .../message/fields/FieldDefinition.java | 13 ++++++----- .../message/fields/FloatFieldCodec.java | 13 ++++++----- .../message/fields/Int16FieldCodec.java | 13 ++++++----- .../message/fields/Int32FieldCodec.java | 13 ++++++----- .../message/fields/Int64FieldCodec.java | 13 ++++++----- .../message/fields/Int8FieldCodec.java | 13 ++++++----- .../message/fields/UInt16FieldCodec.java | 13 ++++++----- .../message/fields/UInt32FieldCodec.java | 13 ++++++----- .../message/fields/UInt64FieldCodec.java | 13 ++++++----- .../message/fields/UInt8FieldCodec.java | 13 ++++++----- .../mavlink/message/fields/WireType.java | 13 ++++++----- .../parser/ClasspathIncludeResolver.java | 13 ++++++----- .../mavlink/parser/DialectDefinition.java | 13 ++++++----- .../mavlink/parser/DialectLoader.java | 13 ++++++----- .../mavlink/parser/ExtraCrcCalculator.java | 13 ++++++----- .../mavlink/parser/IncludeResolver.java | 13 ++++++----- .../mavlink/parser/XmlParser.java | 13 ++++++----- .../mavlink/schema/JsonSchemaBuilder.java | 13 ++++++----- .../signing/MapSigningKeyProvider.java | 13 ++++++----- .../mavlink/signing/NoSigningKeyProvider.java | 13 ++++++----- .../signing/StaticSigningKeyProvider.java | 13 ++++++----- .../mavlink/BaseRoudTripTest.java | 13 ++++++----- .../mapsmessaging/mavlink/HeartbeatTest.java | 15 ++++++++----- .../MavlinkFrameRoundTripAllMessagesTest.java | 15 ++++++++----- ...avlinkPayloadJsonSchemaValidationTest.java | 14 +++++++----- .../MavlinkRoundTripAllMessagesTest.java | 14 +++++++----- .../mavlink/MavlinkTestSupport.java | 14 +++++++----- .../mavlink/SystemContextManagerTest.java | 20 +++++++++++++++++ .../mavlink/TestMavlinkCharArrays.java | 14 +++++++----- .../mavlink/TestMavlinkConcurrency.java | 14 +++++++----- .../mavlink/TestMavlinkExtensions.java | 14 +++++++----- .../mavlink/TestMavlinkNumericArrays.java | 14 +++++++----- .../TestMavlinkRegistryInvariants.java | 14 +++++++----- .../mavlink/TestMavlinkRobustness.java | 14 +++++++----- .../mavlink/TestMavlinkXmlParserIncludes.java | 13 ++++++----- .../io/mapsmessaging/mavlink/X25CrcTest.java | 13 ++++++----- 95 files changed, 951 insertions(+), 450 deletions(-) rename src/main/java/io/mapsmessaging/mavlink/{ => codec}/MavlinkCodec.java (88%) rename src/main/java/io/mapsmessaging/mavlink/{ => codec}/MavlinkFrameCodec.java (95%) diff --git a/pom.xml b/pom.xml index e80b7eb..be34c46 100644 --- a/pom.xml +++ b/pom.xml @@ -392,8 +392,20 @@ 1.5.1 test
- - + + + org.mockito + mockito-junit-jupiter + 5.21.0 + test + + + + org.mockito + mockito-core + 5.21.0 + test + diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java index 8320fa7..55351d5 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java @@ -1,5 +1,27 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink; +import io.mapsmessaging.mavlink.codec.MavlinkCodec; +import io.mapsmessaging.mavlink.codec.MavlinkFrameCodec; import io.mapsmessaging.mavlink.context.Detection; import io.mapsmessaging.mavlink.context.FrameFailureReason; import io.mapsmessaging.mavlink.message.CompiledMessage; diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameEnvelope.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameEnvelope.java index ce27c3f..ecd4207 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameEnvelope.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameEnvelope.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java index ca6a8ae..95a1802 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,15 +9,18 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; +import io.mapsmessaging.mavlink.codec.MavlinkCodec; import io.mapsmessaging.mavlink.codec.PayloadPacker; import io.mapsmessaging.mavlink.codec.PayloadParser; import io.mapsmessaging.mavlink.message.MessageRegistry; diff --git a/src/main/java/io/mapsmessaging/mavlink/ProcessedFrame.java b/src/main/java/io/mapsmessaging/mavlink/ProcessedFrame.java index f6ee815..5193b70 100644 --- a/src/main/java/io/mapsmessaging/mavlink/ProcessedFrame.java +++ b/src/main/java/io/mapsmessaging/mavlink/ProcessedFrame.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink; import io.mapsmessaging.mavlink.context.Detection; diff --git a/src/main/java/io/mapsmessaging/mavlink/SystemContextManager.java b/src/main/java/io/mapsmessaging/mavlink/SystemContextManager.java index 40e39ca..7e607d1 100644 --- a/src/main/java/io/mapsmessaging/mavlink/SystemContextManager.java +++ b/src/main/java/io/mapsmessaging/mavlink/SystemContextManager.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink; import io.mapsmessaging.mavlink.context.*; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/FrameEncoder.java b/src/main/java/io/mapsmessaging/mavlink/codec/FrameEncoder.java index 174dab7..7f265f2 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/FrameEncoder.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/FrameEncoder.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.codec; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/FrameFactory.java b/src/main/java/io/mapsmessaging/mavlink/codec/FrameFactory.java index 7db07fa..ee551d5 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/FrameFactory.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/FrameFactory.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.codec; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/JsonCodec.java b/src/main/java/io/mapsmessaging/mavlink/codec/JsonCodec.java index cc4ad33..b484f95 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/JsonCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/JsonCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.codec; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/JsonValuesExtractor.java b/src/main/java/io/mapsmessaging/mavlink/codec/JsonValuesExtractor.java index 2944da9..dbde5be 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/JsonValuesExtractor.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/JsonValuesExtractor.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.codec; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/MapConverter.java b/src/main/java/io/mapsmessaging/mavlink/codec/MapConverter.java index 5dd6b52..47c3014 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/MapConverter.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/MapConverter.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.codec; diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkCodec.java b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkCodec.java similarity index 88% rename from src/main/java/io/mapsmessaging/mavlink/MavlinkCodec.java rename to src/main/java/io/mapsmessaging/mavlink/codec/MavlinkCodec.java index 0b03d6a..d4bc237 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,17 +9,17 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ -package io.mapsmessaging.mavlink; +package io.mapsmessaging.mavlink.codec; -import io.mapsmessaging.mavlink.codec.PayloadPacker; -import io.mapsmessaging.mavlink.codec.PayloadParser; import io.mapsmessaging.mavlink.message.MessageRegistry; import lombok.Getter; diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameCodec.java similarity index 95% rename from src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java rename to src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameCodec.java index f511695..fcbcc47 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkFrameCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/MavlinkFrameCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,15 +9,18 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ -package io.mapsmessaging.mavlink; +package io.mapsmessaging.mavlink.codec; +import io.mapsmessaging.mavlink.MavlinkFrameEnvelope; import io.mapsmessaging.mavlink.framing.*; import io.mapsmessaging.mavlink.message.CompiledMessage; import io.mapsmessaging.mavlink.message.Frame; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/PayloadPacker.java b/src/main/java/io/mapsmessaging/mavlink/codec/PayloadPacker.java index 5106de4..30b64bc 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/PayloadPacker.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/PayloadPacker.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.codec; diff --git a/src/main/java/io/mapsmessaging/mavlink/codec/PayloadParser.java b/src/main/java/io/mapsmessaging/mavlink/codec/PayloadParser.java index fad7b85..72e36a9 100644 --- a/src/main/java/io/mapsmessaging/mavlink/codec/PayloadParser.java +++ b/src/main/java/io/mapsmessaging/mavlink/codec/PayloadParser.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.codec; diff --git a/src/main/java/io/mapsmessaging/mavlink/context/Detection.java b/src/main/java/io/mapsmessaging/mavlink/context/Detection.java index b2b4807..0726727 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/Detection.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/Detection.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; import lombok.Data; diff --git a/src/main/java/io/mapsmessaging/mavlink/context/DetectionSeverity.java b/src/main/java/io/mapsmessaging/mavlink/context/DetectionSeverity.java index 394482c..26d19be 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/DetectionSeverity.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/DetectionSeverity.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; public enum DetectionSeverity { diff --git a/src/main/java/io/mapsmessaging/mavlink/context/DetectionType.java b/src/main/java/io/mapsmessaging/mavlink/context/DetectionType.java index 081b7d2..839a072 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/DetectionType.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/DetectionType.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; public enum DetectionType { diff --git a/src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java b/src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java index 5bf3ff0..b98c989 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/FrameFailureReason.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; public enum FrameFailureReason { diff --git a/src/main/java/io/mapsmessaging/mavlink/context/FrameFingerprint.java b/src/main/java/io/mapsmessaging/mavlink/context/FrameFingerprint.java index 2f1b345..17fc96d 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/FrameFingerprint.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/FrameFingerprint.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; import io.mapsmessaging.mavlink.message.Frame; diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessingResult.java b/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessingResult.java index 75c4a5d..b5544c0 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessingResult.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessingResult.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; import lombok.Data; diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessor.java b/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessor.java index 8ddded9..914305c 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessor.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessor.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; import io.mapsmessaging.mavlink.message.Frame; diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessorConfig.java b/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessorConfig.java index 6aca599..dee39ff 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessorConfig.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/SequenceProcessorConfig.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; import lombok.Data; diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SequenceRingBuffer256.java b/src/main/java/io/mapsmessaging/mavlink/context/SequenceRingBuffer256.java index 1ffdabd..96e92ff 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/SequenceRingBuffer256.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/SequenceRingBuffer256.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; import java.util.concurrent.atomic.AtomicReferenceArray; diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SequenceRingEntry.java b/src/main/java/io/mapsmessaging/mavlink/context/SequenceRingEntry.java index a23d18d..b24f06c 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/SequenceRingEntry.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/SequenceRingEntry.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; import lombok.Data; diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SequenceStats.java b/src/main/java/io/mapsmessaging/mavlink/context/SequenceStats.java index c5ed6a9..9a79cf0 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/SequenceStats.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/SequenceStats.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; import lombok.Data; diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SourceStats.java b/src/main/java/io/mapsmessaging/mavlink/context/SourceStats.java index 77247ab..f30d340 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/SourceStats.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/SourceStats.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; import lombok.Data; diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SweepConfig.java b/src/main/java/io/mapsmessaging/mavlink/context/SweepConfig.java index 586111e..213eb15 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/SweepConfig.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/SweepConfig.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; import lombok.Data; diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SweepResult.java b/src/main/java/io/mapsmessaging/mavlink/context/SweepResult.java index 01074ac..275f97a 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/SweepResult.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/SweepResult.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; import lombok.Data; diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SystemContext.java b/src/main/java/io/mapsmessaging/mavlink/context/SystemContext.java index a137f6b..a7c99fa 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/SystemContext.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/SystemContext.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; import io.mapsmessaging.mavlink.message.Frame; diff --git a/src/main/java/io/mapsmessaging/mavlink/context/SystemContextSnapshot.java b/src/main/java/io/mapsmessaging/mavlink/context/SystemContextSnapshot.java index 2e0ea2a..c5f159f 100644 --- a/src/main/java/io/mapsmessaging/mavlink/context/SystemContextSnapshot.java +++ b/src/main/java/io/mapsmessaging/mavlink/context/SystemContextSnapshot.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink.context; import lombok.Data; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/ByteBufferUtils.java b/src/main/java/io/mapsmessaging/mavlink/framing/ByteBufferUtils.java index b9ea22f..11ac5c6 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/ByteBufferUtils.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/ByteBufferUtils.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/CrcHelper.java b/src/main/java/io/mapsmessaging/mavlink/framing/CrcHelper.java index d3b3e36..e370050 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/CrcHelper.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/CrcHelper.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/DialectRegistry.java b/src/main/java/io/mapsmessaging/mavlink/framing/DialectRegistry.java index 199e5a7..4e9adc9 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/DialectRegistry.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/DialectRegistry.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/FrameDecoder.java b/src/main/java/io/mapsmessaging/mavlink/framing/FrameDecoder.java index 29ff010..df202cb 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/FrameDecoder.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/FrameDecoder.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/FrameFramer.java b/src/main/java/io/mapsmessaging/mavlink/framing/FrameFramer.java index baf80bf..d9a18a6 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/FrameFramer.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/FrameFramer.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/FrameHandler.java b/src/main/java/io/mapsmessaging/mavlink/framing/FrameHandler.java index 9e8a8f3..534b2cf 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/FrameHandler.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/FrameHandler.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/FramePacker.java b/src/main/java/io/mapsmessaging/mavlink/framing/FramePacker.java index 3bf661b..0a24320 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/FramePacker.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/FramePacker.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/SigningKeyProvider.java b/src/main/java/io/mapsmessaging/mavlink/framing/SigningKeyProvider.java index 3accbd3..71b151a 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/SigningKeyProvider.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/SigningKeyProvider.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/V1FrameHandler.java b/src/main/java/io/mapsmessaging/mavlink/framing/V1FrameHandler.java index 71b9e00..7ac0d97 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/V1FrameHandler.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/V1FrameHandler.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameHandler.java b/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameHandler.java index 303630b..534e214 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameHandler.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameHandler.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameSigning.java b/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameSigning.java index bfcbae5..8828ecd 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameSigning.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/V2FrameSigning.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/framing/V2SignatureGenerator.java b/src/main/java/io/mapsmessaging/mavlink/framing/V2SignatureGenerator.java index dc4aa84..1d23c0b 100644 --- a/src/main/java/io/mapsmessaging/mavlink/framing/V2SignatureGenerator.java +++ b/src/main/java/io/mapsmessaging/mavlink/framing/V2SignatureGenerator.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.framing; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/CompiledField.java b/src/main/java/io/mapsmessaging/mavlink/message/CompiledField.java index bbb8300..81f95d6 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/CompiledField.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/CompiledField.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/CompiledMessage.java b/src/main/java/io/mapsmessaging/mavlink/message/CompiledMessage.java index 433f20e..222ab9a 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/CompiledMessage.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/CompiledMessage.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/EnumResolver.java b/src/main/java/io/mapsmessaging/mavlink/message/EnumResolver.java index fb50ca2..695485e 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/EnumResolver.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/EnumResolver.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/Frame.java b/src/main/java/io/mapsmessaging/mavlink/message/Frame.java index f821fda..b140a35 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/Frame.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/Frame.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/FrameParser.java b/src/main/java/io/mapsmessaging/mavlink/message/FrameParser.java index 971032a..6b08a6a 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/FrameParser.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/FrameParser.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MessageDefinition.java b/src/main/java/io/mapsmessaging/mavlink/message/MessageDefinition.java index b6c5735..1287f11 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MessageDefinition.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/MessageDefinition.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/MessageRegistry.java b/src/main/java/io/mapsmessaging/mavlink/message/MessageRegistry.java index c8e0280..8c85603 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/MessageRegistry.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/MessageRegistry.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/Version.java b/src/main/java/io/mapsmessaging/mavlink/message/Version.java index 8736469..2b5aa1a 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/Version.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/Version.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/X25Crc.java b/src/main/java/io/mapsmessaging/mavlink/message/X25Crc.java index a92b2af..52871d6 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/X25Crc.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/X25Crc.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/AbstractMavlinkFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/AbstractMavlinkFieldCodec.java index 085aaf0..086d7e2 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/AbstractMavlinkFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/AbstractMavlinkFieldCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java index 9c9bfcb..bcf6821 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/ArrayFieldCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java index fe0e385..cbd12c2 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/DoubleFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/DoubleFieldCodec.java index 4534e4e..984913d 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/DoubleFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/DoubleFieldCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/EnumDefinition.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/EnumDefinition.java index 18cc395..788f66b 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/EnumDefinition.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/EnumDefinition.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/EnumEntry.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/EnumEntry.java index 2391172..a92f477 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/EnumEntry.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/EnumEntry.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/FieldCodecFactory.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/FieldCodecFactory.java index 66c453b..994cad0 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/FieldCodecFactory.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/FieldCodecFactory.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/FieldDefinition.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/FieldDefinition.java index 5fc864f..3f585d6 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/FieldDefinition.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/FieldDefinition.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/FloatFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/FloatFieldCodec.java index 2f2c7eb..d418bd7 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/FloatFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/FloatFieldCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int16FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int16FieldCodec.java index cf54f7f..1fceda7 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int16FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int16FieldCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int32FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int32FieldCodec.java index 1e3a844..e8bed0e 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int32FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int32FieldCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int64FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int64FieldCodec.java index 137cc8f..8da71c4 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int64FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int64FieldCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int8FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int8FieldCodec.java index 9df3b3c..e9c2df2 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/Int8FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/Int8FieldCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt16FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt16FieldCodec.java index 045198c..7d541ba 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt16FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt16FieldCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt32FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt32FieldCodec.java index b148487..156e628 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt32FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt32FieldCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt64FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt64FieldCodec.java index 23ff4e1..87b0592 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt64FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt64FieldCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt8FieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt8FieldCodec.java index ccd9975..1c39e68 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt8FieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/UInt8FieldCodec.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/WireType.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/WireType.java index 5922320..b7778bd 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/WireType.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/WireType.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.message.fields; diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathIncludeResolver.java b/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathIncludeResolver.java index 8e6389c..483be98 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathIncludeResolver.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/ClasspathIncludeResolver.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.parser; diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/DialectDefinition.java b/src/main/java/io/mapsmessaging/mavlink/parser/DialectDefinition.java index 93fb5a0..01dc50a 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/DialectDefinition.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/DialectDefinition.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.parser; diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/DialectLoader.java b/src/main/java/io/mapsmessaging/mavlink/parser/DialectLoader.java index abb114a..27627cc 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/DialectLoader.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/DialectLoader.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.parser; diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/ExtraCrcCalculator.java b/src/main/java/io/mapsmessaging/mavlink/parser/ExtraCrcCalculator.java index 7502df0..5630ef8 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/ExtraCrcCalculator.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/ExtraCrcCalculator.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.parser; diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/IncludeResolver.java b/src/main/java/io/mapsmessaging/mavlink/parser/IncludeResolver.java index 1b525e8..e586d0a 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/IncludeResolver.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/IncludeResolver.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.parser; diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/XmlParser.java b/src/main/java/io/mapsmessaging/mavlink/parser/XmlParser.java index 0fa517f..ee3d3bf 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/XmlParser.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/XmlParser.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.parser; diff --git a/src/main/java/io/mapsmessaging/mavlink/schema/JsonSchemaBuilder.java b/src/main/java/io/mapsmessaging/mavlink/schema/JsonSchemaBuilder.java index 6ddbc91..4218d55 100644 --- a/src/main/java/io/mapsmessaging/mavlink/schema/JsonSchemaBuilder.java +++ b/src/main/java/io/mapsmessaging/mavlink/schema/JsonSchemaBuilder.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.schema; diff --git a/src/main/java/io/mapsmessaging/mavlink/signing/MapSigningKeyProvider.java b/src/main/java/io/mapsmessaging/mavlink/signing/MapSigningKeyProvider.java index 7c7f851..04ed55f 100644 --- a/src/main/java/io/mapsmessaging/mavlink/signing/MapSigningKeyProvider.java +++ b/src/main/java/io/mapsmessaging/mavlink/signing/MapSigningKeyProvider.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.signing; diff --git a/src/main/java/io/mapsmessaging/mavlink/signing/NoSigningKeyProvider.java b/src/main/java/io/mapsmessaging/mavlink/signing/NoSigningKeyProvider.java index 47199ef..c52b391 100644 --- a/src/main/java/io/mapsmessaging/mavlink/signing/NoSigningKeyProvider.java +++ b/src/main/java/io/mapsmessaging/mavlink/signing/NoSigningKeyProvider.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.signing; diff --git a/src/main/java/io/mapsmessaging/mavlink/signing/StaticSigningKeyProvider.java b/src/main/java/io/mapsmessaging/mavlink/signing/StaticSigningKeyProvider.java index 4d275c9..f35ed83 100644 --- a/src/main/java/io/mapsmessaging/mavlink/signing/StaticSigningKeyProvider.java +++ b/src/main/java/io/mapsmessaging/mavlink/signing/StaticSigningKeyProvider.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink.signing; diff --git a/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java b/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java index f558f3f..e920310 100644 --- a/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; diff --git a/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java b/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java index dd446fe..f444f40 100644 --- a/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/HeartbeatTest.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,15 +9,19 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; +import io.mapsmessaging.mavlink.codec.MavlinkCodec; +import io.mapsmessaging.mavlink.codec.MavlinkFrameCodec; import io.mapsmessaging.mavlink.message.Frame; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java index 8ffa3b0..d035a6f 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,15 +9,19 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; +import io.mapsmessaging.mavlink.codec.MavlinkCodec; +import io.mapsmessaging.mavlink.codec.MavlinkFrameCodec; import io.mapsmessaging.mavlink.context.FrameFailureReason; import io.mapsmessaging.mavlink.message.CompiledMessage; import io.mapsmessaging.mavlink.message.Frame; diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java index 73018ec..527c6bc 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkPayloadJsonSchemaValidationTest.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; @@ -28,6 +29,7 @@ import com.networknt.schema.JsonSchemaFactory; import com.networknt.schema.SpecVersion; import com.networknt.schema.ValidationMessage; +import io.mapsmessaging.mavlink.codec.MavlinkCodec; import io.mapsmessaging.mavlink.message.CompiledMessage; import io.mapsmessaging.mavlink.message.MessageRegistry; import io.mapsmessaging.mavlink.schema.JsonSchemaBuilder; diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java index 3bc0c09..a31a05e 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,15 +9,18 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; +import io.mapsmessaging.mavlink.codec.MavlinkCodec; import io.mapsmessaging.mavlink.message.CompiledField; import io.mapsmessaging.mavlink.message.CompiledMessage; import io.mapsmessaging.mavlink.message.MessageRegistry; diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java index a6e3566..14e069d 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,15 +9,18 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; +import io.mapsmessaging.mavlink.codec.MavlinkCodec; import io.mapsmessaging.mavlink.message.CompiledField; import io.mapsmessaging.mavlink.message.CompiledMessage; import io.mapsmessaging.mavlink.message.MessageRegistry; diff --git a/src/test/java/io/mapsmessaging/mavlink/SystemContextManagerTest.java b/src/test/java/io/mapsmessaging/mavlink/SystemContextManagerTest.java index ac244d0..77874c9 100644 --- a/src/test/java/io/mapsmessaging/mavlink/SystemContextManagerTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/SystemContextManagerTest.java @@ -1,3 +1,23 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + package io.mapsmessaging.mavlink; import io.mapsmessaging.mavlink.context.*; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkCharArrays.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkCharArrays.java index bbacea6..22e368d 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkCharArrays.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkCharArrays.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,15 +9,18 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; +import io.mapsmessaging.mavlink.codec.MavlinkCodec; import io.mapsmessaging.mavlink.message.CompiledField; import io.mapsmessaging.mavlink.message.CompiledMessage; import io.mapsmessaging.mavlink.message.MessageRegistry; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkConcurrency.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkConcurrency.java index 9eb2f99..96a1854 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkConcurrency.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkConcurrency.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,15 +9,18 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; +import io.mapsmessaging.mavlink.codec.MavlinkCodec; import org.junit.jupiter.api.Test; import java.util.Map; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkExtensions.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkExtensions.java index 562a278..762ee46 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkExtensions.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkExtensions.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,15 +9,18 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; +import io.mapsmessaging.mavlink.codec.MavlinkCodec; import io.mapsmessaging.mavlink.message.CompiledField; import io.mapsmessaging.mavlink.message.CompiledMessage; import io.mapsmessaging.mavlink.message.MessageRegistry; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkNumericArrays.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkNumericArrays.java index f63ab8b..327b39b 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkNumericArrays.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkNumericArrays.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,16 +9,19 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; +import io.mapsmessaging.mavlink.codec.MavlinkCodec; import io.mapsmessaging.mavlink.message.CompiledField; import io.mapsmessaging.mavlink.message.CompiledMessage; import io.mapsmessaging.mavlink.message.MessageRegistry; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRegistryInvariants.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRegistryInvariants.java index b9aba8f..1f3c19f 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRegistryInvariants.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRegistryInvariants.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,15 +9,18 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; +import io.mapsmessaging.mavlink.codec.MavlinkCodec; import io.mapsmessaging.mavlink.message.CompiledField; import io.mapsmessaging.mavlink.message.CompiledMessage; import io.mapsmessaging.mavlink.message.MessageRegistry; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java index 3032b15..52f5b1a 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkRobustness.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,16 +9,19 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; +import io.mapsmessaging.mavlink.codec.MavlinkCodec; import io.mapsmessaging.mavlink.message.MessageRegistry; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkXmlParserIncludes.java b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkXmlParserIncludes.java index 2ef0d97..43e6d36 100644 --- a/src/test/java/io/mapsmessaging/mavlink/TestMavlinkXmlParserIncludes.java +++ b/src/test/java/io/mapsmessaging/mavlink/TestMavlinkXmlParserIncludes.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; diff --git a/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java b/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java index 317fa73..3e93265 100644 --- a/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/X25CrcTest.java @@ -1,5 +1,4 @@ /* - * * Copyright [ 2020 - 2024 ] Matthew Buckton * Copyright [ 2024 - 2026 ] MapsMessaging B.V. * @@ -10,11 +9,13 @@ * http://www.apache.org/licenses/LICENSE-2.0 * https://commonsclause.com/ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * */ package io.mapsmessaging.mavlink; From 6d5890ae32a90997ece68aa428dc8395de8b2a75 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sun, 18 Jan 2026 16:55:28 +1100 Subject: [PATCH 22/34] additional tests --- .../mavlink/MavlinkEventFactoryTest.java | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 src/test/java/io/mapsmessaging/mavlink/MavlinkEventFactoryTest.java diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkEventFactoryTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkEventFactoryTest.java new file mode 100644 index 0000000..590a619 --- /dev/null +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkEventFactoryTest.java @@ -0,0 +1,152 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + +package io.mapsmessaging.mavlink; + +import io.mapsmessaging.mavlink.codec.MavlinkFrameCodec; +import io.mapsmessaging.mavlink.context.Detection; +import io.mapsmessaging.mavlink.context.FrameFailureReason; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.Frame; +import io.mapsmessaging.mavlink.message.MessageRegistry; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.nio.ByteBuffer; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.*; + +@ExtendWith(MockitoExtension.class) +class MavlinkEventFactoryTest { + + @Test + void unpack_returnsEmpty_whenNoFrameDecoded() throws Exception { + MavlinkFrameCodec frameCodec = mock(MavlinkFrameCodec.class); + SystemContextManager systemContextManager = mock(SystemContextManager.class); + + ByteBuffer payload = ByteBuffer.allocate(0); + + when(frameCodec.tryUnpackFrame(payload)).thenReturn(Optional.empty()); + + MavlinkEventFactory factory = new MavlinkEventFactory(frameCodec, systemContextManager); + + Optional result = factory.unpack("streamA", payload); + assertTrue(result.isEmpty()); + + verify(frameCodec, times(1)).tryUnpackFrame(payload); + verifyNoMoreInteractions(frameCodec); + verifyNoInteractions(systemContextManager); + } + + @Test + void unpack_returnsProcessedFrame_valid_whenValidatedOk_orUnsigned_andResolvesName() throws Exception { + MavlinkFrameCodec frameCodec = mock(MavlinkFrameCodec.class); + SystemContextManager systemContextManager = mock(SystemContextManager.class); + MessageRegistry registry = mock(MessageRegistry.class); + + Frame frame = mock(Frame.class); + ByteBuffer payload = ByteBuffer.allocate(16); + + int messageId = 123; + + when(frameCodec.tryUnpackFrame(payload)).thenReturn(Optional.of(frame)); + when(frameCodec.parsePayload(frame)).thenReturn(Map.of("a", 1, "b", "x")); + when(frameCodec.getRegistry()).thenReturn(registry); + + when(frame.getMessageId()).thenReturn(messageId); + + CompiledMessage compiledMessage = mock(CompiledMessage.class); + when(compiledMessage.getName()).thenReturn("HEARTBEAT"); + when(registry.getCompiledMessagesById()).thenReturn(Map.of(messageId, compiledMessage)); + + List detections = List.of(mock(Detection.class)); + when(frame.getValidated()).thenReturn(FrameFailureReason.OK); + when(systemContextManager.onValidatedFrame(eq(frame), eq("streamA"), anyLong())).thenReturn(detections); + + MavlinkEventFactory factory = new MavlinkEventFactory(frameCodec, systemContextManager); + + Optional resultOpt = factory.unpack("streamA", payload); + assertTrue(resultOpt.isPresent()); + + ProcessedFrame result = resultOpt.get(); + + // Adjust getter names if your ProcessedFrame uses different ones. + assertEquals("HEARTBEAT", result.getMessageName()); + assertSame(frame, result.getFrame()); + assertEquals(Map.of("a", 1, "b", "x"), result.getFields()); + assertTrue(result.isValid()); + assertEquals(detections, result.getDetections()); + + verify(systemContextManager, times(1)).onValidatedFrame(eq(frame), eq("streamA"), anyLong()); + verify(systemContextManager, never()).onInvalidFrame(anyInt(), anyString(), anyLong(), any()); + } + + @Test + void unpack_returnsProcessedFrame_invalid_whenValidatedFailure_andDropsFields_andNameMayBeBlank() throws Exception { + MavlinkFrameCodec frameCodec = mock(MavlinkFrameCodec.class); + SystemContextManager systemContextManager = mock(SystemContextManager.class); + MessageRegistry registry = mock(MessageRegistry.class); + + Frame frame = mock(Frame.class); + ByteBuffer payload = ByteBuffer.allocate(32); + + int messageId = 777; + int systemId = 9; + + when(frameCodec.tryUnpackFrame(payload)).thenReturn(Optional.of(frame)); + when(frameCodec.parsePayload(frame)).thenReturn(Map.of("shouldNot", "matter")); + when(frameCodec.getRegistry()).thenReturn(registry); + + when(frame.getMessageId()).thenReturn(messageId); + when(frame.getSystemId()).thenReturn(systemId); + + // No compiled message found -> name should stay "" + when(registry.getCompiledMessagesById()).thenReturn(Map.of()); + + when(frame.getValidated()).thenReturn(FrameFailureReason.CRC_FAILED); + + List detections = List.of(mock(Detection.class), mock(Detection.class)); + when(systemContextManager.onInvalidFrame(eq(systemId), eq("streamA"), anyLong(), eq(FrameFailureReason.CRC_FAILED))) + .thenReturn(detections); + + MavlinkEventFactory factory = new MavlinkEventFactory(frameCodec, systemContextManager); + + Optional resultOpt = factory.unpack("streamA", payload); + assertTrue(resultOpt.isPresent()); + + ProcessedFrame result = resultOpt.get(); + + // Adjust getter names if needed. + assertEquals("", result.getMessageName()); + assertSame(frame, result.getFrame()); + assertEquals(Map.of(), result.getFields()); + assertFalse(result.isValid()); + assertEquals(detections, result.getDetections()); + + verify(systemContextManager, times(1)) + .onInvalidFrame(eq(systemId), eq("streamA"), anyLong(), eq(FrameFailureReason.CRC_FAILED)); + verify(systemContextManager, never()).onValidatedFrame(any(), anyString(), anyLong()); + } +} From 8dd4944fd751ed443d95fd4ef917ecc1fefd739c Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sun, 18 Jan 2026 17:18:48 +1100 Subject: [PATCH 23/34] additional tests --- .../mavlink/BaseRoudTripTest.java | 204 --------------- .../MavlinkRoundTripAllMessagesTest.java | 4 +- .../mavlink/RandomValueFactory.java | 239 ++++++++++++++++++ 3 files changed, 241 insertions(+), 206 deletions(-) create mode 100644 src/test/java/io/mapsmessaging/mavlink/RandomValueFactory.java diff --git a/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java b/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java index e920310..a196815 100644 --- a/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/BaseRoudTripTest.java @@ -45,210 +45,6 @@ void bootTest() { // Intentionally empty. Maven demands tribute. } - static final class RandomValueFactory { - - protected RandomValueFactory() {} - - static Map buildValues( - MessageRegistry registry, - CompiledMessage msg, - MavlinkRoundTripAllMessagesTest.ExtensionMode extensionMode, - long baseSeed - ) throws IOException { - - Map values = new LinkedHashMap<>(); - List fields = msg.getCompiledFields(); - - for (int i = 0; i < fields.size(); i++) { - CompiledField cf = fields.get(i); - FieldDefinition fd = MavlinkTestSupport.fieldDefinition(cf); - - if (fd.isExtension() && extensionMode == MavlinkRoundTripAllMessagesTest.ExtensionMode.OMIT_ALL) { - continue; - } - - if (fd.isExtension() && extensionMode == MavlinkRoundTripAllMessagesTest.ExtensionMode.SOME_PRESENT) { - // include some extensions deterministically (not all) - long seed = perFieldSeed(baseSeed, msg.getMessageId(), i); - Random random = new Random(seed); - if (random.nextInt(100) < 60) { - continue; // omit ~60% of extension fields - } - } - - Object value = generateValueForField(registry, msg.getMessageId(), fd, i, baseSeed); - values.put(fd.getName(), value); - } - - return values; - } - - static FieldDefinition fieldByName(CompiledMessage msg, String fieldName) { - for (CompiledField cf : msg.getCompiledFields()) { - FieldDefinition fd = MavlinkTestSupport.fieldDefinition(cf); - if (fieldName.equals(fd.getName())) { - return fd; - } - } - throw new IllegalStateException("Unknown field '" + fieldName + "' in message " + msg.getMessageId()); - } - - protected static Object generateValueForField( - MessageRegistry registry, - int messageId, - FieldDefinition fd, - int fieldIndex, - long baseSeed - ) throws IOException { - - long seed = perFieldSeed(baseSeed, messageId, fieldIndex); - Random random = new Random(seed); - - if (fd.isArray()) { - if (isCharType(fd)) { - return randomAsciiString(fd.getArrayLength(), messageId, fd.getName(), random); - } - Object[] arr = new Object[fd.getArrayLength()]; - for (int i = 0; i < arr.length; i++) { - arr[i] = generateScalar(registry, fd, random); - } - return arr; - } - - return generateScalar(registry, fd, random); - } - - protected static Object generateScalar(MessageRegistry registry, FieldDefinition fd, Random random) throws IOException { - String enumName = fd.getEnumName(); - if (enumName != null && !enumName.isEmpty()) { - EnumDefinition def = registry.getEnumsByName().get(enumName); - if (def != null && def.getEntries() != null && !def.getEntries().isEmpty()) { - if (def.isBitmask()) { - return pickBitmask(def, random); - } - return pickEnumValue(def, random); - } - // If enum metadata missing, fall back to numeric in-range. - } - - String type = normalizeType(fd.getType()); - - return switch (type) { - case "uint8_t" -> Integer.valueOf(random.nextInt(256)); - case "int8_t" -> Integer.valueOf(random.nextInt(256) - 128); - - case "uint16_t" -> Integer.valueOf(random.nextInt(65536)); - case "int16_t" -> Integer.valueOf(random.nextInt(65536) - 32768); - - case "uint32_t" -> Long.valueOf(nextLongBounded(random, 0L, 0xFFFF_FFFFL)); - case "int32_t" -> Integer.valueOf(random.nextInt()); - - case "uint64_t" -> Long.valueOf(nextLongBounded(random, 0L, Long.MAX_VALUE)); - case "int64_t" -> Long.valueOf(random.nextLong()); - - case "float" -> Float.valueOf(nextFloatBounded(random, -10_000f, 10_000f)); - case "double" -> Double.valueOf(nextDoubleBounded(random, -10_000d, 10_000d)); - - // Some dialects use "char" for scalar, though rare. - case "char" -> Integer.valueOf(random.nextInt(128)); - - default -> throw new IOException("Unsupported MAVLink field type: " + fd.getType() + " (normalized=" + type + ")"); - }; - } - - protected static long pickEnumValue(EnumDefinition def, Random random) { - List entries = def.getEntries(); - EnumEntry entry = entries.get(random.nextInt(entries.size())); - return entry.getValue(); - } - - protected static long pickBitmask(EnumDefinition def, Random random) { - List entries = def.getEntries(); - int count = Math.min(entries.size(), 1 + random.nextInt(3)); - long mask = 0L; - - for (int i = 0; i < count; i++) { - EnumEntry entry = entries.get(random.nextInt(entries.size())); - mask |= entry.getValue(); - } - return mask; - } - - protected static boolean isCharType(FieldDefinition fd) { - String type = normalizeType(fd.getType()); - return "char".equals(type); - } - - protected static String randomAsciiString(int maxLen, int messageId, String fieldName, Random random) { - // Stable-ish prefix helps debugging. - String prefix = "M" + messageId + "_" + fieldName + "_"; - byte[] bytes = new byte[Math.max(1, maxLen)]; - byte[] prefixBytes = prefix.getBytes(StandardCharsets.US_ASCII); - - int pos = 0; - for (int i = 0; i < prefixBytes.length && pos < bytes.length; i++) { - bytes[pos++] = prefixBytes[i]; - } - while (pos < bytes.length) { - int c = 32 + random.nextInt(95); // printable ASCII 32..126 - bytes[pos++] = (byte) c; - } - - // Return String to match your packer expectation for char arrays. - // If you prefer byte[], swap this line. - return new String(bytes, StandardCharsets.US_ASCII); - } - - protected static String normalizeType(String type) { - if (type == null) { - return ""; - } - // Your pipeline already normalizes decorated types; keep this defensive. - String t = type.trim(); - if (t.endsWith("_t")) { - return t; - } - if (t.contains("uint8_t")) return "uint8_t"; - if (t.contains("int8_t")) return "int8_t"; - if (t.contains("uint16_t")) return "uint16_t"; - if (t.contains("int16_t")) return "int16_t"; - if (t.contains("uint32_t")) return "uint32_t"; - if (t.contains("int32_t")) return "int32_t"; - if (t.contains("uint64_t")) return "uint64_t"; - if (t.contains("int64_t")) return "int64_t"; - if (t.equals("float")) return "float"; - if (t.equals("double")) return "double"; - if (t.equals("char")) return "char"; - return t; - } - - protected static long perFieldSeed(long baseSeed, int messageId, int fieldIndex) { - long s = baseSeed; - s ^= (long) messageId * 0x9E37_79B9_7F4A_7C15L; - s ^= (long) fieldIndex * 0xC2B2_AE3D_27D4_EB4FL; - return s; - } - - protected static long nextLongBounded(Random random, long minInclusive, long maxInclusive) { - if (minInclusive > maxInclusive) { - throw new IllegalArgumentException("min > max"); - } - long bound = maxInclusive - minInclusive + 1; - long r = random.nextLong(); - long v = Math.floorMod(r, bound); - return minInclusive + v; - } - - - protected static float nextFloatBounded(Random random, float min, float max) { - return min + random.nextFloat() * (max - min); - } - - protected static double nextDoubleBounded(Random random, double min, double max) { - return min + random.nextDouble() * (max - min); - } - } - static final class ValueAssertions { protected ValueAssertions() {} diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java index a31a05e..275284c 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java @@ -34,7 +34,7 @@ import static org.junit.jupiter.api.Assertions.*; -class MavlinkRoundTripAllMessagesTest extends BaseRoudTripTest { +public class MavlinkRoundTripAllMessagesTest extends BaseRoudTripTest { @TestFactory @@ -188,7 +188,7 @@ private static void extensionSizingForMessage( } } - enum ExtensionMode { + public enum ExtensionMode { OMIT_ALL, SOME_PRESENT } diff --git a/src/test/java/io/mapsmessaging/mavlink/RandomValueFactory.java b/src/test/java/io/mapsmessaging/mavlink/RandomValueFactory.java new file mode 100644 index 0000000..32ec66b --- /dev/null +++ b/src/test/java/io/mapsmessaging/mavlink/RandomValueFactory.java @@ -0,0 +1,239 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + +package io.mapsmessaging.mavlink; + +import io.mapsmessaging.mavlink.message.CompiledField; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.MessageRegistry; +import io.mapsmessaging.mavlink.message.fields.EnumDefinition; +import io.mapsmessaging.mavlink.message.fields.EnumEntry; +import io.mapsmessaging.mavlink.message.fields.FieldDefinition; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; + +public class RandomValueFactory { + + protected RandomValueFactory() {} + + public static Map buildValues( + MessageRegistry registry, + CompiledMessage msg, + MavlinkRoundTripAllMessagesTest.ExtensionMode extensionMode, + long baseSeed + ) throws IOException { + + Map values = new LinkedHashMap<>(); + List fields = msg.getCompiledFields(); + + for (int i = 0; i < fields.size(); i++) { + CompiledField cf = fields.get(i); + FieldDefinition fd = MavlinkTestSupport.fieldDefinition(cf); + + if (fd.isExtension() && extensionMode == MavlinkRoundTripAllMessagesTest.ExtensionMode.OMIT_ALL) { + continue; + } + + if (fd.isExtension() && extensionMode == MavlinkRoundTripAllMessagesTest.ExtensionMode.SOME_PRESENT) { + // include some extensions deterministically (not all) + long seed = perFieldSeed(baseSeed, msg.getMessageId(), i); + Random random = new Random(seed); + if (random.nextInt(100) < 60) { + continue; // omit ~60% of extension fields + } + } + + Object value = generateValueForField(registry, msg.getMessageId(), fd, i, baseSeed); + values.put(fd.getName(), value); + } + + return values; + } + + static FieldDefinition fieldByName(CompiledMessage msg, String fieldName) { + for (CompiledField cf : msg.getCompiledFields()) { + FieldDefinition fd = MavlinkTestSupport.fieldDefinition(cf); + if (fieldName.equals(fd.getName())) { + return fd; + } + } + throw new IllegalStateException("Unknown field '" + fieldName + "' in message " + msg.getMessageId()); + } + + protected static Object generateValueForField( + MessageRegistry registry, + int messageId, + FieldDefinition fd, + int fieldIndex, + long baseSeed + ) throws IOException { + + long seed = perFieldSeed(baseSeed, messageId, fieldIndex); + Random random = new Random(seed); + + if (fd.isArray()) { + if (isCharType(fd)) { + return randomAsciiString(fd.getArrayLength(), messageId, fd.getName(), random); + } + Object[] arr = new Object[fd.getArrayLength()]; + for (int i = 0; i < arr.length; i++) { + arr[i] = generateScalar(registry, fd, random); + } + return arr; + } + + return generateScalar(registry, fd, random); + } + + protected static Object generateScalar(MessageRegistry registry, FieldDefinition fd, Random random) throws IOException { + String enumName = fd.getEnumName(); + if (enumName != null && !enumName.isEmpty()) { + EnumDefinition def = registry.getEnumsByName().get(enumName); + if (def != null && def.getEntries() != null && !def.getEntries().isEmpty()) { + if (def.isBitmask()) { + return pickBitmask(def, random); + } + return pickEnumValue(def, random); + } + // If enum metadata missing, fall back to numeric in-range. + } + + String type = normalizeType(fd.getType()); + + return switch (type) { + case "uint8_t" -> Integer.valueOf(random.nextInt(256)); + case "int8_t" -> Integer.valueOf(random.nextInt(256) - 128); + + case "uint16_t" -> Integer.valueOf(random.nextInt(65536)); + case "int16_t" -> Integer.valueOf(random.nextInt(65536) - 32768); + + case "uint32_t" -> Long.valueOf(nextLongBounded(random, 0L, 0xFFFF_FFFFL)); + case "int32_t" -> Integer.valueOf(random.nextInt()); + + case "uint64_t" -> Long.valueOf(nextLongBounded(random, 0L, Long.MAX_VALUE)); + case "int64_t" -> Long.valueOf(random.nextLong()); + + case "float" -> Float.valueOf(nextFloatBounded(random, -10_000f, 10_000f)); + case "double" -> Double.valueOf(nextDoubleBounded(random, -10_000d, 10_000d)); + + // Some dialects use "char" for scalar, though rare. + case "char" -> Integer.valueOf(random.nextInt(128)); + + default -> throw new IOException("Unsupported MAVLink field type: " + fd.getType() + " (normalized=" + type + ")"); + }; + } + + protected static long pickEnumValue(EnumDefinition def, Random random) { + List entries = def.getEntries(); + EnumEntry entry = entries.get(random.nextInt(entries.size())); + return entry.getValue(); + } + + protected static long pickBitmask(EnumDefinition def, Random random) { + List entries = def.getEntries(); + int count = Math.min(entries.size(), 1 + random.nextInt(3)); + long mask = 0L; + + for (int i = 0; i < count; i++) { + EnumEntry entry = entries.get(random.nextInt(entries.size())); + mask |= entry.getValue(); + } + return mask; + } + + protected static boolean isCharType(FieldDefinition fd) { + String type = normalizeType(fd.getType()); + return "char".equals(type); + } + + protected static String randomAsciiString(int maxLen, int messageId, String fieldName, Random random) { + // Stable-ish prefix helps debugging. + String prefix = "M" + messageId + "_" + fieldName + "_"; + byte[] bytes = new byte[Math.max(1, maxLen)]; + byte[] prefixBytes = prefix.getBytes(StandardCharsets.US_ASCII); + + int pos = 0; + for (int i = 0; i < prefixBytes.length && pos < bytes.length; i++) { + bytes[pos++] = prefixBytes[i]; + } + while (pos < bytes.length) { + int c = 32 + random.nextInt(95); // printable ASCII 32..126 + bytes[pos++] = (byte) c; + } + + // Return String to match your packer expectation for char arrays. + // If you prefer byte[], swap this line. + return new String(bytes, StandardCharsets.US_ASCII); + } + + protected static String normalizeType(String type) { + if (type == null) { + return ""; + } + // Your pipeline already normalizes decorated types; keep this defensive. + String t = type.trim(); + if (t.endsWith("_t")) { + return t; + } + if (t.contains("uint8_t")) return "uint8_t"; + if (t.contains("int8_t")) return "int8_t"; + if (t.contains("uint16_t")) return "uint16_t"; + if (t.contains("int16_t")) return "int16_t"; + if (t.contains("uint32_t")) return "uint32_t"; + if (t.contains("int32_t")) return "int32_t"; + if (t.contains("uint64_t")) return "uint64_t"; + if (t.contains("int64_t")) return "int64_t"; + if (t.equals("float")) return "float"; + if (t.equals("double")) return "double"; + if (t.equals("char")) return "char"; + return t; + } + + protected static long perFieldSeed(long baseSeed, int messageId, int fieldIndex) { + long s = baseSeed; + s ^= (long) messageId * 0x9E37_79B9_7F4A_7C15L; + s ^= (long) fieldIndex * 0xC2B2_AE3D_27D4_EB4FL; + return s; + } + + protected static long nextLongBounded(Random random, long minInclusive, long maxInclusive) { + if (minInclusive > maxInclusive) { + throw new IllegalArgumentException("min > max"); + } + long bound = maxInclusive - minInclusive + 1; + long r = random.nextLong(); + long v = Math.floorMod(r, bound); + return minInclusive + v; + } + + + protected static float nextFloatBounded(Random random, float min, float max) { + return min + random.nextFloat() * (max - min); + } + + protected static double nextDoubleBounded(Random random, double min, double max) { + return min + random.nextDouble() * (max - min); + } +} \ No newline at end of file From 585ac2db57615e6d577f16d812ee45b5114d7d95 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sat, 31 Jan 2026 19:26:37 +1100 Subject: [PATCH 24/34] additional tests --- .../MavlinkFrameRoundTripAllMessagesTest.java | 92 ++++++++++++++++--- 1 file changed, 78 insertions(+), 14 deletions(-) diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java index d035a6f..12c13b2 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java @@ -23,19 +23,20 @@ import io.mapsmessaging.mavlink.codec.MavlinkCodec; import io.mapsmessaging.mavlink.codec.MavlinkFrameCodec; import io.mapsmessaging.mavlink.context.FrameFailureReason; +import io.mapsmessaging.mavlink.framing.SigningKeyProvider; import io.mapsmessaging.mavlink.message.CompiledMessage; import io.mapsmessaging.mavlink.message.Frame; import io.mapsmessaging.mavlink.message.MessageRegistry; import io.mapsmessaging.mavlink.message.Version; import io.mapsmessaging.mavlink.message.fields.FieldDefinition; import io.mapsmessaging.mavlink.signing.MapSigningKeyProvider; +import io.mapsmessaging.mavlink.signing.NoSigningKeyProvider; +import io.mapsmessaging.mavlink.signing.StaticSigningKeyProvider; import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.TestFactory; import java.nio.ByteBuffer; -import java.util.Map; -import java.util.Optional; -import java.util.Random; +import java.util.*; import java.util.stream.Stream; import static org.junit.jupiter.api.Assertions.*; @@ -57,27 +58,90 @@ Stream allMessages_frame_roundTrip_v2_unsigned_fullPayload() throws } @TestFactory - Stream allMessages_frame_roundTrip_v2_signed_fullPayload() throws Exception { + Stream allMessages_frame_roundTrip_v2_unsigned_fullPayload_allSigningProviders() throws Exception { + return buildRoundTripTests(false); + } + + @TestFactory + Stream allMessages_frame_roundTrip_v2_signed_fullPayload_allSigningProviders() throws Exception { return buildRoundTripTests(true); } private Stream buildRoundTripTests(boolean signFrames) throws Exception { MavlinkCodec payloadCodec = MavlinkTestSupport.codec(); + MessageRegistry registry = payloadCodec.getRegistry(); + + List signingProviderCases = buildSigningProviderCases(signFrames); + + String signingSuffix = signFrames ? "signed" : "unsigned"; + + return signingProviderCases.stream() + .flatMap(signingProviderCase -> registry.getCompiledMessages().stream() + .map(message -> DynamicTest.dynamicTest( + message.getMessageId() + + " " + + message.getName() + + " (" + + signingSuffix + + ", " + + signingProviderCase.displayName + + ")", + () -> runRoundTripCase(payloadCodec, registry, message, signFrames, signingProviderCase) + ))); + } + private void runRoundTripCase( + MavlinkCodec payloadCodec, + MessageRegistry registry, + CompiledMessage message, + boolean signFrames, + SigningProviderCase signingProviderCase + ) throws Exception { - MapSigningKeyProvider signingKeyProvider = new MapSigningKeyProvider(); - signingKeyProvider.register (1, 1, 0, TEST_SIGNING_KEY); - MavlinkFrameCodec frameCodec = new MavlinkFrameCodec(payloadCodec, signingKeyProvider); + MavlinkFrameCodec frameCodec = new MavlinkFrameCodec(payloadCodec, signingProviderCase.signingKeyProvider); - MessageRegistry registry = payloadCodec.getRegistry(); + if (signingProviderCase.expectSuccess) { + frameRoundTripForMessageV2(frameCodec, payloadCodec, registry, message, signFrames); + return; + } - String suffix = signFrames ? "signed" : "unsigned"; + assertThrows( + Exception.class, + () -> frameRoundTripForMessageV2(frameCodec, payloadCodec, registry, message, signFrames), + "Expected failure for " + signingProviderCase.displayName + " when signFrames=" + signFrames + ); + } + + private List buildSigningProviderCases(boolean signFrames) { + List signingProviderCases = new ArrayList<>(); + + MapSigningKeyProvider mapSigningKeyProvider = new MapSigningKeyProvider(); + mapSigningKeyProvider.register(1, 1, 0, TEST_SIGNING_KEY); + + SigningKeyProvider staticSigningKeyProvider = new StaticSigningKeyProvider(TEST_SIGNING_KEY); + + SigningKeyProvider noSigningKeyProvider = new NoSigningKeyProvider(); + + signingProviderCases.add(new SigningProviderCase("MapSigningKeyProvider", mapSigningKeyProvider, true)); + signingProviderCases.add(new SigningProviderCase("StaticSigningKeyProvider", staticSigningKeyProvider, true)); - return registry.getCompiledMessages().stream() - .map(msg -> DynamicTest.dynamicTest( - msg.getMessageId() + " " + msg.getName() + " (" + suffix + ")", - () -> frameRoundTripForMessageV2(frameCodec, payloadCodec, registry, msg, signFrames) - )); + boolean noSigningKeyProviderShouldSucceed = !signFrames; + signingProviderCases.add(new SigningProviderCase("NoSigningKeyProvider", noSigningKeyProvider, noSigningKeyProviderShouldSucceed)); + + return signingProviderCases; + } + + private static final class SigningProviderCase { + + private final String displayName; + private final SigningKeyProvider signingKeyProvider; + private final boolean expectSuccess; + + private SigningProviderCase(String displayName, SigningKeyProvider signingKeyProvider, boolean expectSuccess) { + this.displayName = displayName; + this.signingKeyProvider = signingKeyProvider; + this.expectSuccess = expectSuccess; + } } private static void frameRoundTripForMessageV2( From a38d3be5c5909b9a01972d1aacb2e6a961b6f4e8 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Tue, 3 Feb 2026 11:31:36 +1100 Subject: [PATCH 25/34] feat(parsing): add support for loading dialects from file paths Introduce a new `loadDialect(Path dialectName)` method in `MavlinkMessageFormatLoader` to enable loading dialects directly from file paths, including custom include resolution with `FilePathIncludeResolver`. Updated `MavlinkEventFactory` to support dialects by path and added unit tests to verify functionality. --- README.md | 6 +-- .../mavlink/MavlinkEventFactory.java | 18 ++++++- .../mavlink/MavlinkMessageFormatLoader.java | 21 +++++--- .../parser/FilePathIncludeResolver.java | 54 +++++++++++++++++++ .../MavlinkMessageFormatLoaderPathTest.java | 45 ++++++++++++++++ 5 files changed, 131 insertions(+), 13 deletions(-) create mode 100644 src/main/java/io/mapsmessaging/mavlink/parser/FilePathIncludeResolver.java create mode 100644 src/test/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoaderPathTest.java diff --git a/README.md b/README.md index 952de07..ba16041 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ It **does**: - Compile message definitions into an immutable registry - Encode Java field maps into MAVLink payload bytes - Decode MAVLink payload bytes into typed field maps +- Provides ability to sign and validate V2 messages - Correctly handle MAVLink field ordering, arrays, enums, and extensions - Creates JsonSchemas to match the fields that it parses to and from @@ -30,11 +31,6 @@ It **does not**: - Manage system IDs, component IDs, or sequence numbers - Implement any transport (UART, UDP, TCP, etc.) -Frame parsing, CRC handling, and framing are provided by the framework layer -built on top of this codec. - -This library is designed to sit **under** a framing and transport layer. - --- ## Features diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java index 55351d5..85be3ba 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkEventFactory.java @@ -26,9 +26,12 @@ import io.mapsmessaging.mavlink.context.FrameFailureReason; import io.mapsmessaging.mavlink.message.CompiledMessage; import io.mapsmessaging.mavlink.message.Frame; +import org.xml.sax.SAXException; +import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; import java.nio.ByteBuffer; +import java.nio.file.Path; import java.util.List; import java.util.Map; import java.util.Optional; @@ -39,17 +42,28 @@ public class MavlinkEventFactory { private SystemContextManager systemContextManager; public MavlinkEventFactory() throws IOException { - Optional codec = MavlinkMessageFormatLoader.getInstance().getDialect("common"); + this("common"); + } + + public MavlinkEventFactory(String dialectName) throws IOException { + Optional codec = MavlinkMessageFormatLoader.getInstance().getDialect(dialectName); if (codec.isPresent()) { MavlinkCodec codecInstance = codec.get(); frameCodec = new MavlinkFrameCodec(codecInstance); systemContextManager = new SystemContextManager(); } else{ - throw new IOException("Mavlink default common codec not found"); + throw new IOException("Mavlink "+dialectName+" codec not found"); } } + + public MavlinkEventFactory(Path dialectPath) throws IOException, ParserConfigurationException, SAXException { + MavlinkCodec codec = MavlinkMessageFormatLoader.getInstance().loadDialect(dialectPath); + frameCodec = new MavlinkFrameCodec(codec); + systemContextManager = new SystemContextManager(); + } + public MavlinkEventFactory(MavlinkFrameCodec frameCodec, SystemContextManager systemContextManager){ this.frameCodec = frameCodec; this.systemContextManager = systemContextManager; diff --git a/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java b/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java index 95a1802..18ac776 100644 --- a/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java +++ b/src/main/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoader.java @@ -30,6 +30,7 @@ import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; import java.io.InputStream; +import java.nio.file.Path; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -128,7 +129,7 @@ public MavlinkCodec getDialectOrThrow(String dialectName) throws IOException { * @throws ParserConfigurationException if the XML parser cannot be configured * @throws SAXException if the dialect XML is invalid */ - protected MavlinkCodec loadDialectFromClasspath(String dialectName, String classpathXml) + private MavlinkCodec loadDialectFromClasspath(String dialectName, String classpathXml) throws IOException, ParserConfigurationException, SAXException { String normalizedDialectName = normalizeDialectName(dialectName); @@ -142,8 +143,7 @@ protected MavlinkCodec loadDialectFromClasspath(String dialectName, String class XmlParser mavlinkXmlParser = new XmlParser(); DialectLoader dialectLoader = new DialectLoader(mavlinkXmlParser); - IncludeResolver includeResolver = - new ClasspathIncludeResolver(classLoader, "mavlink"); + IncludeResolver includeResolver = new ClasspathIncludeResolver(classLoader, "mavlink"); DialectDefinition dialectDefinition = dialectLoader.load(normalizedDialectName, inputStream, includeResolver); @@ -152,6 +152,17 @@ protected MavlinkCodec loadDialectFromClasspath(String dialectName, String class } } + public MavlinkCodec loadDialect(Path dialectName) throws IOException, ParserConfigurationException, SAXException { + Path base = java.nio.file.Files.isRegularFile(dialectName) ? dialectName.getParent() : dialectName; + FilePathIncludeResolver resolver = new FilePathIncludeResolver(base); + try(InputStream inputStream = java.nio.file.Files.newInputStream(dialectName)){ + String fileName = dialectName.getFileName().toString(); + int dot = fileName.lastIndexOf('.'); + String dialect = (dot > 0) ? fileName.substring(0, dot) : fileName; + return loadDialect(dialect, inputStream, resolver); + } + } + /** * Loads a dialect from an arbitrary stream and caches the resulting codec under the dialect name. * @@ -176,9 +187,7 @@ public MavlinkCodec loadDialect(String dialectName, InputStream inputStream, Inc XmlParser mavlinkXmlParser = new XmlParser(); DialectLoader dialectLoader = new DialectLoader(mavlinkXmlParser); - DialectDefinition dialectDefinition = - dialectLoader.load(normalizedDialectName, inputStream, includeResolver); - + DialectDefinition dialectDefinition = dialectLoader.load(normalizedDialectName, inputStream, includeResolver); MavlinkCodec codec = buildCodec(normalizedDialectName, dialectDefinition); dialects.put(normalizedDialectName, codec); diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/FilePathIncludeResolver.java b/src/main/java/io/mapsmessaging/mavlink/parser/FilePathIncludeResolver.java new file mode 100644 index 0000000..4c0fabe --- /dev/null +++ b/src/main/java/io/mapsmessaging/mavlink/parser/FilePathIncludeResolver.java @@ -0,0 +1,54 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.mapsmessaging.mavlink.parser; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Path; + +public class FilePathIncludeResolver implements IncludeResolver { + + + private final Path root; + + public FilePathIncludeResolver(Path root) { + this.root = root; + } + + @Override + public InputStream open(String includeName) throws IOException { + String fileName = includeName.endsWith(".xml") ? includeName : (includeName + ".xml"); + + Path direct = root.resolve(fileName); + if (java.nio.file.Files.isRegularFile(direct)) { + return java.nio.file.Files.newInputStream(direct); + } + + try (java.util.stream.Stream stream = java.nio.file.Files.walk(root)) { + Path match = stream + .filter(java.nio.file.Files::isRegularFile) + .filter(path -> path.getFileName().toString().equals(fileName)) + .findFirst() + .orElse(null); + + return match == null ? null : java.nio.file.Files.newInputStream(match); + } + } +} diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoaderPathTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoaderPathTest.java new file mode 100644 index 0000000..6571105 --- /dev/null +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkMessageFormatLoaderPathTest.java @@ -0,0 +1,45 @@ +/* + * + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.mapsmessaging.mavlink; + +import io.mapsmessaging.mavlink.codec.MavlinkCodec; +import org.junit.jupiter.api.Test; + +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class MavlinkMessageFormatLoaderPathTest { + + @Test + void loadDialectByPathUsesFileNameWithoutExtensionAndResolvesIncludes() throws Exception { + Path commonXml = Path.of("src/main/resources/mavlink/common.xml"); + + MavlinkMessageFormatLoader loader = MavlinkMessageFormatLoader.getInstance(); + MavlinkCodec codec = loader.loadDialect(commonXml); + + assertEquals("common", codec.getName()); + assertNotNull(codec.getRegistry()); + assertTrue(codec.getRegistry().getCompiledMessages().size() > 0, + "Registry should contain messages if includes were resolved."); + } +} From 503f0d8406b8bde2a455683030ef8a96b4cfc7e8 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sat, 25 Apr 2026 23:22:31 +1000 Subject: [PATCH 26/34] fix(codec): improve value handling in `CharFieldCodec` and enhance XML parsing logic Refactored `CharFieldCodec` to handle `Number` types and ensure consistent value encoding. Updated `XmlParser` to properly decode hex values in the "value" attribute when present. --- .../message/fields/CharFieldCodec.java | 39 ++++++------------- .../mavlink/parser/XmlParser.java | 7 +++- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java b/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java index cbd12c2..f7436f2 100644 --- a/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java +++ b/src/main/java/io/mapsmessaging/mavlink/message/fields/CharFieldCodec.java @@ -1,23 +1,3 @@ -/* - * Copyright [ 2020 - 2024 ] Matthew Buckton - * Copyright [ 2024 - 2026 ] MapsMessaging B.V. - * - * Licensed under the Apache License, Version 2.0 with the Commons Clause - * (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * https://commonsclause.com/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * - */ - package io.mapsmessaging.mavlink.message.fields; import java.nio.ByteBuffer; @@ -32,19 +12,24 @@ public CharFieldCodec() { @Override public Object decode(ByteBuffer buffer) { buffer.order(ByteOrder.LITTLE_ENDIAN); - return (char) (buffer.get() & 0xFF); + return buffer.get() & 0xFF; } @Override public void encode(ByteBuffer buffer, Object value) { buffer.order(ByteOrder.LITTLE_ENDIAN); - char character; - if (value instanceof Character) { - character = (Character) value; + + int characterValue; + + if (value instanceof Number number) { + characterValue = number.intValue(); + } else if (value instanceof Character character) { + characterValue = character; } else { String text = value == null ? "" : value.toString(); - character = text.isEmpty() ? 0 : text.charAt(0); + characterValue = text.isEmpty() ? 0 : text.charAt(0); } - buffer.put((byte) character); + + buffer.put((byte) (characterValue & 0xFF)); } -} +} \ No newline at end of file diff --git a/src/main/java/io/mapsmessaging/mavlink/parser/XmlParser.java b/src/main/java/io/mapsmessaging/mavlink/parser/XmlParser.java index ee3d3bf..fb8fd2f 100644 --- a/src/main/java/io/mapsmessaging/mavlink/parser/XmlParser.java +++ b/src/main/java/io/mapsmessaging/mavlink/parser/XmlParser.java @@ -166,7 +166,12 @@ private EnumEntry parseEnumEntry(Element entryElement) { String valueAttribute = entryElement.getAttribute("value"); if (valueAttribute != null && !valueAttribute.isEmpty()) { - entry.setValue(Long.parseLong(valueAttribute)); + if(valueAttribute.toLowerCase().contains("x")){ + entry.setValue(Long.decode(valueAttribute)); + } + else{ + entry.setValue(Long.parseLong(valueAttribute)); + } } entry.setName(entryElement.getAttribute("name")); From 9bd41650ed99bcc4aba81e3ea207c299c15fdc71 Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sun, 26 Apr 2026 13:53:52 +1000 Subject: [PATCH 27/34] test(mavlink): add unit tests for dialect loading and validation Added `MavlinkDialectLoadTest` to verify dialect loading from paths, message registry initialization, include chain resolution, and message validation. --- .../mavlink/MavlinkDialectLoadTest.java | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 src/test/java/io/mapsmessaging/mavlink/MavlinkDialectLoadTest.java diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkDialectLoadTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkDialectLoadTest.java new file mode 100644 index 0000000..83b213a --- /dev/null +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkDialectLoadTest.java @@ -0,0 +1,124 @@ +/* + * Copyright [ 2020 - 2024 ] Matthew Buckton + * Copyright [ 2024 - 2026 ] MapsMessaging B.V. + * + * Licensed under the Apache License, Version 2.0 with the Commons Clause + * (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * https://commonsclause.com/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ + +package io.mapsmessaging.mavlink; + +import io.mapsmessaging.mavlink.codec.MavlinkCodec; +import io.mapsmessaging.mavlink.message.CompiledMessage; +import io.mapsmessaging.mavlink.message.MessageRegistry; +import org.junit.jupiter.api.Test; + +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Path; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.*; + +class MavlinkDialectLoadTest { + + @Test + void testLoadStandardCommonDialectFromPath() throws Exception { + Path commonPath = resourcePath("mavlink/common.xml"); + + MavlinkCodec codec = MavlinkMessageFormatLoader.getInstance().loadDialect(commonPath); + + assertNotNull(codec); + + MessageRegistry registry = codec.getRegistry(); + + assertNotNull(registry); + assertMessageExists(registry, 0, "HEARTBEAT"); + assertTrue( + registry.getCompiledMessagesById().containsKey(411), "mavlink dialect should resolve ardupilot/common.xml." + ); + } + + @Test + void testLoadArduPilotAllDialectFromPath() throws Exception { + Path ardupilotAllPath = resourcePath("mavlink/ardupilot/all.xml"); + + MavlinkCodec codec = MavlinkMessageFormatLoader.getInstance().loadDialect(ardupilotAllPath); + + assertNotNull(codec); + + MessageRegistry registry = codec.getRegistry(); + + assertNotNull(registry); + assertMessageExists(registry, 0, "HEARTBEAT"); + assertMessageExists(registry, 1, "SYS_STATUS"); + assertFalse( + registry.getCompiledMessagesById().containsKey(411), "ArduPilot dialect should resolve ardupilot/common.xml. Message 411 CURRENT_EVENT_SEQUENCE must not be present when loading ardupilot/all.xml" + ); + } + + @Test + void testArduPilotDialectLoadsFullIncludeChain() throws Exception { + Path ardupilotAllPath = resourcePath("mavlink/ardupilot/all.xml"); + + MavlinkCodec codec = MavlinkMessageFormatLoader.getInstance().loadDialect(ardupilotAllPath); + MessageRegistry registry = codec.getRegistry(); + + assertNotNull(registry); + assertNotNull(registry.getCompiledMessages()); + assertNotNull(registry.getCompiledMessagesById()); + + assertTrue( + registry.getCompiledMessages().size() > 100, + "ArduPilot dialect should load the full include chain" + ); + + assertTrue( + registry.getCompiledMessagesById().size() > 100, + "ArduPilot dialect should index the full include chain" + ); + } + + private static Path resourcePath(String resourceName) throws URISyntaxException { + ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + URL resource = classLoader.getResource(resourceName); + + assertNotNull(resource, "Missing test resource: " + resourceName); + + return Path.of(resource.toURI()); + } + + private static void assertMessageExists( + MessageRegistry registry, + int messageId, + String expectedMessageName + ) { + + Map compiledMessagesById = registry.getCompiledMessagesById(); + + assertTrue( + compiledMessagesById.containsKey(messageId), + "Missing MAVLink message id " + messageId + " (" + expectedMessageName + ")" + ); + + CompiledMessage compiledMessage = compiledMessagesById.get(messageId); + + assertTrue( + expectedMessageName.equals(compiledMessage.getName()), + "Expected message id " + messageId + " to be " + expectedMessageName + + " but was " + compiledMessage.getName() + ); + } +} \ No newline at end of file From f0e352424810365accab21f831b94035864dc55b Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sun, 26 Apr 2026 13:54:22 +1000 Subject: [PATCH 28/34] feat(mavlink): add minimal ArduPilot dialect XML for MAVLink integration --- .../resources/mavlink/ardupilot/ASLUAV.xml | 294 + .../resources/mavlink/ardupilot/AVSSUAS.xml | 198 + src/main/resources/mavlink/ardupilot/all.xml | 52 + .../mavlink/ardupilot/ardupilotmega.xml | 2101 +++++ .../resources/mavlink/ardupilot/common.xml | 7539 +++++++++++++++++ .../resources/mavlink/ardupilot/csAirLink.xml | 29 + .../resources/mavlink/ardupilot/cubepilot.xml | 48 + .../mavlink/ardupilot/development.xml | 256 + .../resources/mavlink/ardupilot/icarous.xml | 48 + .../mavlink/ardupilot/loweheiser.xml | 55 + .../mavlink/ardupilot/matrixpilot.xml | 349 + .../resources/mavlink/ardupilot/minimal.xml | 733 ++ .../resources/mavlink/ardupilot/paparazzi.xml | 38 + .../mavlink/ardupilot/python_array_test.xml | 67 + .../resources/mavlink/ardupilot/standard.xml | 146 + .../resources/mavlink/ardupilot/storm32.xml | 467 + src/main/resources/mavlink/ardupilot/test.xml | 31 + .../resources/mavlink/ardupilot/uAvionix.xml | 208 + .../resources/mavlink/ardupilot/ualberta.xml | 76 + 19 files changed, 12735 insertions(+) create mode 100644 src/main/resources/mavlink/ardupilot/ASLUAV.xml create mode 100644 src/main/resources/mavlink/ardupilot/AVSSUAS.xml create mode 100644 src/main/resources/mavlink/ardupilot/all.xml create mode 100644 src/main/resources/mavlink/ardupilot/ardupilotmega.xml create mode 100644 src/main/resources/mavlink/ardupilot/common.xml create mode 100644 src/main/resources/mavlink/ardupilot/csAirLink.xml create mode 100644 src/main/resources/mavlink/ardupilot/cubepilot.xml create mode 100644 src/main/resources/mavlink/ardupilot/development.xml create mode 100644 src/main/resources/mavlink/ardupilot/icarous.xml create mode 100644 src/main/resources/mavlink/ardupilot/loweheiser.xml create mode 100644 src/main/resources/mavlink/ardupilot/matrixpilot.xml create mode 100644 src/main/resources/mavlink/ardupilot/minimal.xml create mode 100755 src/main/resources/mavlink/ardupilot/paparazzi.xml create mode 100644 src/main/resources/mavlink/ardupilot/python_array_test.xml create mode 100644 src/main/resources/mavlink/ardupilot/standard.xml create mode 100644 src/main/resources/mavlink/ardupilot/storm32.xml create mode 100644 src/main/resources/mavlink/ardupilot/test.xml create mode 100644 src/main/resources/mavlink/ardupilot/uAvionix.xml create mode 100644 src/main/resources/mavlink/ardupilot/ualberta.xml diff --git a/src/main/resources/mavlink/ardupilot/ASLUAV.xml b/src/main/resources/mavlink/ardupilot/ASLUAV.xml new file mode 100644 index 0000000..4e80a5a --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/ASLUAV.xml @@ -0,0 +1,294 @@ + + + + + common.xml + + + + + Mission command to reset Maximum Power Point Tracker (MPPT) + MPPT number + Empty + Empty + Empty + Empty + Empty + Empty + + + Mission command to perform a power cycle on payload + Complete power cycle + VISensor power cycle + Empty + Empty + Empty + Empty + Empty + + + + + no service + + + link type unknown + + + 2G (GSM/GRPS/EDGE) link + + + 3G link (WCDMA/HSDPA/HSPA) + + + 4G link (LTE) + + + + + not specified + + + HUAWEI LTE USB Stick E3372 + + + + + + Message encoding a command with parameters as scaled integers and additional metadata. Scaling depends on the actual command value. + UTC time, seconds elapsed since 01.01.1970 + Microseconds elapsed since vehicle boot + System ID + Component ID + The coordinate system of the COMMAND, as defined by MAV_FRAME enum + The scheduled action for the mission item, as defined by MAV_CMD enum + false:0, true:1 + autocontinue to next wp + PARAM1, see MAV_CMD enum + PARAM2, see MAV_CMD enum + PARAM3, see MAV_CMD enum + PARAM4, see MAV_CMD enum + PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 + PARAM7 / z position: global: altitude in meters (MSL, WGS84, AGL or relative to home - depending on frame). + + + Send a command with up to seven parameters to the MAV and additional metadata + UTC time, seconds elapsed since 01.01.1970 + Microseconds elapsed since vehicle boot + System which should execute the command + Component which should execute the command, 0 for all components + Command ID, as defined by MAV_CMD enum. + 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) + Parameter 1, as defined by MAV_CMD enum. + Parameter 2, as defined by MAV_CMD enum. + Parameter 3, as defined by MAV_CMD enum. + Parameter 4, as defined by MAV_CMD enum. + Parameter 5, as defined by MAV_CMD enum. + Parameter 6, as defined by MAV_CMD enum. + Parameter 7, as defined by MAV_CMD enum. + + + Voltage and current sensor data + Power board voltage sensor reading + Power board current sensor reading + Board current sensor 1 reading + Board current sensor 2 reading + + + Maximum Power Point Tracker (MPPT) sensor data for solar module power performance tracking + MPPT last timestamp + MPPT1 voltage + MPPT1 current + MPPT1 pwm + MPPT1 status + MPPT2 voltage + MPPT2 current + MPPT2 pwm + MPPT2 status + MPPT3 voltage + MPPT3 current + MPPT3 pwm + MPPT3 status + + + ASL-fixed-wing controller data + Timestamp + ASLCTRL control-mode (manual, stabilized, auto, etc...) + See sourcecode for a description of these values... + + + Pitch angle + Pitch angle reference + + + + + + + Airspeed reference + + Yaw angle + Yaw angle reference + Roll angle + Roll angle reference + + + + + + + + + ASL-fixed-wing controller debug data + Debug data + Debug data + Debug data + Debug data + Debug data + Debug data + Debug data + Debug data + Debug data + Debug data + Debug data + + + Extended state information for ASLUAVs + Status of the position-indicator LEDs + Status of the IRIDIUM satellite communication system + Status vector for up to 8 servos + Motor RPM + + + + Extended EKF state estimates for ASLUAVs + Time since system start + Magnitude of wind velocity (in lateral inertial plane) + Wind heading angle from North + Z (Down) component of inertial wind velocity + Magnitude of air velocity + Sideslip angle + Angle of attack + + + Off-board controls/commands for ASLUAVs + Time since system start + Elevator command [~] + Throttle command [~] + Throttle 2 command [~] + Left aileron command [~] + Right aileron command [~] + Rudder command [~] + Off-board computer status + + + Atmospheric sensors (temperature, humidity, ...) + Time since system boot + Ambient temperature + Relative humidity + + + Battery pack monitoring data for Li-Ion batteries + Time since system start + Battery pack temperature + Battery pack voltage + Battery pack current + Battery pack state-of-charge + Battery monitor status report bits in Hex + Battery monitor serial number in Hex + Battery monitor safetystatus report bits in Hex + Battery monitor operation status report bits in Hex + Battery pack cell 1 voltage + Battery pack cell 2 voltage + Battery pack cell 3 voltage + Battery pack cell 4 voltage + Battery pack cell 5 voltage + Battery pack cell 6 voltage + + + Fixed-wing soaring (i.e. thermal seeking) data + Timestamp + Timestamp since last mode change + Thermal core updraft strength + Thermal radius + Thermal center latitude + Thermal center longitude + Variance W + Variance R + Variance Lat + Variance Lon + Suggested loiter radius + Suggested loiter direction + Distance to soar point + Expected sink rate at current airspeed, roll and throttle + Measurement / updraft speed at current/local airplane position + Measurement / roll angle tracking error + Expected measurement 1 + Expected measurement 2 + Thermal drift (from estimator prediction step only) + Thermal drift (from estimator prediction step only) + Total specific energy change (filtered) + Debug variable 1 + Debug variable 2 + Control Mode [-] + Data valid [-] + + + Monitoring of sensorpod status + Timestamp in linuxtime (since 1.1.1970) + Rate of ROS topic 1 + Rate of ROS topic 2 + Rate of ROS topic 3 + Rate of ROS topic 4 + Number of recording nodes + Temperature of sensorpod CPU in + Free space available in recordings directory in [Gb] * 1e2 + + + Monitoring of power board status + Timestamp + Power board status register + Power board leds status + Power board system voltage + Power board servo voltage + Power board digital voltage + Power board left motor current sensor + Power board right motor current sensor + Power board analog current sensor + Power board digital current sensor + Power board extension current sensor + Power board aux current sensor + + + Status of GSM modem (connected to onboard computer) + Timestamp (of OBC) + GSM modem used + GSM link type + RSSI as reported by modem (unconverted) + RSRP (LTE) or RSCP (WCDMA) as reported by modem (unconverted) + SINR (LTE) or ECIO (WCDMA) as reported by modem (unconverted) + RSRQ (LTE only) as reported by modem (unconverted) + + + + Status of the SatCom link + Timestamp + Timestamp of the last successful sbd session + Number of failed sessions + Number of successful sessions + Signal quality + Ring call pending + Transmission session pending + Receiving session pending + + + Calibrated airflow angle measurements + Timestamp + Angle of attack + Angle of attack measurement valid + Sideslip angle + Sideslip angle measurement valid + + + diff --git a/src/main/resources/mavlink/ardupilot/AVSSUAS.xml b/src/main/resources/mavlink/ardupilot/AVSSUAS.xml new file mode 100644 index 0000000..7138758 --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/AVSSUAS.xml @@ -0,0 +1,198 @@ + + + + + + + + + common.xml + 2 + 1 + + + + + AVSS defined command. Set PRS arm statuses. + PRS arm statuses + User defined + User defined + User defined + User defined + User defined + User defined + + + AVSS defined command. Gets PRS arm statuses + User defined + User defined + User defined + User defined + User defined + User defined + User defined + + + AVSS defined command. Get the PRS battery voltage in millivolts + User defined + User defined + User defined + User defined + User defined + User defined + User defined + + + AVSS defined command. Get the PRS error statuses. + User defined + User defined + User defined + User defined + User defined + User defined + User defined + + + AVSS defined command. Set the ATS arming altitude in meters. + ATS arming altitude + User defined + User defined + User defined + User defined + User defined + User defined + + + AVSS defined command. Get the ATS arming altitude in meters. + User defined + User defined + User defined + User defined + User defined + User defined + User defined + + + AVSS defined command. Shuts down the PRS system. + User defined + User defined + User defined + User defined + User defined + User defined + User defined + + + + + AVSS defined command failure reason. PRS not steady. + + + AVSS defined command failure reason. PRS DTM not armed. + + + AVSS defined command failure reason. PRS OTM not armed. + + + + + In manual control mode + + + In attitude mode + + + In GPS mode + + + In hotpoint mode + + + In assisted takeoff mode + + + In auto takeoff mode + + + In auto landing mode + + + In go home mode + + + In sdk control mode + + + In sport mode + + + In force auto landing mode + + + In tripod mode + + + In search mode + + + In engine mode + + + + + In manual control mode + + + In auto takeoff mode + + + In auto landing mode + + + In go home mode + + + In drop mode + + + + + + AVSS PRS system status. + Timestamp (time since PRS boot). + PRS error statuses + Estimated battery run-time without a remote connection and PRS battery voltage + PRS arm statuses + PRS battery charge statuses + + + Drone position. + Timestamp (time since FC boot). + Latitude, expressed + Longitude, expressed + Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL. + Altitude above ground, This altitude is measured by a ultrasound, Laser rangefinder or millimeter-wave radar + This altitude is measured by a barometer + + + Drone IMU data. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0). + Timestamp (time since FC boot). + Quaternion component 1, w (1 in null-rotation) + Quaternion component 2, x (0 in null-rotation) + Quaternion component 3, y (0 in null-rotation) + Quaternion component 4, z (0 in null-rotation) + X acceleration + Y acceleration + Z acceleration + Angular speed around X axis + Angular speed around Y axis + Angular speed around Z axis + + + Drone operation mode. + Timestamp (time since FC boot). + DJI M300 operation mode + horsefly operation mode + + + diff --git a/src/main/resources/mavlink/ardupilot/all.xml b/src/main/resources/mavlink/ardupilot/all.xml new file mode 100644 index 0000000..1c57252 --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/all.xml @@ -0,0 +1,52 @@ + + + ardupilotmega.xml + + ASLUAV.xml + common.xml + development.xml + icarous.xml + + + minimal.xml + + + python_array_test.xml + standard.xml + test.xml + ualberta.xml + uAvionix.xml + + loweheiser.xml + + storm32.xml + + AVSSUAS.xml + + cubepilot.xml + csAirLink.xml + + + + diff --git a/src/main/resources/mavlink/ardupilot/ardupilotmega.xml b/src/main/resources/mavlink/ardupilot/ardupilotmega.xml new file mode 100644 index 0000000..524e42b --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/ardupilotmega.xml @@ -0,0 +1,2101 @@ + + + common.xml + + uAvionix.xml + icarous.xml + loweheiser.xml + cubepilot.xml + csAirLink.xml + 2 + + + + + + + + + + + + + + + + + + + + + + Set the distance to be repeated on mission resume + Distance. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + Control attached liquid sprayer + 0: disable sprayer. 1: enable sprayer. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + Pass instructions onto scripting, a script should be checking for a new command + uint16 ID value to be passed to scripting + float value to be passed to scripting + float value to be passed to scripting + float value to be passed to scripting + Empty. + Empty. + Empty. + + + Execute auxiliary function + Auxiliary Function. + Switch Level. + Empty. + Empty. + Empty. + Empty. + Empty. + + + Mission command to wait for an altitude or downwards vertical speed. This is meant for high altitude balloon launches, allowing the aircraft to be idle until either an altitude is reached or a negative vertical speed is reached (indicating early balloon burst). The wiggle time is how often to wiggle the control surfaces to prevent them seizing up. + Altitude. + Descent speed. + How long to wiggle the control surfaces to prevent them seizing up. + Empty. + Empty. + Empty. + Empty. + + + A system wide power-off event has been initiated. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + + FLY button has been clicked. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + FLY button has been held for 1.5 seconds. + Takeoff altitude. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + PAUSE button has been clicked. + 1 if Solo is in a shot mode, 0 otherwise. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + Magnetometer calibration based on fixed position + in earth field given by inclination, declination and intensity. + Magnetic declination. + Magnetic inclination. + Magnetic intensity. + Yaw. + Empty. + Empty. + Empty. + + + Magnetometer calibration based on fixed expected field values. + Field strength X. + Field strength Y. + Field strength Z. + Empty. + Empty. + Empty. + Empty. + + + + Set EKF sensor source set. + Source Set Id. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + Initiate a magnetometer calibration. + Bitmask of magnetometers to calibrate. Use 0 to calibrate all sensors that can be started (sensors may not start if disabled, unhealthy, etc.). The command will NACK if calibration does not start for a sensor explicitly specified by the bitmask. + Automatically retry on failure (0=no retry, 1=retry). + Save without user input (0=require input, 1=autosave). + Delay. + Autoreboot (0=user reboot, 1=autoreboot). + Empty. + Empty. + + + Accept a magnetometer calibration. + Bitmask of magnetometers that calibration is accepted (0 means all). + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + Cancel a running magnetometer calibration. + Bitmask of magnetometers to cancel a running calibration (0 means all). + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + Used when doing accelerometer calibration. When sent to the GCS tells it what position to put the vehicle in. When sent to the vehicle says what position the vehicle is in. + Position. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + Reply with the version banner. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + Command autopilot to get into factory test/diagnostic mode. + 0: activate test mode, 1: exit test mode. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + Causes the gimbal to reset and boot as if it was just powered on. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + Reports progress and success or failure of gimbal axis calibration procedure. + Gimbal axis we're reporting calibration progress for. + Current calibration progress for this axis. + Status of the calibration. + Empty. + Empty. + Empty. + Empty. + + + Starts commutation calibration on the gimbal. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + Erases gimbal application and parameters. + Magic number. + Magic number. + Magic number. + Magic number. + Magic number. + Magic number. + Magic number. + + + + Update the bootloader + Empty + Empty + Empty + Empty + Magic number - set to 290876 to actually flash + Empty + Empty + + + Reset battery capacity for batteries that accumulate consumed battery via integration. + Bitmask of batteries to reset. Least significant bit is for the first battery. + Battery percentage remaining to set. + + + Issue a trap signal to the autopilot process, presumably to enter the debugger. + Magic number - set to 32451 to actually trap. + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + Control onboard scripting. + Scripting command to execute + + + Scripting command as NAV command with wait for completion. + integer command number (0 to 255) + timeout for operation in seconds. Zero means no timeout (0 to 255) + argument1. + argument2. + argument3. + argument4. + Empty + + + Maintain an attitude for a specified time. + Time to maintain specified attitude and climb rate + Roll angle in degrees (positive is lean right, negative is lean left) + Pitch angle in degrees (positive is lean back, negative is lean forward) + Yaw angle + Climb rate + Empty + Empty + + + Change flight speed at a given rate. This slews the vehicle at a controllable rate between it's previous speed and the new one. (affects GUIDED only. Outside GUIDED, aircraft ignores these commands. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.) + Airspeed or groundspeed. + Target Speed + Acceleration rate, 0 to take effect instantly + Empty + Empty + Empty + Empty + + + Change target altitude at a given rate. This slews the vehicle at a controllable rate between it's previous altitude and the new one. (affects GUIDED only. Outside GUIDED, aircraft ignores these commands. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.) + Empty + Empty + Rate of change, toward new altitude. 0 for maximum rate change. Positive numbers only, as negative numbers will not converge on the new target alt. + Empty + Empty + Empty + Target Altitude + + + Change to target heading at a given rate, overriding previous heading/s. This slews the vehicle at a controllable rate between it's previous heading and the new one. (affects GUIDED only. Exiting GUIDED returns aircraft to normal behaviour defined elsewhere. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.) + course-over-ground or raw vehicle heading. + Target heading. + Maximum centripetal accelearation, ie rate of change, toward new heading. + Empty + Empty + Empty + Empty + + + Provide a value for height above ground level. This can be used for things like fixed wing and VTOL landing. + Height above ground level. + estimated one standard deviation accuracy of the measurement. Set to NaN if not known. + Timeout for this data. The flight controller should only consider this data valid within the timeout window. + Empty + Empty + Empty + Empty + + + + + + Start a REPL session. + + + End a REPL session. + + + Stop execution of scripts. + + + Stop execution of scripts and restart. + + + + + Get an 8 byte session key which is used for remote secure updates which operate on flight controller data such as bootloader public keys. Return data will be 8 bytes on success. The session key remains valid until either the flight controller reboots or another SECURE_COMMAND_GET_SESSION_KEY is run. + + + Get an 8 byte session key which is used for remote secure updates which operate on RemoteID module data. Return data will be 8 bytes on success. The session key remains valid until either the remote ID module reboots or another SECURE_COMMAND_GET_REMOTEID_SESSION_KEY is run. + + + Remove range of public keys from the bootloader. Command data consists of two bytes, first byte if index of first public key to remove. Second byte is the number of keys to remove. If all keys are removed then secure boot is disabled and insecure firmware can be loaded. + + + Get current public keys from the bootloader. Command data consists of two bytes, first byte is index of first public key to fetch, 2nd byte is number of keys to fetch. Total data needs to fit in data portion of reply (max 6 keys for 32 byte keys). Reply data has the index of the first key in the first byte, followed by the keys. Returned keys may be less than the number of keys requested if there are less keys installed than requested. + + + Set current public keys in the bootloader. Data consists of a one byte public key index followed by the public keys. With 32 byte keys this allows for up to 6 keys to be set in one request. Keys outside of the range that is being set will remain unchanged. + + + Get config data for remote ID module. This command should be sent to the component ID of the flight controller which will forward it to the RemoteID module either over mavlink or DroneCAN. Data format is specific to the RemoteID implementation, see RemoteID firmware documentation for details. + + + Set config data for remote ID module. This command should be sent to the component ID of the flight controller which will forward it to the RemoteID module either over mavlink or DroneCAN. Data format is specific to the RemoteID implementation, see RemoteID firmware documentation for details. + + + Flash bootloader from local storage. Data is the filename to use for the bootloader. This is intended to be used with MAVFtp to upload a new bootloader to a microSD before flashing. + + + + + + Pre-initialization. + + + Disabled. + + + Checking limits. + + + A limit has been breached. + + + Taking action e.g. Return/RTL. + + + We're no longer in breach of a limit. + + + + + + Pre-initialization. + + + Disabled. + + + Checking limits. + + + + + Flags in RALLY_POINT message. + + Flag set when requiring favorable winds for landing. + + + Flag set when plane is to immediately descend to break altitude and land without GCS intervention. Flag not set when plane is to loiter at Rally point until commanded to land. + + + True if the following altitude frame value is valid. + + + 2 bit value representing altitude frame. 0: absolute, 1: relative home, 2: relative origin, 3: relative terrain + + + + + + Camera heartbeat, announce camera component ID at 1Hz. + + + Camera image triggered. + + + Camera connection lost. + + + Camera unknown error. + + + Camera battery low. Parameter p1 shows reported voltage. + + + Camera storage low. Parameter p1 shows reported shots remaining. + + + Camera storage low. Parameter p1 shows reported video minutes remaining. + + + + + + Shooting photos, not video. + + + Shooting video, not stills. + + + Unable to achieve requested exposure (e.g. shutter speed too low). + + + Closed loop feedback from camera, we know for sure it has successfully taken a picture. + + + Open loop camera, an image trigger has been requested but we can't know for sure it has successfully taken a picture. + + + + + + Gimbal is powered on but has not started initializing yet. + + + Gimbal is currently running calibration on the pitch axis. + + + Gimbal is currently running calibration on the roll axis. + + + Gimbal is currently running calibration on the yaw axis. + + + Gimbal has finished calibrating and initializing, but is relaxed pending reception of first rate command from copter. + + + Gimbal is actively stabilizing. + + + Gimbal is relaxed because it missed more than 10 expected rate command messages in a row. Gimbal will move back to active mode when it receives a new rate command. + + + + + Gimbal yaw axis. + + + Gimbal pitch axis. + + + Gimbal roll axis. + + + + + Axis calibration is in progress. + + + Axis calibration succeeded. + + + Axis calibration failed. + + + + + Whether or not this axis requires calibration is unknown at this time. + + + This axis requires calibration. + + + This axis does not require calibration. + + + + + + No GoPro connected. + + + The detected GoPro is not HeroBus compatible. + + + A HeroBus compatible GoPro is connected. + + + An unrecoverable error was encountered with the connected GoPro, it may require a power cycle. + + + + + + GoPro is currently recording. + + + + + The write message with ID indicated succeeded. + + + The write message with ID indicated failed. + + + + + (Get/Set). + + + (Get/Set). + + + (___/Set). + + + (Get/___). + + + (Get/___). + + + (Get/Set). + + + + (Get/Set). + + + (Get/Set). + + + (Get/Set). + + + (Get/Set). + + + (Get/Set) Hero 3+ Only. + + + (Get/Set) Hero 3+ Only. + + + (Get/Set) Hero 3+ Only. + + + (Get/Set) Hero 3+ Only. + + + (Get/Set) Hero 3+ Only. + + + (Get/Set). + + + + (Get/Set). + + + + + Video mode. + + + Photo mode. + + + Burst mode, Hero 3+ only. + + + Time lapse mode, Hero 3+ only. + + + Multi shot mode, Hero 4 only. + + + Playback mode, Hero 4 only, silver only except when LCD or HDMI is connected to black. + + + Playback mode, Hero 4 only. + + + Mode not yet known. + + + + + 848 x 480 (480p). + + + 1280 x 720 (720p). + + + 1280 x 960 (960p). + + + 1920 x 1080 (1080p). + + + 1920 x 1440 (1440p). + + + 2704 x 1440 (2.7k-17:9). + + + 2704 x 1524 (2.7k-16:9). + + + 2704 x 2028 (2.7k-4:3). + + + 3840 x 2160 (4k-16:9). + + + 4096 x 2160 (4k-17:9). + + + 1280 x 720 (720p-SuperView). + + + 1920 x 1080 (1080p-SuperView). + + + 2704 x 1520 (2.7k-SuperView). + + + 3840 x 2160 (4k-SuperView). + + + + + 12 FPS. + + + 15 FPS. + + + 24 FPS. + + + 25 FPS. + + + 30 FPS. + + + 48 FPS. + + + 50 FPS. + + + 60 FPS. + + + 80 FPS. + + + 90 FPS. + + + 100 FPS. + + + 120 FPS. + + + 240 FPS. + + + 12.5 FPS. + + + + + 0x00: Wide. + + + 0x01: Medium. + + + 0x02: Narrow. + + + + + 0=NTSC, 1=PAL. + + + + + 5MP Medium. + + + 7MP Medium. + + + 7MP Wide. + + + 10MP Wide. + + + 12MP Wide. + + + + + Auto. + + + 3000K. + + + 5500K. + + + 6500K. + + + Camera Raw. + + + + + Auto. + + + Neutral. + + + + + ISO 400. + + + ISO 800 (Only Hero 4). + + + ISO 1600. + + + ISO 3200 (Only Hero 4). + + + ISO 6400. + + + + + Low Sharpness. + + + Medium Sharpness. + + + High Sharpness. + + + + + -5.0 EV (Hero 3+ Only). + + + -4.5 EV (Hero 3+ Only). + + + -4.0 EV (Hero 3+ Only). + + + -3.5 EV (Hero 3+ Only). + + + -3.0 EV (Hero 3+ Only). + + + -2.5 EV (Hero 3+ Only). + + + -2.0 EV. + + + -1.5 EV. + + + -1.0 EV. + + + -0.5 EV. + + + 0.0 EV. + + + +0.5 EV. + + + +1.0 EV. + + + +1.5 EV. + + + +2.0 EV. + + + +2.5 EV (Hero 3+ Only). + + + +3.0 EV (Hero 3+ Only). + + + +3.5 EV (Hero 3+ Only). + + + +4.0 EV (Hero 3+ Only). + + + +4.5 EV (Hero 3+ Only). + + + +5.0 EV (Hero 3+ Only). + + + + + Charging disabled. + + + Charging enabled. + + + + + Unknown gopro model. + + + Hero 3+ Silver (HeroBus not supported by GoPro). + + + Hero 3+ Black. + + + Hero 4 Silver. + + + Hero 4 Black. + + + + + 3 Shots / 1 Second. + + + 5 Shots / 1 Second. + + + 10 Shots / 1 Second. + + + 10 Shots / 2 Second. + + + 10 Shots / 3 Second (Hero 4 Only). + + + 30 Shots / 1 Second. + + + 30 Shots / 2 Second. + + + 30 Shots / 3 Second. + + + 30 Shots / 6 Second. + + + + + Switch Low. + + + Switch Middle. + + + Switch High. + + + + + + LED patterns off (return control to regular vehicle control). + + + LEDs show pattern during firmware update. + + + Custom Pattern using custom bytes fields. + + + + + Flags in EKF_STATUS message. + + Set if EKF's attitude estimate is good. + + + Set if EKF's horizontal velocity estimate is good. + + + Set if EKF's vertical velocity estimate is good. + + + Set if EKF's horizontal position (relative) estimate is good. + + + Set if EKF's horizontal position (absolute) estimate is good. + + + Set if EKF's vertical position (absolute) estimate is good. + + + Set if EKF's vertical position (above ground) estimate is good. + + + EKF is in constant position mode and does not know it's absolute or relative position. + + + Set if EKF's predicted horizontal position (relative) estimate is good. + + + Set if EKF's predicted horizontal position (absolute) estimate is good. + + + Set if EKF believes the GPS input data is faulty. + + + Set if EKF has never been healthy. + + + + + + + + + + + Left wheel rate. + + + Right wheel rate. + + + Sailboat heel to mainsail. + + + Velocity north. + + + Velocity east. + + + Velocity down. + + + Position north. + + + Position east. + + + Position down. + + + Yaw angle. + + + + Special ACK block numbers control activation of dataflash log streaming. + + + + UAV to stop sending DataFlash blocks. + + + + UAV to start sending DataFlash blocks. + + + + + Possible remote log data block statuses. + + This block has NOT been received. + + + This block has been received. + + + + Bus types for device operations. + + I2C Device operation. + + + SPI Device operation. + + + + Deepstall flight stage. + + Flying to the landing point. + + + Building an estimate of the wind. + + + Waiting to breakout of the loiter to fly the approach. + + + Flying to the first arc point to turn around to the landing point. + + + Turning around back to the deepstall landing point. + + + Approaching the landing point. + + + Stalling and steering towards the land point. + + + + A mapping of plane flight modes for custom_mode field of heartbeat. + + MANUAL + + + CIRCLE + + + STABILIZE + + + TRAINING + + + ACRO + + + FBWA + + + FBWB + + + CRUISE + + + AUTOTUNE + + + AUTO + + + RTL + + + LOITER + + + TAKEOFF + + + AVOID ADSB + + + GUIDED + + + INITIALISING + + + QSTABILIZE + + + QHOVER + + + QLOITER + + + QLAND + + + QRTL + + + QAUTOTUNE + + + QACRO + + + THERMAL + + + LOITER2QLAND + + + AUTOLAND + + + + A mapping of copter flight modes for custom_mode field of heartbeat. + + STABILIZE + + + ACRO + + + ALT HOLD + + + AUTO + + + GUIDED + + + LOITER + + + RTL + + + CIRCLE + + + LAND + + + DRIFT + + + SPORT + + + FLIP + + + AUTOTUNE + + + POSHOLD + + + BRAKE + + + THROW + + + AVOID ADSB + + + GUIDED NOGPS + + + SMARTRTL + + + FLOWHOLD + + + FOLLOW + + + ZIGZAG + + + SYSTEMID + + + AUTOROTATE + + + AUTO RTL + + + TURTLE + + + RATE_ACRO + + + + A mapping of sub flight modes for custom_mode field of heartbeat. + + STABILIZE + + + ACRO + + + ALT HOLD + + + AUTO + + + GUIDED + + + CIRCLE + + + SURFACE + + + POSHOLD + + + MANUAL + + + MOTORDETECT + + + SURFTRAK + + + + A mapping of rover flight modes for custom_mode field of heartbeat. + + MANUAL + + + ACRO + + + STEERING + + + HOLD + + + LOITER + + + FOLLOW + + + SIMPLE + + + DOCK + + + CIRCLE + + + AUTO + + + RTL + + + SMART RTL + + + GUIDED + + + INITIALISING + + + + A mapping of antenna tracker flight modes for custom_mode field of heartbeat. + + MANUAL + + + STOP + + + SCAN + + + SERVO TEST + + + GUIDED + + + AUTO + + + INITIALISING + + + + The type of parameter for the OSD parameter editor. + + + + + + + + + + + + The error type for the OSD parameter editor. + + + + + + + + + + Offsets and calibrations values for hardware sensors. This makes it easier to debug the calibration process. + Magnetometer X offset. + Magnetometer Y offset. + Magnetometer Z offset. + Magnetic declination. + Raw pressure from barometer. + Raw temperature from barometer. + Gyro X calibration. + Gyro Y calibration. + Gyro Z calibration. + Accel X calibration. + Accel Y calibration. + Accel Z calibration. + + + + Set the magnetometer offsets + System ID. + Component ID. + Magnetometer X offset. + Magnetometer Y offset. + Magnetometer Z offset. + + + State of autopilot RAM. + Heap top. + Free memory. + + Free memory (32 bit). + + + Raw ADC output. + ADC output 1. + ADC output 2. + ADC output 3. + ADC output 4. + ADC output 5. + ADC output 6. + + + + Configure on-board Camera Control System. + System ID. + Component ID. + Mode enumeration from 1 to N //P, TV, AV, M, etc. (0 means ignore). + Divisor number //e.g. 1000 means 1/1000 (0 means ignore). + F stop number x 10 //e.g. 28 means 2.8 (0 means ignore). + ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore). + Exposure type enumeration from 1 to N (0 means ignore). + Command Identity (incremental loop: 0 to 255). //A command sent multiple times will be executed or pooled just once. + Main engine cut-off time before camera trigger (0 means no cut-off). + Extra parameters enumeration (0 means ignore). + Correspondent value to given extra_param. + + + Control on-board Camera Control System to take shots. + System ID. + Component ID. + 0: stop, 1: start or keep it up //Session control e.g. show/hide lens. + 1 to N //Zoom's absolute position (0 means ignore). + -100 to 100 //Zooming step value to offset zoom from the current position. + 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus. + 0: ignore, 1: shot or start filming. + Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once. + Extra parameters enumeration (0 means ignore). + Correspondent value to given extra_param. + + + + Message to configure a camera mount, directional antenna, etc. + System ID. + Component ID. + Mount operating mode. + (1 = yes, 0 = no). + (1 = yes, 0 = no). + (1 = yes, 0 = no). + + + Message to control a camera mount, directional antenna, etc. + System ID. + Component ID. + Pitch (centi-degrees) or lat (degE7), depending on mount mode. + Roll (centi-degrees) or lon (degE7) depending on mount mode. + Yaw (centi-degrees) or alt (cm) depending on mount mode. + If "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING). + + + Message with some status from autopilot to GCS about camera or antenna mount. + System ID. + Component ID. + Pitch. + Roll. + Yaw. + + Mount operating mode. + + + + A fence point. Used to set a point when from GCS -> MAV. Also used to return a point from MAV -> GCS. + System ID. + Component ID. + Point index (first point is 1, 0 is for return point). + Total number of points (for sanity checking). + Latitude of point. + Longitude of point. + + + Request a current fence point from MAV. + System ID. + Component ID. + Point index (first point is 1, 0 is for return point). + + + Status of DCM attitude estimator. + X gyro drift estimate. + Y gyro drift estimate. + Z gyro drift estimate. + Average accel_weight. + Average renormalisation value. + Average error_roll_pitch value. + Average error_yaw value. + + + Status of simulation environment, if used. + Roll angle. + Pitch angle. + Yaw angle. + X acceleration. + Y acceleration. + Z acceleration. + Angular speed around X axis. + Angular speed around Y axis. + Angular speed around Z axis. + Latitude. + Longitude. + + + POWER_STATUS+SYS_STATUS form a superset of the fields in this message. + Status of key hardware. + Board voltage. + I2C error count. + + + Status generated by radio. + Local signal strength. + Remote signal strength. + How full the tx buffer is. + Background noise level. + Remote background noise level. + Receive errors. + Count of error corrected packets. + + + + Status of AP_Limits. Sent in extended status stream when AP_Limits is enabled. + State of AP_Limits. + Time (since boot) of last breach. + Time (since boot) of last recovery action. + Time (since boot) of last successful recovery. + Time (since boot) of last all-clear. + Number of fence breaches. + AP_Limit_Module bitfield of enabled modules. + AP_Limit_Module bitfield of required modules. + AP_Limit_Module bitfield of triggered modules. + + + Wind estimation. + Wind direction (that wind is coming from). + Wind speed in ground plane. + Vertical wind speed. + + + Data packet, size 16. + Data type. + Data length. + Raw data. + + + Data packet, size 32. + Data type. + Data length. + Raw data. + + + Data packet, size 64. + Data type. + Data length. + Raw data. + + + Data packet, size 96. + Data type. + Data length. + Raw data. + + + Rangefinder reporting. + Distance. + Raw voltage if available, zero otherwise. + + + Airspeed auto-calibration. + GPS velocity north. + GPS velocity east. + GPS velocity down. + Differential pressure. + Estimated to true airspeed ratio. + Airspeed ratio. + EKF state x. + EKF state y. + EKF state z. + EKF Pax. + EKF Pby. + EKF Pcz. + + + + A rally point. Used to set a point when from GCS -> MAV. Also used to return a point from MAV -> GCS. + System ID. + Component ID. + Point index (first point is 0). + Total number of points (for sanity checking). + Latitude of point. + Longitude of point. + Transit / loiter altitude relative to home. + + Break altitude relative to home. + Heading to aim for when landing. + Configuration flags. + + + Request a current rally point from MAV. MAV should respond with a RALLY_POINT message. MAV should not respond if the request is invalid. + System ID. + Component ID. + Point index (first point is 0). + + + Status of compassmot calibration. + Throttle. + Current. + Interference. + Motor Compensation X. + Motor Compensation Y. + Motor Compensation Z. + + + Status of secondary AHRS filter if available. + Roll angle. + Pitch angle. + Yaw angle. + Altitude (MSL). + Latitude. + Longitude. + + + + Camera Event. + Image timestamp (since UNIX epoch, according to camera clock). + System ID. + + Camera ID. + + Image index. + + Event type. + Parameter 1 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). + Parameter 2 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). + Parameter 3 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). + Parameter 4 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). + + + + Camera Capture Feedback. + Image timestamp (since UNIX epoch), as passed in by CAMERA_STATUS message (or autopilot if no CCB). + System ID. + + Camera ID. + + Image index. + + Latitude. + Longitude. + Altitude (MSL). + Altitude (Relative to HOME location). + Camera Roll angle (earth frame, +-180). + + Camera Pitch angle (earth frame, +-180). + + Camera Yaw (earth frame, 0-360, true). + + Focal Length. + + Feedback flags. + + + Completed image captures. + + + + 2nd Battery status + Voltage. + Battery current, -1: autopilot does not measure the current. + + + Status of third AHRS filter if available. This is for ANU research group (Ali and Sean). + Roll angle. + Pitch angle. + Yaw angle. + Altitude (MSL). + Latitude. + Longitude. + Test variable1. + Test variable2. + Test variable3. + Test variable4. + + + Request the autopilot version from the system/component. + System ID. + Component ID. + + + + Send a block of log data to remote location. + System ID. + Component ID. + Log data block sequence number. + Log data block. + + + Send Status of each log block that autopilot board might have sent. + System ID. + Component ID. + Log data block sequence number. + Log data block status. + + + Control vehicle LEDs. + System ID. + Component ID. + Instance (LED instance to control or 255 for all LEDs). + Pattern (see LED_PATTERN_ENUM). + Custom Byte Length. + Custom Bytes. + + + Reports progress of compass calibration. + Compass being calibrated. + Bitmask of compasses being calibrated. + Calibration Status. + Attempt number. + Completion percentage. + Bitmask of sphere sections (see http://en.wikipedia.org/wiki/Geodesic_grid). + Body frame direction vector for display. + Body frame direction vector for display. + Body frame direction vector for display. + + + + + EKF Status message including flags and variances. + Flags. + + Velocity variance. + + Horizontal Position variance. + Vertical Position variance. + Compass variance. + Terrain Altitude variance. + + Airspeed variance. + + + + PID tuning information. + Axis. + Desired rate. + Achieved rate. + FF component. + P component. + I component. + D component. + + Slew rate. + P/D oscillation modifier. + + + Deepstall path planning. + Landing latitude. + Landing longitude. + Final heading start point, latitude. + Final heading start point, longitude. + Arc entry point, latitude. + Arc entry point, longitude. + Altitude. + Distance the aircraft expects to travel during the deepstall. + Deepstall cross track error (only valid when in DEEPSTALL_STAGE_LAND). + Deepstall stage. + + + 3 axis gimbal measurements. + System ID. + Component ID. + Time since last update. + Delta angle X. + Delta angle Y. + Delta angle X. + Delta velocity X. + Delta velocity Y. + Delta velocity Z. + Joint ROLL. + Joint EL. + Joint AZ. + + + Control message for rate gimbal. + System ID. + Component ID. + Demanded angular rate X. + Demanded angular rate Y. + Demanded angular rate Z. + + + 100 Hz gimbal torque command telemetry. + System ID. + Component ID. + Roll Torque Command. + Elevation Torque Command. + Azimuth Torque Command. + + + + Heartbeat from a HeroBus attached GoPro. + Status. + Current capture mode. + Additional status bits. + + + + Request a GOPRO_COMMAND response from the GoPro. + System ID. + Component ID. + Command ID. + + + Response from a GOPRO_COMMAND get request. + Command ID. + Status. + Value. + + + Request to set a GOPRO_COMMAND with a desired. + System ID. + Component ID. + Command ID. + Value. + + + Response from a GOPRO_COMMAND set request. + Command ID. + Status. + + + + + RPM sensor output. + RPM Sensor1. + RPM Sensor2. + + + + Read registers for a device. + System ID. + Component ID. + Request ID - copied to reply. + The bus type. + Bus number. + Bus address. + Name of device on bus (for SPI). + First register to read. + Count of registers to read. + + Bank number. + + + Read registers reply. + Request ID - copied from request. + 0 for success, anything else is failure code. + Starting register. + Count of bytes read. + Reply data. + + Bank number. + + + Write registers for a device. + System ID. + Component ID. + Request ID - copied to reply. + The bus type. + Bus number. + Bus address. + Name of device on bus (for SPI). + First register to write. + Count of registers to write. + Write data. + + Bank number. + + + Write registers reply. + Request ID - copied from request. + 0 for success, anything else is failure code. + + + Send a secure command. Data should be signed with a private key corresponding with a public key known to the recipient. Signature should be over the concatenation of the sequence number (little-endian format), the operation (little-endian format) the data and the session key. For SECURE_COMMAND_GET_SESSION_KEY the session key should be zero length. The data array consists of the data followed by the signature. The sum of the data_length and the sig_length cannot be more than 220. The format of the data is command specific. + System ID. + Component ID. + Sequence ID for tagging reply. + Operation being requested. + Data length. + Signature length. + Signed data. + + + Reply from secure command. + Sequence ID from request. + Operation that was requested. + Result of command. + Data length. + Reply data. + + + + Adaptive Controller tuning information. + Axis. + Desired rate. + Achieved rate. + Error between model and vehicle. + Theta estimated state predictor. + Omega estimated state predictor. + Sigma estimated state predictor. + Theta derivative. + Omega derivative. + Sigma derivative. + Projection operator value. + Projection operator derivative. + u adaptive controlled output command. + + + + Camera vision based attitude and position deltas. + Timestamp (synced to UNIX time or since system boot). + Time since the last reported camera frame. + Defines a rotation vector [roll, pitch, yaw] to the current MAV_FRAME_BODY_FRD from the previous MAV_FRAME_BODY_FRD. + Change in position to the current MAV_FRAME_BODY_FRD from the previous FRAME_BODY_FRD rotated to the current MAV_FRAME_BODY_FRD. + Normalised confidence value from 0 to 100. + + + + Angle of Attack and Side Slip Angle. + Timestamp (since boot or Unix epoch). + Angle of Attack. + Side Slip Angle. + + + ESC Telemetry Data for ESCs 1 to 4, matching data sent by BLHeli ESCs. + Temperature. + Voltage. + Current. + Total current. + RPM (eRPM). + count of telemetry packets received (wraps at 65535). + + + ESC Telemetry Data for ESCs 5 to 8, matching data sent by BLHeli ESCs. + Temperature. + Voltage. + Current. + Total current. + RPM (eRPM). + count of telemetry packets received (wraps at 65535). + + + ESC Telemetry Data for ESCs 9 to 12, matching data sent by BLHeli ESCs. + Temperature. + Voltage. + Current. + Total current. + RPM (eRPM). + count of telemetry packets received (wraps at 65535). + + + Configure an OSD parameter slot. + System ID. + Component ID. + Request ID - copied to reply. + OSD parameter screen index. + OSD parameter display index. + Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + Config type. + OSD parameter minimum value. + OSD parameter maximum value. + OSD parameter increment. + + + Configure OSD parameter reply. + Request ID - copied from request. + Config error type. + + + Read a configured an OSD parameter slot. + System ID. + Component ID. + Request ID - copied to reply. + OSD parameter screen index. + OSD parameter display index. + + + Read configured OSD parameter reply. + Request ID - copied from request. + Config error type. + Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + Config type. + OSD parameter minimum value. + OSD parameter maximum value. + OSD parameter increment. + + + + Obstacle located as a 3D vector. + Timestamp (time since system boot). + Class id of the distance sensor type. + Coordinate frame of reference. + Unique ID given to each obstacle so that its movement can be tracked. Use UINT16_MAX if object ID is unknown or cannot be determined. + X position of the obstacle. + Y position of the obstacle. + Z position of the obstacle. + Minimum distance the sensor can measure. + Maximum distance the sensor can measure. + + + Water depth + Timestamp (time since system boot) + Onboard ID of the sensor + Sensor data healthy (0=unhealthy, 1=healthy) + Latitude + Longitude + Altitude (MSL) of vehicle + Roll angle + Pitch angle + Yaw angle + Distance (uncorrected) + Water temperature + + + The MCU status, giving MCU temperature and voltage. The min and max voltages are to allow for detecting power supply instability. + MCU instance + MCU Internal temperature + MCU voltage + MCU voltage minimum + MCU voltage maximum + + + ESC Telemetry Data for ESCs 13 to 16, matching data sent by BLHeli ESCs. + Temperature. + Voltage. + Current. + Total current. + RPM (eRPM). + count of telemetry packets received (wraps at 65535). + + + ESC Telemetry Data for ESCs 17 to 20, matching data sent by BLHeli ESCs. + Temperature. + Voltage. + Current. + Total current. + RPM (eRPM). + count of telemetry packets received (wraps at 65535). + + + ESC Telemetry Data for ESCs 21 to 24, matching data sent by BLHeli ESCs. + Temperature. + Voltage. + Current. + Total current. + RPM (eRPM). + count of telemetry packets received (wraps at 65535). + + + ESC Telemetry Data for ESCs 25 to 28, matching data sent by BLHeli ESCs. + Temperature. + Voltage. + Current. + Total current. + RPM (eRPM). + count of telemetry packets received (wraps at 65535). + + + ESC Telemetry Data for ESCs 29 to 32, matching data sent by BLHeli ESCs. + Temperature. + Voltage. + Current. + Total current. + RPM (eRPM). + count of telemetry packets received (wraps at 65535). + + + Send a key-value pair as string. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. + Timestamp (time since system boot). + Name of the debug variable + Value of the debug variable + + + diff --git a/src/main/resources/mavlink/ardupilot/common.xml b/src/main/resources/mavlink/ardupilot/common.xml new file mode 100644 index 0000000..067c8dd --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/common.xml @@ -0,0 +1,7539 @@ + + + standard.xml + 3 + 0 + + + Flags to report failure cases over the high latency telemetry. + + GPS failure. + + + Differential pressure sensor failure. + + + Absolute pressure sensor failure. + + + Accelerometer sensor failure. + + + Gyroscope sensor failure. + + + Magnetometer sensor failure. + + + Terrain subsystem failure. + + + Battery failure/critical low battery. + + + RC receiver failure/no RC connection. + + + Offboard link failure. + + + Engine failure. + + + Geofence violation. + + + Estimator failure, for example measurement rejection or large variances. + + + Mission failure. + + + + Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution. + + Hold at the current position. + + + Continue with the next item in mission execution. + + + Hold at the current position of the system + + + Hold at the position specified in the parameters of the DO_HOLD action + + + + Using MAV_MODE to set modes is less predictable than using standard modes (MAV_STANDARD_MODE) or custom modes (MAV_MODE_FLAG_CUSTOM_MODE_ENABLED). + Predefined OR-combined MAV_MODE_FLAG values. These can simplify using the flags when setting modes. Note that manual input is enabled in all modes as a safety override. + + System is not ready to fly, booting, calibrating, etc. No flag is set. + + + System is allowed to be active, under assisted RC control (MAV_MODE_FLAG_SAFETY_ARMED, MAV_MODE_FLAG_STABILIZE_ENABLED) + + + System is allowed to be active, under assisted RC control (MAV_MODE_FLAG_SAFETY_ARMED, MAV_MODE_FLAG_MANUAL_INPUT_ENABLED, MAV_MODE_FLAG_STABILIZE_ENABLED) + + + System is allowed to be active, under manual (RC) control, no stabilization (MAV_MODE_FLAG_MANUAL_INPUT_ENABLED) + + + System is allowed to be active, under manual (RC) control, no stabilization (MAV_MODE_FLAG_SAFETY_ARMED, MAV_MODE_FLAG_MANUAL_INPUT_ENABLED) + + + System is allowed to be active, under autonomous control, manual setpoint (MAV_MODE_FLAG_SAFETY_ARMED, MAV_MODE_FLAG_STABILIZE_ENABLED, MAV_MODE_FLAG_GUIDED_ENABLED) + + + System is allowed to be active, under autonomous control, manual setpoint (MAV_MODE_FLAG_SAFETY_ARMED, MAV_MODE_FLAG_MANUAL_INPUT_ENABLED, MAV_MODE_FLAG_STABILIZE_ENABLED, MAV_MODE_FLAG_GUIDED_ENABLED) + + + System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints). (MAV_MODE_FLAG_SAFETY_ARMED, MAV_MODE_FLAG_STABILIZE_ENABLED, MAV_MODE_FLAG_GUIDED_ENABLED, MAV_MODE_FLAG_AUTO_ENABLED). + + + System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints). (MAV_MODE_FLAG_SAFETY_ARMED, MAV_MODE_FLAG_MANUAL_INPUT_ENABLED, MAV_MODE_FLAG_STABILIZE_ENABLED, MAV_MODE_FLAG_GUIDED_ENABLED,MAV_MODE_FLAG_AUTO_ENABLED). + + + UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. (MAV_MODE_FLAG_MANUAL_INPUT_ENABLED, MAV_MODE_FLAG_TEST_ENABLED). + + + UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only (MAV_MODE_FLAG_SAFETY_ARMED, MAV_MODE_FLAG_MANUAL_INPUT_ENABLED, MAV_MODE_FLAG_TEST_ENABLED) + + + + These encode the sensors whose status is sent as part of the SYS_STATUS message. + + 0x01 3D gyro + + + 0x02 3D accelerometer + + + 0x04 3D magnetometer + + + 0x08 absolute pressure + + + 0x10 differential pressure + + + 0x20 GPS + + + 0x40 optical flow + + + 0x80 computer vision position + + + 0x100 laser based position + + + 0x200 external ground truth (Vicon or Leica) + + + 0x400 3D angular rate control + + + 0x800 attitude stabilization + + + 0x1000 yaw position + + + 0x2000 z/altitude control + + + 0x4000 x/y position control + + + 0x8000 motor outputs / control + + + 0x10000 RC receiver + + + 0x20000 2nd 3D gyro + + + 0x40000 2nd 3D accelerometer + + + 0x80000 2nd 3D magnetometer + + + 0x100000 geofence + + + 0x200000 AHRS subsystem health + + + 0x400000 Terrain subsystem health + + + 0x800000 Motors are reversed + + + 0x1000000 Logging + + + 0x2000000 Battery + + + 0x4000000 Proximity + + + 0x8000000 Satellite Communication + + + 0x10000000 pre-arm check status. Always healthy when armed + + + 0x20000000 Avoidance/collision prevention + + + 0x40000000 propulsion (actuator, esc, motor or propellor) + + + 0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only) + + + + These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields. + + 0x01 Recovery system (parachute, balloon, retracts etc) + + + 0x02 Leak detection + + + + Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. + + Global frames use the following naming conventions: + - "GLOBAL": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. + The following modifiers may be used with "GLOBAL": + - "RELATIVE_ALT": Altitude is relative to the vehicle home position rather than MSL. + - "TERRAIN_ALT": Altitude is relative to ground level rather than MSL. + - "INT": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. + + Local frames use the following naming conventions: + - "LOCAL": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator ("EKF"). + - "BODY": Origin of local frame travels with the vehicle. NOTE, "BODY" does NOT indicate alignment of frame axis with vehicle attitude. + - "OFFSET": Deprecated synonym for "BODY" (origin travels with the vehicle). Not to be used for new frames. + + Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED). + + + Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL). + + + NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth. + + + NOT a coordinate frame, indicates a mission command. + + + + Global (WGS84) coordinate frame + altitude relative to the home position. + + + + ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth. + + + Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. + Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL). + + + Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. + Global (WGS84) coordinate frame (scaled) + altitude relative to the home position. + + + NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle. + + + + Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values. + + + + This is the same as MAV_FRAME_BODY_FRD. + + + Global (WGS84) coordinate frame with AGL altitude (altitude at ground level). + + + Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. + Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level). + + + FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle. + + + + MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up). + + + + MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down). + + + + MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up). + + + + MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down). + + + + MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up). + + + + MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down). + + + + MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up). + + + FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane. + + + FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane. + + + + + + + + + + + + + + + + + + + + + + + + + + No last fence breach + + + Breached minimum altitude + + + Breached maximum altitude + + + Breached fence boundary + + + + + Actions being taken to mitigate/prevent fence breach + + Unknown + + + No actions being taken + + + Velocity limiting active to prevent breach + + + + Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. + Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. + If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them). + + + Maximum altitude fence + + + Circle fence + + + Polygon fence + + + Minimum altitude fence + + + + + + Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages. + + Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization + + + Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. + + + Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization + + + Load neutral position and start RC Roll,Pitch,Yaw control with stabilization + + + Load neutral position and start to point to Lat,Lon,Alt + + + Gimbal tracks system with specified system ID + + + Gimbal tracks home position + + + + Gimbal device (low level) capability flags (bitmap). + + Gimbal device supports a retracted position. + + + Gimbal device supports a horizontal, forward looking position, stabilized. + + + Gimbal device supports rotating around roll axis. + + + Gimbal device supports to follow a roll angle relative to the vehicle. + + + Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized). + + + Gimbal device supports rotating around pitch axis. + + + Gimbal device supports to follow a pitch angle relative to the vehicle. + + + Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized). + + + Gimbal device supports rotating around yaw axis. + + + Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default). + + + Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available). + + + Gimbal device supports yawing/panning infinitely (e.g. using slip disk). + + + Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME. + + + Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation. + + + Gimbal device supports to point to a local position. + + + Gimbal device supports to point to a global latitude, longitude, altitude position. + + + + Gimbal manager high level capability flags (bitmap). The flags are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags. + + Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT. + + + Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL. + + + Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS. + + + Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW. + + + Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK. + + + Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS. + + + Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW. + + + Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK. + + + Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS. + + + Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW. + + + Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK. + + + Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW. + + + Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME. + + + Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS. + + + Based on GIMBAL_DEVICE_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL. + + + Based on GIMBAL_DEVICE_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL. + + + + Flags for gimbal device (lower level) operation. + + Set to retracted safe position (no stabilization), takes precedence over all other flags. + + + Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation. + + + Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal. + + + Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal. + + + Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward). + + + Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward). + + + Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North). + + + Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored). + + + The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored. + + + The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation. + + + + Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS. + + Based on GIMBAL_DEVICE_FLAGS_RETRACT. + + + Based on GIMBAL_DEVICE_FLAGS_NEUTRAL. + + + Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK. + + + Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK. + + + Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK. + + + Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME. + + + Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME. + + + Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME. + + + Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE. + + + Based on GIMBAL_DEVICE_FLAGS_RC_MIXED. + + + + Gimbal device (low level) error flags (bitmap, 0 means no error) + + Gimbal device is limited by hardware roll limit. + + + Gimbal device is limited by hardware pitch limit. + + + Gimbal device is limited by hardware yaw limit. + + + There is an error with the gimbal encoders. + + + There is an error with the gimbal power source. + + + There is an error with the gimbal motors. + + + There is an error with the gimbal's software. + + + There is an error with the gimbal's communication. + + + Gimbal device is currently calibrating. + + + Gimbal device is not assigned to a gimbal manager. + + + + + Gripper actions. + + Gripper release cargo. + + + Gripper grab onto cargo. + + + Gripper hold current grip state/position. + + + + + Winch actions. + + Allow motor to freewheel. + + + Wind or unwind specified length of line, optionally using specified rate. + + + Wind or unwind line at specified rate. + + + Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored. + + + Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored. + + + Engage motor and hold current position. Only action and instance command parameters are used, others are ignored. + + + Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored. + + + Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored. + + + Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored. + + + Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored + + + + + Generalized UAVCAN node health + + The node is functioning properly. + + + A critical parameter went out of range or the node has encountered a minor failure. + + + The node has encountered a major failure. + + + The node has suffered a fatal malfunction. + + + + + Generalized UAVCAN node mode + + The node is performing its primary functions. + + + The node is initializing; this mode is entered immediately after startup. + + + The node is under maintenance. + + + The node is in the process of updating its software. + + + The node is no longer available online. + + + + Flags to indicate the status of camera storage. + + Storage is missing (no microSD card loaded for example.) + + + Storage present but unformatted. + + + Storage present and ready. + + + Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored. + + + + Flags to indicate the type of storage. + + Storage type is not known. + + + Storage type is USB device. + + + Storage type is SD card. + + + Storage type is microSD card. + + + Storage type is CFast. + + + Storage type is CFexpress. + + + Storage type is XQD. + + + Storage type is HD mass storage type. + + + Storage type is other, not listed type. + + + + Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE). + + Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported). + + + Storage for saving photos. + + + Storage for saving videos. + + + Storage for saving logs. + + + + Yaw behaviour during orbit flight. + + Vehicle front points to the center (default). + + + Vehicle front holds heading when message received. + + + Yaw uncontrolled. + + + Vehicle front follows flight path (tangential to circle). + + + Yaw controlled by RC input. + + + Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded. + + + + Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands. + + Do nothing. + + + Command the actuator to beep now. + + + Permanently set the actuator (ESC) to 3D mode (reversible thrust). + + + Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust). + + + Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise). + + + Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1). + + + + Actuator output function. Values greater or equal to 1000 are autopilot-specific. + + No function (disabled). + + + Motor 1 + + + Motor 2 + + + Motor 3 + + + Motor 4 + + + Motor 5 + + + Motor 6 + + + Motor 7 + + + Motor 8 + + + Motor 9 + + + Motor 10 + + + Motor 11 + + + Motor 12 + + + Motor 13 + + + Motor 14 + + + Motor 15 + + + Motor 16 + + + Servo 1 + + + Servo 2 + + + Servo 3 + + + Servo 4 + + + Servo 5 + + + Servo 6 + + + Servo 7 + + + Servo 8 + + + Servo 9 + + + Servo 10 + + + Servo 11 + + + Servo 12 + + + Servo 13 + + + Servo 14 + + + Servo 15 + + + Servo 16 + + + + Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. + Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes. + + Autotune roll axis. + + + Autotune pitch axis. + + + Autotune yaw axis. + + + + + Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. + (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.) + + + Read all parameters from persistent storage. Replaces values in volatile storage. + + + Write all parameter values to persistent storage (flash/EEPROM) + + + Reset parameters to default values (such as sensor calibration, safety settings, and so on). Note that a flight stack may choose not to reset some parameters at their own discretion (such as those that are locked or expected to persist for the vehicle lifetime). + + + Reset only sensor calibration parameters to factory defaults (or firmware default if not available) + + + Reset all parameters to default values. + + + + + Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. + (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.) + + + Read current mission data from persistent storage + + + Write current mission data to persistent storage + + + Erase all mission data stored on the vehicle (both persistent and volatile storage) + + + + Reboot/shutdown action for selected component in MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN. + + Do nothing. + + + Reboot component. + + + Shutdown component. + + + Reboot component and keep it in the bootloader until upgraded. + + + Power on component. Do nothing if component is already powered (ACK command with MAV_RESULT_ACCEPTED). + + + + Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted. + + Reboot/Shutdown only if allowed by safety checks, such as being landed. + + + Force reboot/shutdown of the autopilot/component regardless of system state. + + + + Action for the magnetometer (param2) of MAV_CMD_PREFLIGHT_CALIBRATION. + + No action. + + + Start magnetometer calibration. + + + Force-accept the existing compass calibration as valid without re-running it. Useful after a parameter reload that cleared calibration validity flags. + + + + Action for the accelerometer (param5) of MAV_CMD_PREFLIGHT_CALIBRATION. + + No action. + + + Full 6-position accelerometer calibration. + + + Board level (trim) calibration. + + + Accelerometer temperature calibration. + + + Simple accelerometer calibration. + + + Force-accept the existing accelerometer calibration as valid without re-running it. Useful after a parameter reload that cleared calibration validity flags. + + + + + Accept the command even if the autopilot does not have control over its horizontal position (note that it might not have altitude control either). + + + + + + + + Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See https://mavlink.io/en/guide/xml_schema.html#MAV_CMD for information about the structure of the MAV_CMD entries + + Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION). + Hold time. (ignored by fixed wing, time to stay at waypoint for rotary wing) + Acceptance radius (if the sphere with this radius is hit, the waypoint counts as reached) + 0 to pass through the WP, if > 0 radius to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control. + Desired yaw angle at waypoint (rotary wing). NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.). + Latitude + Longitude + Altitude + + + Loiter around this waypoint an unlimited amount of time + Empty + Empty + Loiter radius around waypoint for forward-only moving vehicles (not multicopters). If positive loiter clockwise, else counter-clockwise + Desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.). + Latitude + Longitude + Altitude + + + Loiter around this waypoint for X turns + Number of turns. + Empty + Radius around waypoint. If positive loiter clockwise, else counter-clockwise + Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.). + Latitude + Longitude + Altitude + + + Loiter around this waypoint for X seconds + Loiter time. + Empty + Radius around waypoint. If positive loiter clockwise, else counter-clockwise. + Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.). + Latitude + Longitude + Altitude + + + Return to launch location + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + Land at location. + Minimum target altitude if landing is aborted (0 = undefined/use system default). + Precision land mode. + Empty. + Desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.). + Latitude. + Longitude. + Landing altitude (ground level in current frame). + + + Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode. + Minimum pitch (if airspeed sensor present), desired pitch without sensor + Empty + Bitmask of options flags. + Yaw angle (if magnetometer present), ignored without magnetometer. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.). + Latitude + Longitude + Altitude + + + Land at local position (local frame only) + Landing target number (if available) + Maximum accepted offset from desired landing position - computed magnitude from spherical coordinates: d = sqrt(x^2 + y^2 + z^2), which gives the maximum accepted distance between the desired landing position and the position where the vehicle is about to land + Landing descend rate + Desired yaw angle + Y-axis position + X-axis position + Z-axis / ground level position + + + Takeoff from local position (local frame only) + Minimum pitch (if airspeed sensor present), desired pitch without sensor + Empty + Takeoff ascend rate + Yaw angle (if magnetometer or another yaw estimation source present), ignored without one of these + Y-axis position + X-axis position + Z-axis position + + + Vehicle following, i.e. this waypoint represents the position of a moving vehicle + Following logic to use (e.g. loitering or sinusoidal following) - depends on specific autopilot implementation + Ground speed of vehicle to be followed + Radius around waypoint. If positive loiter clockwise, else counter-clockwise + Desired yaw angle. + Latitude + Longitude + Altitude + + + Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached. + Climb or Descend (0 = Neutral, command completes when within 5m of this command's altitude, 1 = Climbing, command completes when at or above this command's altitude, 2 = Descending, command completes when at or below this command's altitude. + Empty + Empty + Empty + Empty + Empty + Desired altitude + + + Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint. + Leave loiter circle only when track heading towards the next waypoint (MAV_BOOL_FALSE: Leave when altitude reached). Values not equal to 0 or 1 are invalid. + Loiter radius around waypoint for forward-only moving vehicles (not multicopters). If positive loiter clockwise, negative counter-clockwise, 0 means no change to standard loiter. + Empty + Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location + Latitude + Longitude + Altitude + + + Begin following a target + System ID (of the FOLLOW_TARGET beacon). Send 0 to disable follow-me and return to the default position hold mode. + Reserved + Reserved + Altitude mode: 0: Keep current altitude, 1: keep altitude difference to target, 2: go to a fixed altitude above home. + Altitude above home. (used if mode=2) + Reserved + Time to land in which the MAV should go to the default position hold mode after a message RX timeout. + + + Reposition the MAV after a follow target command has been sent + Camera q1 (where 0 is on the ray from the camera to the tracking device) + Camera q2 + Camera q3 + Camera q4 + altitude offset from target + X offset from target + Y offset from target + + + Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults. + Radius of the circle. Positive: orbit clockwise. Negative: orbit counter-clockwise. NaN: Use vehicle default radius, or current radius if already orbiting. + Tangential Velocity. NaN: Use vehicle default velocity, or current velocity if already orbiting. + Yaw behavior of the vehicle. + Orbit around the centre point for this many radians (i.e. for a three-quarter orbit set 270*Pi/180). 0: Orbit forever. NaN: Use vehicle default, or current value if already orbiting. + Center point latitude (if no MAV_FRAME specified) / X coordinate according to MAV_FRAME. INT32_MAX (or NaN if sent in COMMAND_LONG): Use current vehicle position, or current center if already orbiting. + Center point longitude (if no MAV_FRAME specified) / Y coordinate according to MAV_FRAME. INT32_MAX (or NaN if sent in COMMAND_LONG): Use current vehicle position, or current center if already orbiting. + Center point altitude (MSL) (if no MAV_FRAME specified) / Z coordinate according to MAV_FRAME. NaN: Use current vehicle altitude. + + + Fly a figure eight path as defined by the parameters. + Set parameters to NaN/INT32_MAX (as appropriate) to use system-default values. + The command is intended for fixed wing vehicles (and VTOL hybrids flying in fixed-wing mode), allowing POI tracking for gimbals that don't support infinite rotation. + This command only defines the flight path. Speed should be set independently (use e.g. MAV_CMD_DO_CHANGE_SPEED). + Yaw and other degrees of freedom are not specified, and will be flight-stack specific (on vehicles where they can be controlled independent of the heading). + + Major axis radius of the figure eight. Positive: orbit the north circle clockwise. Negative: orbit the north circle counter-clockwise. + NaN: The radius will be set to 2.5 times the minor radius and direction is clockwise. + Must be greater or equal to two times the minor radius for feasible values. + Minor axis radius of the figure eight. Defines the radius of the two circles that make up the figure. Negative value has no effect. + NaN: The radius will be set to the default loiter radius. + + Orientation of the figure eight major axis with respect to true north (range: [-pi,pi]). NaN: use default orientation aligned to true north. + Center point latitude/X coordinate according to MAV_FRAME. If no MAV_FRAME specified, MAV_FRAME_GLOBAL is assumed. + INT32_MAX or NaN: Use current vehicle position, or current center if already loitering. + Center point longitude/Y coordinate according to MAV_FRAME. If no MAV_FRAME specified, MAV_FRAME_GLOBAL is assumed. + INT32_MAX or NaN: Use current vehicle position, or current center if already loitering. + Center point altitude MSL/Z coordinate according to MAV_FRAME. If no MAV_FRAME specified, MAV_FRAME_GLOBAL is assumed. + INT32_MAX or NaN: Use current vehicle altitude. + + + Circular arc path waypoint. + This defines the end/exit point and angle (param1) of an arc path from the previous waypoint. A position is required before this command to define the start of the arc (e.g. current position, a MAV_CMD_NAV_WAYPOINT, or a MAV_CMD_NAV_ARC_WAYPOINT). + The resulting path is a circular arc in the NE frame, with the difference in height being defined by the difference in waypoint altitudes. + + The angle in degrees from the starting position to the exit position of the arc in the NE frame. Positive values are CW arcs and negative values are CCW arcs. + Latitude + Longitude + Altitude + + + + Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. + Region of interest mode. + Waypoint index/ target ID. (see MAV_ROI enum) + ROI index (allows a vehicle to manage multiple ROI's) + Empty + x the location of the fixed ROI (see MAV_FRAME) + y + z + + + Control autonomous path planning on the MAV. + 0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning + 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid + Empty + Yaw angle at goal + Latitude/X of goal + Longitude/Y of goal + Altitude/Z of goal + + + Navigate to waypoint using a spline path. + Hold time. (ignored by fixed wing, time to stay at waypoint for rotary wing) + Empty + Empty + Empty + Latitude/X of goal + Longitude/Y of goal + Altitude/Z of goal + + + Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.). + Empty + Front transition heading. + Empty + Yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.). + Latitude + Longitude + Altitude + + + Land using VTOL mode + Landing behaviour. + Empty + Approach altitude (with the same reference as the Altitude field). NaN if unspecified. + Yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.). + Latitude + Longitude + Altitude (ground level) + + + + Hand control over to an external controller + Guided mode on (MAV_BOOL_FALSE: Off). Values not equal to 0 or 1 are invalid. + Empty + Empty + Empty + Empty + Empty + Empty + + + Delay the next navigation command a number of seconds or until a specified time + Delay (-1 to enable time-of-day fields) + hour (24h format, UTC, -1 to ignore) + minute (24h format, UTC, -1 to ignore) + second (24h format, UTC, -1 to ignore) + Empty + Empty + Empty + + + Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload. + Maximum distance to descend. + Empty + Empty + Empty + Latitude + Longitude + Altitude + + + NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + Delay mission state machine. + Delay + Empty + Empty + Empty + Empty + Empty + Empty + + + Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached. + Descent / Ascend rate. + Empty + Empty + Empty + Empty + Empty + Target Altitude + + + Delay mission state machine until within desired distance of next NAV point. + Distance. + Empty + Empty + Empty + Empty + Empty + Empty + + + Reach a certain target angle. + target angle [0-360]. Absolute angles: 0 is north. Relative angle: 0 is initial yaw. Direction set by param3. + angular speed + direction: -1: counter clockwise, 0: shortest direction, 1: clockwise + Relative offset (MAV_BOOL_FALSE: absolute angle). Values not equal to 0 or 1 are invalid. + Empty + Empty + Empty + + + NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + Set system mode. + Mode flags. MAV_MODE values can be used to set some mode flag combinations. + Custom system-specific mode (see target autopilot specifications for mode information). If MAV_MODE_FLAG_CUSTOM_MODE_ENABLED is set in param1 (mode) this mode is used: otherwise the field is ignored. + Custom sub mode - this is system specific, please refer to the individual autopilot specifications for details. + Empty + Empty + Empty + Empty + + + Jump to the desired command in the mission list. Repeat this action only the specified number of times + Sequence number + Repeat count + Empty + Empty + Empty + Empty + Empty + + + Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change + Speed type of value set in param2 (such as airspeed, ground speed, and so on) + Speed (-1 indicates no change, -2 indicates return to default vehicle speed) + Throttle (-1 indicates no change, -2 indicates return to default vehicle throttle value) + + + + + + + + Sets the home position to either to the current position or a specified position. + The home position is the default position that the system will return to and land on. + The position is set automatically by the system during the takeoff (and may also be set using this command). + Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242). + + Use current location (MAV_BOOL_FALSE: use specified location). Values not equal to 0 or 1 are invalid. + Empty + Empty + Empty + Latitude + Longitude + Altitude + + + + Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. + Parameter number + Parameter value + Empty + Empty + Empty + Empty + Empty + + + Set a relay to a condition. The current value may optionally be reported using RELAY_STATUS. + Relay instance number. + Setting. (1=on, 0=off, others possible depending on system hardware) + Empty + Empty + Empty + Empty + Empty + + + Cycle a relay on and off for a desired number of cycles with a desired period. + Relay instance number. + Cycle count. + Cycle time. + Empty + Empty + Empty + Empty + + + Set a servo to a desired PWM value. + Servo instance number. + Pulse Width Modulation. + Empty + Empty + Empty + Empty + Empty + + + Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. + Servo instance number. + Pulse Width Modulation. + Cycle count. + Cycle time. + Empty + Empty + Empty + + + Terminate flight immediately + Flight termination activated if > 0.5 + Empty + Empty + Empty + Empty + Empty + Empty + + + Change altitude set point. + Altitude. + Frame of new altitude. + Empty + Empty + Empty + Empty + Empty + + + Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter). + Actuator 1 value, scaled from [-1 to 1]. NaN to ignore. + Actuator 2 value, scaled from [-1 to 1]. NaN to ignore. + Actuator 3 value, scaled from [-1 to 1]. NaN to ignore. + Actuator 4 value, scaled from [-1 to 1]. NaN to ignore. + Actuator 5 value, scaled from [-1 to 1]. NaN to ignore. + Actuator 6 value, scaled from [-1 to 1]. NaN to ignore. + Index of actuator set (i.e if set to 1, Actuator 1 becomes Actuator 7) + + + + + Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). + A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). + The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. + The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. + If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. + If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. + The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. + If specified, the item defines the waypoint at which the return segment starts. + If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored. + + Empty + Empty + Empty + Empty + Latitudee. 0: not used. + Longitudee. 0: not used. + Altitudee. 0: not used. + + + Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. + + When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. + It should be followed by a navigation item that defines the first waypoint of the landing sequence. + The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). + If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. + + When sent as a command it triggers a landing using a mission landing pattern. + The location parameters are not used in this case, and should be set to 0. + + Empty + Empty + Empty + Empty + Latitude for landing sequence selection, or 0 (see description). Ignored in commands (set 0). + Longitude for landing sequence selection, or 0 (see description). Ignored in commands (set 0). + Altitude for landing sequence selection, or 0 (see description). Ignored in commands (set 0). + + + Mission command to perform a landing from a rally point. + Break altitude + Landing speed + Empty + Empty + Empty + Empty + Empty + + + Mission command to safely abort an autonomous landing. + Altitude + Empty + Empty + Empty + Empty + Empty + Empty + + + Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead). + Ground speed, less than 0 (-1) for default + Bitmask of option flags. + Loiter radius for planes. Positive values only, direction is controlled by Yaw value. A value of zero or NaN is ignored. + Yaw heading (heading reference defined in Bitmask field). NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.). For planes indicates loiter direction (0: clockwise, 1: counter clockwise) + Latitude + Longitude + Altitude + + + If in a GPS controlled position mode, hold the current position or continue. + Continue mission (MAV_BOOL_TRUE), Pause current mission or reposition command, hold current position (MAV_BOOL_FALSE). Values not equal to 0 or 1 are invalid. A VTOL capable vehicle should enter hover mode (multicopter and VTOL planes). A plane should loiter with the default loiter radius. + Reserved + Reserved + Reserved + Reserved + Reserved + Reserved + + + Set moving direction to forward or reverse. + Reverse direction (MAV_BOOL_FALSE: Forward direction). Values not equal to 0 or 1 are invalid. + Empty + Empty + Empty + Empty + Empty + Empty + + + Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. + Empty + Empty + Empty + Empty + Latitude of ROI location + Longitude of ROI location + Altitude of ROI location + + + Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. + Empty + Empty + Empty + Empty + Pitch offset from next waypoint, positive pitching up + Roll offset from next waypoint, positive rolling to the right + Yaw offset from next waypoint, positive yawing to the right + + + Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. + System ID + + + Control onboard camera system. + Camera ID (-1 for all) + Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw + Transmission mode: 0: video stream, >0: single images every n seconds + Recording: 0: disabled, 1: enabled compressed, 2: enabled raw + Empty + Empty + Empty + + + + Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. + Region of interest mode. + Waypoint index/ target ID (depends on param 1). + Region of interest index. (allows a vehicle to manage multiple ROI's) + Empty + x the location of the fixed ROI (see MAV_FRAME) + y + z + + + + Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see https://mavlink.io/en/services/camera_def.html ). + Modes: P, TV, AV, M, Etc. + Shutter speed: Divisor number for one second. + Aperture: F stop number. + ISO number e.g. 80, 100, 200, Etc. + Exposure type enumerator. + Command Identity. + Main engine cut-off time before camera trigger. (0 means no cut-off) + + + Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see https://mavlink.io/en/services/camera_def.html ). + Session control e.g. show/hide lens + Zoom's absolute position + Zooming step value to offset zoom from the current position + Focus Locking, Unlocking or Re-locking + Shooting Command + Command Identity + Test shot identifier. If set to 1, image will only be captured, but not counted towards internal frame count. + + + + The message can still be used to communicate with legacy gimbals implementing it. + Mission command to configure a camera or antenna mount + Mount operation mode + Stabilize roll (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid. + Stabilize pitch (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid. + Stabilize yaw (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid. + Empty + Empty + Empty + + + + This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. + Mission command to control a camera or antenna mount + pitch (WIP: DEPRECATED: or lat in degrees) depending on mount mode. + roll (WIP: DEPRECATED: or lon in degrees) depending on mount mode. + yaw (WIP: DEPRECATED: or alt in meters) depending on mount mode. + WIP: alt in meters depending on mount mode. + WIP: latitude in degrees * 1E7, set if appropriate mount mode. + WIP: longitude in degrees * 1E7, set if appropriate mount mode. + Mount mode. + + + Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera. + Camera trigger distance. 0 to stop triggering. + Camera shutter integration time. -1 or 0 to ignore + Trigger camera once, immediately (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid. + Empty + Empty + Empty + Empty + + + + Enable the geofence. + This can be used in a mission or via the command protocol. + The persistence/lifetime of the setting is undefined. + Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. + Flight stacks typically reset the setting to system defaults on reboot. + + enable? (0=disable, 1=enable, 2=disable_floor_only) + Fence types to enable or disable as a bitmask. 0: all fences should be enabled or disabled (parameter is ignored, for compatibility reasons).Parameter is ignored if param1=2 + Empty + Empty + Empty + Empty + Empty + + + Mission item/command to release a parachute or enable/disable auto release. + Action + Empty + Empty + Empty + Empty + Empty + Empty + + + Command to perform motor test. + Motor instance number (from 1 to max number of motors on the vehicle). + Throttle type (whether the Throttle Value in param3 is a percentage, PWM value, etc.) + Throttle value. + Timeout between tests that are run in sequence. + Motor count. Number of motors to test in sequence: 0/1=one motor, 2= two motors, etc. The Timeout (param4) is used between tests. + Motor test order. + Empty + + + Change to/from inverted flight. + Inverted flight (MAV_BOOL_False: normal flight). Values not equal to 0 or 1 are invalid. + Empty + Empty + Empty + Empty + Empty + Empty + + + Mission command to operate a gripper. + Gripper ID. 1-6 for an autopilot connected gripper. In missions this may be set to 1-6 for an autopilot gripper, or the gripper component id for a MAVLink gripper. 0 targets all grippers. + Gripper action to perform. + Empty + Empty + Empty + Empty + Empty + + + Enable/disable autotune. + Enable autotune (MAV_BOOL_FALSE: disable autotune). Values not equal to 0 or 1 are invalid. + Specify axes for which autotuning is enabled/disabled. 0 indicates the field is unused (for compatibility reasons). If 0 the autopilot will follow its default behaviour, which is usually to tune all axes. + Empty. + Empty. + Empty. + Empty. + Empty. + + + Sets a desired vehicle turn angle and speed change. + Yaw angle to adjust steering by. + Speed. + Relative final angle (MAV_BOOL_FALSE: Absolute angle). Values not equal to 0 or 1 are invalid. + Empty + Empty + Empty + Empty + + + Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera. + Camera trigger cycle time. -1 or 0 to ignore. + Camera shutter integration time. Should be less than trigger cycle time. -1 or 0 to ignore. + Empty + Empty + Empty + Empty + Empty + + + + Mission command to control a camera or antenna mount, using a quaternion as reference. + quaternion param q1, w (1 in null-rotation) + quaternion param q2, x (0 in null-rotation) + quaternion param q3, y (0 in null-rotation) + quaternion param q4, z (0 in null-rotation) + Empty + Empty + Empty + + + set id of master controller + System ID + Component ID + Empty + Empty + Empty + Empty + Empty + + + Set limits for external control + Timeout - maximum time that external controller will be allowed to control vehicle. 0 means no timeout. + Altitude (MSL) min - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit. + Altitude (MSL) max - if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit. + Horizontal move limit - if vehicle moves more than this distance from its location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal move limit. + Empty + Empty + Empty + + + Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines + Start engine (MAV_BOOL_False: Stop engine). Values not equal to 0 or 1 are invalid. + Cold start engine (MAV_BOOL_FALSE: Warm start). Values not equal to 0 or 1 are invalid. Controls use of choke where applicable + Height delay. This is for commanding engine start only after the vehicle has gained the specified height. Used in VTOL vehicles during takeoff to start engine after the aircraft is off the ground. Zero for no delay. + A bitmask of options for engine control + Empty + Empty + Empty + + + + Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). + If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. + Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). + + This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. + If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. + If the system is not in mission mode this command must not trigger a switch to mission mode. + + The mission may be "reset" using param2. + Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). + Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. + + The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item). + + Mission sequence value to set. -1 for the current mission item (use to reset mission without changing current mission item). + Reset mission (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid. Resets jump counters to initial values and changes mission state "completed" to be "active" or "paused". + Empty + Empty + Empty + Empty + Empty + + + NOP - This command is only used to mark the upper limit of the DO commands in the enumeration + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero. + 1: gyro calibration, 3: gyro temperature calibration + Magnetometer calibration action. + Ground pressure calibration. Values not equal to 0 or 1 are invalid. + 1: radio RC calibration, 2: RC trim calibration + Accelerometer calibration action. + 1: APM: compass/motor interference calibration (PX4: airspeed calibration, deprecated), 2: airspeed calibration + 1: ESC calibration, 3: barometer temperature calibration + + + Set sensor offsets. This command will be only accepted if in pre-flight mode. + Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow, 5: second magnetometer, 6: third magnetometer + X axis offset (or generic dimension 1), in the sensor's raw units + Y axis offset (or generic dimension 2), in the sensor's raw units + Z axis offset (or generic dimension 3), in the sensor's raw units + Generic dimension 4, in the sensor's raw units + Generic dimension 5, in the sensor's raw units + Generic dimension 6, in the sensor's raw units + + + Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named). + 1: Trigger actuator ID assignment and direction mapping. 0: Cancel command. + Reserved + Reserved + Reserved + Reserved + Reserved + Reserved + + + Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. + Action to perform on the persistent parameter storage + Action to perform on the persistent mission storage + Onboard logging: 0: Ignore, 1: Start default rate logging, -1: Stop logging, > 1: logging rate (e.g. set to 1000 for 1000 Hz logging) + Reserved + Empty + Empty + Empty + + + Request the reboot or shutdown of system components. + Action to take for autopilot. + Action to take for onboard computer. + Action to take for component specified in param4. + MAVLink Component ID targeted in param3 (0 for all components). + Reserved (set to 0) + Conditions under which reboot/shutdown is allowed. + WIP: ID (e.g. camera ID -1 for all IDs) + + + + Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position. + MAV_GOTO_DO_HOLD: pause mission and either hold or move to specified position (depending on param2), MAV_GOTO_DO_CONTINUE: resume mission. + MAV_GOTO_HOLD_AT_CURRENT_POSITION: hold at current position, MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position. + Coordinate frame of hold point. + Desired yaw angle. + Latitude/X position. + Longitude/Y position. + Altitude/Z position. + + + Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera. + Camera trigger distance. 0 to stop triggering. + Camera shutter integration time. 0 to ignore + The minimum interval in which the camera is capable of taking subsequent pictures repeatedly. 0 to ignore. + Total number of roll positions at which the camera will capture photos (images captures spread evenly across the limits defined by param5). + Angle limits that the camera can be rolled to left and right of center. + Fixed pitch angle that the camera will hold in oblique mode if the mount is actuated in the pitch axis. + Empty + + + Enable the specified standard MAVLink mode. + If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. + See https://mavlink.io/en/services/standard_modes.html + + The mode to set. + + + + + + + + + start running a mission + first_item: the first mission item to run + last_item: the last mission item to run (after this item is run, the mission ends) + + + Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed. + Output value: 1 means maximum positive output, 0 to center servos or minimum motor thrust (expected to spin), -1 for maximum negative (if not supported by the motors, i.e. motor is not reversible, smaller than 0 maps to NaN). And NaN maps to disarmed (stop the motors). + Timeout after which the test command expires and the output is restored to the previous value. A timeout has to be set for safety reasons. A timeout of 0 means to restore the previous value immediately. + + + Actuator Output function + + + + + Actuator configuration command. + Actuator configuration action + + + + Actuator Output function + + + + + Arms / Disarms a component + Arm (MAV_BOOL_FALSE: disarm). Values not equal to 0 or 1 are invalid. + 0: arm-disarm unless prevented by safety checks (i.e. when landed), 21196: force arming/disarming (e.g. allow arming to override preflight checks and disarming in flight) + + + Instructs a target system to run pre-arm checks. + This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. + This command should return MAV_RESULT_ACCEPTED if it will run the checks. + The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). + The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed. + + + + Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light). + Illuminators on/off (MAV_BOOL_TRUE: illuminators on). Values not equal to 0 or 1 are invalid. + + + Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light). + Mode + 0%: Off, 100%: Max Brightness + Strobe period in seconds where 0 means strobing is not used + Strobe duty cycle where 100% means it is on constantly and 0 means strobing is not used + + + + Request the home position from the vehicle. + The vehicle will ACK the command and emit the HOME_POSITION message. + Reserved + Reserved + Reserved + Reserved + Reserved + Reserved + Reserved + + + Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting. + The unit which is affected by the failure. + The type how the failure manifests itself. + Instance affected by failure (0 to signal all). + + + Starts receiver pairing. + RC type. + RC sub type. + + + Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message. + The MAVLink message ID + + + Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM. + The MAVLink message ID + The interval between two messages. Set to -1 to disable and 0 to request default rate. + Target address of message stream (if message has target address fields). 0: Flight-stack default (recommended), 1: address of requester, 2: broadcast. + + + Request the target system(s) emit a single instance of a specified message (i.e. a "one-shot" version of MAV_CMD_SET_MESSAGE_INTERVAL). + The MAVLink message ID of the requested message. + Use for index ID, if required. Otherwise, the use of this parameter (if any) must be defined in the requested message. By default assumed not used (0). + The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0). + The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0). + The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0). + The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0). + Target address for requested message (if message has target address fields). 0: Flight-stack default, 1: address of requester, 2: broadcast. + + + + Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message + Request supported protocol versions by all nodes on the network (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid. + Reserved (all remaining params) + + + + Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message + Request autopilot version (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid. + Reserved (all remaining params) + + + + Request camera information (CAMERA_INFORMATION). + Request camera capabilities (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid. + Reserved (all remaining params) + + + + Request camera settings (CAMERA_SETTINGS). + Request camera settings (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid. + Reserved (all remaining params) + + + + Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage. + Storage ID (0 for all, 1 for first, 2 for second, etc.) + Request storage information (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid. + Reserved (all remaining params) + + + Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage. + Storage ID (1 for first, 2 for second, etc.) + Format storage (and reset image log). Values not equal to 0 or 1 are invalid. + Reserved (all remaining params) + + + + Request camera capture status (CAMERA_CAPTURE_STATUS) + Request camera capture status (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid. + Reserved (all remaining params) + + + + Request flight information (FLIGHT_INFORMATION) + Request flight information (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid. + Reserved (all remaining params) + + + Reset all camera settings to Factory Default + Reset all settings (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid. + Reserved (all remaining params) + + + Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming. + Reserved (Set to 0) + Camera mode + + + + + + Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success). + Zoom type + Zoom value. The range of valid values depend on the zoom type. + + + + + + Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success). + Focus type + Focus value + + + + + + Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). + There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. + If no flag is set the system should use its default storage. + A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. + A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED. + Storage ID (1 for first, 2 for second, etc.) + Usage flags + + + Set camera source. Changes the camera's active sources on cameras with multiple image sensors. + Component Id of camera to address or 1-6 for non-MAVLink cameras, 0 for all cameras. + Primary Source + Secondary Source. If non-zero the second source will be displayed as picture-in-picture. + + + Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG. + Tag. + + + Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number. + Target tag to jump to. + Repeat count. + + + Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate. + Pitch angle (positive to pitch up, relative to vehicle for FOLLOW mode, relative to world horizon for LOCK mode). + Yaw angle (positive to yaw to the right, relative to vehicle for FOLLOW mode, absolute to North for LOCK mode). + Pitch rate (positive to pitch up). + Yaw rate (positive to yaw to the right). + Gimbal manager flags to use. + Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals). + + + Gimbal configuration to set which sysid/compid is in primary and secondary control. + Sysid for primary control (0: no one in control, -1: leave unchanged, -2: set itself in control (for missions where the own sysid is still unknown), -3: remove control if currently in control). + Compid for primary control (0: no one in control, -1: leave unchanged, -2: set itself in control (for missions where the own sysid is still unknown), -3: remove control if currently in control). + Sysid for secondary control (0: no one in control, -1: leave unchanged, -2: set itself in control (for missions where the own sysid is still unknown), -3: remove control if currently in control). + Compid for secondary control (0: no one in control, -1: leave unchanged, -2: set itself in control (for missions where the own sysid is still unknown), -3: remove control if currently in control). + Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals). + + + Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. + + Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. + It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). + It is also needed to specify the target camera in missions. + + When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). + If the param1 is 0 the autopilot should do both. + + When sent in a command the target MAVLink address is set using target_component. + If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). + If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. + If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels. + + Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras that don't have a distinct component id (such as autopilot-attached cameras). 0: all cameras. This is used to specifically target autopilot-connected cameras or individual sensors in a multi-sensor MAVLink camera. It is also used to target specific cameras when the MAV_CMD is used in a mission + Desired elapsed time between two consecutive pictures (in seconds). Minimum values depend on hardware (typically greater than 2 seconds). + Total number of images to capture. 0 to capture forever/until MAV_CMD_IMAGE_STOP_CAPTURE. + Capture sequence number starting from 1. This is only valid for single-capture (param3 == 1), otherwise set to 0. Increment the capture ID for each capture command to prevent double captures when a command is re-transmitted. + + + + + + Stop image capture sequence. + + Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. + It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). + It is also needed to specify the target camera in missions. + + When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). + If the param1 is 0 the autopilot should do both. + + When sent in a command the target MAVLink address is set using target_component. + If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). + If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. + If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels. + + Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras that don't have a distinct component id (such as autopilot-attached cameras). 0: all cameras. This is used to specifically target autopilot-connected cameras or individual sensors in a multi-sensor MAVLink camera. It is also used to target specific cameras when the MAV_CMD is used in a mission + + + + + + + + + + Re-request a CAMERA_IMAGE_CAPTURED message. + Sequence number for missing CAMERA_IMAGE_CAPTURED message + + + + + + + + + Enable or disable on-board camera triggering system. + Trigger enable/disable (0 for disable, 1 for start), -1 to ignore + 1 to reset the trigger sequence, -1 or 0 to ignore + 1 to pause triggering, but without switching the camera off or retracting it. -1 to ignore + + + If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking. + Point to track x value (normalized 0..1, 0 is left, 1 is right). + Point to track y value (normalized 0..1, 0 is top, 1 is bottom). + Point radius (normalized 0..1, 0 is image left, 1 is image right). + + + If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking. + Top left corner of rectangle x value (normalized 0..1, 0 is left, 1 is right). + Top left corner of rectangle y value (normalized 0..1, 0 is top, 1 is bottom). + Bottom right corner of rectangle x value (normalized 0..1, 0 is left, 1 is right). + Bottom right corner of rectangle y value (normalized 0..1, 0 is top, 1 is bottom). + + + Stops ongoing tracking. + + + Starts video capture (recording). + Video Stream ID (0 for all streams) + Frequency CAMERA_CAPTURE_STATUS messages should be sent while recording (0 for no messages, otherwise frequency) + + + + + + + + Stop the current video capture (recording). + Video Stream ID (0 for all streams) + + + + + + + + + Start video streaming + Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.) + + + Stop the given video stream + Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.) + + + + Request video stream information (VIDEO_STREAM_INFORMATION) + Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.) + + + + Request video stream status (VIDEO_STREAM_STATUS) + Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.) + + + Request to start streaming logging data over MAVLink (see also LOGGING_DATA message) + Format: 0: ULog + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + + + Request to stop streaming log data over MAVLink + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + + + + Landing gear ID (default: 0, -1 for all) + Landing gear position (Down: 0, Up: 1, NaN for no change) + + + + + + + + Request to start/stop transmitting over the high latency telemetry + Start transmission over high latency telemetry (MAV_BOOL_FALSE: stop transmission). Values not equal to 0 or 1 are invalid. + Empty + Empty + Empty + Empty + Empty + Empty + + + Create a panorama at the current position + Viewing angle horizontal of the panorama (+- 0.5 the total angle) + Viewing angle vertical of panorama. + Speed of the horizontal rotation. + Speed of the vertical rotation. + + + Request VTOL transition + The target VTOL state. Only MAV_VTOL_STATE_MC and MAV_VTOL_STATE_FW can be used. + + + Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. + If approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. + If the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON. + + Vehicle system id, this way ground station can request arm authorization on behalf of any vehicle + + + This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes. + + + + This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position. + + Radius of desired circle in CIRCLE_MODE + User defined + User defined + User defined + Target latitude of center of circle in CIRCLE_MODE + Target longitude of center of circle in CIRCLE_MODE + + + + + Delay mission state machine until gate has been reached. + Geometry: 0: orthogonal to path between previous and next waypoint. + Use altitude (MAV_BOOL_FALSE: ignore altitude). Values not equal to 0 or 1 are invalid. + Empty + Empty + Latitude + Longitude + Altitude + + + Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead. + Reserved + Reserved + Reserved + Reserved + Latitude + Longitude + Altitude + + + Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. + The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon. + + Polygon vertex count. This is the number of vertices in the current polygon (all vertices will have the same number). + Vehicle must be inside ALL inclusion zones in a single group, vehicle must be inside at least one group, must be the same for all points in each polygon + Reserved + Reserved + Latitude + Longitude + Reserved + + + Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. + The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon. + + Polygon vertex count. This is the number of vertices in the current polygon (all vertices will have the same number). + Reserved + Reserved + Reserved + Latitude + Longitude + Reserved + + + Circular fence area. The vehicle must stay inside this area. + + Radius. + Vehicle must be inside ALL inclusion zones in a single group, vehicle must be inside at least one group + Reserved + Reserved + Latitude + Longitude + Reserved + + + Circular fence area. The vehicle must stay outside this area. + + Radius. + Reserved + Reserved + Reserved + Latitude + Longitude + Reserved + + + Rally point. You can have multiple rally points defined. + + Reserved + Reserved + Reserved + Reserved + Latitude + Longitude + Altitude + + + + + Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages. + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + + + + Change state of safety switch. + New safety switch state. + Empty. + Empty. + Empty + Empty. + Empty. + Empty. + + + Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec. + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + Reserved (set to 0) + + + + + + + Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity. + Operation mode. 0: prepare single payload deploy (overwriting previous requests), but do not execute it. 1: execute payload deploy immediately (rejecting further deploy commands during execution, but allowing abort). 2: add payload deploy to existing deployment list. + Desired approach vector in compass heading. A negative value indicates the system can define the approach vector at will. + Desired ground speed at release time. This can be overridden by the airframe in case it needs to meet minimum airspeed. A negative value indicates the system can define the ground speed at will. + Minimum altitude clearance to the release position. A negative value indicates the system can define the clearance at will. + Latitude. + Longitude. + Altitude (MSL) + + + + Control the payload deployment. + Operation mode. 0: Abort deployment, continue normal mission. 1: switch to payload deployment mode. 100: delete first payload deployment request. 101: delete all payload deployment requests. + Reserved + Reserved + Reserved + Reserved + Reserved + Reserved + + + + Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location. + Yaw of vehicle in earth frame. + CompassMask, 0 for all. + Latitude. + Longitude. + Empty. + Empty. + Empty. + + + Command to operate winch. + Winch instance number. + Action to perform. + Length of line to release (negative to wind). + Release rate (negative to wind). + Empty. + Empty. + Empty. + + + + Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link. + Timestamp that this message was sent as a time in the transmitters time domain. The sender should wrap this time back to zero based on required timing accuracy for the application and the limitations of a 32 bit float. For example, wrapping at 10 hours would give approximately 1ms accuracy. Recipient must handle time wrap in any timing jitter correction applied to this field. Wrap rollover time should not be at not more than 250 seconds, which would give approximately 10 microsecond accuracy. + The time spent in processing the sensor data that is the basis for this position. The recipient can use this to improve time alignment of the data. Set to zero if not known. + estimated one standard deviation accuracy of the measurement. Set to NaN if not known. + Empty + Latitude + Longitude + Altitude, not used. Should be sent as NaN. May be supported in a future version of this message. + + + + + User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude (MSL) + + + User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude (MSL) + + + User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude (MSL) + + + User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude (MSL) + + + User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude (MSL) + + + User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude (MSL) + + + User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude (MSL) + + + User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude (MSL) + + + User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude (MSL) + + + User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude (MSL) + + + User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + User defined + User defined + User defined + User defined + User defined + User defined + User defined + + + User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + User defined + User defined + User defined + User defined + User defined + User defined + User defined + + + User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + User defined + User defined + User defined + User defined + User defined + User defined + User defined + + + User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + User defined + User defined + User defined + User defined + User defined + User defined + User defined + + + User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + User defined + User defined + User defined + User defined + User defined + User defined + User defined + + + + Request forwarding of CAN packets from the given CAN bus to this component via this mavlink channel. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages + Bus number (0 to disable forwarding, 1 for first bus, 2 for 2nd bus, 3 for 3rd bus). + Empty. + Empty. + Empty. + Empty. + Empty. + Empty. + + + + A data stream is not a fixed set of messages, but rather a + recommendation to the autopilot software. Individual autopilots may or may not obey + the recommended messages. + + Enable all data streams + + + Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. + + + Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS + + + Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW + + + Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. + + + Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages. + + + Dependent on the autopilot + + + Dependent on the autopilot + + + Dependent on the autopilot + + + + + The ROI (region of interest) for the vehicle. This can be + be used by the vehicle for camera/vehicle attitude alignment (see + MAV_CMD_NAV_ROI). + + No region of interest. + + + Point toward next waypoint, with optional pitch/roll/yaw offset. + + + Point toward given waypoint. + + + Point toward fixed location. + + + Point toward of given id. + + + + Specifies the datatype of a MAVLink parameter. + + 8-bit unsigned integer + + + 8-bit signed integer + + + 16-bit unsigned integer + + + 16-bit signed integer + + + 32-bit unsigned integer + + + 32-bit signed integer + + + 64-bit unsigned integer + + + 64-bit signed integer + + + 32-bit floating-point + + + 64-bit floating-point + + + + + + Parameter protocol error types (see PARAM_ERROR). + + No error occurred (not expected in PARAM_ERROR but may be used in future implementations. + + + Parameter does not exist + + + Parameter value does not fit within accepted range + + + Caller is not permitted to set the value of this parameter + + + Unknown component specified + + + Parameter is read-only + + + + Specifies the datatype of a MAVLink extended parameter. + + 8-bit unsigned integer + + + 8-bit signed integer + + + 16-bit unsigned integer + + + 16-bit signed integer + + + 32-bit unsigned integer + + + 32-bit signed integer + + + 64-bit unsigned integer + + + 64-bit signed integer + + + 32-bit floating-point + + + 64-bit floating-point + + + Custom Type + + + + Result from a MAVLink command (MAV_CMD) + + Command is valid (is supported and has valid parameters), and was executed. + + + Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work. + + + Command is invalid; it is supported but one or more parameter values are invalid (i.e. parameter reserved, value allowed by spec but not supported by flight stack, and so on). Retrying the same command and parameters will not work. + + + Command is not supported (unknown). + + + Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc. + + + Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation. There is no need for the sender to retry the command, but if done during execution, the component will return MAV_RESULT_IN_PROGRESS with an updated progress. + + + Command is only accepted when sent as a COMMAND_LONG. + + + Command is only accepted when sent as a COMMAND_INT. + + + + Result of mission operation (in a MISSION_ACK message). + + mission accepted OK + + + Generic error / not accepting mission commands at all right now. + + + Coordinate frame is not supported. + + + Command is not supported. + + + Mission items exceed storage space. + + + One of the parameters has an invalid value. + + + param1 has an invalid value. + + + param2 has an invalid value. + + + param3 has an invalid value. + + + param4 has an invalid value. + + + x / param5 has an invalid value. + + + y / param6 has an invalid value. + + + z / param7 has an invalid value. + + + Mission item received out of sequence + + + Not accepting any mission commands from this communication partner. + + + Current mission operation cancelled (e.g. mission upload, mission download). + + + + Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: http://www.kiwisyslog.com/kb/info:-syslog-message-levels/. + + System is unusable. This is a "panic" condition. + + + Action should be taken immediately. Indicates error in non-critical systems. + + + Action must be taken immediately. Indicates failure in a primary system. + + + Indicates an error in secondary/redundant systems. + + + Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning. + + + An unusual event has occurred, though not an error condition. This should be investigated for the root cause. + + + Normal operational messages. Useful for logging. No action is required for these messages. + + + Useful non-operational messages that can assist in debugging. These should not occur during normal operation. + + + + Power supply status flags (bitmask) + + main brick power supply valid + + + main servo power supply valid for FMU + + + USB power is connected + + + peripheral supply is in over-current state + + + hi-power peripheral supply is in over-current state + + + Power status has changed since boot + + + + SERIAL_CONTROL device types + + First telemetry port + + + Second telemetry port + + + First GPS port + + + Second GPS port + + + system shell + + + SERIAL0 + + + SERIAL1 + + + SERIAL2 + + + SERIAL3 + + + SERIAL4 + + + SERIAL5 + + + SERIAL6 + + + SERIAL7 + + + SERIAL8 + + + SERIAL9 + + + + SERIAL_CONTROL flags (bitmask) + + Set if this is a reply + + + Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message + + + Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set + + + Block on writes to the serial port + + + Send multiple replies until port is drained + + + + Enumeration of distance sensor types + + Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units + + + Ultrasound rangefinder, e.g. MaxBotix units + + + Infrared rangefinder, e.g. Sharp units + + + Radar type, e.g. uLanding units + + + Broken or unknown type, e.g. analog units + + + + Enumeration of sensor orientation, according to its rotations + + Roll: 0, Pitch: 0, Yaw: 0 + + + Roll: 0, Pitch: 0, Yaw: 45 + + + Roll: 0, Pitch: 0, Yaw: 90 + + + Roll: 0, Pitch: 0, Yaw: 135 + + + Roll: 0, Pitch: 0, Yaw: 180 + + + Roll: 0, Pitch: 0, Yaw: 225 + + + Roll: 0, Pitch: 0, Yaw: 270 + + + Roll: 0, Pitch: 0, Yaw: 315 + + + Roll: 180, Pitch: 0, Yaw: 0 + + + Roll: 180, Pitch: 0, Yaw: 45 + + + Roll: 180, Pitch: 0, Yaw: 90 + + + Roll: 180, Pitch: 0, Yaw: 135 + + + Roll: 0, Pitch: 180, Yaw: 0 + + + Roll: 180, Pitch: 0, Yaw: 225 + + + Roll: 180, Pitch: 0, Yaw: 270 + + + Roll: 180, Pitch: 0, Yaw: 315 + + + Roll: 90, Pitch: 0, Yaw: 0 + + + Roll: 90, Pitch: 0, Yaw: 45 + + + Roll: 90, Pitch: 0, Yaw: 90 + + + Roll: 90, Pitch: 0, Yaw: 135 + + + Roll: 270, Pitch: 0, Yaw: 0 + + + Roll: 270, Pitch: 0, Yaw: 45 + + + Roll: 270, Pitch: 0, Yaw: 90 + + + Roll: 270, Pitch: 0, Yaw: 135 + + + Roll: 0, Pitch: 90, Yaw: 0 + + + Roll: 0, Pitch: 270, Yaw: 0 + + + Roll: 0, Pitch: 180, Yaw: 90 + + + Roll: 0, Pitch: 180, Yaw: 270 + + + Roll: 90, Pitch: 90, Yaw: 0 + + + Roll: 180, Pitch: 90, Yaw: 0 + + + Roll: 270, Pitch: 90, Yaw: 0 + + + Roll: 90, Pitch: 180, Yaw: 0 + + + Roll: 270, Pitch: 180, Yaw: 0 + + + Roll: 90, Pitch: 270, Yaw: 0 + + + Roll: 180, Pitch: 270, Yaw: 0 + + + Roll: 270, Pitch: 270, Yaw: 0 + + + Roll: 90, Pitch: 180, Yaw: 90 + + + Roll: 90, Pitch: 0, Yaw: 270 + + + Roll: 90, Pitch: 68, Yaw: 293 + + + Pitch: 315 + + + Roll: 90, Pitch: 315 + + + Custom orientation + + + + Type of mission items being requested/sent in mission protocol. + + Items are mission commands for main mission. + + + Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items. + + + Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items. + + + Only used in MISSION_CLEAR_ALL to clear all mission types. + + + + Enumeration of estimator types + + Unknown type of the estimator. + + + This is a naive estimator without any real covariance feedback. + + + Computer vision based estimate. Might be up to scale. + + + Visual-inertial estimate. + + + Plain GPS estimate. + + + Estimator integrating GPS and inertial sensing. + + + Estimate from external motion capturing system. + + + Estimator based on lidar sensor input. + + + Estimator on autopilot. + + + + Enumeration of battery types + + Not specified. + + + Lithium polymer battery + + + Lithium-iron-phosphate battery + + + Lithium-ION battery + + + Nickel metal hydride battery + + + + Enumeration of battery functions + + Battery function is unknown + + + Battery supports all flight systems + + + Battery for the propulsion system + + + Avionics battery + + + Payload battery + + + + Enumeration for battery charge states. + + Low battery state is not provided + + + Battery is not in low state. Normal operation. + + + Battery state is low, warn and monitor close. + + + Battery state is critical, return or abort immediately. + + + Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage. + + + Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT. + + + Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT. + + + Battery is charging. + + + + Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight. + + Battery mode not supported/unknown battery mode/normal operation. + + + Battery is auto discharging (towards storage level). + + + Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits). + + + + Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set. + + Battery has deep discharged. + + + Voltage spikes. + + + One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used). + + + Over-current fault. + + + Over-temperature fault. + + + Under-temperature fault. + + + Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage). + + + Battery firmware is not compatible with current autopilot firmware. + + + Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s). + + + + Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly). + + Generator is off. + + + Generator is ready to start generating power. + + + Generator is generating power. + + + Generator is charging the batteries (generating enough power to charge and provide the load). + + + Generator is operating at a reduced maximum power. + + + Generator is providing the maximum output. + + + Generator is near the maximum operating temperature, cooling is insufficient. + + + Generator hit the maximum operating temperature and shutdown. + + + Power electronics are near the maximum operating temperature, cooling is insufficient. + + + Power electronics hit the maximum operating temperature and shutdown. + + + Power electronics experienced a fault and shutdown. + + + The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening. + + + Generator controller having communication problems. + + + Power electronic or generator cooling system error. + + + Generator controller power rail experienced a fault. + + + Generator controller exceeded the overcurrent threshold and shutdown to prevent damage. + + + Generator controller detected a high current going into the batteries and shutdown to prevent battery damage. + + + Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating. + + + Batteries are under voltage (generator will not start). + + + Generator start is inhibited by e.g. a safety switch. + + + Generator requires maintenance. + + + Generator is not ready to generate yet. + + + Generator is idle. + + + + Enumeration of VTOL states + + MAV is not configured as VTOL + + + VTOL is in transition from multicopter to fixed-wing + + + VTOL is in transition from fixed-wing to multicopter + + + VTOL is in multicopter state + + + VTOL is in fixed-wing state + + + + Enumeration of landed detector states + + MAV landed state is unknown + + + MAV is landed (on ground) + + + MAV is in air + + + MAV currently taking off + + + MAV currently landing + + + + Enumeration of the ADSB altimeter types + + Altitude reported from a Baro source using QNH reference + + + Altitude reported from a GNSS source + + + + ADSB classification for the type of vehicle emitting the transponder signal + + + + + + + + + + + + + + + + + + + + + + + These flags indicate status such as data validity of each data source. Set = data valid + + + + + + + + + + + + + Bitmap of options for the MAV_CMD_DO_REPOSITION + + The aircraft should immediately transition into guided. This should not be set for follow me applications + + + Yaw relative to the vehicle current heading (if not set, relative to North). + + + + Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED + + Airspeed + + + Groundspeed + + + Climb speed + + + Descent speed + + + + + Flags in ESTIMATOR_STATUS message + + True if the attitude estimate is good + + + True if the horizontal velocity estimate is good + + + True if the vertical velocity estimate is good + + + True if the horizontal position (relative) estimate is good + + + True if the horizontal position (absolute) estimate is good + + + True if the vertical position (absolute) estimate is good + + + True if the vertical position (above ground) estimate is good + + + True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow) + + + True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate + + + True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate + + + True if the EKF has detected a GPS glitch + + + True if the EKF has detected bad accelerometer data + + + + + Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST. + + Default autopilot motor test method. + + + Motor numbers are specified as their index in a predefined vehicle-specific sequence. + + + Motor numbers are specified as the output as labeled on the board. + + + + + Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST. + + Throttle as a percentage (0 ~ 100) + + + Throttle as an absolute PWM value (normally in range of 1000~2000). + + + Throttle pass-through from pilot's transmitter. + + + Per-motor compass calibration test. + + + + + + ignore altitude field + + + ignore hdop field + + + ignore vdop field + + + ignore horizontal velocity field (vn and ve) + + + ignore vertical velocity field (vd) + + + ignore speed accuracy field + + + ignore horizontal accuracy field + + + ignore vertical accuracy field + + + + Possible actions an aircraft can take to avoid a collision. + + Ignore any potential collisions + + + Report potential collision + + + Ascend or Descend to avoid threat + + + Move horizontally to avoid threat + + + Aircraft to move perpendicular to the collision's velocity vector + + + Aircraft to fly directly back to its launch point + + + Aircraft to stop in place + + + + Aircraft-rated danger from this threat. + + Not a threat + + + Craft is mildly concerned about this threat + + + Craft is panicking, and may take actions to avoid threat + + + + Source of information about this collision. + + ID field references ADSB_VEHICLE packets + + + ID field references MAVLink SRC ID + + + + Type of GPS fix + + No GPS connected + + + No position information, GPS is connected + + + 2D position + + + 3D position + + + DGPS/SBAS aided 3D position + + + RTK float, 3D position + + + RTK Fixed, 3D position + + + Static fixed, typically used for base stations + + + PPP, 3D position. + + + + RTK GPS baseline coordinate system, used for RTK corrections + + Earth-centered, Earth-fixed + + + RTK basestation centered, north, east, down + + + + Type of landing target + + Landing target signaled by light beacon (ex: IR-LOCK) + + + Landing target signaled by radio beacon (ex: ILS, NDB) + + + Landing target represented by a fiducial marker (ex: ARTag) + + + Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square) + + + + Direction of VTOL transition + + Respect the heading configuration of the vehicle. + + + Use the heading pointing towards the next waypoint. + + + Use the heading on takeoff (while sitting on the ground). + + + Use the specified heading in parameter 4. + + + Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active). + + + + Camera capability flags (Bitmap) + + Camera is able to record video + + + Camera is able to capture images + + + Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE) + + + Camera can capture images while in video mode + + + Camera can capture videos while in Photo/Image mode + + + Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE) + + + Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM) + + + Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS) + + + Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info) + + + Camera supports tracking of a point on the camera view. + + + Camera supports tracking of a selection rectangle on the camera view. + + + Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS). + + + Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE). + + + + Camera supports Moving Target Indicators (MTI) on the camera view (using MAV_CMD_CAMERA_START_MTI). + + + + Stream status flags (Bitmap) + + Stream is active (running) + + + Stream is thermal imaging + + + Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE). + + + + Video stream types + + Stream is RTSP + + + Stream is RTP UDP (URI gives the port number) + + + Stream is MPEG on TCP + + + Stream is MPEG TS (URI gives the port number) + + + + Video stream encodings + + Stream encoding is unknown + + + Stream encoding is H.264 + + + Stream encoding is H.265 + + + + Camera tracking status flags + + Camera is not tracking + + + Camera is tracking + + + Camera tracking in error state + + + + Camera Moving Target Indicators (MTI) are active + + + + Camera tracking target is obscured and is being predicted + + + + Camera tracking modes + + Not tracking + + + Target is a point + + + Target is a rectangle + + + + Camera tracking target data (shows where tracked target is within image) + + Target data embedded in image data (proprietary) + + + Target data rendered in image + + + Target data within status message (Point or Rectangle) + + + + Zoom types for MAV_CMD_SET_CAMERA_ZOOM + + Zoom one step increment (-1 for wide, 1 for tele) + + + Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range. + + + Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0) + + + Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera) + + + Zoom value as horizontal field of view in degrees. + + + + Focus types for MAV_CMD_SET_CAMERA_FOCUS + + Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity). + + + Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range. + + + Focus value as proportion of full camera focus range (a value between 0.0 and 100.0) + + + Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera). + + + Focus automatically. + + + Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S. + + + Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C. + + + + Camera sources for MAV_CMD_SET_CAMERA_SOURCE + + Default camera source. + + + RGB camera source. + + + IR camera source. + + + NDVI camera source. + + + + Result from PARAM_EXT_SET message. + + Parameter value ACCEPTED and SET + + + Parameter value UNKNOWN/UNSUPPORTED + + + Parameter failed to set + + + Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent. + + + + Camera Modes. + + Camera is in image/photo capture mode. + + + Camera is in video capture mode. + + + Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys. + + + + + Not a specific reason + + + Authorizer will send the error as string to GCS + + + At least one waypoint have a invalid value + + + Timeout in the authorizer process(in case it depends on network) + + + Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied. + + + Weather is not good to fly + + + + RC type. Used in MAV_CMD_START_RX_PAIR. + + Spektrum + + + CRSF + + + + RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE. + + Spektrum DSM2 + + + Spektrum DSMX + + + Spektrum DSMX8 + + + + Engine control options + + Allow starting the engine while disarmed (without changing the vehicle's armed state). This effectively arms just the ICE, without arming the vehicle to start other motors or propellers. + + + + Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration. + + Ignore position x + + + Ignore position y + + + Ignore position z + + + Ignore velocity x + + + Ignore velocity y + + + Ignore velocity z + + + Ignore acceleration x + + + Ignore acceleration y + + + Ignore acceleration z + + + Use force instead of acceleration + + + Ignore yaw + + + Ignore yaw rate + + + + Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored. + + Ignore body roll rate + + + Ignore body pitch rate + + + Ignore body yaw rate + + + Ignore throttle + + + Ignore attitude + + + + Airborne status of UAS. + + The flight state can't be determined. + + + UAS on ground. + + + UAS airborne. + + + UAS is in an emergency flight state. + + + UAS has no active controls. + + + + Flags for the global position report. + + The field time contains valid data. + + + The field uas_id contains valid data. + + + The fields lat, lon and h_acc contain valid data. + + + The fields alt and v_acc contain valid data. + + + The field relative_alt contains valid data. + + + The fields vx and vy contain valid data. + + + The field vz contains valid data. + + + The fields next_lat, next_lon and next_alt contain valid data. + + + + Precision land modes (used in MAV_CMD_NAV_LAND). + + Normal (non-precision) landing. + + + Use precision landing if beacon detected when land command accepted, otherwise land normally. + + + Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found). + + + + + Parachute actions. Trigger release and enable/disable auto-release. + + Disable auto-release of parachute (i.e. release triggered by crash detectors). + + + Enable auto-release of parachute. + + + Release parachute and kill motors. + + + + + Encoding of payload unknown. + + + Registered for STorM32 gimbal controller. + + + Registered for STorM32 gimbal controller. + + + Registered for STorM32 gimbal controller. + + + Registered for STorM32 gimbal controller. + + + Registered for STorM32 gimbal controller. + + + Registered for STorM32 gimbal controller. + + + Registered for STorM32 gimbal controller. + + + Registered for STorM32 gimbal controller. + + + Registered for STorM32 gimbal controller. + + + Registered for STorM32 gimbal controller. + + + Registered for ModalAI remote OSD protocol. + + + Registered for ModalAI ESC UART passthru protocol. + + + Registered for ModalAI vendor use. + + + + + No type defined. + + + Manufacturer Serial Number (ANSI/CTA-2063 format). + + + CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]. + + + UTM (Unmanned Traffic Management) assigned UUID (RFC4122). + + + A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO. + + + + + No UA (Unmanned Aircraft) type defined. + + + Aeroplane/Airplane. Fixed wing. + + + Helicopter or multirotor. + + + Gyroplane. + + + VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically. + + + Ornithopter. + + + Glider. + + + Kite. + + + Free Balloon. + + + Captive Balloon. + + + Airship. E.g. a blimp. + + + Free Fall/Parachute (unpowered). + + + Rocket. + + + Tethered powered aircraft. + + + Ground Obstacle. + + + Other type of aircraft not listed earlier. + + + + + The status of the (UA) Unmanned Aircraft is undefined. + + + The UA is on the ground. + + + The UA is in the air. + + + The UA is having an emergency. + + + The remote ID system is failing or unreliable in some way. + + + + + The height field is relative to the take-off location. + + + The height field is relative to ground. + + + + + The horizontal accuracy is unknown. + + + The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km. + + + The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km. + + + The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km. + + + The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km. + + + The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m. + + + The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m. + + + The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m. + + + The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m. + + + The horizontal accuracy is smaller than 30 meter. + + + The horizontal accuracy is smaller than 10 meter. + + + The horizontal accuracy is smaller than 3 meter. + + + The horizontal accuracy is smaller than 1 meter. + + + + + The vertical accuracy is unknown. + + + The vertical accuracy is smaller than 150 meter. + + + The vertical accuracy is smaller than 45 meter. + + + The vertical accuracy is smaller than 25 meter. + + + The vertical accuracy is smaller than 10 meter. + + + The vertical accuracy is smaller than 3 meter. + + + The vertical accuracy is smaller than 1 meter. + + + + + The speed accuracy is unknown. + + + The speed accuracy is smaller than 10 meters per second. + + + The speed accuracy is smaller than 3 meters per second. + + + The speed accuracy is smaller than 1 meters per second. + + + The speed accuracy is smaller than 0.3 meters per second. + + + + + The timestamp accuracy is unknown. + + + The timestamp accuracy is smaller than or equal to 0.1 second. + + + The timestamp accuracy is smaller than or equal to 0.2 second. + + + The timestamp accuracy is smaller than or equal to 0.3 second. + + + The timestamp accuracy is smaller than or equal to 0.4 second. + + + The timestamp accuracy is smaller than or equal to 0.5 second. + + + The timestamp accuracy is smaller than or equal to 0.6 second. + + + The timestamp accuracy is smaller than or equal to 0.7 second. + + + The timestamp accuracy is smaller than or equal to 0.8 second. + + + The timestamp accuracy is smaller than or equal to 0.9 second. + + + The timestamp accuracy is smaller than or equal to 1.0 second. + + + The timestamp accuracy is smaller than or equal to 1.1 second. + + + The timestamp accuracy is smaller than or equal to 1.2 second. + + + The timestamp accuracy is smaller than or equal to 1.3 second. + + + The timestamp accuracy is smaller than or equal to 1.4 second. + + + The timestamp accuracy is smaller than or equal to 1.5 second. + + + + + No authentication type is specified. + + + Signature for the UAS (Unmanned Aircraft System) ID. + + + Signature for the Operator ID. + + + Signature for the entire message set. + + + Authentication is provided by Network Remote ID. + + + The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO. + + + + + Optional free-form text description of the purpose of the flight. + + + Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY. + + + Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY. + + + + + The location/altitude of the operator is the same as the take-off location. + + + The location/altitude of the operator is dynamic. E.g. based on live GNSS data. + + + The location/altitude of the operator are fixed values. + + + + + The classification type for the UA is undeclared. + + + The classification type for the UA follows EU (European Union) specifications. + + + + + The category for the UA, according to the EU specification, is undeclared. + + + The category for the UA, according to the EU specification, is the Open category. + + + The category for the UA, according to the EU specification, is the Specific category. + + + The category for the UA, according to the EU specification, is the Certified category. + + + + + The class for the UA, according to the EU specification, is undeclared. + + + The class for the UA, according to the EU specification, is Class 0. + + + The class for the UA, according to the EU specification, is Class 1. + + + The class for the UA, according to the EU specification, is Class 2. + + + The class for the UA, according to the EU specification, is Class 3. + + + The class for the UA, according to the EU specification, is Class 4. + + + The class for the UA, according to the EU specification, is Class 5. + + + The class for the UA, according to the EU specification, is Class 6. + + + + + CAA (Civil Aviation Authority) registered operator ID. + + + + + Passing arming checks. + + + Generic arming failure, see error string for details. + + + + + Type of AIS vessel, enum duplicated from AIS standard, https://gpsd.gitlab.io/gpsd/AIVDM.html + + Not available (default). + + + + + + + + + + + + + + + + + + + + + + Wing In Ground effect. + + + + + + + + + + + + + + Towing: length exceeds 200m or breadth exceeds 25m. + + + Dredging or other underwater ops. + + + + + + + + + High Speed Craft. + + + + + + + + + + + + + Search And Rescue vessel. + + + + + Anti-pollution equipment. + + + + + + + Noncombatant ship according to RR Resolution No. 18. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Navigational status of AIS vessel, enum duplicated from AIS standard, https://gpsd.gitlab.io/gpsd/AIVDM.html + + Under way using engine. + + + + + + + + + + + + + + + + Search And Rescue Transponder. + + + Not available (default). + + + + These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid. + + 1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m. + + + + + 1 = Velocity over 52.5765m/s (102.2 knots) + + + + Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s + + + + Distance to bow is larger than 511m + + + Distance to stern is larger than 511m + + + Distance to port side is larger than 63m + + + Distance to starboard side is larger than 63m + + + + + + + List of possible units where failures can be injected. + + + + + + + + + + + + + + + + + + + List of possible failure type to inject. + + No failure injected, used to reset a previous failure. + + + Sets unit off, so completely non-responsive. + + + Unit is stuck e.g. keeps reporting the same value. + + + Unit is reporting complete garbage. + + + Unit is consistently wrong. + + + Unit is slow, so e.g. reporting at slower than expected rate. + + + Data of unit is delayed in time. + + + Unit is sometimes working, sometimes not. + + + + + Default autopilot landing behaviour. + + + Use a fixed wing spiral desent approach before landing. + + + Use a fixed wing approach before detransitioning and landing vertically. + + + + Winch status flags used in WINCH_STATUS + + Winch is healthy + + + Winch thread is fully retracted + + + Winch motor is moving + + + Winch clutch is engaged allowing motor to move freely + + + + + + + + + + + + + + Flags in the HIL_SENSOR message indicate which fields have updated since the last message + + The value in the xacc field has been updated + + + The value in the yacc field has been updated + + + The value in the zacc field has been updated + + + The value in the xgyro field has been updated + + + The value in the ygyro field has been updated + + + The value in the zgyro field has been updated + + + The value in the xmag field has been updated + + + The value in the ymag field has been updated + + + The value in the zmag field has been updated + + + The value in the abs_pressure field has been updated + + + The value in the diff_pressure field has been updated + + + The value in the pressure_alt field has been updated + + + The value in the temperature field has been updated + + + Full reset of attitude/position/velocities/etc was performed in sim (Bit 31). + + + + Flags in the HIGHRES_IMU message indicate which fields have updated since the last message + + The value in the xacc field has been updated + + + The value in the yacc field has been updated + + + The value in the zacc field has been updated since + + + The value in the xgyro field has been updated + + + The value in the ygyro field has been updated + + + The value in the zgyro field has been updated + + + The value in the xmag field has been updated + + + The value in the ymag field has been updated + + + The value in the zmag field has been updated + + + The value in the abs_pressure field has been updated + + + The value in the diff_pressure field has been updated + + + The value in the pressure_alt field has been updated + + + The value in the temperature field has been updated + + + + + + + + + MAV FTP error codes (https://mavlink.io/en/services/ftp.html) + + None: No error + + + Fail: Unknown failure + + + FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. + This is a file-system error number understood by the server operating system. + + + InvalidDataSize: Payload size is invalid + + + InvalidSession: Session is not currently open + + + NoSessionsAvailable: All available sessions are already in use + + + EOF: Offset past end of file for ListDirectory and ReadFile commands + + + UnknownCommand: Unknown command / opcode + + + FileExists: File/directory already exists + + + FileProtected: File/directory is write protected + + + FileNotFound: File/directory not found + + + + MAV FTP opcodes: https://mavlink.io/en/services/ftp.html + + None. Ignored, always ACKed + + + TerminateSession: Terminates open Read session + + + ResetSessions: Terminates all open read sessions + + + ListDirectory. List files and directories in path from offset + + + OpenFileRO: Opens file at path for reading, returns session + + + ReadFile: Reads size bytes from offset in session + + + CreateFile: Creates file at path for writing, returns session + + + WriteFile: Writes size bytes to offset in session + + + RemoveFile: Remove file at path + + + CreateDirectory: Creates directory at path + + + RemoveDirectory: Removes directory at path. The directory must be empty. + + + OpenFileWO: Opens file at path for writing, returns session + + + TruncateFile: Truncate file at path to offset length + + + Rename: Rename path1 to path2 + + + CalcFileCRC32: Calculate CRC32 for file at path + + + BurstReadFile: Burst download session file + + + ACK: ACK response + + + NAK: NAK response + + + + + States of the mission state machine. + Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). + They may not all be relevant on all vehicles. + + + The mission status reporting is not supported. + + + No mission on the vehicle. + + + Mission has not started. This is the case after a mission has uploaded but not yet started executing. + + + Mission is active, and will execute mission items when in auto mode. + + + Mission is paused when in auto mode. + + + Mission has executed all mission items. + + + + + Possible safety switch states. + + + Safety switch is engaged and vehicle should be safe to approach. + + + Safety switch is NOT engaged and motors, propellers and other actuators should be considered active. + + + + Modes of illuminator + + Illuminator mode is not specified/unknown + + + Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings + + + Illuminator behavior is controlled by external factors: e.g. an external hardware signal + + + + Illuminator module error flags (bitmap, 0 means no error) + + Illuminator thermal throttling error. + + + Illuminator over temperature shutdown error. + + + Illuminator thermistor failure. + + + + Standard modes with a well understood meaning across flight stacks and vehicle types. + For example, most flight stack have the concept of a "return" or "RTL" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. + The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. + The current mode is streamed in CURRENT_MODE. + See https://mavlink.io/en/services/standard_modes.html + + + Non standard mode. + This may be used when reporting the mode if the current flight mode is not a standard mode. + + + + Position mode (manual). + Position-controlled and stabilized manual mode. + When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. + This mode can only be set by vehicles that can hold a fixed position. + Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. + Hybrid MC/FW ("VTOL") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. + Fixed-wing (FW) vehicles must not support this mode. + Other vehicle types must not support this mode (this may be revisited through the PR process). + + + + Orbit (manual). + Position-controlled and stabilized manual mode. + The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. + Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. + Flight stacks may support the [MAV_CMD_DO_ORBIT](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT) for changing the orbit parameters. + MC and FW vehicles may support this mode. + Hybrid MC/FW ("VTOL") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. + Other vehicle types must not support this mode (this may be revisited through the PR process). + + + + Cruise mode (manual). + Position-controlled and stabilized manual mode. + When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. + Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. + Hybrid MC/FW ("VTOL") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. + Multicopter (MC) vehicles must not support this mode. + Other vehicle types must not support this mode (this may be revisited through the PR process). + + + + Altitude hold (manual). + Altitude-controlled and stabilized manual mode. + When sticks are released vehicles return to their level-flight orientation and hold their altitude. + MC vehicles continue with existing momentum and may move with wind (or other external forces). + FW vehicles continue with current heading, but may be moved off-track by wind. + Hybrid MC/FW ("VTOL") vehicles behave according to their current configuration/mode (FW or MC). + Other vehicle types must not support this mode (this may be revisited through the PR process). + + + + Safe recovery mode (auto). + Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. + This mode is more commonly referred to as RTL and/or or Smart RTL. + The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. + For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent. + + + + Mission mode (automatic). + Automatic mode that executes MAVLink missions. + Missions are executed from the current waypoint as soon as the mode is enabled. + + + + Land mode (auto). + Automatic mode that lands the vehicle at the current location. + The precise landing behaviour depends on vehicle configuration and type. + + + + Takeoff mode (auto). + Automatic takeoff mode. + The precise takeoff behaviour depends on vehicle configuration and type. + + + + + Flags used in HIL_ACTUATOR_CONTROLS message. + + Simulation is using lockstep + + + + Flags used to report computer status. + + Indicates if the system is experiencing voltage outside of acceptable range. + + + Indicates if CPU throttling is active. + + + Indicates if thermal throttling is active. + + + Indicates if main disk is full. + + + + Airspeed sensor flags + + Airspeed sensor is unhealthy + + + True if the data from this sensor is being actively used by the flight controller for guidance, navigation or control. + + + + + + Sensor and subsystem status information. Provides a compact representation of sensor/subsystem status and a few other basic statistics. + Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. + Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. + Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy. + Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000 + Battery voltage, UINT16_MAX: Voltage not sent by autopilot + Battery current, -1: Current not sent by autopilot + Battery energy remaining, -1: Battery remaining energy not sent by autopilot + Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + Autopilot-specific errors + Autopilot-specific errors + Autopilot-specific errors + Autopilot-specific errors + + Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. + Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. + Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy. + + + The system time is the time of the sender's master clock. + This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. + Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a system that indicates a more recent time. + This allows more broadly accurate date stamping of logs, and so on. + If precise time synchronization is needed then use TIMESYNC instead. + Timestamp (UNIX epoch time). + Timestamp (time since system boot). + + + To be removed / merged with TIMESYNC + A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at https://mavlink.io/en/services/ping.html + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + PING sequence + 0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system + 0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component. + + + Request to control this MAV + System the GCS requests control for + 0: request control of this MAV, 1: Release control of this MAV + 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. + Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" + + + Accept / deny control of this MAV + ID of the GCS this message + 0: request control of this MAV, 1: Release control of this MAV + 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control + + + Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety. + key + + + Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead + Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component. + The system setting the mode + The new base mode. + The new autopilot-specific mode. This field can be ignored by an autopilot. + + + + Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] -> value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also https://mavlink.io/en/services/parameter.html for a full documentation of QGroundControl and IMU code. + System ID + Component ID + Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) + + + Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at https://mavlink.io/en/services/parameter.html + System ID + Component ID + + + Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at https://mavlink.io/en/services/parameter.html + Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + Onboard parameter value + Onboard parameter type. + Total number of onboard parameters + Index of this onboard parameter + + + Set a parameter value (write new value to permanent storage). + The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at https://mavlink.io/en/services/parameter.html. + + System ID + Component ID + Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + Onboard parameter value + Onboard parameter type. + + + The global position, as returned by the Global Positioning System (GPS). This is + NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + GPS fix type. + Latitude (WGS84, EGM96 ellipsoid) + Longitude (WGS84, EGM96 ellipsoid) + Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude. + GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX + GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX + GPS ground speed. If unknown, set to: UINT16_MAX + Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + Number of satellites visible. If unknown, set to UINT8_MAX + + Altitude (above WGS84, EGM96 ellipsoid). Positive for up. + Position uncertainty. + Altitude uncertainty. + Speed uncertainty. + Heading / track uncertainty + Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north. + + + The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites. + Number of satellites visible + Global satellite ID + 0: Satellite not used, 1: used for localization + Elevation (0: right on top of receiver, 90: on the horizon) of satellite + Direction of satellite, 0: 0 deg, 255: 360 deg. + Signal to noise ratio of satellite + + + The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units + Timestamp (time since system boot). + X acceleration + Y acceleration + Z acceleration + Angular speed around X axis + Angular speed around Y axis + Angular speed around Z axis + X Magnetic field + Y Magnetic field + Z Magnetic field + + Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C). + + + The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging. On ArduPilot platforms, this message is identical to SCALED_IMU. By default, only RAW_IMU is sent via telemetry for historical reasons, SCALED_IMU can be requested. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + X acceleration (raw) + Y acceleration (raw) + Z acceleration (raw) + Angular speed around X axis (raw) + Angular speed around Y axis (raw) + Angular speed around Z axis (raw) + X Magnetic field (raw) + Y Magnetic field (raw) + Z Magnetic field (raw) + + Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0) + Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C). + + + The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Absolute pressure (raw) + Differential pressure 1 (raw, 0 if nonexistent) + Differential pressure 2 (raw, 0 if nonexistent) + Raw Temperature measurement (raw) + + + The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field. + Timestamp (time since system boot). + Absolute pressure + Differential pressure 1 + Absolute pressure temperature + + Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC. + + + The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic). + Timestamp (time since system boot). + Roll angle (-pi..+pi) + Pitch angle (-pi..+pi) + Yaw angle (-pi..+pi) + Roll angular speed + Pitch angular speed + Yaw angular speed + + + The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0). + Timestamp (time since system boot). + Quaternion component 1, w (1 in null-rotation) + Quaternion component 2, x (0 in null-rotation) + Quaternion component 3, y (0 in null-rotation) + Quaternion component 4, z (0 in null-rotation) + Roll angular speed + Pitch angular speed + Yaw angular speed + + Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode. + + + The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) + Timestamp (time since system boot). + X Position + Y Position + Z Position + X Speed + Y Speed + Z Speed + + + The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX. + Timestamp (time since system boot). + Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. + RC channel 1 value scaled. + RC channel 2 value scaled. + RC channel 3 value scaled. + RC channel 4 value scaled. + RC channel 5 value scaled. + RC channel 6 value scaled. + RC channel 7 value scaled. + RC channel 8 value scaled. + Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown. + + + The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification. + Timestamp (time since system boot). + Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. + RC channel 1 value. + RC channel 2 value. + RC channel 3 value. + RC channel 4 value. + RC channel 5 value. + RC channel 6 value. + RC channel 7 value. + RC channel 8 value. + Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. + + + Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX. + Servo output 1 value + Servo output 2 value + Servo output 3 value + Servo output 4 value + Servo output 5 value + Servo output 6 value + Servo output 7 value + Servo output 8 value + + Servo output 9 value + Servo output 10 value + Servo output 11 value + Servo output 12 value + Servo output 13 value + Servo output 14 value + Servo output 15 value + Servo output 16 value + + + Request a partial list of mission items from the system/component. https://mavlink.io/en/services/mission.html. If start and end index are the same, just send one waypoint. + System ID + Component ID + Start index + End index, -1 by default (-1: send list to end). Else a valid index of the list + + Mission type. + + + This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED! + System ID + Component ID + Start index. Must be smaller / equal to the largest index of the current onboard list. + End index, equal or greater than start index. + + Mission type. + + + + Message encoding a mission item. This message is emitted to announce + the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also https://mavlink.io/en/services/mission.html. + System ID + Component ID + Sequence + The coordinate system of the waypoint. + The scheduled action for the waypoint. + false:0, true:1 + Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes. + PARAM1, see MAV_CMD enum + PARAM2, see MAV_CMD enum + PARAM3, see MAV_CMD enum + PARAM4, see MAV_CMD enum + PARAM5 / local: X coordinate, global: latitude + PARAM6 / local: Y coordinate, global: longitude + PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame). + + Mission type. + + + A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). + Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. https://mavlink.io/en/services/mission.html + System ID + Component ID + Sequence + + Mission type. + + + + + Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). + If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. + Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). + + This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. + If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. + If the system is not in mission mode this message must not trigger a switch to mission mode. + + System ID + Component ID + Sequence + + + + Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). + This message should be streamed all the time (nominally at 1Hz). + This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT. + + Sequence + + Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle. + Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported. + Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode). + + + Request the overall list of mission items from the system/component. + System ID + Component ID + + Mission type. + + + This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints. + System ID + Component ID + Number of mission items in the sequence + + Mission type. + + + Delete all mission items at once. + System ID + Component ID + + Mission type. + + + A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint. + Sequence + + + Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero). + System ID + Component ID + Mission result. + + Mission type. + + + + Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor. + System ID + Latitude (WGS84) + Longitude (WGS84) + Altitude (MSL). Positive for up. + + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + + + Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message. + Latitude (WGS84) + Longitude (WGS84) + Altitude (MSL). Positive for up. + + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + + + Bind a RC channel to a parameter. The parameter should change according to the RC channel value. + System ID + Component ID + Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index. + Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC. + Initial parameter value + Scale, maps the RC range [-1, 1] to a parameter value + Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation) + Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation) + + + Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. https://mavlink.io/en/services/mission.html + System ID + Component ID + Sequence + + Mission type. + + + + Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations. + System ID + Component ID + Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + x position 1 / Latitude 1 + y position 1 / Longitude 1 + z position 1 / Altitude 1 + x position 2 / Latitude 2 + y position 2 / Longitude 2 + z position 2 / Altitude 2 + + + Read out the safety zone the MAV currently assumes. + Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + x position 1 / Latitude 1 + y position 1 / Longitude 1 + z position 1 / Altitude 1 + x position 2 / Latitude 2 + y position 2 / Longitude 2 + z position 2 / Altitude 2 + + + The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0). + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) + Roll angular speed + Pitch angular speed + Yaw angular speed + Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array. + + + The state of the navigation and position controller. + Current desired roll + Current desired pitch + Current desired heading + Bearing to current waypoint/target + Distance to active waypoint + Current altitude error + Current airspeed error + Current crosstrack error on x-y plane + + + The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Class id of the estimator this estimate originated from. + Latitude + Longitude + Altitude in meters above MSL + Altitude above ground + Ground X Speed (Latitude) + Ground Y Speed (Longitude) + Ground Z Speed (Altitude) + Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array. + + + The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Class id of the estimator this estimate originated from. + X Position + Y Position + Z Position + X Speed + Y Speed + Z Speed + X Acceleration + Y Acceleration + Z Acceleration + Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array. + + + The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification. + Timestamp (time since system boot). + Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. + RC channel 1 value. + RC channel 2 value. + RC channel 3 value. + RC channel 4 value. + RC channel 5 value. + RC channel 6 value. + RC channel 7 value. + RC channel 8 value. + RC channel 9 value. + RC channel 10 value. + RC channel 11 value. + RC channel 12 value. + RC channel 13 value. + RC channel 14 value. + RC channel 15 value. + RC channel 16 value. + RC channel 17 value. + RC channel 18 value. + Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown. + + + Request a data stream. + The target requested to send the message stream. + The target requested to send the message stream. + The ID of the requested data stream. + The requested message rate + 1 to start sending, 0 to stop sending. + + + Data stream status information. + The ID of the requested data stream. + The message rate + 1 stream is enabled, 0 stream is stopped. + + + This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask + The system to be controlled. + X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. + Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. + Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust. + R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. + A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. + + A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16. + Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6 + Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid. + Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid. + Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset. + Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset. + Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset. + Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset. + Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset. + Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset. + + + The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels + System ID + Component ID + RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio. + RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio. + RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio. + RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio. + RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio. + RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio. + RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio. + RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio. + + RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio. + RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio. + RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio. + RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio. + RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio. + RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio. + RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio. + RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio. + RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio. + RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio. + + + Message encoding a mission item. This message is emitted to announce + the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also https://mavlink.io/en/services/mission.html. + System ID + Component ID + Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). + The coordinate system of the waypoint. + The scheduled action for the waypoint. + false:0, true:1 + Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes. + PARAM1, see MAV_CMD enum + PARAM2, see MAV_CMD enum + PARAM3, see MAV_CMD enum + PARAM4, see MAV_CMD enum + PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 + PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + + Mission type. + + + Metrics typically displayed on a HUD for fixed wing aircraft. + Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed. + Current ground speed. + Current heading in compass units (0-360, 0=north). + Current throttle setting (0 to 100). + Current altitude (MSL). + Current climb rate. + + + Message encoding a command with parameters as scaled integers. Scaling depends on the actual command value. The command microservice is documented at https://mavlink.io/en/services/command.html + System ID + Component ID + The coordinate system of the COMMAND. + The scheduled action for the mission item. + Not used. + Not used (set 0). + PARAM1, see MAV_CMD enum + PARAM2, see MAV_CMD enum + PARAM3, see MAV_CMD enum + PARAM4, see MAV_CMD enum + PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 + PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame). + + + Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at https://mavlink.io/en/services/command.html + System which should execute the command + Component which should execute the command, 0 for all components + Command ID (of command to send). + 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) + Parameter 1 (for the specific command). + Parameter 2 (for the specific command). + Parameter 3 (for the specific command). + Parameter 4 (for the specific command). + Parameter 5 (for the specific command). + Parameter 6 (for the specific command). + Parameter 7 (for the specific command). + + + Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at https://mavlink.io/en/services/command.html + Command ID (of acknowledged command). + Result of command. + + Also used as result_param1, it can be set with a enum containing the errors reasons of why the command was denied or the progress percentage or 255 if unknown the progress when result is MAV_RESULT_IN_PROGRESS. + Additional parameter of the result, example: which parameter of MAV_CMD_NAV_WAYPOINT caused it to be denied. + System which requested the command to be executed + Component which requested the command to be executed + + + Setpoint in roll, pitch, yaw and thrust from the operator + Timestamp (time since system boot). + Desired roll rate + Desired pitch rate + Desired yaw rate + Collective thrust, normalized to 0 .. 1 + Flight mode switch position, 0.. 255 + Override mode switch position, 0.. 255 + + + Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system). + Timestamp (time since system boot). + System ID + Component ID + Bitmap to indicate which dimensions should be ignored by the vehicle. + Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + Body roll rate + Body pitch rate + Body yaw rate + Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse thrust) + + + Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way. + Timestamp (time since system boot). + Bitmap to indicate which dimensions should be ignored by the vehicle. + Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + Body roll rate + Body pitch rate + Body yaw rate + Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse thrust) + + + Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system). + Timestamp (time since system boot). + System ID + Component ID + Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + Bitmap to indicate which dimensions should be ignored by the vehicle. + X Position in NED frame + Y Position in NED frame + Z Position in NED frame (note, altitude is negative in NED) + X velocity in NED frame + Y velocity in NED frame + Z velocity in NED frame + X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + yaw setpoint + yaw rate setpoint + + + Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way. + Timestamp (time since system boot). + Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + Bitmap to indicate which dimensions should be ignored by the vehicle. + X Position in NED frame + Y Position in NED frame + Z Position in NED frame (note, altitude is negative in NED) + X velocity in NED frame + Y velocity in NED frame + Z velocity in NED frame + X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + yaw setpoint + yaw rate setpoint + + + Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system). + Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + System ID + Component ID + Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated) + Bitmap to indicate which dimensions should be ignored by the vehicle. + Latitude in WGS84 frame + Longitude in WGS84 frame + Altitude (MSL, Relative to home, or AGL - depending on frame) + X velocity in NED frame + Y velocity in NED frame + Z velocity in NED frame + X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + yaw setpoint + yaw rate setpoint + + + Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way. + Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated) + Bitmap to indicate which dimensions should be ignored by the vehicle. + Latitude in WGS84 frame + Longitude in WGS84 frame + Altitude (MSL, AGL or relative to home altitude, depending on frame) + X velocity in NED frame + Y velocity in NED frame + Z velocity in NED frame + X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + yaw setpoint + yaw rate setpoint + + + The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) + Timestamp (time since system boot). + X Position + Y Position + Z Position + Roll + Pitch + Yaw + + + Suffers from missing airspeed fields and singularities due to Euler angles + Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Roll angle + Pitch angle + Yaw angle + Body frame roll / phi angular speed + Body frame pitch / theta angular speed + Body frame yaw / psi angular speed + Latitude + Longitude + Altitude + Ground X Speed (Latitude) + Ground Y Speed (Longitude) + Ground Z Speed (Altitude) + X acceleration + Y acceleration + Z acceleration + + + Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Control output -1 .. 1 + Control output -1 .. 1 + Control output -1 .. 1 + Throttle 0 .. 1 + Aux 1, -1 .. 1 + Aux 2, -1 .. 1 + Aux 3, -1 .. 1 + Aux 4, -1 .. 1 + System mode. + Navigation mode (MAV_NAV_MODE) + + + Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + RC channel 1 value + RC channel 2 value + RC channel 3 value + RC channel 4 value + RC channel 5 value + RC channel 6 value + RC channel 7 value + RC channel 8 value + RC channel 9 value + RC channel 10 value + RC channel 11 value + RC channel 12 value + Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown. + + + Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Control outputs -1 .. 1. Channel assignment depends on the simulated hardware. + System mode. Includes arming state. + Flags bitmask. + + + Optical flow from a flow sensor (e.g. optical mouse sensor) + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Sensor ID + Flow rate around X-axis (deprecated; use flow_rate_x) + Flow rate around Y-axis (deprecated; use flow_rate_y) + Flow in x-sensor direction, angular-speed compensated + Flow in y-sensor direction, angular-speed compensated + Optical flow quality / confidence. 0: bad, 255: maximum quality + Ground distance. Positive value: distance known. Negative value: Unknown distance + + Flow rate about X axis + Flow rate about Y axis + + + Global position/attitude estimate from a vision source. + Timestamp (UNIX time or since system boot) + Global X position + Global Y position + Global Z position + Roll angle + Pitch angle + Yaw angle + + Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. + Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps. + + + Local position/attitude estimate from a vision source. + Timestamp (UNIX time or time since system boot) + Local X position + Local Y position + Local Z position + Roll angle + Pitch angle + Yaw angle + + Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. + Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps. + + + Speed estimate from a vision source. + Timestamp (UNIX time or time since system boot) + Global X speed + Global Y speed + Global Z speed + + Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array. + Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps. + + + Global position estimate from a Vicon motion system source. + Timestamp (UNIX time or time since system boot) + Global X position + Global Y position + Global Z position + Roll angle + Pitch angle + Yaw angle + + Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. + + + The IMU readings in SI units in NED body frame + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + X acceleration + Y acceleration + Z acceleration + Angular speed around X axis + Angular speed around Y axis + Angular speed around Z axis + X Magnetic field + Y Magnetic field + Z Magnetic field + Absolute pressure + Differential pressure + Altitude calculated from pressure + Temperature + Bitmap for fields that have updated since last message + + Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0) + + + Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor) + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Sensor ID + Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + RH rotation around X axis + RH rotation around Y axis + RH rotation around Z axis + Temperature + Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + Time since the distance was sampled. + Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance. + + + The IMU readings in SI units in NED body frame + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + X acceleration + Y acceleration + Z acceleration + Angular speed around X axis in body frame + Angular speed around Y axis in body frame + Angular speed around Z axis in body frame + X Magnetic field + Y Magnetic field + Z Magnetic field + Absolute pressure + Differential pressure (airspeed) + Altitude calculated from pressure + Temperature + Bitmap for fields that have updated since last message + + Sensor ID (zero indexed). Used for multiple sensor inputs + + + Status of simulation environment, if used + True attitude quaternion component 1, w (1 in null-rotation) + True attitude quaternion component 2, x (0 in null-rotation) + True attitude quaternion component 3, y (0 in null-rotation) + True attitude quaternion component 4, z (0 in null-rotation) + Attitude roll expressed as Euler angles, not recommended except for human-readable outputs + Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs + Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs + X acceleration + Y acceleration + Z acceleration + Angular speed around X axis + Angular speed around Y axis + Angular speed around Z axis + Latitude (lower precision). Both this and the lat_int field should be set. + Longitude (lower precision). Both this and the lon_int field should be set. + Altitude + Horizontal position standard deviation + Vertical position standard deviation + True velocity in north direction in earth-fixed NED frame + True velocity in east direction in earth-fixed NED frame + True velocity in down direction in earth-fixed NED frame + + Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred). + Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred). + + + Status generated by radio and injected into MAVLink stream. + Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown. + Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown. + Remaining free transmitter buffer space. + Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown. + Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown. + Count of radio packet receive errors (since boot). + Count of error corrected radio packets (since boot). + + + File transfer protocol message: https://mavlink.io/en/services/ftp.html. + Network ID (0 for broadcast) + System ID (0 for broadcast) + Component ID (0 for broadcast) + Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in https://mavlink.io/en/services/ftp.html. + + + + Time synchronization message. + The message is used for both timesync requests and responses. + The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. + The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. + Systems can determine if they are receiving a request or response based on the value of `tc`. + If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requester may report an error. + Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). + The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. + See also: https://mavlink.io/en/services/timesync.html. + + Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component. + Time sync timestamp 2. Timestamp of syncing component (mirrored in response). + + + Camera-IMU triggering and synchronisation message. + Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Image frame sequence + + + The global position, as returned by the Global Positioning System (GPS). This is + NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. + Latitude (WGS84) + Longitude (WGS84) + Altitude (MSL). Positive for up. + GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX + GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX + GPS ground speed. If unknown, set to: UINT16_MAX + GPS velocity in north direction in earth-fixed NED frame + GPS velocity in east direction in earth-fixed NED frame + GPS velocity in down direction in earth-fixed NED frame + Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + Number of satellites visible. If unknown, set to UINT8_MAX + + GPS ID (zero indexed). Used for multiple GPS inputs + Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north + + + Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor) + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Sensor ID + Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + RH rotation around X axis + RH rotation around Y axis + RH rotation around Z axis + Temperature + Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + Time since the distance was sampled. + Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance. + + + Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) + Body frame roll / phi angular speed + Body frame pitch / theta angular speed + Body frame yaw / psi angular speed + Latitude + Longitude + Altitude + Ground X Speed (Latitude) + Ground Y Speed (Longitude) + Ground Z Speed (Altitude) + Indicated airspeed + True airspeed + X acceleration + Y acceleration + Z acceleration + + + The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units + Timestamp (time since system boot). + X acceleration + Y acceleration + Z acceleration + Angular speed around X axis + Angular speed around Y axis + Angular speed around Z axis + X Magnetic field + Y Magnetic field + Z Magnetic field + + Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C). + + + Request a list of available logs. + On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. + If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0. + LOG_ENTRY messages can start with id 1 or 0. + The ground station needs to be able to process either. + + System ID + Component ID + First log id (0 for first available) + Last log id (0xffff for last available) + + + Reply to LOG_REQUEST_LIST + Log id + Total number of logs + High log number + UTC timestamp of log since 1970, or 0 if not available + Size of the log (may be approximate) + + + Request a chunk of a log + System ID + Component ID + Log id (from LOG_ENTRY reply) + Offset into the log + Number of bytes + + + Reply to LOG_REQUEST_DATA + Log id (from LOG_ENTRY reply) + Offset into the log + Number of bytes (zero for end of log) + log data + + + Erase all logs + System ID + Component ID + + + Stop log transfer and resume normal logging + System ID + Component ID + + + Data for injecting into the onboard GPS (used for DGPS) + System ID + Component ID + Data length + Raw data (110 is enough for 12 satellites of RTCMv2) + + + Second GPS data. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + GPS fix type. + Latitude (WGS84) + Longitude (WGS84) + Altitude (MSL). Positive for up. + GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX + GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX + GPS ground speed. If unknown, set to: UINT16_MAX + Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + Number of satellites visible. If unknown, set to UINT8_MAX + Number of DGPS satellites + Age of DGPS info + + Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north. + Altitude (above WGS84, EGM96 ellipsoid). Positive for up. + Position uncertainty. + Altitude uncertainty. + Speed uncertainty. + Heading / track uncertainty + + + Power supply status + 5V rail voltage. + Servo rail voltage. + Bitmap of power supply status flags. + + + Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate. + Serial control device type. + Bitmap of serial control flags. + Timeout for reply data + Baudrate of transfer. Zero means no change. + how many bytes in this transfer + serial data + + + RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting + Time since boot of last baseline message received. + Identification of connected RTK receiver. + GPS Week Number of last baseline + GPS Time of Week of last baseline + GPS-specific health report for RTK data. + Rate of baseline messages being received by GPS + Current number of sats used for RTK calculation. + Coordinate system of baseline + Current baseline in ECEF x or NED north component. + Current baseline in ECEF y or NED east component. + Current baseline in ECEF z or NED down component. + Current estimate of baseline accuracy. + Current number of integer ambiguity hypotheses. + + + RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting + Time since boot of last baseline message received. + Identification of connected RTK receiver. + GPS Week Number of last baseline + GPS Time of Week of last baseline + GPS-specific health report for RTK data. + Rate of baseline messages being received by GPS + Current number of sats used for RTK calculation. + Coordinate system of baseline + Current baseline in ECEF x or NED north component. + Current baseline in ECEF y or NED east component. + Current baseline in ECEF z or NED down component. + Current estimate of baseline accuracy. + Current number of integer ambiguity hypotheses. + + + The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units + Timestamp (time since system boot). + X acceleration + Y acceleration + Z acceleration + Angular speed around X axis + Angular speed around Y axis + Angular speed around Z axis + X Magnetic field + Y Magnetic field + Z Magnetic field + + Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C). + + + Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: https://mavlink.io/en/services/image_transmission.html. + Type of requested/acknowledged data. + total data size (set on ACK only). + Width of a matrix or image. + Height of a matrix or image. + Number of packets being sent (set on ACK only). + Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only). + JPEG quality. Values: [1-100]. + + + Data packet for images sent using the Image Transmission Protocol: https://mavlink.io/en/services/image_transmission.html. + sequence number (starting with 0 on every transmission) + image data bytes + + + Distance sensor information for an onboard rangefinder. + Timestamp (time since system boot). + Minimum distance the sensor can measure + Maximum distance the sensor can measure + Current distance reading + Type of distance sensor. + Onboard ID of the sensor + Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270 + Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown. + + Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0. + Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0. + Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid." + Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal. + + + Request for terrain data and terrain status. See terrain protocol docs: https://mavlink.io/en/services/terrain.html + Latitude of SW corner of first grid + Longitude of SW corner of first grid + Grid spacing + Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) + + + Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: https://mavlink.io/en/services/terrain.html + Latitude of SW corner of first grid + Longitude of SW corner of first grid + Grid spacing + bit within the terrain request mask + Terrain data MSL + + + Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission. + Latitude + Longitude + + + Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: https://mavlink.io/en/services/terrain.html + Latitude + Longitude + grid spacing (zero if terrain at this location unavailable) + Terrain height MSL + Current vehicle height above lat/lon terrain height + Number of 4x4 terrain blocks waiting to be received or read from disk + Number of 4x4 terrain blocks in memory + + + Barometer readings for 2nd barometer + Timestamp (time since system boot). + Absolute pressure + Differential pressure + Absolute pressure temperature + + Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC. + + + Motion capture attitude and position + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + X position (NED) + Y position (NED) + Z position (NED) + + Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. + + + Set the vehicle attitude and body angular rates. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + System ID + Component ID + Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + + + Set the vehicle attitude and body angular rates. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + + + The current system altitude. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. + This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude. + This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. + This is the altitude above the home position. It resets on each change of the current home position. + This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. + This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. + + + The autopilot is requesting a resource (file, binary, other type of data) + Request ID. This ID should be reused when sending back URI contents + The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary + The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) + The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. + The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). + + + Barometer readings for 3rd barometer + Timestamp (time since system boot). + Absolute pressure + Differential pressure + Absolute pressure temperature + + Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC. + + + Current motion information from a designated system + Timestamp (time since system boot). + bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) + Latitude (WGS84) + Longitude (WGS84) + Altitude (MSL) + target velocity (0,0,0) for unknown + linear target acceleration (0,0,0) for unknown + (1 0 0 0 for unknown) + (0 0 0 for unknown) + eph epv + button states or switches of a tracker device + + + The smoothed, monotonic system state used to feed the control loops of the system. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + X acceleration in body frame + Y acceleration in body frame + Z acceleration in body frame + X velocity in body frame + Y velocity in body frame + Z velocity in body frame + X position in local frame + Y position in local frame + Z position in local frame + Airspeed, set to -1 if unknown + Variance of body velocity estimate + Variance in local position + The attitude, represented as Quaternion + Angular rate in roll axis + Angular rate in pitch axis + Angular rate in yaw axis + + + Battery information + Battery ID + Function of the battery + Type (chemistry) of the battery + Temperature of the battery. INT16_MAX for unknown temperature. + Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1). + Battery current, -1: autopilot does not measure the current + Consumed charge, -1: autopilot does not provide consumption estimate + Consumed energy, -1: autopilot does not provide energy consumption estimate + Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery. + + Remaining battery time, 0: autopilot does not provide remaining battery time estimate + State for extent of discharge, provided by autopilot for warning or external reactions + Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead. + Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode. + Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported). + + + + The location of a landing target. See: https://mavlink.io/en/services/landing_target.html + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + The ID of the target if multiple targets are present + Coordinate frame used for following fields. + X-axis angular offset of the target from the center of the image + Y-axis angular offset of the target from the center of the image + Distance to the target from the vehicle + Size of target along x-axis + Size of target along y-axis + + X Position of the landing target in MAV_FRAME + Y Position of the landing target in MAV_FRAME + Z Position of the landing target in MAV_FRAME + Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + Type of landing target + Position fields (x, y, z, q, type) contain valid target position information (MAV_BOOL_FALSE: invalid values). Values not equal to 0 or 1 are invalid. + + + + Status of geo-fencing. Sent in extended status stream when fencing enabled. + Breach status (0 if currently inside fence, 1 if outside). + Number of fence breaches. + Last breach type. + Time (since boot) of last breach. + + Active action to prevent fence breach + + + + + Reports results of completed compass calibration. Sent until MAG_CAL_ACK received. + Compass being calibrated. + Bitmask of compasses being calibrated. + Calibration Status. + 0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters. + RMS milligauss residuals. + X offset. + Y offset. + Z offset. + X diagonal (matrix 11). + Y diagonal (matrix 22). + Z diagonal (matrix 33). + X off-diagonal (matrix 12 and 21). + Y off-diagonal (matrix 13 and 31). + Z off-diagonal (matrix 32 and 23). + + Confidence in orientation (higher is better). + orientation before calibration. + orientation after calibration. + field radius correction factor + + + + EFI status output + EFI health status + ECU index + RPM + Fuel consumed + Fuel flow rate + Engine load + Throttle position + Spark dwell time + Barometric pressure + Intake manifold pressure( + Intake manifold temperature + Cylinder head temperature + Ignition timing (Crank angle degrees) + Injection time + Exhaust gas temperature + Output throttle + Pressure/temperature compensation + + Supply voltage to EFI sparking system. Zero in this value means "unknown", so if the supply voltage really is zero volts use 0.0001 instead. + Fuel pressure. Zero in this value means "unknown", so if the fuel pressure really is zero kPa use 0.0001 instead. + + + + Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Bitmap indicating which EKF outputs are valid. + Velocity innovation test ratio + Horizontal position innovation test ratio + Vertical position innovation test ratio + Magnetometer innovation test ratio + Height above terrain innovation test ratio + True airspeed innovation test ratio + Horizontal position 1-STD accuracy relative to the EKF local origin + Vertical position 1-STD accuracy relative to the EKF local origin + + + Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD). + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Wind in North (NED) direction (NAN if unknown) + Wind in East (NED) direction (NAN if unknown) + Wind in down (NED) direction (NAN if unknown) + Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown) + Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown) + Altitude (MSL) that this measurement was taken at (NAN if unknown) + Horizontal speed 1-STD accuracy (0 if unknown) + Vertical speed 1-STD accuracy (0 if unknown) + + + GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + ID of the GPS for multiple GPS inputs + Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided. + GPS time (from start of GPS week) + GPS week number + 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK + Latitude (WGS84) + Longitude (WGS84) + Altitude (MSL). Positive for up. + GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX + GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX + GPS velocity in north direction in earth-fixed NED frame + GPS velocity in east direction in earth-fixed NED frame + GPS velocity in down direction in earth-fixed NED frame + GPS speed accuracy + GPS horizontal accuracy + GPS vertical accuracy + Number of satellites visible. + + Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north + + + RTCM message for injecting into the onboard GPS (used for DGPS) + LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order. + data length + RTCM message (may be fragmented) + + + + Message appropriate for high latency connections like Iridium + Bitmap of enabled system modes. + A bitfield for use for autopilot-specific flags. + The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. + roll + pitch + heading + throttle (percentage) + heading setpoint + Latitude + Longitude + Altitude above mean sea level + Altitude setpoint relative to the home position + airspeed + airspeed setpoint + groundspeed + climb rate + Number of satellites visible. If unknown, set to UINT8_MAX + GPS Fix type. + Remaining battery (percentage) + Autopilot temperature (degrees C) + Air temperature (degrees C) from airspeed sensor + failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence) + current waypoint number + distance to target + + + Message appropriate for high latency connections like Iridium (version 2) + Timestamp (milliseconds since boot or Unix epoch) + Type of the MAV (quadrotor, helicopter, etc.) + Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers. + A bitfield for use for autopilot-specific flags (2 byte version). + Latitude + Longitude + Altitude above mean sea level + Altitude setpoint + Heading + Heading setpoint + Distance to target waypoint or position + Throttle + Airspeed + Airspeed setpoint + Groundspeed + Windspeed + Wind heading + Maximum error horizontal position since last message + Maximum error vertical position since last message + Air temperature from airspeed sensor + Maximum climb rate magnitude since last message + Battery level (-1 if field not provided). + Current waypoint number + Bitmap of failure flags. + Field for custom payload. + Field for custom payload. + Field for custom payload. + + + Vibration levels and accelerometer clipping + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Vibration levels on X-axis + Vibration levels on Y-axis + Vibration levels on Z-axis + first accelerometer clipping count + second accelerometer clipping count + third accelerometer clipping count + + + This message can be requested by sending the MAV_CMD_GET_HOME_POSITION command. The position the system will return to and land on. The position is set automatically by the system during the takeoff in case it was not explicitly set by the operator before or after. The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. + Latitude (WGS84) + Longitude (WGS84) + Altitude (MSL). Positive for up. + Local X position of this position in the local coordinate frame + Local Y position of this position in the local coordinate frame + Local Z position of this position in the local coordinate frame + World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + + + The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. + + Sets the home position. + The home position is the default position that the system will return to and land on. + The position is set automatically by the system during the takeoff (and may also be set using this message). + The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. + Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. + The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. + Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242). + + System ID. + Latitude (WGS84) + Longitude (WGS84) + Altitude (MSL). Positive for up. + Local X position of this position in the local coordinate frame (NED) + Local Y position of this position in the local coordinate frame (NED) + Local Z position of this position in the local coordinate frame (NED: positive "down") + World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + + + + The interval between messages for a particular MAVLink message ID. + This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). + It may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. + This interface replaces DATA_STREAM. + The ID of the requested MAVLink message. v1.0 is limited to 254 messages. + The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. + + + Provides state for additional features + The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. + The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. + + + The location and information of an ADSB vehicle + ICAO address + Latitude + Longitude + ADSB altitude type. + Altitude(ASL) + Course over ground + The horizontal velocity + The vertical velocity. Positive is up + The callsign, 8+null + ADSB emitter type. + Time since last communication in seconds + Bitmap to indicate various statuses including valid data fields + Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000 + + + Information about a potential collision + Collision data source + Unique identifier, domain based on src field + Action that is being taken to avoid this collision + How concerned the aircraft is about this collision + Estimated time until collision occurs + Closest vertical distance between vehicle and object + Closest horizontal distance between vehicle and object + + + Message implementing parts of the V2 payload specs in V1 frames for transitional support. + Network ID (0 for broadcast) + System ID (0 for broadcast) + Component ID (0 for broadcast) + A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. + Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification. + + + Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. + Starting address of the debug variables + Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below + Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 + Memory contents at specified address + + + To debug something using a named 3D vector. + Name + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + x + y + z + + + Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. + Timestamp (time since system boot). + Name of the debug variable + Floating point value + + + Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. + Timestamp (time since system boot). + Name of the debug variable + Signed integer value + + + Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz). + Severity of status. Relies on the definitions within RFC-5424. + Status text message, without null termination character. UTF-8 encoded. + + Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately. + This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk. + + + Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N. + Timestamp (time since system boot). + index of debug variable + DEBUG value + + + + Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing + system id of the target + component ID of the target + signing key + initial timestamp + + + Report button state change. + Timestamp (time since system boot). + Time of last change of button state. + Bitmap for state of buttons. + + + Control vehicle tone generation (buzzer). + System ID + Component ID + tune in board specific format + + tune extension (appended to tune) + + + Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command. + Timestamp (time since system boot). + Name of the camera vendor + Name of the camera model + Version of the camera firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff). Use 0 if not known. + Focal length. Use NaN if not known. + Image sensor size horizontal. Use NaN if not known. + Image sensor size vertical. Use NaN if not known. + Horizontal image resolution. Use 0 if not known. + Vertical image resolution. Use 0 if not known. + Reserved for a lens ID. Use 0 if not known. + Bitmap of camera capability flags. + Camera definition version (iteration). Use 0 if not known. + Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known. + + Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera. + + + Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command. + Timestamp (time since system boot). + Camera mode + + Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known) + Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known) + + + Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc. + Timestamp (time since system boot). + Storage ID (1 for first, 2 for second, etc.) + Number of storage devices + Status of storage + Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored. + Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored. + Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored. + Read speed. + Write speed. + + Type of storage + Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user. + + + Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command. + Timestamp (time since system boot). + Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress) + Current status of video capturing (0: idle, 1: capture in progress) + Image capture interval + Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy. + Available storage capacity. + + Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT). + + + Information about a captured image. This is emitted every time a message is captured. It may be re-requested using MAV_CMD_REQUEST_MESSAGE, using param2 to indicate the sequence number for the missing image. + Timestamp (time since system boot). + Timestamp (time since UNIX epoch) in UTC. 0 for unknown. + Deprecated/unused. Component IDs are used to differentiate multiple cameras. + Latitude where image was taken + Longitude where capture was taken + Altitude (MSL) where image was taken + Altitude above ground + Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1) + Image was captured successfully (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid. + URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface. + + + Flight information. + This includes time since boot for arm, takeoff, and land, and a flight number. + Takeoff and landing values reset to zero on arm. + This can be requested using MAV_CMD_REQUEST_MESSAGE. + Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number. + + Timestamp (time since system boot). + Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC. + Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC. + Flight number. Note, field is misnamed UUID. + + Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming. + + + This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. + Orientation of a mount + Timestamp (time since system boot). + Roll in global frame (set to NaN for invalid). + Pitch in global frame (set to NaN for invalid). + Yaw relative to vehicle (set to NaN for invalid). + + Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid). + + + A message containing logged data (see also MAV_CMD_LOGGING_START) + system ID of the target + component ID of the target + sequence number (can wrap) + data length + offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists). + logged data + + + A message containing logged data which requires a LOGGING_ACK to be sent back + system ID of the target + component ID of the target + sequence number (can wrap) + data length + offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists). + logged data + + + An ack for a LOGGING_DATA_ACKED message + system ID of the target + component ID of the target + sequence number (must match the one in LOGGING_DATA_ACKED) + + + Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc. + Video Stream ID (1 for first, 2 for second, etc.) + Number of streams available. + Type of stream. + Bitmap of stream status flags. + Frame rate. + Horizontal resolution. + Vertical resolution. + Bit rate. + Video image rotation clockwise. + Horizontal Field of view. + Stream name. + Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to). + + Encoding of stream. + + + Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE. + Video Stream ID (1 for first, 2 for second, etc.) + Bitmap of stream status flags + Frame rate + Horizontal resolution + Vertical resolution + Bit rate + Video image rotation clockwise + Horizontal Field of view + + + Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command. + Timestamp (time since system boot). + Latitude of camera (INT32_MAX if unknown). + Longitude of camera (INT32_MAX if unknown). + Altitude (MSL) of camera (INT32_MAX if unknown). + Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon). + Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon). + Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon). + Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + Horizontal field of view (NaN if unknown). + Vertical field of view (NaN if unknown). + + + Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval. + Current tracking status + Current tracking mode + Defines location of target data + Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown + Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown + Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown + Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown + Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown + Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown + Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown + + + Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval. + Current tracking status + Latitude of tracked object + Longitude of tracked object + Altitude of tracked object(AMSL, WGS84) + Horizontal accuracy. NAN if unknown + Vertical accuracy. NAN if unknown + North velocity of tracked object. NAN if unknown + East velocity of tracked object. NAN if unknown + Down velocity of tracked object. NAN if unknown + Velocity accuracy. NAN if unknown + Distance between camera and tracked object. NAN if unknown + Heading in radians, in NED. NAN if unknown + Accuracy of heading, in NED. NAN if unknown + + + + + Camera absolute thermal range. This can be streamed when the associated `VIDEO_STREAM_STATUS.flag` bit `VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED` is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras). + Timestamp (time since system boot). + Video Stream ID (1 for first, 2 for second, etc.) + Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). + Temperature max. + Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown. + Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown. + Temperature min. + Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown. + Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown. + + + Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE. + Timestamp (time since system boot). + Bitmap of gimbal capability flags. + Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal). + Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left) + Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left) + Minimum pitch angle (positive: up, negative: down) + Maximum pitch angle (positive: up, negative: down) + Minimum yaw angle (positive: to the right, negative: to the left) + Maximum yaw angle (positive: to the right, negative: to the left) + + + Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz). + Timestamp (time since system boot). + High level gimbal manager flags currently applied. + Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal). + System ID of MAVLink component with primary control, 0 for none. + Component ID of MAVLink component with primary control, 0 for none. + System ID of MAVLink component with secondary control, 0 for none. + Component ID of MAVLink component with secondary control, 0 for none. + + + High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case. + System ID + Component ID + High level gimbal manager flags to use. + Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals). + Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set) + X component of angular velocity, positive is rolling to the right, NaN to be ignored. + Y component of angular velocity, positive is pitching up, NaN to be ignored. + Z component of angular velocity, positive is yawing to the right, NaN to be ignored. + + + Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.. + Timestamp (time since system boot). + Name of the gimbal vendor. + Name of the gimbal model. + Custom name of the gimbal given to it by the user. + Version of the gimbal firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff). + Version of the gimbal hardware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff). + UID of gimbal hardware (0 if unknown). + Bitmap of gimbal capability flags. + Bitmap for use for gimbal-specific capability flags. + Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown. + Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown. + Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown. + Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown. + Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown. + Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown. + + This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0. + Extended bitmap of gimbal capability flags (32 bit). For backwards compatibility, the lower 16 bits should also be set in cap_flags. Ground stations should prefer this field if non-zero. + + + Low level message to control a gimbal device's attitude. + This message is to be sent from the gimbal manager to the gimbal device component. + The quaternion and angular velocities can be set to NaN according to use case. + For the angles encoded in the quaternion and the angular velocities holds: + If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). + If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). + If neither of these flags are set, then (for backwards compatibility) it holds: + If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), + else they are relative to the vehicle heading (vehicle frame). + Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. + These rules are to ensure backwards compatibility. + New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME. + System ID + Component ID + Low level gimbal flags. + Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored. + X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored. + Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored. + Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored. + + + Message reporting the status of a gimbal device. + This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). + For the angles encoded in the quaternion and the angular velocities holds: + If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). + If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). + If neither of these flags are set, then (for backwards compatibility) it holds: + If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), + else they are relative to the vehicle heading (vehicle frame). + Other conditions of the flags are not allowed. + The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as + q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). + If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, + then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. + New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, + and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN. + System ID + Component ID + Timestamp (time since system boot). + Current gimbal flags set. + Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. + X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown. + Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown. + Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown. + Failure flags (0 for no failure) + + Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown. + Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown. + This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0. + + + Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis. + System ID + Component ID + Timestamp (time since system boot). + Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention). + Estimated delay of the attitude data. 0 if unknown. + X Speed in NED (North, East, Down). NAN if unknown. + Y Speed in NED (North, East, Down). NAN if unknown. + Z Speed in NED (North, East, Down). NAN if unknown. + Estimated delay of the speed data. 0 if unknown. + Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing. + Bitmap indicating which estimator outputs are valid. + The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. + + Z component of angular velocity in NED (North, East, Down). NaN if unknown. + + + Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation. + System ID + Component ID + High level gimbal manager flags to use. + Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals). + Pitch angle (positive: up, negative: down, NaN to be ignored). + Yaw angle (positive: to the right, negative: to the left, NaN to be ignored). + Pitch angular rate (positive: up, negative: down, NaN to be ignored). + Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored). + + + High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case. + System ID + Component ID + High level gimbal manager flags. + Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals). + Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored). + Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored). + Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored). + Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored). + + + Airspeed information from a sensor. + Sensor ID. + Calibrated airspeed (CAS). + Temperature. + Raw differential pressure. + Airspeed sensor flags. + + + Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE + Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response. + Password. Blank for an open AP. MD5 hash when message is sent back as a response. + + + The location and information of an AIS vessel + Mobile Marine Service Identifier, 9 decimal digits + Latitude + Longitude + Course over ground + True heading + Speed over ground + Turn rate, 0.1 degrees per second + Navigational status + Type of vessels + Distance from lat/lon location to bow + Distance from lat/lon location to stern + Distance from lat/lon location to port side + Distance from lat/lon location to starboard side + The vessel callsign + The vessel name + Time since last communication in seconds + Bitmask to indicate various statuses including valid data fields + + + + General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message "uavcan.protocol.NodeStatus" for the background information. The UAVCAN specification is available at http://uavcan.org. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Time since the start-up of the node. + Generalized node health status. + Generalized operating mode. + Not used currently. + Vendor-specific status information. + + + General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service "uavcan.protocol.GetNodeInfo" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at http://uavcan.org. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Time since the start-up of the node. + Node name string. For example, "sapog.px4.io". + Hardware major version number. + Hardware minor version number. + Hardware unique 128-bit ID. + Software major version number. + Software minor version number. + Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown. + + + Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response. + System ID + Component ID + Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored) + + + Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE. + System ID + Component ID + + + Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout. + Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + Parameter value + Parameter type. + Total number of parameters + Index of this parameter + + + Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response. + System ID + Component ID + Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + Parameter value + Parameter type. + + + Response from a PARAM_EXT_SET message. + Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise) + Parameter type. + Result code. + + + Obstacle distances in front of the sensor, starting from the left in increment degrees to the right + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Class id of the distance sensor type. + Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm. + Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero. + Minimum distance the sensor can measure. + Maximum distance the sensor can measure. + + Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise. + Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise. + Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned. + + + Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (http://www.ros.org/reps/rep-0147.html). + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Coordinate frame of reference for the pose data. + Coordinate frame of reference for the velocity in free space (twist) data. + X Position + Y Position + Z Position + Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) + X linear speed + Y linear speed + Z linear speed + Roll angular speed + Pitch angular speed + Yaw angular speed + Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. + Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. + + Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps. + Type of estimator that is providing the odometry. + Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality + + + Implemented PX4 v1.11 to v1.14. Not used in current flight stacks. + Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED). + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Number of valid points (up-to 5 waypoints are possible) + X-coordinate of waypoint, set to NaN if not being used + Y-coordinate of waypoint, set to NaN if not being used + Z-coordinate of waypoint, set to NaN if not being used + X-velocity of waypoint, set to NaN if not being used + Y-velocity of waypoint, set to NaN if not being used + Z-velocity of waypoint, set to NaN if not being used + X-acceleration of waypoint, set to NaN if not being used + Y-acceleration of waypoint, set to NaN if not being used + Z-acceleration of waypoint, set to NaN if not being used + Yaw angle, set to NaN if not being used + Yaw rate, set to NaN if not being used + MAV_CMD command id of waypoint, set to UINT16_MAX if not being used. + + + Implemented PX4 v1.11 to v1.14. Not used in current flight stacks. + Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED). + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Number of valid control points (up-to 5 points are possible) + X-coordinate of bezier control points. Set to NaN if not being used + Y-coordinate of bezier control points. Set to NaN if not being used + Z-coordinate of bezier control points. Set to NaN if not being used + Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated + Yaw. Set to NaN for unchanged + + + Status of the Iridium SBD link. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Number of failed SBD sessions. + Number of successful SBD sessions. + Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength. + 1: Ring call pending, 0: No call pending. + 1: Transmission session pending, 0: No transmission session pending. + 1: Receiving session pending, 0: No receiving session pending. + + + RPM sensor data message. + Index of this RPM sensor (0-indexed) + Indicated rate + + + The global position resulting from GPS and sensor fusion. + Time of applicability of position (microseconds since UNIX epoch). + Unique UAS ID. + Latitude (WGS84) + Longitude (WGS84) + Altitude (WGS84) + Altitude above ground + Ground X speed (latitude, positive north) + Ground Y speed (longitude, positive east) + Ground Z speed (altitude, positive down) + Horizontal position uncertainty (standard deviation) + Altitude uncertainty (standard deviation) + Speed uncertainty (standard deviation) + Next waypoint, latitude (WGS84) + Next waypoint, longitude (WGS84) + Next waypoint, altitude (WGS84) + Time until next update. Set to 0 if unknown or in data driven mode. + Flight state + Bitwise OR combination of the data available flags. + + + + + Parameter set/get error. Returned from a MAVLink node in response to an error in the parameter protocol, for example failing to set a parameter because it does not exist. + + System ID + Component ID + Parameter id. Terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + Parameter index. Will be -1 if the param ID field should be used as an identifier (else the param id will be ignored) + Error being returned to client. + + + Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Name, for human-friendly display in a Ground Control Station + Unique ID used to discriminate between arrays + + data + + + Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT). + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise. + The coordinate system of the fields: x, y, z. + X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7. + Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7. + Altitude of center point. Coordinate system depends on frame field. + + + Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for smart battery frequent updates. + Battery ID + Function of the battery + Type (chemistry) of the battery + Capacity when full according to manufacturer, -1: field not provided. + Capacity when full (accounting for battery degradation), -1: field not provided. + Charge/discharge cycle count. UINT16_MAX: field not provided. + Serial number in ASCII characters, 0 terminated. All 0: field not provided. + Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore. + Battery weight. 0: field not provided. + Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value. + Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value. + Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value. + + Maximum per-cell voltage when charged. 0: field not provided. + Number of battery cells in series. 0: field not provided. + Maximum pack discharge current. 0: field not provided. + Maximum pack discharge burst current. 0: field not provided. + Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided. + + + Telemetry of power generation system. Alternator or mechanical generator. + Status flags. + Speed of electrical generator or alternator. UINT16_MAX: field not provided. + Current into/out of battery. Positive for out. Negative for in. NaN: field not provided. + Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided + The power being generated. NaN: field not provided + Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus. + The temperature of the rectifier or power converter. INT16_MAX: field not provided. + The target battery current. Positive for out. Negative for in. NaN: field not provided + The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided. + Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided. + Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided. + + + The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW. + Timestamp (since system boot). + Active outputs + Servo / motor output array values. Zero values indicate unused channels. + + + Reports the on/off state of relays, as controlled by MAV_CMD_DO_SET_RELAY. + Message streaming should be requested using MAV_CMD_SET_MESSAGE_INTERVAL. + Note that it should not be sent on every relay state change to avoid flooding the link. + + Timestamp (time since system boot). + Relay states. Relay instance numbers are represented as individual bits in this mask by offset. + Relay present. Relay instance numbers are represented as individual bits in this mask by offset. Bits will be true if a relay instance is configured. + + + Message for transporting "arbitrary" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification. + System ID (can be 0 for broadcast, but this is discouraged) + Component ID (can be 0 for broadcast, but this is discouraged) + A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. + Length of the data transported in payload + Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type. + + + A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD. + System ID. + Component ID. + Bus number + Frame length + Frame ID + Frame data + + + A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling) + System ID. + Component ID. + bus number + Frame length + Frame ID + Frame data + + + Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages. + System ID. + Component ID. + bus number + what operation to perform on the filter list. See CAN_FILTER_OP enum. + number of IDs in filter list + filter IDs, length num_ids + + + Hardware status sent by an onboard computer. + Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number. + Time since system boot. + Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers. + CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused. + Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused. + GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused. + Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused. + Temperature of the board. A value of INT8_MAX implies the field is unused. + Temperature of the CPU core. A value of INT8_MAX implies the field is unused. + Fan speeds. A value of INT16_MAX implies the field is unused. + Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused. + Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused. + Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused. + Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused. + Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused. + Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary + Network traffic from the component system. A value of UINT32_MAX implies the field is unused. + Network traffic to the component system. A value of UINT32_MAX implies the field is unused. + Network capacity from the component system. A value of UINT32_MAX implies the field is unused. + Network capacity to the component system. A value of UINT32_MAX implies the field is unused. + + Bitmap of status flags. + + + + Cumulative distance traveled for each reported wheel. + Timestamp (synced to UNIX time or since system boot). + Number of wheels reported. + Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints. + + + Winch status. + Timestamp (synced to UNIX time or since system boot). + Length of line released. NaN if unknown + Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown + Tension on the line. NaN if unknown + Voltage of the battery supplying the winch. NaN if unknown + Current draw from the winch. NaN if unknown + Temperature of the motor. INT16_MAX if unknown + Status flags + + + Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. https://github.com/opendroneid/opendroneid-core-c. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at https://mavlink.io/en/services/opendroneid.html. + System ID (0 for broadcast). + Component ID (0 for broadcast). + Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html. + Indicates the format for the uas_id field of this message. + Indicates the type of UA (Unmanned Aircraft). + UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field. + + + Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft. + System ID (0 for broadcast). + Component ID (0 for broadcast). + Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html. + Indicates whether the unmanned aircraft is on the ground or in the air. + Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees. + Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s. + The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s. + Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon). + Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon). + The altitude calculated from the barometric pressure. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m. + The geodetic altitude as defined by WGS84. If unknown: -1000 m. + Indicates the reference point for the height field. + The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m. + The accuracy of the horizontal position. + The accuracy of the vertical position. + The accuracy of the barometric altitude. + The accuracy of the horizontal and vertical speed. + Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF. + The accuracy of the timestamps. + + + Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes. + System ID (0 for broadcast). + Component ID (0 for broadcast). + Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html. + Indicates the type of authentication. + Allowed range is 0 - 15. + This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h. + This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h. + This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019. + Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field. + + + Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation. + System ID (0 for broadcast). + Component ID (0 for broadcast). + Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html. + Indicates the type of the description field. + Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field. + + + Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information. + System ID (0 for broadcast). + Component ID (0 for broadcast). + Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html. + Specifies the operator location type. + Specifies the classification type of the UA. + Latitude of the operator. If unknown: 0 (both Lat/Lon). + Longitude of the operator. If unknown: 0 (both Lat/Lon). + Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA. + Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA. + Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA. + Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA. + When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA. + When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA. + Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m. + 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019. + + + Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID. + System ID (0 for broadcast). + Component ID (0 for broadcast). + Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html. + Indicates the type of the operator_id field. + Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field. + + + + An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon. + System ID (0 for broadcast). + Component ID (0 for broadcast). + Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html. + This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length. + Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9. + Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field. + + + + Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm. + Status level indicating if arming is allowed. + Text error message, should be empty if status is good to arm. Fill with nulls in unused portion. + + + Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location. + System ID (0 for broadcast). + Component ID (0 for broadcast). + Latitude of the operator. If unknown: 0 (both Lat/Lon). + Longitude of the operator. If unknown: 0 (both Lat/Lon). + Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m. + 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019. + + + Temperature and humidity from hygrometer. + Hygrometer ID + Temperature + Humidity + + + diff --git a/src/main/resources/mavlink/ardupilot/csAirLink.xml b/src/main/resources/mavlink/ardupilot/csAirLink.xml new file mode 100644 index 0000000..2f6c7da --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/csAirLink.xml @@ -0,0 +1,29 @@ + + + + + + + 3 + + + + Login or password error + + + Auth successful + + + + + + Authorization package + Login + Password + + + Response to the authorization request + Response type + + + diff --git a/src/main/resources/mavlink/ardupilot/cubepilot.xml b/src/main/resources/mavlink/ardupilot/cubepilot.xml new file mode 100644 index 0000000..65b58c8 --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/cubepilot.xml @@ -0,0 +1,48 @@ + + + + + + + common.xml + + + Raw RC Data + + + + Information about video stream + Video Stream ID (1 for first, 2 for second, etc.) + Number of streams available. + Frame rate. + Horizontal resolution. + Vertical resolution. + Bit rate. + Video image rotation clockwise. + Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to). + + + Herelink Telemetry + + + + + + + + + + Start firmware update with encapsulated data. + System ID. + Component ID. + FW Size. + FW CRC. + + + offset response to encapsulated data. + System ID. + Component ID. + FW Offset. + + + diff --git a/src/main/resources/mavlink/ardupilot/development.xml b/src/main/resources/mavlink/ardupilot/development.xml new file mode 100644 index 0000000..e0e0f62 --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/development.xml @@ -0,0 +1,256 @@ + + + + common.xml + 0 + 0 + + + RADIO_RC_CHANNELS flags (bitmask). + + Failsafe is active. The content of the RC channels data in the RADIO_RC_CHANNELS message is implementation dependent. + + + Channel data may be out of date. This is set when the receiver is unable to validate incoming data from the transmitter and has therefore resent the last valid data it received. + + + + Mode properties. + + + If set, this mode is an advanced mode. + For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. + A GCS can optionally use this flag to configure the UI for its intended users. + + + + If set, this mode should not be added to the list of selectable modes. + The mode might still be selected by the FC directly (for example as part of a failsafe). + + + + + + + + + + + Set system and component id. + This allows moving of a system and all its components to a new system id, or moving a particular component to a new system/component id. + Recipients must reject command addressed to broadcast system ID. + + New system ID for target component(s). 0: ignore and reject command (broadcast system ID not allowed). + New component ID for target component(s). 0: ignore (component IDs don't change). + Reboot components after ID change. Any non-zero value triggers the reboot. + + + + Sets the GNSS coordinates of the vehicle local origin (0,0,0) position. + Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. + This enables transform between the local coordinate frame and the global (GNSS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor. + This command supersedes SET_GPS_GLOBAL_ORIGIN. + Should be sent in a COMMAND_INT (Expected frame is MAV_FRAME_GLOBAL, and this should be assumed when sent in COMMAND_LONG). + + Empty + Empty + Empty + Empty + Latitude + Longitude + Altitude + + + Set an external estimate of wind direction and speed. + This might be used to provide an initial wind estimate to the estimator (EKF) in the case where the vehicle is wind dead-reckoning, extending the time when operating without GPS before before position drift builds to an unsafe level. For this use case the command might reasonably be sent every few minutes when operating at altitude, and the value is cleared if the estimator resets itself. + + Horizontal wind speed. + Estimated 1 sigma accuracy of wind speed. Set to NaN if unknown. + Azimuth (relative to true north) from where the wind is blowing. + Estimated 1 sigma accuracy of wind direction. Set to NaN if unknown. + Empty + Empty + Empty + + + + + Circular fence area centered on home. The vehicle must stay inside this area. If home is moved, the fence moves. + Radius. + Vehicle must be inside ALL inclusion zones in a single group, vehicle must be inside at least one group. Ignored when sent as a command. + + + + Flags indicating errors in a GPS receiver. + + There are problems with incoming correction streams. + + + There are problems with the configuration. + + + There are problems with the software on the GPS receiver. + + + There are problems with an antenna connected to the GPS receiver. + + + There are problems handling all incoming events. + + + The GPS receiver CPU is overloaded. + + + The GPS receiver is experiencing output congestion. + + + + Signal authentication state in a GPS receiver. + + The GPS receiver does not provide GPS signal authentication info. + + + The GPS receiver is initializing signal authentication. + + + The GPS receiver encountered an error while initializing signal authentication. + + + The GPS receiver has correctly authenticated all signals. + + + GPS signal authentication is disabled on the receiver. + + + + Signal jamming state in a GPS receiver. + + The GPS receiver does not provide GPS signal jamming info. + + + The GPS receiver detected no signal jamming. + + + The GPS receiver detected and mitigated signal jamming. + + + The GPS receiver detected signal jamming. + + + + Signal spoofing state in a GPS receiver. + + The GPS receiver does not provide GPS signal spoofing info. + + + The GPS receiver detected no signal spoofing. + + + The GPS receiver detected and mitigated signal spoofing. + + + The GPS receiver detected signal spoofing but still has a fix. + + + + State of RAIM processing. + + RAIM capability is unknown. + + + RAIM is disabled. + + + RAIM integrity check was successful. + + + RAIM integrity check failed. + + + + + + Checksum for the current mission, rally point or geofence plan, or for the "combined" plan (a GCS can use these checksums to determine if it has matching plans). + This message must be broadcast with the appropriate checksum following any change to a mission, geofence or rally point definition + (immediately after the MISSION_ACK that completes the upload sequence). + It may also be requested using MAV_CMD_REQUEST_MESSAGE, where param 2 indicates the plan type for which the checksum is required. + The checksum must be calculated on the autopilot, but may also be calculated by the GCS. + The checksum uses the same CRC32 algorithm as MAVLink FTP (https://mavlink.io/en/services/ftp.html#crc32-implementation). + The checksum for a mission, geofence or rally point definition is run over each item in the plan in seq order (excluding the home location if present in the plan), and covers the following fields (in order): + frame, command, autocontinue, param1, param2, param3, param4, param5, param6, param7. + The checksum for the whole plan (MAV_MISSION_TYPE_ALL) is calculated using the same approach, running over each sub-plan in the following order: mission, geofence then rally point. + + Mission type. + CRC32 checksum of current plan for specified type. + + + RC channel outputs from a MAVLink RC receiver for input to a flight controller or other components (allows an RC receiver to connect via MAVLink instead of some other protocol such as PPM-Sum or S.BUS). + Note that this is not intended to be an over-the-air format, and does not replace RC_CHANNELS and similar messages reported by the flight controller. + The target_system field should normally be set to the system id of the system to control, typically the flight controller. + The target_component field can normally be set to 0, so that all components of the system can receive the message. + The channels array field can publish up to 32 channels; the number of channel items used in the array is specified in the count field. + The time_last_update_ms field contains the timestamp of the last received valid channels data in the receiver's time domain. + The count field indicates the first index of the channel array that is not used for channel data (this and later indexes are zero-filled). + The RADIO_RC_CHANNELS_FLAGS_OUTDATED flag is set by the receiver if the channels data is not up-to-date (for example, if new data from the transmitter could not be validated so the last valid data is resent). + The RADIO_RC_CHANNELS_FLAGS_FAILSAFE failsafe flag is set by the receiver if the receiver's failsafe condition is met (implementation dependent, e.g., connection to the RC radio is lost). + In this case time_last_update_ms still contains the timestamp of the last valid channels data, but the content of the channels data is not defined by the protocol (it is up to the implementation of the receiver). + For instance, the channels data could contain failsafe values configured in the receiver; the default is to carry the last valid data. + Note: The RC channels fields are extensions to ensure that they are located at the end of the serialized payload and subject to MAVLink's trailing-zero trimming. + + System ID (ID of target system, normally flight controller). + Component ID (normally 0 for broadcast). + Time when the data in the channels field were last updated (time since boot in the receiver's time domain). + Radio RC channels status flags. + Total number of RC channels being received. This can be larger than 32, indicating that more channels are available but not given in this message. + + RC channels. + Channel values are in centered 13 bit format. Range is -4096 to 4096, center is 0. Conversion to PWM is x * 5/32 + 1500. + Channels with indexes equal or above count should be set to 0, to benefit from MAVLink's trailing-zero trimming. + + + Get information about a particular flight modes. + The message can be enumerated or requested for a particular mode using MAV_CMD_REQUEST_MESSAGE. + Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. + The modes must be available/settable for the current vehicle/frame type. + Each modes should only be emitted once (even if it is both standard and custom). + + The total number of available modes for the current vehicle type. + The current mode index within number_modes, indexed from 1. + Standard mode. + A bitfield for use for autopilot-specific flags + Mode properties. + Name of custom mode, with null termination character. Should be omitted for standard modes. + + + Get the current mode. + This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). + It may be requested using MAV_CMD_REQUEST_MESSAGE. + + Standard mode. + A bitfield for use for autopilot-specific flags + The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied + + + A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. + A receiver must re-request all available modes whenever the sequence number changes. + This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. + + Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically). + + + Information about key components of GNSS receivers, like signal authentication, interference and system errors. + GNSS receiver id. Must match instance ids of other messages from same receiver. + Errors in the GPS system. + Signal authentication state of the GPS system. + Signal jamming state of the GPS system. + Signal spoofing state of the GPS system. + The state of the RAIM processing. + Horizontal expected accuracy using satellites successfully validated using RAIM. + Vertical expected accuracy using satellites successfully validated using RAIM. + An abstract value representing the estimated quality of incoming corrections, or 255 if not available. + An abstract value representing the overall status of the receiver, or 255 if not available. + An abstract value representing the quality of incoming GNSS signals, or 255 if not available. + An abstract value representing the estimated PPK quality, or 255 if not available. + + + diff --git a/src/main/resources/mavlink/ardupilot/icarous.xml b/src/main/resources/mavlink/ardupilot/icarous.xml new file mode 100644 index 0000000..7dbdb95 --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/icarous.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + ICAROUS heartbeat + See the FMS_STATE enum. + + + Kinematic multi bands (track) output from Daidalus + Number of track bands + See the TRACK_BAND_TYPES enum. + min angle (degrees) + max angle (degrees) + See the TRACK_BAND_TYPES enum. + min angle (degrees) + max angle (degrees) + See the TRACK_BAND_TYPES enum. + min angle (degrees) + max angle (degrees) + See the TRACK_BAND_TYPES enum. + min angle (degrees) + max angle (degrees) + See the TRACK_BAND_TYPES enum. + min angle (degrees) + max angle (degrees) + + + diff --git a/src/main/resources/mavlink/ardupilot/loweheiser.xml b/src/main/resources/mavlink/ardupilot/loweheiser.xml new file mode 100644 index 0000000..0dc5b5b --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/loweheiser.xml @@ -0,0 +1,55 @@ + + + + + + + + minimal.xml + + + + + Set Loweheiser desired states + EFI Index + Desired Engine/EFI State (0: Power Off, 1:Running) + Desired Governor State (0:manual throttle, 1:Governed throttle) + Manual throttle level, 0% - 100% + Electronic Start up (0:Off, 1:On) + Empty + Empty + + + + + + Composite EFI and Governor data from Loweheiser equipment. This message is created by the EFI unit based on its own data and data received from a governor attached to that EFI unit. + + Generator Battery voltage. + Generator Battery current. + Current being produced by generator. + Load current being consumed by the UAV (sum of curr_gen and curr_batt) + Generator fuel remaining in litres. + Throttle Output. + Seconds this generator has run since it was rebooted. + Seconds until this generator requires maintenance. A negative value indicates maintenance is past due. + The Temperature of the rectifier. + The temperature of the mechanical motor, fuel cell core or generator. + + EFI Supply Voltage. + Motor RPM. + Injector pulse-width in milliseconds. + Fuel flow rate in litres/hour. + Fuel consumed. + Atmospheric pressure. + Manifold Air Temperature. + Cylinder Head Temperature. + Throttle Position. + Exhaust gas temperature. + + EFI index. + Generator status. + EFI status. + + + diff --git a/src/main/resources/mavlink/ardupilot/matrixpilot.xml b/src/main/resources/mavlink/ardupilot/matrixpilot.xml new file mode 100644 index 0000000..8a3b291 --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/matrixpilot.xml @@ -0,0 +1,349 @@ + + + common.xml + + + + Action required when performing CMD_PREFLIGHT_STORAGE + + Read all parameters from storage + + + Write all parameters to storage + + + Clear all parameters in storage + + + Read specific parameters from storage + + + Write specific parameters to storage + + + Clear specific parameters in storage + + + do nothing + + + + + Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. + Storage action: Action defined by MAV_PREFLIGHT_STORAGE_ACTION_ADVANCED + Storage area as defined by parameter database + Storage flags as defined by parameter database + Empty + Empty + Empty + Empty + + + + + + Depreciated but used as a compiler flag. Do not remove + System ID + Component ID + + + Request reading of flexifunction data + System ID + Component ID + Type of flexifunction data requested + index into data where needed + + + Flexifunction type and parameters for component at function index from buffer + System ID + Component ID + Function index + Total count of functions + Address in the flexifunction data, Set to 0xFFFF to use address in target memory + Size of the + Settings data + + + Flexifunction type and parameters for component at function index from buffer + System ID + Component ID + Function index + result of acknowledge, 0=fail, 1=good + + + Acknowledge success or failure of a flexifunction command + System ID + Component ID + 0=inputs, 1=outputs + index of first directory entry to write + count of directory entries to write + Settings data + + + Acknowledge success or failure of a flexifunction command + System ID + Component ID + 0=inputs, 1=outputs + index of first directory entry to write + count of directory entries to write + result of acknowledge, 0=fail, 1=good + + + Acknowledge success or failure of a flexifunction command + System ID + Component ID + Flexifunction command type + + + Acknowledge success or failure of a flexifunction command + Command acknowledged + result of acknowledge + + + Backwards compatible MAVLink version of SERIAL_UDB_EXTRA - F2: Format Part A + Serial UDB Extra Time + Serial UDB Extra Status + Serial UDB Extra Latitude + Serial UDB Extra Longitude + Serial UDB Extra Altitude + Serial UDB Extra Waypoint Index + Serial UDB Extra Rmat 0 + Serial UDB Extra Rmat 1 + Serial UDB Extra Rmat 2 + Serial UDB Extra Rmat 3 + Serial UDB Extra Rmat 4 + Serial UDB Extra Rmat 5 + Serial UDB Extra Rmat 6 + Serial UDB Extra Rmat 7 + Serial UDB Extra Rmat 8 + Serial UDB Extra GPS Course Over Ground + Serial UDB Extra Speed Over Ground + Serial UDB Extra CPU Load + Serial UDB Extra 3D IMU Air Speed + Serial UDB Extra Estimated Wind 0 + Serial UDB Extra Estimated Wind 1 + Serial UDB Extra Estimated Wind 2 + Serial UDB Extra Magnetic Field Earth 0 + Serial UDB Extra Magnetic Field Earth 1 + Serial UDB Extra Magnetic Field Earth 2 + Serial UDB Extra Number of Satellites in View + Serial UDB Extra GPS Horizontal Dilution of Precision + + + Backwards compatible version of SERIAL_UDB_EXTRA - F2: Part B + Serial UDB Extra Time + Serial UDB Extra PWM Input Channel 1 + Serial UDB Extra PWM Input Channel 2 + Serial UDB Extra PWM Input Channel 3 + Serial UDB Extra PWM Input Channel 4 + Serial UDB Extra PWM Input Channel 5 + Serial UDB Extra PWM Input Channel 6 + Serial UDB Extra PWM Input Channel 7 + Serial UDB Extra PWM Input Channel 8 + Serial UDB Extra PWM Input Channel 9 + Serial UDB Extra PWM Input Channel 10 + Serial UDB Extra PWM Input Channel 11 + Serial UDB Extra PWM Input Channel 12 + Serial UDB Extra PWM Output Channel 1 + Serial UDB Extra PWM Output Channel 2 + Serial UDB Extra PWM Output Channel 3 + Serial UDB Extra PWM Output Channel 4 + Serial UDB Extra PWM Output Channel 5 + Serial UDB Extra PWM Output Channel 6 + Serial UDB Extra PWM Output Channel 7 + Serial UDB Extra PWM Output Channel 8 + Serial UDB Extra PWM Output Channel 9 + Serial UDB Extra PWM Output Channel 10 + Serial UDB Extra PWM Output Channel 11 + Serial UDB Extra PWM Output Channel 12 + Serial UDB Extra IMU Location X + Serial UDB Extra IMU Location Y + Serial UDB Extra IMU Location Z + Serial UDB Location Error Earth X + Serial UDB Location Error Earth Y + Serial UDB Location Error Earth Z + Serial UDB Extra Status Flags + Serial UDB Extra Oscillator Failure Count + Serial UDB Extra IMU Velocity X + Serial UDB Extra IMU Velocity Y + Serial UDB Extra IMU Velocity Z + Serial UDB Extra Current Waypoint Goal X + Serial UDB Extra Current Waypoint Goal Y + Serial UDB Extra Current Waypoint Goal Z + Aeroforce in UDB X Axis + Aeroforce in UDB Y Axis + Aeroforce in UDB Z axis + SUE barometer temperature + SUE barometer pressure + SUE barometer altitude + SUE battery voltage + SUE battery current + SUE battery milli amp hours used + Sue autopilot desired height + Serial UDB Extra Stack Memory Free + + + Backwards compatible version of SERIAL_UDB_EXTRA F4: format + Serial UDB Extra Roll Stabilization with Ailerons Enabled + Serial UDB Extra Roll Stabilization with Rudder Enabled + Serial UDB Extra Pitch Stabilization Enabled + Serial UDB Extra Yaw Stabilization using Rudder Enabled + Serial UDB Extra Yaw Stabilization using Ailerons Enabled + Serial UDB Extra Navigation with Ailerons Enabled + Serial UDB Extra Navigation with Rudder Enabled + Serial UDB Extra Type of Alitude Hold when in Stabilized Mode + Serial UDB Extra Type of Alitude Hold when in Waypoint Mode + Serial UDB Extra Firmware racing mode enabled + + + Backwards compatible version of SERIAL_UDB_EXTRA F5: format + Serial UDB YAWKP_AILERON Gain for Proporional control of navigation + Serial UDB YAWKD_AILERON Gain for Rate control of navigation + Serial UDB Extra ROLLKP Gain for Proportional control of roll stabilization + Serial UDB Extra ROLLKD Gain for Rate control of roll stabilization + + + Backwards compatible version of SERIAL_UDB_EXTRA F6: format + Serial UDB Extra PITCHGAIN Proportional Control + Serial UDB Extra Pitch Rate Control + Serial UDB Extra Rudder to Elevator Mix + Serial UDB Extra Roll to Elevator Mix + Gain For Boosting Manual Elevator control When Plane Stabilized + + + Backwards compatible version of SERIAL_UDB_EXTRA F7: format + Serial UDB YAWKP_RUDDER Gain for Proporional control of navigation + Serial UDB YAWKD_RUDDER Gain for Rate control of navigation + Serial UDB Extra ROLLKP_RUDDER Gain for Proportional control of roll stabilization + Serial UDB Extra ROLLKD_RUDDER Gain for Rate control of roll stabilization + SERIAL UDB EXTRA Rudder Boost Gain to Manual Control when stabilized + Serial UDB Extra Return To Landing - Angle to Pitch Plane Down + + + Backwards compatible version of SERIAL_UDB_EXTRA F8: format + Serial UDB Extra HEIGHT_TARGET_MAX + Serial UDB Extra HEIGHT_TARGET_MIN + Serial UDB Extra ALT_HOLD_THROTTLE_MIN + Serial UDB Extra ALT_HOLD_THROTTLE_MAX + Serial UDB Extra ALT_HOLD_PITCH_MIN + Serial UDB Extra ALT_HOLD_PITCH_MAX + Serial UDB Extra ALT_HOLD_PITCH_HIGH + + + Backwards compatible version of SERIAL_UDB_EXTRA F13: format + Serial UDB Extra GPS Week Number + Serial UDB Extra MP Origin Latitude + Serial UDB Extra MP Origin Longitude + Serial UDB Extra MP Origin Altitude Above Sea Level + + + Backwards compatible version of SERIAL_UDB_EXTRA F14: format + Serial UDB Extra Wind Estimation Enabled + Serial UDB Extra Type of GPS Unit + Serial UDB Extra Dead Reckoning Enabled + Serial UDB Extra Type of UDB Hardware + Serial UDB Extra Type of Airframe + Serial UDB Extra Reboot Register of DSPIC + Serial UDB Extra Last dspic Trap Flags + Serial UDB Extra Type Program Address of Last Trap + Serial UDB Extra Number of Ocillator Failures + Serial UDB Extra UDB Internal Clock Configuration + Serial UDB Extra Type of Flight Plan + + + Backwards compatible version of SERIAL_UDB_EXTRA F15 format + Serial UDB Extra Model Name Of Vehicle + Serial UDB Extra Registraton Number of Vehicle + + + Backwards compatible version of SERIAL_UDB_EXTRA F16 format + Serial UDB Extra Name of Expected Lead Pilot + Serial UDB Extra URL of Lead Pilot or Team + + + The altitude measured by sensors and IMU + Timestamp (milliseconds since system boot) + GPS altitude (MSL) in meters, expressed as * 1000 (millimeters) + IMU altitude above ground in meters, expressed as * 1000 (millimeters) + barometeric altitude above ground in meters, expressed as * 1000 (millimeters) + Optical flow altitude above ground in meters, expressed as * 1000 (millimeters) + Rangefinder Altitude above ground in meters, expressed as * 1000 (millimeters) + Extra altitude above ground in meters, expressed as * 1000 (millimeters) + + + The airspeed measured by sensors and IMU + Timestamp (milliseconds since system boot) + Airspeed estimate from IMU, cm/s + Pitot measured forward airpseed, cm/s + Hot wire anenometer measured airspeed, cm/s + Ultrasonic measured airspeed, cm/s + Angle of attack sensor, degrees * 10 + Yaw angle sensor, degrees * 10 + + + Backwards compatible version of SERIAL_UDB_EXTRA F17 format + SUE Feed Forward Gain + SUE Max Turn Rate when Navigating + SUE Max Turn Rate in Fly By Wire Mode + + + Backwards compatible version of SERIAL_UDB_EXTRA F18 format + SUE Angle of Attack Normal + SUE Angle of Attack Inverted + SUE Elevator Trim Normal + SUE Elevator Trim Inverted + SUE reference_speed + + + Backwards compatible version of SERIAL_UDB_EXTRA F19 format + SUE aileron output channel + SUE aileron reversed + SUE elevator output channel + SUE elevator reversed + SUE throttle output channel + SUE throttle reversed + SUE rudder output channel + SUE rudder reversed + + + Backwards compatible version of SERIAL_UDB_EXTRA F20 format + SUE Number of Input Channels + SUE UDB PWM Trim Value on Input 1 + SUE UDB PWM Trim Value on Input 2 + SUE UDB PWM Trim Value on Input 3 + SUE UDB PWM Trim Value on Input 4 + SUE UDB PWM Trim Value on Input 5 + SUE UDB PWM Trim Value on Input 6 + SUE UDB PWM Trim Value on Input 7 + SUE UDB PWM Trim Value on Input 8 + SUE UDB PWM Trim Value on Input 9 + SUE UDB PWM Trim Value on Input 10 + SUE UDB PWM Trim Value on Input 11 + SUE UDB PWM Trim Value on Input 12 + + + Backwards compatible version of SERIAL_UDB_EXTRA F21 format + SUE X accelerometer offset + SUE Y accelerometer offset + SUE Z accelerometer offset + SUE X gyro offset + SUE Y gyro offset + SUE Z gyro offset + + + Backwards compatible version of SERIAL_UDB_EXTRA F22 format + SUE X accelerometer at calibration time + SUE Y accelerometer at calibration time + SUE Z accelerometer at calibration time + SUE X gyro at calibration time + SUE Y gyro at calibration time + SUE Z gyro at calibration time + + + diff --git a/src/main/resources/mavlink/ardupilot/minimal.xml b/src/main/resources/mavlink/ardupilot/minimal.xml new file mode 100644 index 0000000..a64e841 --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/minimal.xml @@ -0,0 +1,733 @@ + + + 3 + + + Micro air vehicle / autopilot classes. This identifies the individual model. + + Generic autopilot, full support for everything + + + Reserved for future use. + + + SLUGS autopilot, http://slugsuav.soe.ucsc.edu + + + ArduPilot - Plane/Copter/Rover/Sub/Tracker, https://ardupilot.org + + + OpenPilot, http://openpilot.org + + + Generic autopilot only supporting simple waypoints + + + Generic autopilot supporting waypoints and other simple navigation commands + + + Generic autopilot supporting the full mission command set + + + No valid autopilot, e.g. a GCS or other MAVLink component + + + PPZ UAV - http://nongnu.org/paparazzi + + + UAV Dev Board + + + FlexiPilot + + + PX4 Autopilot - http://px4.io/ + + + SMACCMPilot - http://smaccmpilot.org + + + AutoQuad -- http://autoquad.org + + + Armazila -- http://armazila.com + + + Aerob -- http://aerob.ru + + + ASLUAV autopilot -- http://www.asl.ethz.ch + + + SmartAP Autopilot - http://sky-drones.com + + + AirRails - http://uaventure.com + + + Fusion Reflex - https://fusion.engineering + + + + MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA). + + Generic micro air vehicle + + + Fixed wing aircraft. + + + Quadrotor + + + Coaxial helicopter + + + Normal helicopter with tail rotor. + + + Ground installation + + + Operator control unit / ground control station + + + Airship, controlled + + + Free balloon, uncontrolled + + + Rocket + + + Ground rover + + + Surface vessel, boat, ship + + + Submarine + + + Hexarotor + + + Octorotor + + + Tricopter + + + Flapping wing + + + Kite + + + Onboard companion controller + + + Two-rotor VTOL using control surfaces in vertical operation in addition. Tailsitter. + + + Quad-rotor VTOL using a V-shaped quad config in vertical operation. Tailsitter. + + + Tiltrotor VTOL + + + + VTOL reserved 2 + + + VTOL reserved 3 + + + VTOL reserved 4 + + + VTOL reserved 5 + + + Gimbal + + + ADSB system + + + Steerable, nonrigid airfoil + + + Dodecarotor + + + Camera + + + Charging station + + + FLARM collision avoidance system + + + Servo + + + Open Drone ID. See https://mavlink.io/en/services/opendroneid.html. + + + Decarotor + + + Battery + + + Parachute + + + Log + + + OSD + + + IMU + + + GPS + + + Winch + + + Generic multirotor that does not fit into a specific type or whose type is unknown + + + Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light). + + + Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification. + + + A generic four-legged ground vehicle (e.g., a robot dog). + + + VTOL hybrid of helicopter and autogyro. It has a main rotor for lift and separate propellers for forward flight. The rotor must be powered for hover but can autorotate in cruise flight. See: https://en.wikipedia.org/wiki/Gyrodyne + + + Gripper + + + + These flags encode the MAV mode, see MAV_MODE enum for useful combinations. + + 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state. + + + 0b01000000 remote control input is enabled. + + + 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. + + + 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. + + + 0b00001000 guided mode enabled, system flies waypoints / mission items. + + + 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. + + + 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. + + + 0b00000001 Reserved for future use. + + + + These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not. + + First bit: 10000000 + + + Second bit: 01000000 + + + Third bit: 00100000 + + + Fourth bit: 00010000 + + + Fifth bit: 00001000 + + + Sixth bit: 00000100 + + + Seventh bit: 00000010 + + + Eighth bit: 00000001 + + + + + Uninitialized system, state is unknown. + + + System is booting up. + + + System is calibrating and not flight-ready. + + + System is grounded and on standby. It can be launched any time. + + + System is active and might be already airborne. Motors are engaged. + + + System is in a non-normal flight mode (failsafe). It can however still navigate. + + + System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down. + + + System just initialized its power-down sequence, will shut down now. + + + System is terminating itself (failsafe or commanded). + + + + Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). + Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. + When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded. + + Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message. + + + System flight controller component ("autopilot"). Only one autopilot is expected in a particular system. + + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages). + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. + + + Camera #1. + + + Camera #2. + + + Camera #3. + + + Camera #4. + + + Camera #5. + + + Camera #6. + + + Servo #1. + + + Servo #2. + + + Servo #3. + + + Servo #4. + + + Servo #5. + + + Servo #6. + + + Servo #7. + + + Servo #8. + + + Servo #9. + + + Servo #10. + + + Servo #11. + + + Servo #12. + + + Servo #13. + + + Servo #14. + + + Gimbal #1. + + + Logging component. + + + Automatic Dependent Surveillance-Broadcast (ADS-B) component. + + + On Screen Display (OSD) devices for video links. + + + Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice. + + + All gimbals should use MAV_COMP_ID_GIMBAL. + Gimbal ID for QX1. + + + FLARM collision alert component. + + + Parachute component. + + + Winch component. + + + Gimbal #2. + + + Gimbal #3. + + + Gimbal #4 + + + Gimbal #5. + + + Gimbal #6. + + + Battery #1. + + + Battery #2. + + + CAN over MAVLink client. + + + Component that can generate/supply a mission flight plan (e.g. GCS or developer API). + + + Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on. + + + Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on. + + + Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on. + + + Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on. + + + Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.). + + + Component that plans a collision free path between two points. + + + Component that provides position estimates using VIO techniques. + + + Component that manages pairing of vehicle and GCS. + + + Inertial Measurement Unit (IMU) #1. + + + Inertial Measurement Unit (IMU) #2. + + + Inertial Measurement Unit (IMU) #3. + + + GPS #1. + + + GPS #2. + + + Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet). + + + Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet). + + + Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet). + + + Component to bridge MAVLink to UDP (i.e. from a UART). + + + Component to bridge to UART (i.e. from UDP). + + + Component handling TUNNEL messages (e.g. vendor specific GUI of a component). + + + Illuminator + + + System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. + Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.). + + + + + + The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at https://mavlink.io/en/services/heartbeat.html + Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type. + Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers. + System mode bitmap. + A bitfield for use for autopilot-specific flags + System status flag. + MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version + + + diff --git a/src/main/resources/mavlink/ardupilot/paparazzi.xml b/src/main/resources/mavlink/ardupilot/paparazzi.xml new file mode 100755 index 0000000..45c9ec5 --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/paparazzi.xml @@ -0,0 +1,38 @@ + + + common.xml + 3 + + + + + + Message encoding a mission script item. This message is emitted upon a request for the next script item. + System ID + Component ID + Sequence + The name of the mission script, NULL terminated. + + + Request script item with the sequence number seq. The response of the system to this message should be a SCRIPT_ITEM message. + System ID + Component ID + Sequence + + + Request the overall list of mission items from the system/component. + System ID + Component ID + + + This message is emitted as response to SCRIPT_REQUEST_LIST by the MAV to get the number of mission scripts. + System ID + Component ID + Number of script items in the sequence + + + This message informs about the currently active SCRIPT. + Active Sequence + + + diff --git a/src/main/resources/mavlink/ardupilot/python_array_test.xml b/src/main/resources/mavlink/ardupilot/python_array_test.xml new file mode 100644 index 0000000..7e4b72e --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/python_array_test.xml @@ -0,0 +1,67 @@ + + + + common.xml + + + Array test #0. + Stub field + Value array + Value array + Value array + Value array + + + Array test #1. + Value array + + + Array test #3. + Stub field + Value array + + + Array test #4. + Value array + Stub field + + + Array test #5. + Value array + Value array + + + Array test #6. + Stub field + Stub field + Stub field + Value array + Value array + Value array + Value array + Value array + Value array + Value array + Value array + Value array + + + Array test #7. + Value array + Value array + Value array + Value array + Value array + Value array + Value array + Value array + Value array + + + Array test #8. + Stub field + Value array + Value array + + + diff --git a/src/main/resources/mavlink/ardupilot/standard.xml b/src/main/resources/mavlink/ardupilot/standard.xml new file mode 100644 index 0000000..df63c93 --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/standard.xml @@ -0,0 +1,146 @@ + + + + minimal.xml + 0 + + + Enum used to indicate true or false (also: success or failure, enabled or disabled, active or inactive). + + False. + + + True. + + + + Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability. + + Autopilot supports the MISSION_ITEM float message type. + Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_ITEM_INT instead. + + + + + Autopilot supports the new param float message type. + + + Autopilot supports MISSION_ITEM_INT scaled integer message type. + Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated). + + + + Autopilot supports COMMAND_INT scaled integer message type. + + + Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: https://mavlink.io/en/services/parameter.html#parameter-encoding. + Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported. + + + + Autopilot supports the File Transfer Protocol v1: https://mavlink.io/en/services/ftp.html. + + + Autopilot supports commanding attitude offboard. + + + Autopilot supports commanding position and velocity targets in local NED frame. + + + Autopilot supports commanding position and velocity targets in global scaled integers. + + + Autopilot supports terrain protocol / data handling. + + + Reserved for future use. + + + Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination). + + + Autopilot supports onboard compass calibration. + + + Autopilot supports MAVLink version 2. + + + Autopilot supports mission fence protocol. + + + Autopilot supports mission rally point protocol. + + + Reserved for future use. + + + Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: https://mavlink.io/en/services/parameter.html#parameter-encoding. + Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported. + + + + This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested. + + + + + Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL). + + + + Autopilot has a connected gripper. MAVLink Grippers would set MAV_TYPE_GRIPPER instead. + + + + These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65. + + development release + + + alpha release + + + beta release + + + release candidate + + + official stable release + + + + + + + The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. + Timestamp (time since system boot). + Latitude, expressed + Longitude, expressed + Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL. + Altitude above home + Ground X Speed (Latitude, positive north) + Ground Y Speed (Longitude, positive east) + Ground Z Speed (Altitude, positive down) + Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + + + Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE. + Bitmap of capabilities + Firmware version number. + The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE). + + Middleware version number + Operating system version number + HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify a board type from an enumeration stored at https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt and with extensive additions at https://github.com/ArduPilot/ardupilot/blob/master/Tools/AP_Bootloader/board_types.txt + Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + ID of the board vendor + ID of the product + UID if provided by hardware (see uid2) + + UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid) + + + diff --git a/src/main/resources/mavlink/ardupilot/storm32.xml b/src/main/resources/mavlink/ardupilot/storm32.xml new file mode 100644 index 0000000..6510fec --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/storm32.xml @@ -0,0 +1,467 @@ + + + + ardupilotmega.xml + 1 + 1 + + + + + + + Registered for STorM32 gimbal controller. For communication with gimbal or camera. + + + Registered for STorM32 gimbal controller. For communication with gimbal or camera. + + + Registered for STorM32 gimbal controller. For communication with gimbal. + + + Registered for STorM32 gimbal controller. For communication with gimbal. + + + Registered for STorM32 gimbal controller. For communication with camera. + + + Registered for STorM32 gimbal controller. For communication with camera. + + + + + + + + Gimbal manager capability flags. + + The gimbal manager supports several profiles. + + + + + Flags for gimbal manager operation. Used for setting and reporting, unless specified otherwise. If a setting has been accepted by the gimbal manager is reported in the STORM32_GIMBAL_MANAGER_STATUS message. + + Request to set RC input to active, or report RC input is active. Implies RC mixed. RC exclusive is achieved by setting all clients to inactive. + + + Request to set onboard/companion computer client to active, or report this client is active. + + + Request to set autopliot client to active, or report this client is active. + + + Request to set GCS client to active, or report this client is active. + + + Request to set camera client to active, or report this client is active. + + + Request to set GCS2 client to active, or report this client is active. + + + Request to set camera2 client to active, or report this client is active. + + + Request to set custom client to active, or report this client is active. + + + Request to set custom2 client to active, or report this client is active. + + + Request supervision. This flag is only for setting, it is not reported. + + + Release supervision. This flag is only for setting, it is not reported. + + + + + Gimbal manager client ID. In a prioritizing profile, the priorities are determined by the implementation; they could e.g. be custom1 > onboard > GCS > autopilot/camera > GCS2 > custom2. + + For convenience. + + + This is the onboard/companion computer client. + + + This is the autopilot client. + + + This is the GCS client. + + + This is the camera client. + + + This is the GCS2 client. + + + This is the camera2 client. + + + This is the custom client. + + + This is the custom2 client. + + + + + Gimbal manager profiles. Only standard profiles are defined. Any implementation can define its own profile(s) in addition, and should use enum values > 16. + + Default profile. Implementation specific. + + + Not supported/deprecated. + + + Profile with cooperative behavior. + + + Profile with exclusive behavior. + + + Profile with priority and cooperative behavior for equal priority. + + + Profile with priority and exclusive behavior for equal priority. + + + + + + Enumeration of possible shot modes. + + Undefined shot mode. Can be used to determine if qshots should be used or not. + + + Start normal gimbal operation. Is usually used to return back from a shot. + + + Load and keep safe gimbal position and stop stabilization. + + + Load neutral gimbal position and keep it while stabilizing. + + + Start mission with gimbal control. + + + Start RC gimbal control. + + + Start gimbal tracking the point specified by Lat, Lon, Alt. + + + Start gimbal tracking the system with specified system ID. + + + Start 2-point cable cam quick shot. + + + Start gimbal tracking the home location. + + + + + + + + Command to a gimbal manager to control the gimbal tilt and pan angles. It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. A gimbal device is never to react to this command. + Pitch/tilt angle (positive: tilt up). NaN to be ignored. + Yaw/pan angle (positive: pan to the right). NaN to be ignored. The frame is determined by the GIMBAL_DEVICE_FLAGS_YAW_IN_xxx_FRAME flags. + Pitch/tilt rate (positive: tilt up). NaN to be ignored. + Yaw/pan rate (positive: pan to the right). NaN to be ignored. The frame is determined by the GIMBAL_DEVICE_FLAGS_YAW_IN_xxx_FRAME flags. + Gimbal device flags to be applied. + Gimbal manager flags to be applied. + Gimbal ID of the gimbal manager to address (component ID or 1-6 for non-MAVLink gimbal, 0 for all gimbals). Send command multiple times for more than one but not all gimbals. The client is copied into bits 8-15. + + + + + Command to configure a gimbal manager. A gimbal device is never to react to this command. The selected profile is reported in the STORM32_GIMBAL_MANAGER_STATUS message. + Gimbal manager profile (0 = default). + Gimbal ID of the gimbal manager to address (component ID or 1-6 for non-MAVLink gimbal, 0 for all gimbals). Send command multiple times for more than one but not all gimbals. + + + + + Command to set the shot manager mode. + Set shot mode. + Set shot state or command. The allowed values are specific to the selected shot mode. + + + + + + RADIO_LINK_STATS flags (bitmask). + The RX_RECEIVE and TX_RECEIVE flags indicate from which antenna the received data are taken for processing. + If a flag is set then the data received on antenna2 is processed, else the data received on antenna1 is used. + The RX_TRANSMIT and TX_TRANSMIT flags specify which antenna are transmitting data. + Both antenna 1 and antenna 2 transmit flags can be set simultaneously, e.g., in case of dual-band or dual-frequency systems. + If neither flag is set then antenna 1 should be assumed. + + + Rssi values are in negative dBm. Values 1..254 corresponds to -1..-254 dBm. 0: no reception, UINT8_MAX: unknown. + + + Rx receive antenna. When set the data received on antenna 2 are taken, else the data stems from antenna 1. + + + Rx transmit antenna. Data are transmitted on antenna 1. + + + Rx transmit antenna. Data are transmitted on antenna 2. + + + Tx receive antenna. When set the data received on antenna 2 are taken, else the data stems from antenna 1. + + + Tx transmit antenna. Data are transmitted on antenna 1. + + + Tx transmit antenna. Data are transmitted on antenna 2. + + + + + RADIO_LINK_TYPE enum. + + Unknown radio link type. + + + Radio link is HereLink. + + + Radio link is Dragon Link. + + + Radio link is RFD900. + + + Radio link is Crossfire. + + + Radio link is ExpressLRS. + + + Radio link is mLRS. + + + + + + + + + + Information about a gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE. It mirrors some fields of the GIMBAL_DEVICE_INFORMATION message, but not all. If the additional information is desired, also GIMBAL_DEVICE_INFORMATION should be requested. + Gimbal ID (component ID or 1-6 for non-MAVLink gimbal) that this gimbal manager is responsible for. + Gimbal device capability flags. Same flags as reported by GIMBAL_DEVICE_INFORMATION. The flag is only 16 bit wide, but stored in 32 bit, for backwards compatibility (high word is zero). + Gimbal manager capability flags. + Hardware minimum roll angle (positive: roll to the right). NaN if unknown. + Hardware maximum roll angle (positive: roll to the right). NaN if unknown. + Hardware minimum pitch/tilt angle (positive: tilt up). NaN if unknown. + Hardware maximum pitch/tilt angle (positive: tilt up). NaN if unknown. + Hardware minimum yaw/pan angle (positive: pan to the right, relative to the vehicle/gimbal base). NaN if unknown. + Hardware maximum yaw/pan angle (positive: pan to the right, relative to the vehicle/gimbal base). NaN if unknown. + + + + Message reporting the current status of a gimbal manager. This message should be broadcast at a low regular rate (e.g. 1 Hz, may be increase momentarily to e.g. 5 Hz for a period of 1 sec after a change). + Gimbal ID (component ID or 1-6 for non-MAVLink gimbal) that this gimbal manager is responsible for. + Client who is currently supervisor (0 = none). + Gimbal device flags currently applied. Same flags as reported by GIMBAL_DEVICE_ATTITUDE_STATUS. + Gimbal manager flags currently applied. + Profile currently applied (0 = default). + + + + Message to a gimbal manager to control the gimbal attitude. Angles and rates can be set to NaN according to use case. A gimbal device is never to react to this message. + System ID + Component ID + Gimbal ID of the gimbal manager to address (component ID or 1-6 for non-MAVLink gimbal, 0 for all gimbals). Send command multiple times for more than one but not all gimbals. + Client which is contacting the gimbal manager (must be set). + Gimbal device flags to be applied (UINT16_MAX to be ignored). Same flags as used in GIMBAL_DEVICE_SET_ATTITUDE. + Gimbal manager flags to be applied (0 to be ignored). + Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). Set first element to NaN to be ignored. The frame is determined by the GIMBAL_DEVICE_FLAGS_YAW_IN_xxx_FRAME flags. + X component of angular velocity (positive: roll to the right). NaN to be ignored. + Y component of angular velocity (positive: tilt up). NaN to be ignored. + Z component of angular velocity (positive: pan to the right). NaN to be ignored. The frame is determined by the GIMBAL_DEVICE_FLAGS_YAW_IN_xxx_FRAME flags. + + + + Message to a gimbal manager to control the gimbal tilt and pan angles. Angles and rates can be set to NaN according to use case. A gimbal device is never to react to this message. + System ID + Component ID + Gimbal ID of the gimbal manager to address (component ID or 1-6 for non-MAVLink gimbal, 0 for all gimbals). Send command multiple times for more than one but not all gimbals. + Client which is contacting the gimbal manager (must be set). + Gimbal device flags to be applied (UINT16_MAX to be ignored). Same flags as used in GIMBAL_DEVICE_SET_ATTITUDE. + Gimbal manager flags to be applied (0 to be ignored). + Pitch/tilt angle (positive: tilt up). NaN to be ignored. + Yaw/pan angle (positive: pan the right). NaN to be ignored. The frame is determined by the GIMBAL_DEVICE_FLAGS_YAW_IN_xxx_FRAME flags. + Pitch/tilt angular rate (positive: tilt up). NaN to be ignored. + Yaw/pan angular rate (positive: pan to the right). NaN to be ignored. The frame is determined by the GIMBAL_DEVICE_FLAGS_YAW_IN_xxx_FRAME flags. + + + + Message to a gimbal manager to correct the gimbal roll angle. This message is typically used to manually correct for a tilted horizon in operation. A gimbal device is never to react to this message. + System ID + Component ID + Gimbal ID of the gimbal manager to address (component ID or 1-6 for non-MAVLink gimbal, 0 for all gimbals). Send command multiple times for more than one but not all gimbals. + Client which is contacting the gimbal manager (must be set). + Roll angle (positive to roll to the right). + + + + + + Information about the shot operation. + Current shot mode. + Current state in the shot. States are specific to the selected shot mode. + + + + + + Addition to message AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. + System ID. + Component ID. + Timestamp (time since system boot). + Wind X speed in NED (North,Est, Down). NAN if unknown. + Wind Y speed in NED (North, East, Down). NAN if unknown. + Correction angle due to wind. NaN if unknown. + + + + Frsky SPort passthrough multi packet container. + Timestamp (time since system boot). + Number of passthrough packets in this message. + Passthrough packet buffer. A packet has 6 bytes: uint16_t id + uint32_t data. The array has space for 40 packets. + + + + Parameter multi param value container. + Total number of onboard parameters. + Index of the first onboard parameter in this array. + Number of onboard parameters in this array. + Flags. + Parameters buffer. Contains a series of variable length parameter blocks, one per parameter, with format as specified elsewhere. + + + + Radio link statistics for a MAVLink RC receiver or transmitter and other links. Tx: ground-side device, Rx: vehicle-side device. + The message is normally emitted in regular time intervals upon each actual or expected reception of an over-the-air data packet on the link. + A MAVLink RC receiver should emit it shortly after it emits a RADIO_RC_CHANNELS message (if it is emitting that message). + Per default, rssi values are in MAVLink units: 0 represents weakest signal, 254 represents maximum signal, UINT8_MAX represents unknown. + The RADIO_LINK_STATS_FLAGS_RSSI_DBM flag is set if the rssi units are negative dBm: 1..254 correspond to -1..-254 dBm, 0 represents no reception, UINT8_MAX represents unknown. + The target_system field should normally be set to the system id of the system the link is connected to, typically the flight controller. + The target_component field can normally be set to 0, so that all components of the system can receive the message. + Note: The frequency fields are extensions to ensure that they are located at the end of the serialized payload and subject to MAVLink's trailing-zero trimming. + + System ID (ID of target system, normally flight controller). + Component ID (normally 0 for broadcast). + Radio link statistics flags. + Link quality of RC data stream from Tx to Rx. Values: 1..100, 0: no link connection, UINT8_MAX: unknown. + Link quality of serial MAVLink data stream from Tx to Rx. Values: 1..100, 0: no link connection, UINT8_MAX: unknown. + Rssi of antenna 1. 0: no reception, UINT8_MAX: unknown. + Noise on antenna 1. Radio link dependent. INT8_MAX: unknown. + Link quality of serial MAVLink data stream from Rx to Tx. Values: 1..100, 0: no link connection, UINT8_MAX: unknown. + Rssi of antenna 1. 0: no reception. UINT8_MAX: unknown. + Noise on antenna 1. Radio link dependent. INT8_MAX: unknown. + Rssi of antenna 2. 0: no reception, UINT8_MAX: use rx_rssi1 if it is known else unknown. + Noise on antenna 2. Radio link dependent. INT8_MAX: use rx_snr1 if it is known else unknown. + Rssi of antenna 2. 0: no reception. UINT8_MAX: use tx_rssi1 if it is known else unknown. + Noise on antenna 2. Radio link dependent. INT8_MAX: use tx_snr1 if it is known else unknown. + + Frequency on antenna1 in Hz. 0: unknown. + Frequency on antenna2 in Hz. 0: unknown. + + + + Radio link information. Tx: ground-side device, Rx: vehicle-side device. + The values of the fields in this message do normally not or only slowly change with time, and for most times the message can be send at a low rate, like 0.2 Hz. + If values change then the message should temporarily be send more often to inform the system about the changes. + The target_system field should normally be set to the system id of the system the link is connected to, typically the flight controller. + The target_component field can normally be set to 0, so that all components of the system can receive the message. + + System ID (ID of target system, normally flight controller). + Component ID (normally 0 for broadcast). + Radio link type. 0: unknown/generic type. + Operation mode. Radio link dependent. UINT8_MAX: ignore/unknown. + Tx transmit power in dBm. INT8_MAX: unknown. + Rx transmit power in dBm. INT8_MAX: unknown. + Frame rate in Hz (frames per second) for Tx to Rx transmission. 0: unknown. + Frame rate in Hz (frames per second) for Rx to Tx transmission. Normally equal to tx_packet_rate. 0: unknown. + Operation mode as human readable string. Radio link dependent. Terminated by NULL if the string length is less than 6 chars and WITHOUT NULL termination if the length is exactly 6 chars - applications have to provide 6+1 bytes storage if the mode is stored as string. Use a zero-length string if not known. + Frequency band as human readable string. Radio link dependent. Terminated by NULL if the string length is less than 6 chars and WITHOUT NULL termination if the length is exactly 6 chars - applications have to provide 6+1 bytes storage if the mode is stored as string. Use a zero-length string if not known. + Maximum data rate of serial stream in bytes/s for Tx to Rx transmission. 0: unknown. UINT16_MAX: data rate is 64 KBytes/s or larger. + Maximum data rate of serial stream in bytes/s for Rx to Tx transmission. 0: unknown. UINT16_MAX: data rate is 64 KBytes/s or larger. + Receive sensitivity of Tx in inverted dBm. 1..255 represents -1..-255 dBm, 0: unknown. + Receive sensitivity of Rx in inverted dBm. 1..255 represents -1..-255 dBm, 0: unknown. + + + + + Injected by a radio link endpoint into the MAVLink stream for purposes of flow control. Should be emitted only by components with component id MAV_COMP_ID_TELEMETRY_RADIO. + Transmitted bytes per second, UINT16_MAX: invalid/unknown. + Received bytes per second, UINT16_MAX: invalid/unknown. + Transmit bandwidth consumption. Values: 0..100, UINT8_MAX: invalid/unknown. + Receive bandwidth consumption. Values: 0..100, UINT8_MAX: invalid/unknown. + For compatibility with legacy method. UINT8_MAX: unknown. + + + diff --git a/src/main/resources/mavlink/ardupilot/test.xml b/src/main/resources/mavlink/ardupilot/test.xml new file mode 100644 index 0000000..c680207 --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/test.xml @@ -0,0 +1,31 @@ + + + 3 + + + Test all field types + char + string + uint8_t + uint16_t + uint32_t + uint64_t + int8_t + int16_t + int32_t + int64_t + float + double + uint8_t_array + uint16_t_array + uint32_t_array + uint64_t_array + int8_t_array + int16_t_array + int32_t_array + int64_t_array + float_array + double_array + + + diff --git a/src/main/resources/mavlink/ardupilot/uAvionix.xml b/src/main/resources/mavlink/ardupilot/uAvionix.xml new file mode 100644 index 0000000..63a33e3 --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/uAvionix.xml @@ -0,0 +1,208 @@ + + + + + + + common.xml + + + State flags for ADS-B transponder dynamic report + + + + + + + + Transceiver RF control flags for ADS-B transponder dynamic reports + + + + + Status for ADS-B transponder dynamic input + + + + + + + + + Status flags for ADS-B transponder dynamic output + + + + + + Definitions for aircraft size + + + + + + + + + + + + + + + + + + + GPS lataral offset encoding + + + + + + + + + + + GPS longitudinal offset encoding + + + + + Emergency status encoding + + + + + + + + + + + State flags for ADS-B transponder dynamic report + + + + + + + + + + State flags for X-Bit and reserved fields. + + + + State flags for ADS-B transponder status report + + + + + + + + + + + State flags for ADS-B transponder status report + + + + + + + + + + + + + + + + + + + + + + + + + State flags for ADS-B transponder fault report + + + + + + + + + + Static data to configure the ADS-B transponder (send within 10 sec of a POR and every 10 sec thereafter) + Vehicle address (24 bit) + Vehicle identifier (8 characters, null terminated, valid characters are A-Z, 0-9, " " only) + Transmitting vehicle type. See ADSB_EMITTER_TYPE enum + Aircraft length and width encoding (table 2-35 of DO-282B) + GPS antenna lateral offset (table 2-36 of DO-282B) + GPS antenna longitudinal offset from nose [if non-zero, take position (in meters) divide by 2 and add one] (table 2-37 DO-282B) + Aircraft stall speed in cm/s + ADS-B transponder receiver and transmit enable flags + + + Dynamic data used to generate ADS-B out transponder data (send at 5Hz) + UTC time in seconds since GPS epoch (Jan 6, 1980). If unknown set to UINT32_MAX + Latitude WGS84 (deg * 1E7). If unknown set to INT32_MAX + Longitude WGS84 (deg * 1E7). If unknown set to INT32_MAX + Altitude (WGS84). UP +ve. If unknown set to INT32_MAX + 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK + Number of satellites visible. If unknown set to UINT8_MAX + Barometric pressure altitude (MSL) relative to a standard atmosphere of 1013.2 mBar and NOT bar corrected altitude (m * 1E-3). (up +ve). If unknown set to INT32_MAX + Horizontal accuracy in mm (m * 1E-3). If unknown set to UINT32_MAX + Vertical accuracy in cm. If unknown set to UINT16_MAX + Velocity accuracy in mm/s (m * 1E-3). If unknown set to UINT16_MAX + GPS vertical speed in cm/s. If unknown set to INT16_MAX + North-South velocity over ground in cm/s North +ve. If unknown set to INT16_MAX + East-West velocity over ground in cm/s East +ve. If unknown set to INT16_MAX + Emergency status + ADS-B transponder dynamic input state flags + Mode A code (typically 1200 [0x04B0] for VFR) + + + Transceiver heartbeat with health report (updated every 10s) + ADS-B transponder messages + + + Aircraft Registration. + Aircraft Registration (ASCII string A-Z, 0-9 only), e.g. "N8644B ". Trailing spaces (0x20) only. This is null-terminated. + + + Flight Identification for ADSB-Out vehicles. + Flight Identification: 8 ASCII characters, '0' through '9', 'A' through 'Z' or space. Spaces (0x20) used as a trailing pad character, or when call sign is unavailable. Reflects Control message setting. This is null-terminated. + + + Request messages. + Message ID to request. Supports any message in this 10000-10099 range + + + Control message with all data sent in UCP control message. + ADS-B transponder control state flags + Barometric pressure altitude (MSL) relative to a standard atmosphere of 1013.2 mBar and NOT bar corrected altitude (m * 1E-3). (up +ve). If unknown set to INT32_MAX + Mode A code (typically 1200 [0x04B0] for VFR) + Emergency status + Flight Identification: 8 ASCII characters, '0' through '9', 'A' through 'Z' or space. Spaces (0x20) used as a trailing pad character, or when call sign is unavailable. + X-Bit enable (military transponders only) + + + Status message with information from UCP Heartbeat and Status messages. + ADS-B transponder status state flags + Mode A code (typically 1200 [0x04B0] for VFR) + Integrity and Accuracy of traffic reported as a 4-bit value for each field (NACp 7:4, NIC 3:0) and encoded by Containment Radius (HPL) and Estimated Position Uncertainty (HFOM), respectively + Board temperature in C + ADS-B transponder fault flags + Flight Identification: 8 ASCII characters, '0' through '9', 'A' through 'Z' or space. Spaces (0x20) used as a trailing pad character, or when call sign is unavailable. + + + diff --git a/src/main/resources/mavlink/ardupilot/ualberta.xml b/src/main/resources/mavlink/ardupilot/ualberta.xml new file mode 100644 index 0000000..e0a6214 --- /dev/null +++ b/src/main/resources/mavlink/ardupilot/ualberta.xml @@ -0,0 +1,76 @@ + + + common.xml + + + Available autopilot modes for ualberta uav + + Raw input pulse widts sent to output + + + Inputs are normalized using calibration, the converted back to raw pulse widths for output + + + dfsdfs + + + dfsfds + + + dfsdfsdfs + + + + Navigation filter mode + + + AHRS mode + + + INS/GPS initialization mode + + + INS/GPS mode + + + + Mode currently commanded by pilot + + sdf + + + dfs + + + Rotomotion mode + + + + + + Accelerometer and Gyro biases from the navigation filter + Timestamp (microseconds) + b_f[0] + b_f[1] + b_f[2] + b_f[0] + b_f[1] + b_f[2] + + + Complete set of calibration parameters for the radio + Aileron setpoints: left, center, right + Elevator setpoints: nose down, center, nose up + Rudder setpoints: nose left, center, nose right + Tail gyro mode/gain setpoints: heading hold, rate mode + Pitch curve setpoints (every 25%) + Throttle curve setpoints (every 25%) + + + System status specific to ualberta uav + System mode, see UALBERTA_AUTOPILOT_MODE ENUM + Navigation mode, see UALBERTA_NAV_MODE ENUM + Pilot mode, see UALBERTA_PILOT_MODE + + + From bfaaf5235627e440efca24a1351e481b1add688d Mon Sep 17 00:00:00 2001 From: Matthew Buckton Date: Sun, 26 Apr 2026 20:34:13 +1000 Subject: [PATCH 29/34] test(mavlink): remove legacy `MavlinkFrameRoundTripAllMessagesTest` and refactor test coverage Removed `MavlinkFrameRoundTripAllMessagesTest` as its functionality is now consolidated into `MavlinkRoundTripAllMessagesTest` with enhanced dialect support. Refactored `RandomValueFactory` for improved random value generation and added dialect-specific handling of message round trips. --- .../mavlink/MavlinkDialectLoadTest.java | 2 +- .../MavlinkFrameRoundTripAllMessagesTest.java | 221 ------------- .../MavlinkRoundTripAllMessagesTest.java | 274 +++++++++++----- .../mavlink/MavlinkTestSupport.java | 6 + .../mavlink/RandomValueFactory.java | 309 ++++++++++++------ 5 files changed, 414 insertions(+), 398 deletions(-) delete mode 100644 src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkDialectLoadTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkDialectLoadTest.java index 83b213a..5b9e470 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkDialectLoadTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkDialectLoadTest.java @@ -91,7 +91,7 @@ void testArduPilotDialectLoadsFullIncludeChain() throws Exception { ); } - private static Path resourcePath(String resourceName) throws URISyntaxException { + public static Path resourcePath(String resourceName) throws URISyntaxException { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); URL resource = classLoader.getResource(resourceName); diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java deleted file mode 100644 index 12c13b2..0000000 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkFrameRoundTripAllMessagesTest.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright [ 2020 - 2024 ] Matthew Buckton - * Copyright [ 2024 - 2026 ] MapsMessaging B.V. - * - * Licensed under the Apache License, Version 2.0 with the Commons Clause - * (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * https://commonsclause.com/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * - */ - -package io.mapsmessaging.mavlink; - -import io.mapsmessaging.mavlink.codec.MavlinkCodec; -import io.mapsmessaging.mavlink.codec.MavlinkFrameCodec; -import io.mapsmessaging.mavlink.context.FrameFailureReason; -import io.mapsmessaging.mavlink.framing.SigningKeyProvider; -import io.mapsmessaging.mavlink.message.CompiledMessage; -import io.mapsmessaging.mavlink.message.Frame; -import io.mapsmessaging.mavlink.message.MessageRegistry; -import io.mapsmessaging.mavlink.message.Version; -import io.mapsmessaging.mavlink.message.fields.FieldDefinition; -import io.mapsmessaging.mavlink.signing.MapSigningKeyProvider; -import io.mapsmessaging.mavlink.signing.NoSigningKeyProvider; -import io.mapsmessaging.mavlink.signing.StaticSigningKeyProvider; -import org.junit.jupiter.api.DynamicTest; -import org.junit.jupiter.api.TestFactory; - -import java.nio.ByteBuffer; -import java.util.*; -import java.util.stream.Stream; - -import static org.junit.jupiter.api.Assertions.*; - -class MavlinkFrameRoundTripAllMessagesTest extends BaseRoudTripTest { - - private static final byte[] TEST_SIGNING_KEY = buildTestSigningKey(); - - private static byte[] buildTestSigningKey() { - Random random = new Random(); - byte[] key = new byte[32]; - random.nextBytes(key); - return key; - } - - @TestFactory - Stream allMessages_frame_roundTrip_v2_unsigned_fullPayload() throws Exception { - return buildRoundTripTests(false); - } - - @TestFactory - Stream allMessages_frame_roundTrip_v2_unsigned_fullPayload_allSigningProviders() throws Exception { - return buildRoundTripTests(false); - } - - @TestFactory - Stream allMessages_frame_roundTrip_v2_signed_fullPayload_allSigningProviders() throws Exception { - return buildRoundTripTests(true); - } - - private Stream buildRoundTripTests(boolean signFrames) throws Exception { - MavlinkCodec payloadCodec = MavlinkTestSupport.codec(); - MessageRegistry registry = payloadCodec.getRegistry(); - - List signingProviderCases = buildSigningProviderCases(signFrames); - - String signingSuffix = signFrames ? "signed" : "unsigned"; - - return signingProviderCases.stream() - .flatMap(signingProviderCase -> registry.getCompiledMessages().stream() - .map(message -> DynamicTest.dynamicTest( - message.getMessageId() - + " " - + message.getName() - + " (" - + signingSuffix - + ", " - + signingProviderCase.displayName - + ")", - () -> runRoundTripCase(payloadCodec, registry, message, signFrames, signingProviderCase) - ))); - } - - private void runRoundTripCase( - MavlinkCodec payloadCodec, - MessageRegistry registry, - CompiledMessage message, - boolean signFrames, - SigningProviderCase signingProviderCase - ) throws Exception { - - MavlinkFrameCodec frameCodec = new MavlinkFrameCodec(payloadCodec, signingProviderCase.signingKeyProvider); - - if (signingProviderCase.expectSuccess) { - frameRoundTripForMessageV2(frameCodec, payloadCodec, registry, message, signFrames); - return; - } - - assertThrows( - Exception.class, - () -> frameRoundTripForMessageV2(frameCodec, payloadCodec, registry, message, signFrames), - "Expected failure for " + signingProviderCase.displayName + " when signFrames=" + signFrames - ); - } - - private List buildSigningProviderCases(boolean signFrames) { - List signingProviderCases = new ArrayList<>(); - - MapSigningKeyProvider mapSigningKeyProvider = new MapSigningKeyProvider(); - mapSigningKeyProvider.register(1, 1, 0, TEST_SIGNING_KEY); - - SigningKeyProvider staticSigningKeyProvider = new StaticSigningKeyProvider(TEST_SIGNING_KEY); - - SigningKeyProvider noSigningKeyProvider = new NoSigningKeyProvider(); - - signingProviderCases.add(new SigningProviderCase("MapSigningKeyProvider", mapSigningKeyProvider, true)); - signingProviderCases.add(new SigningProviderCase("StaticSigningKeyProvider", staticSigningKeyProvider, true)); - - boolean noSigningKeyProviderShouldSucceed = !signFrames; - signingProviderCases.add(new SigningProviderCase("NoSigningKeyProvider", noSigningKeyProvider, noSigningKeyProviderShouldSucceed)); - - return signingProviderCases; - } - - private static final class SigningProviderCase { - - private final String displayName; - private final SigningKeyProvider signingKeyProvider; - private final boolean expectSuccess; - - private SigningProviderCase(String displayName, SigningKeyProvider signingKeyProvider, boolean expectSuccess) { - this.displayName = displayName; - this.signingKeyProvider = signingKeyProvider; - this.expectSuccess = expectSuccess; - } - } - - private static void frameRoundTripForMessageV2( - MavlinkFrameCodec frameCodec, - MavlinkCodec payloadCodec, - MessageRegistry registry, - CompiledMessage msg, - boolean signFrame - ) throws Exception { - - Map values = - RandomValueFactory.buildValues(registry, msg, MavlinkRoundTripAllMessagesTest.ExtensionMode.SOME_PRESENT, BASE_SEED); - - byte[] payload = payloadCodec.encodePayload(msg.getMessageId(), values); - assertNotNull(payload); - - Frame frame = new Frame(); - frame.setVersion(Version.V2); - frame.setSequence(42); - frame.setSystemId(1); - frame.setComponentId(1); - frame.setMessageId(msg.getMessageId()); - frame.setPayload(payload); - frame.setPayloadLength(payload.length); - - frame.setSigned(signFrame); - frame.setIncompatibilityFlags(signFrame ? (byte) 1 : (byte) 0); - frame.setCompatibilityFlags((byte) 0); - frame.setSignature(null); - - ByteBuffer out = ByteBuffer.allocate(payload.length + 128); - frameCodec.packFrame(out, frame); - - out.flip(); - - ByteBuffer networkOwned = ByteBuffer.allocate(out.remaining() + 16); - networkOwned.put(out); - networkOwned.flip(); - - Optional decodedOpt = frameCodec.tryUnpackFrame(networkOwned); - assertTrue(decodedOpt.isPresent(), "Expected to decode a frame"); - - Frame decoded = decodedOpt.get(); - - if (signFrame) { - assertTrue(decoded.isSigned(), "Expected signed frame"); - assertEquals(FrameFailureReason.OK, decoded.getValidated(), "Expected signature validation to succeed"); - assertNotNull(decoded.getSignature(), "Expected signature bytes"); - assertEquals(13, decoded.getSignature().length, "Expected 13-byte MAVLink v2 signature block"); - } else { - assertFalse(decoded.isSigned(), "Expected unsigned frame"); - assertNotEquals(FrameFailureReason.OK, decoded.getValidated(), "Expected validated=false for unsigned frame"); - assertNull(decoded.getSignature(), "Expected signature to be null for unsigned frame"); - } - - assertEquals(frame.getVersion(), decoded.getVersion()); - assertEquals(frame.getSequence(), decoded.getSequence()); - assertEquals(frame.getSystemId(), decoded.getSystemId()); - assertEquals(frame.getComponentId(), decoded.getComponentId()); - assertEquals(frame.getMessageId(), decoded.getMessageId()); - - assertNotNull(decoded.getPayload()); - assertArrayEquals(frame.getPayload(), decoded.getPayload(), "Payload bytes mismatch"); - - Map output = payloadCodec.parsePayload(decoded.getMessageId(), decoded.getPayload()); - - for (Map.Entry entry : values.entrySet()) { - String fieldName = entry.getKey(); - Object expected = entry.getValue(); - Object actual = output.get(fieldName); - assertNotNull(actual, "Missing field after decode: " + fieldName); - - FieldDefinition fieldDefinition = RandomValueFactory.fieldByName(msg, fieldName); - ValueAssertions.assertFieldEquals(fieldDefinition, expected, actual, msg); - } - } -} diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java index 275284c..15f22fb 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkRoundTripAllMessagesTest.java @@ -28,59 +28,119 @@ import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.TestFactory; -import java.util.*; -import java.util.concurrent.*; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; import java.util.stream.Stream; -import static org.junit.jupiter.api.Assertions.*; - -public class MavlinkRoundTripAllMessagesTest extends BaseRoudTripTest { +import static io.mapsmessaging.mavlink.MavlinkDialectLoadTest.resourcePath; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +class MavlinkRoundTripAllMessagesTest extends BaseRoudTripTest { @TestFactory Stream allMessages_baseFields_roundTrip() throws Exception { - MavlinkCodec codec = MavlinkTestSupport.codec(); - MessageRegistry registry = codec.getRegistry(); - - return registry.getCompiledMessages().stream() - .map(msg -> DynamicTest.dynamicTest( - msg.getMessageId() + " " + msg.getName(), - () -> roundTripForMessage(codec, registry, msg, ExtensionMode.OMIT_ALL) - )); + List dynamicTests = new ArrayList<>(); + + for (Map.Entry dialectEntry : buildDialectEntries()) { + MavlinkCodec codec = MavlinkTestSupport.loadPath(dialectEntry.getValue()); + MessageRegistry registry = codec.getRegistry(); + + registry.getCompiledMessages().stream() + .map(message -> DynamicTest.dynamicTest( + dialectEntry.getKey() + + " / " + + message.getMessageId() + + " " + + message.getName(), + () -> roundTripForMessage(codec, registry, message, ExtensionMode.OMIT_ALL) + )) + .forEach(dynamicTests::add); + } + + return dynamicTests.stream(); } @TestFactory Stream allMessages_extensions_omitted_vs_present_payloadSizing() throws Exception { - MavlinkCodec codec = MavlinkTestSupport.codec(); - MessageRegistry registry = codec.getRegistry(); - - return registry.getCompiledMessages().stream() - .filter(msg -> msg.getCompiledFields().stream().anyMatch(cf -> MavlinkTestSupport.fieldDefinition(cf).isExtension())) - .map(msg -> DynamicTest.dynamicTest( - msg.getMessageId() + " " + msg.getName(), - () -> extensionSizingForMessage(codec, registry, msg) - )); + List dynamicTests = new ArrayList<>(); + + for (Map.Entry dialectEntry : buildDialectEntries()) { + MavlinkCodec codec = MavlinkTestSupport.loadPath(dialectEntry.getValue()); + MessageRegistry registry = codec.getRegistry(); + + registry.getCompiledMessages().stream() + .filter(message -> message.getCompiledFields().stream() + .anyMatch(compiledField -> MavlinkTestSupport.fieldDefinition(compiledField).isExtension())) + .map(message -> DynamicTest.dynamicTest( + dialectEntry.getKey() + + " / " + + message.getMessageId() + + " " + + message.getName(), + () -> extensionSizingForMessage(codec, registry, message) + )) + .forEach(dynamicTests::add); + } + + return dynamicTests.stream(); } @TestFactory Stream parallel_encode_decode_sanity_no_shared_state_per_message() throws Exception { - MavlinkCodec codec = MavlinkTestSupport.codec(); - MessageRegistry registry = codec.getRegistry(); + List dynamicTests = new ArrayList<>(); + + for (Map.Entry dialectEntry : buildDialectEntries()) { + MavlinkCodec codec = MavlinkTestSupport.loadPath(dialectEntry.getValue()); + MessageRegistry registry = codec.getRegistry(); + + int threads = Math.max(2, Runtime.getRuntime().availableProcessors() / 2); + int tasksPerMessage = 8; + + registry.getCompiledMessages().stream() + .map(message -> DynamicTest.dynamicTest( + dialectEntry.getKey() + + " / " + + message.getMessageId() + + " " + + message.getName(), + () -> runParallelRoundTrips(codec, registry, message, threads, tasksPerMessage) + )) + .forEach(dynamicTests::add); + } + + return dynamicTests.stream(); + } + + private static List> buildDialectEntries() throws Exception { + List> dialectEntries = new ArrayList<>(); - int threads = Math.max(2, Runtime.getRuntime().availableProcessors() / 2); - int tasksPerMessage = 8; // tune: enough to shake shared state without being silly + dialectEntries.add(Map.entry( + "common", + resourcePath("mavlink/common.xml") + )); - return registry.getCompiledMessages().stream() - .map(msg -> DynamicTest.dynamicTest( - msg.getMessageId() + " " + msg.getName(), - () -> runParallelRoundTrips(codec, registry, msg, threads, tasksPerMessage) - )); + dialectEntries.add(Map.entry( + "ardupilot all", + resourcePath("mavlink/ardupilot/all.xml") + )); + + return dialectEntries; } private static void runParallelRoundTrips( MavlinkCodec codec, MessageRegistry registry, - CompiledMessage msg, + CompiledMessage message, int threads, int tasksPerMessage ) throws Exception { @@ -89,102 +149,145 @@ private static void runParallelRoundTrips( try { List> callables = new ArrayList<>(tasksPerMessage); - for (int i = 0; i < tasksPerMessage; i++) { - final int taskIndex = i; + + for (int taskIndex = 0; taskIndex < tasksPerMessage; taskIndex++) { + final int currentTaskIndex = taskIndex; callables.add(() -> { - // Vary seed per task so we don't just replay the same values in parallel. - long seed = BASE_SEED ^ (((long) msg.getMessageId()) << 32) ^ taskIndex; - Map input = - RandomValueFactory.buildValues(registry, msg, ExtensionMode.SOME_PRESENT, seed); + long seed = BASE_SEED ^ (((long) message.getMessageId()) << 32) ^ currentTaskIndex; - byte[] payload = codec.encodePayload(msg.getMessageId(), input); - Map output = codec.parsePayload(msg.getMessageId(), payload); + Map input = RandomValueFactory.buildValues(registry, message, ExtensionMode.SOME_PRESENT, seed); + + byte[] payload = codec.encodePayload(message.getMessageId(), input); + Map output = codec.parsePayload(message.getMessageId(), payload); for (Map.Entry entry : input.entrySet()) { String fieldName = entry.getKey(); Object expected = entry.getValue(); Object actual = output.get(fieldName); + if (actual == null) { - fail("Missing field after decode: message " + msg.getMessageId() + " (" + msg.getName() + ") field=" + fieldName); + fail( + "Missing field after decode: message " + + message.getMessageId() + + " (" + + message.getName() + + ") field=" + + fieldName + ); } - FieldDefinition fd = RandomValueFactory.fieldByName(msg, fieldName); - ValueAssertions.assertFieldEquals(fd, expected, actual, msg); + FieldDefinition fieldDefinition = RandomValueFactory.fieldByName(message, fieldName); + ValueAssertions.assertFieldEquals(fieldDefinition, expected, actual, message); } + return null; }); } List> futures = executor.invokeAll(callables, 30, TimeUnit.SECONDS); - for (Future f : futures) { - f.get(); + + for (Future future : futures) { + future.get(); } } finally { executor.shutdownNow(); } } + private static void roundTripForMessage( MavlinkCodec codec, MessageRegistry registry, - CompiledMessage msg, + CompiledMessage message, ExtensionMode extensionMode ) throws Exception { - Map input = RandomValueFactory.buildValues(registry, msg, extensionMode, BASE_SEED); - byte[] payload = codec.encodePayload(msg.getMessageId(), input); + Map input = RandomValueFactory.buildValues(registry, message, extensionMode, BASE_SEED); + + byte[] payload = codec.encodePayload(message.getMessageId(), input); assertNotNull(payload); assertTrue(payload.length > 0, "payload length must be > 0"); - Map output = codec.parsePayload(msg.getMessageId(), payload); + Map output = codec.parsePayload(message.getMessageId(), payload); assertNotNull(output); - // Compare only the fields we provided. - // (If you want to enforce “missing required becomes 0”, add a separate test.) for (Map.Entry entry : input.entrySet()) { String fieldName = entry.getKey(); Object expected = entry.getValue(); Object actual = output.get(fieldName); - // Parser may omit trailing extension fields if payload shorter. if (actual == null) { - // If we set it, it should exist after decode. - fail("Missing field after decode for message " + msg.getMessageId() + " (" + msg.getName() + "): " + fieldName); + fail( + "Missing field after decode for message " + + message.getMessageId() + + " (" + + message.getName() + + "): " + + fieldName + ); } - FieldDefinition fd = RandomValueFactory.fieldByName(msg, fieldName); - ValueAssertions.assertFieldEquals(fd, expected, actual, msg); + FieldDefinition fieldDefinition = RandomValueFactory.fieldByName(message, fieldName); + ValueAssertions.assertFieldEquals(fieldDefinition, expected, actual, message); } } private static void extensionSizingForMessage( MavlinkCodec codec, MessageRegistry registry, - CompiledMessage msg + CompiledMessage message ) throws Exception { - int baseSize = PayloadSizing.computeBaseSize(msg); - - Map baseOnly = RandomValueFactory.buildValues(registry, msg, ExtensionMode.OMIT_ALL, BASE_SEED); - byte[] basePayload = codec.encodePayload(msg.getMessageId(), baseOnly); - assertEquals(baseSize, basePayload.length, - "Base payload size mismatch for message " + msg.getMessageId() + " (" + msg.getName() + ")"); + int baseSize = PayloadSizing.computeBaseSize(message); + + Map baseOnly = RandomValueFactory.buildValues( + registry, + message, + ExtensionMode.OMIT_ALL, + BASE_SEED + ); + + byte[] basePayload = codec.encodePayload(message.getMessageId(), baseOnly); + + assertEquals( + baseSize, + basePayload.length, + "Base payload size mismatch for message " + + message.getMessageId() + + " (" + + message.getName() + + ")" + ); + + Map withExtensions = RandomValueFactory.buildValues( + registry, + message, + ExtensionMode.SOME_PRESENT, + BASE_SEED + ); + + byte[] extensionPayload = codec.encodePayload(message.getMessageId(), withExtensions); + + assertTrue( + extensionPayload.length >= baseSize, + "Extension payload should be >= base size for message " + + message.getMessageId() + + " (" + + message.getName() + + ")" + ); + + Map decoded = codec.parsePayload(message.getMessageId(), extensionPayload); - Map withExt = RandomValueFactory.buildValues(registry, msg, ExtensionMode.SOME_PRESENT, BASE_SEED); - byte[] extPayload = codec.encodePayload(msg.getMessageId(), withExt); - assertTrue(extPayload.length >= baseSize, - "Extension payload should be >= base size for message " + msg.getMessageId() + " (" + msg.getName() + ")"); - - // Decode should succeed and base fields should remain stable. - Map decoded = codec.parsePayload(msg.getMessageId(), extPayload); for (Map.Entry entry : baseOnly.entrySet()) { - String name = entry.getKey(); + String fieldName = entry.getKey(); Object expected = entry.getValue(); - Object actual = decoded.get(name); - assertNotNull(actual, "Missing base field after extension decode: " + name); + Object actual = decoded.get(fieldName); + + assertNotNull(actual, "Missing base field after extension decode: " + fieldName); - FieldDefinition fd = RandomValueFactory.fieldByName(msg, name); - ValueAssertions.assertFieldEquals(fd, expected, actual, msg); + FieldDefinition fieldDefinition = RandomValueFactory.fieldByName(message, fieldName); + ValueAssertions.assertFieldEquals(fieldDefinition, expected, actual, message); } } @@ -195,20 +298,23 @@ public enum ExtensionMode { static final class PayloadSizing { - private PayloadSizing() {} + private PayloadSizing() { + } - static int computeBaseSize(CompiledMessage msg) { + static int computeBaseSize(CompiledMessage message) { int size = 0; - for (CompiledField cf : msg.getCompiledFields()) { - FieldDefinition fd = MavlinkTestSupport.fieldDefinition(cf); - if (fd.isExtension()) { + + for (CompiledField compiledField : message.getCompiledFields()) { + FieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(compiledField); + + if (fieldDefinition.isExtension()) { break; } - size += cf.getSizeInBytes(); + + size += compiledField.getSizeInBytes(); } + return size; } } - - -} +} \ No newline at end of file diff --git a/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java b/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java index 14e069d..94b010a 100644 --- a/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java +++ b/src/test/java/io/mapsmessaging/mavlink/MavlinkTestSupport.java @@ -27,6 +27,7 @@ import io.mapsmessaging.mavlink.message.fields.FieldDefinition; import java.lang.reflect.Field; +import java.nio.file.Path; import java.util.Comparator; import java.util.List; import java.util.Map; @@ -42,6 +43,11 @@ public static MavlinkCodec codec() throws Exception { return loader.getDialectOrThrow("common"); } + public static MavlinkCodec loadPath(Path path) throws Exception { + MavlinkMessageFormatLoader loader = MavlinkMessageFormatLoader.getInstance(); + return loader.loadDialect(path); + } + public static MessageRegistry registry(MavlinkCodec codec) { return codec.getRegistry(); } diff --git a/src/test/java/io/mapsmessaging/mavlink/RandomValueFactory.java b/src/test/java/io/mapsmessaging/mavlink/RandomValueFactory.java index 32ec66b..231896e 100644 --- a/src/test/java/io/mapsmessaging/mavlink/RandomValueFactory.java +++ b/src/test/java/io/mapsmessaging/mavlink/RandomValueFactory.java @@ -36,56 +36,66 @@ public class RandomValueFactory { - protected RandomValueFactory() {} + protected RandomValueFactory() { + } public static Map buildValues( MessageRegistry registry, - CompiledMessage msg, + CompiledMessage message, MavlinkRoundTripAllMessagesTest.ExtensionMode extensionMode, long baseSeed ) throws IOException { Map values = new LinkedHashMap<>(); - List fields = msg.getCompiledFields(); + List fields = message.getCompiledFields(); - for (int i = 0; i < fields.size(); i++) { - CompiledField cf = fields.get(i); - FieldDefinition fd = MavlinkTestSupport.fieldDefinition(cf); + for (int fieldIndex = 0; fieldIndex < fields.size(); fieldIndex++) { + CompiledField compiledField = fields.get(fieldIndex); + FieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(compiledField); - if (fd.isExtension() && extensionMode == MavlinkRoundTripAllMessagesTest.ExtensionMode.OMIT_ALL) { + if (fieldDefinition.isExtension() && extensionMode == MavlinkRoundTripAllMessagesTest.ExtensionMode.OMIT_ALL) { continue; } - if (fd.isExtension() && extensionMode == MavlinkRoundTripAllMessagesTest.ExtensionMode.SOME_PRESENT) { - // include some extensions deterministically (not all) - long seed = perFieldSeed(baseSeed, msg.getMessageId(), i); + if (fieldDefinition.isExtension() && extensionMode == MavlinkRoundTripAllMessagesTest.ExtensionMode.SOME_PRESENT) { + long seed = perFieldSeed(baseSeed, message.getMessageId(), fieldIndex); Random random = new Random(seed); + if (random.nextInt(100) < 60) { - continue; // omit ~60% of extension fields + continue; } } - Object value = generateValueForField(registry, msg.getMessageId(), fd, i, baseSeed); - values.put(fd.getName(), value); + Object value = generateValueForField( + registry, + message.getMessageId(), + fieldDefinition, + fieldIndex, + baseSeed + ); + + values.put(fieldDefinition.getName(), value); } return values; } - static FieldDefinition fieldByName(CompiledMessage msg, String fieldName) { - for (CompiledField cf : msg.getCompiledFields()) { - FieldDefinition fd = MavlinkTestSupport.fieldDefinition(cf); - if (fieldName.equals(fd.getName())) { - return fd; + static FieldDefinition fieldByName(CompiledMessage message, String fieldName) { + for (CompiledField compiledField : message.getCompiledFields()) { + FieldDefinition fieldDefinition = MavlinkTestSupport.fieldDefinition(compiledField); + + if (fieldName.equals(fieldDefinition.getName())) { + return fieldDefinition; } } - throw new IllegalStateException("Unknown field '" + fieldName + "' in message " + msg.getMessageId()); + + throw new IllegalStateException("Unknown field '" + fieldName + "' in message " + message.getMessageId()); } protected static Object generateValueForField( MessageRegistry registry, int messageId, - FieldDefinition fd, + FieldDefinition fieldDefinition, int fieldIndex, long baseSeed ) throws IOException { @@ -93,34 +103,52 @@ protected static Object generateValueForField( long seed = perFieldSeed(baseSeed, messageId, fieldIndex); Random random = new Random(seed); - if (fd.isArray()) { - if (isCharType(fd)) { - return randomAsciiString(fd.getArrayLength(), messageId, fd.getName(), random); + if (fieldDefinition.isArray()) { + if (isCharType(fieldDefinition)) { + return randomAsciiString(fieldDefinition.getArrayLength(), messageId, fieldDefinition.getName(), random); } - Object[] arr = new Object[fd.getArrayLength()]; - for (int i = 0; i < arr.length; i++) { - arr[i] = generateScalar(registry, fd, random); + + Object[] values = new Object[fieldDefinition.getArrayLength()]; + + for (int arrayIndex = 0; arrayIndex < values.length; arrayIndex++) { + values[arrayIndex] = generateScalar(registry, fieldDefinition, random); } - return arr; + + return values; } - return generateScalar(registry, fd, random); + return generateScalar(registry, fieldDefinition, random); } - protected static Object generateScalar(MessageRegistry registry, FieldDefinition fd, Random random) throws IOException { - String enumName = fd.getEnumName(); + protected static Object generateScalar( + MessageRegistry registry, + FieldDefinition fieldDefinition, + Random random + ) throws IOException { + + String enumName = fieldDefinition.getEnumName(); + if (enumName != null && !enumName.isEmpty()) { - EnumDefinition def = registry.getEnumsByName().get(enumName); - if (def != null && def.getEntries() != null && !def.getEntries().isEmpty()) { - if (def.isBitmask()) { - return pickBitmask(def, random); + EnumDefinition enumDefinition = registry.getEnumsByName().get(enumName); + + if ( + enumDefinition != null + && enumDefinition.getEntries() != null + && !enumDefinition.getEntries().isEmpty() + ) { + long enumValue; + + if (enumDefinition.isBitmask()) { + enumValue = pickBitmask(enumDefinition, random); + } else { + enumValue = pickEnumValue(enumDefinition, random); } - return pickEnumValue(def, random); + + return coerceValueToFieldType(fieldDefinition, enumValue); } - // If enum metadata missing, fall back to numeric in-range. } - String type = normalizeType(fd.getType()); + String type = normalizeType(fieldDefinition.getType()); return switch (type) { case "uint8_t" -> Integer.valueOf(random.nextInt(256)); @@ -129,62 +157,114 @@ protected static Object generateScalar(MessageRegistry registry, FieldDefinition case "uint16_t" -> Integer.valueOf(random.nextInt(65536)); case "int16_t" -> Integer.valueOf(random.nextInt(65536) - 32768); - case "uint32_t" -> Long.valueOf(nextLongBounded(random, 0L, 0xFFFF_FFFFL)); + case "uint32_t" -> Long.valueOf(nextUnsignedIntValue(random)); case "int32_t" -> Integer.valueOf(random.nextInt()); - case "uint64_t" -> Long.valueOf(nextLongBounded(random, 0L, Long.MAX_VALUE)); + case "uint64_t" -> Long.valueOf(nextPositiveLongValue(random)); case "int64_t" -> Long.valueOf(random.nextLong()); case "float" -> Float.valueOf(nextFloatBounded(random, -10_000f, 10_000f)); case "double" -> Double.valueOf(nextDoubleBounded(random, -10_000d, 10_000d)); - // Some dialects use "char" for scalar, though rare. case "char" -> Integer.valueOf(random.nextInt(128)); - default -> throw new IOException("Unsupported MAVLink field type: " + fd.getType() + " (normalized=" + type + ")"); + default -> throw new IOException( + "Unsupported MAVLink field type: " + + fieldDefinition.getType() + + " (normalized=" + + type + + ")" + ); + }; + } + + protected static Object coerceValueToFieldType( + FieldDefinition fieldDefinition, + long value + ) throws IOException { + + String type = normalizeType(fieldDefinition.getType()); + + return switch (type) { + case "uint8_t" -> Integer.valueOf((int) (value & 0xFFL)); + case "int8_t" -> Integer.valueOf((byte) value); + + case "uint16_t" -> Integer.valueOf((int) (value & 0xFFFFL)); + case "int16_t" -> Integer.valueOf((short) value); + + case "uint32_t" -> Long.valueOf(value & 0xFFFF_FFFFL); + case "int32_t" -> Integer.valueOf((int) value); + + case "uint64_t" -> Long.valueOf(value); + case "int64_t" -> Long.valueOf(value); + + case "char" -> Integer.valueOf((int) (value & 0x7FL)); + + default -> throw new IOException( + "Unsupported MAVLink enum field type: " + + fieldDefinition.getType() + + " (normalized=" + + type + + ")" + ); }; } - protected static long pickEnumValue(EnumDefinition def, Random random) { - List entries = def.getEntries(); + protected static long pickEnumValue( + EnumDefinition enumDefinition, + Random random + ) { + List entries = enumDefinition.getEntries(); EnumEntry entry = entries.get(random.nextInt(entries.size())); + return entry.getValue(); } - protected static long pickBitmask(EnumDefinition def, Random random) { - List entries = def.getEntries(); + protected static long pickBitmask( + EnumDefinition enumDefinition, + Random random + ) { + List entries = enumDefinition.getEntries(); int count = Math.min(entries.size(), 1 + random.nextInt(3)); long mask = 0L; - for (int i = 0; i < count; i++) { + for (int index = 0; index < count; index++) { EnumEntry entry = entries.get(random.nextInt(entries.size())); mask |= entry.getValue(); } + return mask; } - protected static boolean isCharType(FieldDefinition fd) { - String type = normalizeType(fd.getType()); + protected static boolean isCharType(FieldDefinition fieldDefinition) { + String type = normalizeType(fieldDefinition.getType()); + return "char".equals(type); } - protected static String randomAsciiString(int maxLen, int messageId, String fieldName, Random random) { - // Stable-ish prefix helps debugging. + protected static String randomAsciiString( + int maxLength, + int messageId, + String fieldName, + Random random + ) { String prefix = "M" + messageId + "_" + fieldName + "_"; - byte[] bytes = new byte[Math.max(1, maxLen)]; + byte[] bytes = new byte[Math.max(1, maxLength)]; byte[] prefixBytes = prefix.getBytes(StandardCharsets.US_ASCII); - int pos = 0; - for (int i = 0; i < prefixBytes.length && pos < bytes.length; i++) { - bytes[pos++] = prefixBytes[i]; + int position = 0; + + for (int index = 0; index < prefixBytes.length && position < bytes.length; index++) { + bytes[position] = prefixBytes[index]; + position++; } - while (pos < bytes.length) { - int c = 32 + random.nextInt(95); // printable ASCII 32..126 - bytes[pos++] = (byte) c; + + while (position < bytes.length) { + int character = 32 + random.nextInt(95); + bytes[position] = (byte) character; + position++; } - // Return String to match your packer expectation for char arrays. - // If you prefer byte[], swap this line. return new String(bytes, StandardCharsets.US_ASCII); } @@ -192,48 +272,93 @@ protected static String normalizeType(String type) { if (type == null) { return ""; } - // Your pipeline already normalizes decorated types; keep this defensive. - String t = type.trim(); - if (t.endsWith("_t")) { - return t; + + String trimmedType = type.trim(); + + if (trimmedType.endsWith("_t")) { + return trimmedType; + } + + if (trimmedType.contains("uint8_t")) { + return "uint8_t"; + } + + if (trimmedType.contains("int8_t")) { + return "int8_t"; + } + + if (trimmedType.contains("uint16_t")) { + return "uint16_t"; + } + + if (trimmedType.contains("int16_t")) { + return "int16_t"; + } + + if (trimmedType.contains("uint32_t")) { + return "uint32_t"; + } + + if (trimmedType.contains("int32_t")) { + return "int32_t"; + } + + if (trimmedType.contains("uint64_t")) { + return "uint64_t"; + } + + if (trimmedType.contains("int64_t")) { + return "int64_t"; + } + + if (trimmedType.equals("float")) { + return "float"; + } + + if (trimmedType.equals("double")) { + return "double"; } - if (t.contains("uint8_t")) return "uint8_t"; - if (t.contains("int8_t")) return "int8_t"; - if (t.contains("uint16_t")) return "uint16_t"; - if (t.contains("int16_t")) return "int16_t"; - if (t.contains("uint32_t")) return "uint32_t"; - if (t.contains("int32_t")) return "int32_t"; - if (t.contains("uint64_t")) return "uint64_t"; - if (t.contains("int64_t")) return "int64_t"; - if (t.equals("float")) return "float"; - if (t.equals("double")) return "double"; - if (t.equals("char")) return "char"; - return t; + + if (trimmedType.equals("char")) { + return "char"; + } + + return trimmedType; } - protected static long perFieldSeed(long baseSeed, int messageId, int fieldIndex) { - long s = baseSeed; - s ^= (long) messageId * 0x9E37_79B9_7F4A_7C15L; - s ^= (long) fieldIndex * 0xC2B2_AE3D_27D4_EB4FL; - return s; + protected static long perFieldSeed( + long baseSeed, + int messageId, + int fieldIndex + ) { + long seed = baseSeed; + seed ^= (long) messageId * 0x9E37_79B9_7F4A_7C15L; + seed ^= (long) fieldIndex * 0xC2B2_AE3D_27D4_EB4FL; + + return seed; } - protected static long nextLongBounded(Random random, long minInclusive, long maxInclusive) { - if (minInclusive > maxInclusive) { - throw new IllegalArgumentException("min > max"); - } - long bound = maxInclusive - minInclusive + 1; - long r = random.nextLong(); - long v = Math.floorMod(r, bound); - return minInclusive + v; + protected static long nextUnsignedIntValue(Random random) { + return Integer.toUnsignedLong(random.nextInt()); } + protected static long nextPositiveLongValue(Random random) { + return random.nextLong() & Long.MAX_VALUE; + } - protected static float nextFloatBounded(Random random, float min, float max) { - return min + random.nextFloat() * (max - min); + protected static float nextFloatBounded( + Random random, + float minimum, + float maximum + ) { + return minimum + random.nextFloat() * (maximum - minimum); } - protected static double nextDoubleBounded(Random random, double min, double max) { - return min + random.nextDouble() * (max - min); + protected static double nextDoubleBounded( + Random random, + double minimum, + double maximum + ) { + return minimum + random.nextDouble() * (maximum - minimum); } } \ No newline at end of file From 085c63930b3ce65f0c959d2168ab37a24affe710 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 04:31:45 +0000 Subject: [PATCH 30/34] Bump org.apache.maven.plugins:maven-source-plugin from 3.3.1 to 3.4.0 Bumps [org.apache.maven.plugins:maven-source-plugin](https://github.com/apache/maven-source-plugin) from 3.3.1 to 3.4.0. - [Release notes](https://github.com/apache/maven-source-plugin/releases) - [Commits](https://github.com/apache/maven-source-plugin/compare/maven-source-plugin-3.3.1...maven-source-plugin-3.4.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-source-plugin dependency-version: 3.4.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index be34c46..44a0a0b 100644 --- a/pom.xml +++ b/pom.xml @@ -229,7 +229,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.1 + 3.4.0 attach-sources From 7ee1d2f4d6ceb8cfe66010f7a2a0f3154fb907fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 04:31:49 +0000 Subject: [PATCH 31/34] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.5.4 to 3.5.5 Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.5.4 to 3.5.5. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.4...surefire-3.5.5) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-version: 3.5.5 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index be34c46..7b0cbe2 100644 --- a/pom.xml +++ b/pom.xml @@ -281,7 +281,7 @@ org.apache.maven.plugins - 3.5.4 + 3.5.5 From 096b777cbb0335a8aaa4aa58be62cdfb07a154b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 04:31:50 +0000 Subject: [PATCH 32/34] Bump io.swagger.core.v3:swagger-annotations from 2.2.41 to 2.2.50 Bumps io.swagger.core.v3:swagger-annotations from 2.2.41 to 2.2.50. --- updated-dependencies: - dependency-name: io.swagger.core.v3:swagger-annotations dependency-version: 2.2.50 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index be34c46..22f273b 100644 --- a/pom.xml +++ b/pom.xml @@ -374,7 +374,7 @@ io.swagger.core.v3 swagger-annotations - 2.2.41 + 2.2.50 compile From b80483242b60b464c9c11c75bc1d14373ff1eef0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 04:31:57 +0000 Subject: [PATCH 33/34] Bump org.mockito:mockito-junit-jupiter from 5.21.0 to 5.23.0 Bumps [org.mockito:mockito-junit-jupiter](https://github.com/mockito/mockito) from 5.21.0 to 5.23.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.21.0...v5.23.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-junit-jupiter dependency-version: 5.23.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index be34c46..76b8b1b 100644 --- a/pom.xml +++ b/pom.xml @@ -396,7 +396,7 @@ org.mockito mockito-junit-jupiter - 5.21.0 + 5.23.0 test From e60e7be771f2570a6c10dbf57fb81a4af115e37e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 04:32:04 +0000 Subject: [PATCH 34/34] Bump org.mockito:mockito-core from 5.21.0 to 5.23.0 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.21.0 to 5.23.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.21.0...v5.23.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-version: 5.23.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index be34c46..0cb8022 100644 --- a/pom.xml +++ b/pom.xml @@ -403,7 +403,7 @@ org.mockito mockito-core - 5.21.0 + 5.23.0 test