Skip to content

Conversation

@hamishwillee
Copy link
Collaborator

This updates the param protocol with information about PARAM_ERROR. Designed to match mavlink/mavlink#2365 - in progress.

Some questions for you @peterbarker - we should iterate this in parallel with the link above.

FYI @DonLakeFlyer

Comment on lines +192 to +193
4. If the targeted component does not have any parameters then it should ignore the `PARAM_REQUEST_LIST` request.
The GCS may resend the request on timeout if no `PARAM_VALUE` is received, but should cease after resends.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should we create an error for this case so that no need for a retry on PARAM_REQUEST_LIST?

Comment on lines +262 to +268
In some cases the drone may not be able write a value, for example because it is a read-only parameter, the specified parameter id or index does not exist, or the id exists but the encoding specified does not match the stored values.
If the parameter is known (i.e. the id or index is valid) the drone should acknowledge the `PARAM_SET` by broadcasting a `PARAM_VALUE` (in the case of error, with the current/unchanged parameter value).
1. GCS should update the [parameter cache](#parameter_caching) (if used) with the new value.
1. The GCS may restart the sequence if the expected `PARAM_VALUE` is not received within the timeout, or if the write operation fails (the value returned in `PARAM_VALUE` does not match the value set).
In older versions of the protocol, if the parameter is unknown the `PARAM_SET` would be silently ignored.
In newer versions, if [PARAM_ERROR](#PARAM_ERROR) message is supported, it should be sent for any error (alongside `PARAM_VALUE` if its value can be known).
The GCS may restart the sequence if the expected `PARAM_VALUE` and/or `PARAM_ERROR` is not received within the timeout.
Copy link
Collaborator Author

@hamishwillee hamishwillee Oct 29, 2025

Choose a reason for hiding this comment

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

This is PARAM VALUE/ERROR handling for a write. Note that it states that you return the PARAM_VALUE if there is a value that can be returend.

Comment on lines +225 to +229
In some cases the drone may not be able read a value, such as if an invalid parameter id or index was specified.
In older versions of the protocol the drone would silently ignore the message.
In newer versions the drone may return a [PARAM_ERROR](#PARAM_ERROR) message.
The GCS may restart the sequence if a `PARAM_VALUE` or `PARAM_ERROR` acknowledgment is not received within the timeout.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is PARAM VALUE/ERROR handling for a read.

- C-style encoding of parameters is supported.
Note however that ArduPilot does not set `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST`.
C-style encoding of parameters is used and `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` is set on versions since circ a 2022.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If you know a version or date that might be handy? I haven't modified the following text for off spec behaviour. To be confirmed how it works.

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.

1 participant