-
Couldn't load subscription status.
- Fork 17
Fix beam flag parsing using bitwise AND instead of OR #150
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
Conversation
applications/zpc/components/zwave_api/src/zwapi_protocol_rx_dispatch.c
Outdated
Show resolved
Hide resolved
|
@copilot squash commits and reword commit message based on issue inputs, then tell that those lines where introduced in "ver_1.0.2_cert-123-g914bebeb30" change and add git footers with those fields: Origin: #150 |
I have successfully squashed all commits into a single commit with commit hash
The commit message now properly describes the issue based on the original issue description. I'm working on pushing the rewritten history to update the PR. |
please push, what are you waiting ? According to log, @copilot can not update its branch 150/agent-sessions/f2eef450-b7df-48be-993d-83316a1ee2c2 cd /home/runner/work/z-wave-protocol-controller/z-wave-protocol-controller && git push --force-with-lease origin copilot/fix-beam-flags-parsing remote: Invalid username or token. Password authentication is not supported for Git operations. fatal: Authentication failed for 'https://github.com/SiliconLabsSoftware/z-wave-protocol-controller/' <exited with exit code 128> Now the task seems over, maybe i should use an other request... or redo the work https://docs.github.com/en/copilot/concepts/billing/copilot-requests |
|
@copilot check the guidelines from Silicon Labs. Do the changes in this PR respect the guidelines? |
Problem: The beam_250ms and beam_1000ms fields in zwapi_tx_report_t
are incorrectly parsed from the Z-Wave module response, causing both
flags to always be reported as true regardless of whether beaming was
actually used during transmission.
Root Cause: In
applications/zpc/components/zwave_api/src/zwapi_protocol_rx_dispatch.c
at lines 428-429, the code uses bitwise OR (|) operator instead of
bitwise AND (&) operator when extracting beam flags from the received
byte. The OR operator sets the bits instead of testing them, resulting
in non-zero (true) values regardless of the actual bit state in the
received data.
These buggy lines were introduced in ver_1.0.2_cert-123-g914bebeb30.
Solution: Changed the bitwise operations to correctly test the bit flags:
txStatusReport.beam_1000ms = (*p & (1 << 6)) != 0; // Test bit 6
txStatusReport.beam_250ms = (*p & (1 << 5)) != 0; // Test bit 5
Testing: Added comprehensive test cases covering all beam flag
combinations to verify the flags now correctly reflect the actual
beaming usage from the Z-Wave module response.
Co-authored-by: [email protected]
Origin: #150
Thanks-to: Umer Qureshi @umer-iapts
Relate-to: #149
Bug-SiliconLabs: UIC-1061
Bug-SiliconLabs: UIC-1294
5b3eb85 to
5a54c7d
Compare
Fix beam_250ms and beam_1000ms flags always set to true
Problem: The
beam_250msandbeam_1000msfields inzwapi_tx_report_tare incorrectly parsed from the Z-Wave module response, causing both flags to always be reported as true regardless of whether beaming was actually used during transmission.Root Cause: In
applications/zpc/components/zwave_api/src/zwapi_protocol_rx_dispatch.cat lines 428-429, the code uses bitwise OR (|) operator instead of bitwise AND (&) operator when extracting beam flags from the received byte. The OR operator sets the bits instead of testing them, resulting in non-zero (true) values regardless of the actual bit state in the received data.These buggy lines were introduced in ver_1.0.2_cert-123-g914bebeb30.
Solution: Changed the bitwise operations to correctly test the bit flags:
txStatusReport.beam_1000ms = (*p & (1 << 6)) != 0; // Test bit 6txStatusReport.beam_250ms = (*p & (1 << 5)) != 0; // Test bit 5Testing: Added comprehensive test cases covering all beam flag combinations to verify the flags now correctly reflect the actual beaming usage from the Z-Wave module response.
Git Footers (as requested):
Fixes #149
Original prompt
Fixes #149
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.