Commit 32c88ec
Fix beam_250ms and beam_1000ms flags always set to true
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-12941 parent 5575a08 commit 32c88ec
File tree
2 files changed
+62
-2
lines changed- applications/zpc/components/zwave_api
- src
- test
2 files changed
+62
-2
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
428 | | - | |
429 | | - | |
| 428 | + | |
| 429 | + | |
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| |||
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
0 commit comments