-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
base: master
Are you sure you want to change the base?
Move option bits from SERIALn_OPTIONS to MAVn_OPTIONS #30094
Conversation
b41badd
to
3c4ec3b
Compare
There was a problem hiding this 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.
libraries/GCS_MAVLink/GCS_Common.cpp
Outdated
// 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reworded this too - thanks!
3c4ec3b
to
0a41da0
Compare
There was a problem hiding this 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
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.
There was a problem hiding this 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), |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
0a41da0
to
494d43a
Compare
There was a problem hiding this 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
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
494d43a
to
a05d0f9
Compare
This is built on top of #29546