Skip to content

Conversation

@ReladormAndry
Copy link

Added MAVDeprecated class to mavparse.py

Added deprecated field to MAVType, MAVEnumEntry, MAVEnum classes that are filled from the XML specification to generate corresponding comments.

Added invalid field to MAVField class that is filled from XML specification and can be used in generation. For example, to set as an initial (non-initialized) value for the field.

@ReladormAndry
Copy link
Author

ReladormAndry commented Dec 29, 2025

From @peterbarker

I know how to spell Ada, but that's pretty much where my knowledge ends. But the first substantial line would probably >break anybody using something pre-2022 Ada? We probably want to avoid doing that if that's the case.

We use Ada2022 features to make the coder/encoder more robust. Here is the document that explains how it works (english variant): "Обновление MAVLink для Ады"
This pragma is already supported by modern gnat and gcc13 compilers.

Please tidy the commit list - there should probably only be a single commit.

Done.

Please present testing results.

For testing I used the following script:

#!/bin/bash
for p in 1.0 2.0
do
  for w in ASLUAV.xml common.xml cubepilot.xml icarous.xml marsh.xml minimal.xml ualberta.xml ardupilotmega.xml AVSSUAS.xml csAirLink.xml development.xml loweheiser.xml matrixpilot.xml paparazzi.xml standar
d.xml uAvionix.xml
  do
    rm -rf ./gen
    python3 -m pymavlink.tools.mavgen --lang=Ada --wire-protocol=$p --output=gen mavlink/message_definitions/v1.0/$w

    if ! gprbuild -q ./gen/tests/test.gpr; then
      exit 1;
    fi

    if ! ./gen/tests/obj/test; then
      exit 1;
    fi
  done
done
echo "all is ok"

It generates code and test for all selected dialects for both v1 and v2. The test tries to encode/decode all messages and compare whether the before is equal to the after.

The last part of the output is:

Validating .../mavlink/message_definitions/v1.0/minimal.xml
Parsing .../mavlink/message_definitions/v1.0/minimal.xml
Found 238 MAVLink message types in 4 XML files
Generate Uavionix
Generate Common
Generate Standard
Generate Minimal
Ok
all is ok

@peterbarker
Copy link
Contributor

Ping @python36 - could we get your input on this? Particularly on the new requirement to use Ada 2022 or better....

@ReladormAndry we try not to break existing users as much as possible. Saying "the modern tooling supports it" doesn't actually hold a huge amount of weight. We supported Python2 well past its EOL date so as not to break existing users. I don't know how the Ada ecosystem works, so I can't block it based on this - but I would have thought Ada users most likely to be using older tools!

@ReladormAndry ReladormAndry force-pushed the version2_for_Ada branch 2 times, most recently from 7fd4a7a to ec9112e Compare December 30, 2025 14:23
Added MAVDeprecated class to mavparse.py

Added deprecated field to MAVType, MAVEnumEntry, MAVEnum classes that are filled from the XML specification to generate corresponding comments.

Added invalid field to MAVField class that is filled from XML specification and can be used in generation. For example, to set as an initial (non-initialized) value for the field.
@reznikmm
Copy link

reznikmm commented Jan 7, 2026

Ada community is rather small. After putting MAVLink into Alire (package manager for Ada), I didn't receive any feedback (except a tiny comment, so probably nobody uses it except @python36 and me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants