Skip to content

Conversation

gemenerik
Copy link
Member

Parameter writes were incorrectly treating echoed values as error codes, causing all successful parameter sets to fail with 'Error setting the parameter: code X' where X was the actual value being set.

Root cause: The firmware echoes back the successfully written parameter value, but the Rust implementation was checking byte 2 for an error code (expecting 0 for success).

Fix: Compare the echoed bytes with the expected parameter value bytes to verify the parameter was set correctly.

Tested: Resolves parameter setting failures in (upcoming) example where stabilizer.estimator could not be set to value 2. Can be tested by modifying test_params.rs

  Parameter writes were incorrectly treating echoed values as error codes, causing all successful parameter sets to fail with 'Error setting the parameter: code X' where X was the actual value being set.

  Root cause: The firmware echoes back the successfully written parameter value, but the Rust implementation was checking byte 2 for an error code (expecting 0 for success).

  Fix: Compare the echoed bytes with the expected parameter value bytes to verify the parameter was set correctly.

  Tested: Resolves parameter setting failures in (upcoming) example where stabilizer.estimator could not be set to value 2. Can be tested by modifying test_params.rs
@gemenerik gemenerik self-assigned this Sep 12, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Fixes parameter write response validation by correctly interpreting firmware echoed values instead of treating them as error codes. The firmware echoes back the successfully written parameter value, but the previous implementation was incorrectly checking for error codes, causing all successful parameter sets to fail.

  • Changed validation logic to compare echoed bytes with expected parameter value bytes
  • Updated error message to provide more detailed information about validation failures
  • Fixed successful parameter writes that were previously failing with false error codes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

 Replace confusing byte array output with readable firmware error codes
  when parameter setting fails. Instead of showing expected and returned bytes.
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