Commit cb1fb54
authored
fix(segmentation): correctly reassemble segmented ComplexACK responses (#71)
## Summary
This PR fixes segmented response handling for BACnet `ComplexACK`
messages.
## Problem
Some devices return segmented `ComplexACK` responses (e.g. large
object/property payloads).
The client could enter an invalid APDU state during reassembly,
resulting in abort/error behavior and missing response payload.
## Root Cause
Segment flags/state were not handled consistently across segmented
frames and final reassembled APDU processing.
## Changes
- Correct segmented `ComplexACK` reassembly flow.
- Clear segmented state/flags after full APDU is reassembled.
- Ensure final payload is passed once through normal decode path after
reassembly.
## Impact
- Stabilizes reads from devices that require segmentation.
- Prevents invalid state transitions/abort loops in segmented exchanges.
- Improves compatibility with larger BACnet payloads.
## Validation
- Verified against real-device traffic with segmented `ComplexACK`.
- Confirmed reassembled response is decoded successfully.
- Confirmed no regression for non-segmented responses.
## Compatibility
Backward compatible.
No API changes.1 parent 9fbac5d commit cb1fb54
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
| 364 | + | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| |||
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
592 | | - | |
| 592 | + | |
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
| |||
0 commit comments