mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 16:51:16 +08:00
feat(params): add board-level read-only parameter support (#26522)
Integrators can declare read-only parameters in a per-board YAML file: readonly_params.yaml. There are two ways to define the read-only params: - "block": default writable, explicitly list params to be locked - "allow": default readonly, explicitly list params to be writable Enforcement is activated by `param lock` in rcS after all startup scripts have run, so board defaults and airframe scripts can still set params during init. The feedback via MAVLink uses the new MAV_PARAM_ERROR_READ_ONLY as part of the PARAM_ERROR message.
This commit is contained in:
1 parent
efd05431e8
commit
b48ec2dd68
16 files changed
+276
-9
No files matched your search
@@ -226,6 +226,9 @@ MavlinkParametersManager::handle_message(const mavlink_message_t *msg)
|
||||
PX4_ERR("param types mismatch param: %s", name);
|
||||
send_error(MAV_PARAM_ERROR_TYPE_MISMATCH, name, -1, msg->sysid, msg->compid);
|
||||
|
||||
} else if (param_is_readonly(param)) {
|
||||
PX4_WARN("param %s is read-only", name);
|
||||
send_error(MAV_PARAM_ERROR_READ_ONLY, name, -1, msg->sysid, msg->compid);
|
||||
|
||||
} else {
|
||||
// According to the mavlink spec we should always acknowledge a write operation.
|
||||
|
||||
Reference in new issue
Block a user