Skip to content

Move option bits from SERIALn_OPTIONS to MAVn_OPTIONS #30094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

peterbarker
Copy link
Contributor

This is built on top of #29546

@peterbarker peterbarker added the WikiNeeded needs wiki update label May 18, 2025
@peterbarker peterbarker force-pushed the pr/move-uartdriver-options-to-MAVx branch from b41badd to 3c4ec3b Compare May 18, 2025 06:07
Copy link
Contributor

@timtuxworth timtuxworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two minor points about the comments. I know it's possible to request stream rate changes from another vehicle. I'm pretty sure the disable stream rate request would apply to those requests too, not just requests from a GCS.

// PARAMETER_CONVERSION - Added: May-2025 for ArduPilot-4.7
// convert parameters; we used to use bits in the UARTDriver to
// remember whether the mavlink connection on that interface was
// "private" or not, and whether to ignore streamrate sets GCSs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again - not sure if this is just stream rate sets from a GCS only.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworded this too - thanks!

@peterbarker peterbarker force-pushed the pr/move-uartdriver-options-to-MAVx branch from 3c4ec3b to 0a41da0 Compare May 19, 2025 00:03
Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this basically looks good.

@@ -202,6 +202,24 @@ const AP_Param::GroupInfo GCS_MAVLINK::var_info[] = {
// @RebootRequired: True
// @User: Advanced
AP_GROUPINFO("_ADSB", 10, GCS_MAVLINK, streamRates[GCS_MAVLINK::STREAM_ADSB], DRATE(GCS_MAVLINK::STREAM_ADSB)),

// ------------
// IMPORTANT: Add new stream rates *before* the _OPTIONS parameter.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to group them together. I know it's not required, but it's nicer when you're looking for things.

Copy link
Contributor

@tridge tridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more understanding needed of how this worked :-)

// PARAMETER_CONVERSION - Added: May-2025 for ArduPilot-4.7
// Hidden param used as a flag for param conversion
// This allows one time conversion while allowing user to flash between versions with and without converted params
AP_GROUPINFO_FLAGS("_OPTIONSCNV", 20, GCS_MAVLINK, options_were_converted, 0, AP_PARAM_FLAG_HIDDEN),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate 20? how is this not crashing on startup?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not call AP_Param::check_group_info on objects loaded via load_object_from_eeprom - so only validation on the base structures.

It looks like actually calling check_group_info would require us passing more information into load_object_from_eeprom - the current parameter-name-prefix length and the currently shift value - so adding this sanity check is a non-trivial task!

Further complicating things is that these problems may arise because a script is trying to define parameters. Our current FATAL("...") approach for invalid structures isn't suitable in this case!

As to why Everything Worked: they both get shoved into eeprom, differentiated by parameter type:

00d2: type 1 (INT8) key 258 group_element 1292 size 1 value 1
 01
00d7: type 2 (INT16) key 258 group_element 1292 size 2 value 0
 00 00

Probably not something to rely on... I've moved _OPTIONSCNV to parameter 21 and re-tested parameter upgrade

@peterbarker peterbarker force-pushed the pr/move-uartdriver-options-to-MAVx branch from 0a41da0 to 494d43a Compare May 20, 2025 03:29
Copy link
Contributor

@tridge tridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing change to SERIALn_OPTIONS meta-data

@tridge tridge removed the DevCallEU label May 21, 2025
ben-sembira-1 and others added 5 commits May 21, 2025 17:39
we recently got options on a per-mavlink-connection basis.  Use them
we recently got options on a per-mavlink-connection basis.  Use them
we recently got options on a per-mavlink-connection basis.  Use them
@peterbarker peterbarker force-pushed the pr/move-uartdriver-options-to-MAVx branch from 494d43a to a05d0f9 Compare May 21, 2025 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WikiNeeded needs wiki update
Projects
Development

Successfully merging this pull request may close these issues.

6 participants