Skip to content

Parameter protocol messages - update to clarify responses#2365

Open
hamishwillee wants to merge 20 commits intomasterfrom
hamishwillee-param-protocol
Open

Parameter protocol messages - update to clarify responses#2365
hamishwillee wants to merge 20 commits intomasterfrom
hamishwillee-param-protocol

Conversation

@hamishwillee
Copy link
Copy Markdown
Contributor

Updated descriptions for PARAM_REQUEST_READ, PARAM_REQUEST_LIST, PARAM_VALUE, PARAM_SET, and PARAM_ERROR messages to clarify usage and response requirements.
This makes the descriptions more coherent and consistent so that they are better cross linked.
Also clarifies that the index is not necessarily invariant.

The reason for the change comes out of #2344 (comment) - clarifying what values must be set for parameter identity in the emitted command. I chose:

Note that the response must include the parameter identity specified in the request (either param_id or param_index) and must also include param_index if it is available.

So you always return the id (name) if you have it, because that's the invariant thing we really want. However sometimes you can't have it for example in param_error, if you requested an index out of range.
We don't care about the index in the setter case; as long as it is correct.

@peterbarker I think this is good and makes things more clear.

…e set

Updated descriptions for PARAM_REQUEST_READ, PARAM_REQUEST_LIST, PARAM_VALUE, PARAM_SET, and PARAM_ERROR messages to clarify usage and response requirements.
@peterbarker
Copy link
Copy Markdown
Contributor

Let's not rush this one in. We run the risk of making a whole bunch of things no longer follow the spec, which is a little rude. For example, ArduPilot won't fill in the name for out-of-range or permission-denied errors if you don't sent it in yourself. Of course, we only actually really use set-by-name as we're quite clear by-numeric-id doesn't really work, but the wording would put us in violation.

Maybe we should start with should or a can for filling in the name wheneever you can.

@hamishwillee
Copy link
Copy Markdown
Contributor Author

@peterbarker Sure! This is why we have review. Note that no one will be filling in the name of out of range errors, because they don't have a name. If it doesn't say that, it should.

It would help if you could add those variations as suggestions - I really can't guess them.

Note also that this needs to match mavlink/mavlink-devguide#644

hamishwillee and others added 6 commits October 31, 2025 08:09
Comment on lines +5342 to +5344
The receiving component must emit PARAM_VALUE if the parameter can be read, or PARAM_ERROR if there is an error (older protocol versions send no response on error).
A PARAM_VALUE response must include both the `param_id` and `param_index`.
A PARAM_ERROR response must include the `param_id` or `param_index` included in the request, and should include both if available.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@peterbarker FYI this is updated in response to your comment https://github.com/mavlink/mavlink/pull/2365/files#r2476014580

@hamishwillee
Copy link
Copy Markdown
Contributor Author

Thanks @peterbarker I think I have addressed your comments. Time for another review.

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.

2 participants