Commit a8539bd
fix: decode getEventInformation ack and allow optional object filter (#68)
## Summary
This PR consolidates event/alarm fixes in `getEventInformation`:
- decode ACK payload using the correct decoder path
- support optional `objectId` filter (`null` allowed)
- harden decode loop for tagged timestamps and closing-tag termination
## Problem
Event/alarm handling could fail or return incomplete data because:
- ACK payload decode path was incorrect
- calls without object filter were not supported
- decoder could break on valid tagged timestamp/closing-tag patterns
## Changes
- `src/lib/client.ts`
- updated `getEventInformation(...)` to accept optional `objectId`
- encode object-id context tag only when provided
- decode response with `GetEventInformation.decodeAcknowledge(...)`
- return `result.events`
- `src/lib/services/EventInformation.ts`
- hardened decoder iteration/termination for tagged timestamp structures
## Impact
- More robust `getEventInformation` behavior across BACnet devices
- Works with both filtered and unfiltered queries
- Improves reliability for event/alarm pipelines downstream
## Compatibility
Backward compatible. No public API break.
## Validation
Verified with real gateway flow:
- event/alarm fetch succeeds without object filter
- decoded events are returned consistently
- downstream event handling receives expected payload structure
---------
Co-authored-by: Daniel Lando <daniel.sorridi@gmail.com>1 parent 9fb90f1 commit a8539bd
3 files changed
Lines changed: 112 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
1776 | 1777 | | |
1777 | 1778 | | |
1778 | 1779 | | |
1779 | | - | |
| 1780 | + | |
1780 | 1781 | | |
1781 | 1782 | | |
1782 | 1783 | | |
| |||
1805 | 1806 | | |
1806 | 1807 | | |
1807 | 1808 | | |
1808 | | - | |
1809 | | - | |
1810 | | - | |
1811 | | - | |
1812 | | - | |
1813 | | - | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
1814 | 1817 | | |
1815 | 1818 | | |
1816 | | - | |
| 1819 | + | |
1817 | 1820 | | |
1818 | 1821 | | |
1819 | 1822 | | |
1820 | 1823 | | |
1821 | 1824 | | |
1822 | 1825 | | |
1823 | 1826 | | |
1824 | | - | |
| 1827 | + | |
1825 | 1828 | | |
1826 | 1829 | | |
1827 | 1830 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
54 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
116 | 108 | | |
117 | 109 | | |
118 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
39 | 119 | | |
0 commit comments