Skip to content

test: ASHRAE 135 Annex F golden-vector encode tests (+ 3 encoder fixes)#170

Merged
gralin merged 2 commits into
v4from
v4-ashrae-tests
Jul 2, 2026
Merged

test: ASHRAE 135 Annex F golden-vector encode tests (+ 3 encoder fixes)#170
gralin merged 2 commits into
v4from
v4-ashrae-tests

Conversation

@gralin

@gralin gralin commented Jul 2, 2026

Copy link
Copy Markdown
Member

Adds ASHRAE 135 Annex F "Examples of APDU Encoding" golden-vector encode tests, harvested from #25 (@DarkStarDS9) and adapted to the v4 API. Covers 57 of #25's 62 vectors (92%) across all four Annex F sections — F.1 alarm/event, F.2 file access, F.3 object access, F.4 remote-device management (requests, complex-acks, simple-acks). 115 tests, all green.

The golden vectors also surfaced and fixed three real encoder bugs (first commit):

  • encode_bacnet_time now emits the BACnet wildcard FF FF FF FF for unspecified times (was 00:00:00).
  • EncodePrivateTransferAcknowledge no longer NREs on null data / emits a spurious [2] block.
  • EncodeLogRecord now context-tags the record status (matching v4's own decoder + the spec; encode/decode were inconsistent).

The remaining 5 vectors are blocked by v4's missing request encoders/types (EncodeCreateObject, EncodeDeleteObject, BacnetObjectPropertyReference) — tracked in #169, to land with the Phase 12 harvest.

2 commits (fix + test), co-authored with @DarkStarDS9.

gralin and others added 2 commits July 2, 2026 13:07
ASN1.encode_bacnet_time now emits the wildcard FF FF FF FF for an unspecified time (default DateTime), matching encode_bacnet_date; it previously wrote 00:00:00.00. EncodePrivateTransferAcknowledge no longer NREs on null data and omits the optional [2] result block when there is none. EncodeLogRecord now writes the record status as a context-tagged BACnetStatusFlags bitstring (matching the decode side and ASHRAE F.3.8) instead of a constructed application bitstring. All three fixes mirror #25.

Co-Authored-By: Rainer Perl <rainer.perl@sprytech.com>
Harvest the ASHRAE Annex F 'Examples of APDU Encoding' vectors from #25, adapted to the v4 API / xUnit, covering all four sections (F.1 alarm/event, F.2 file access, F.3 object access, F.4 remote device management) - requests, complex-acks and simple-acks. The F.1 alarm/event examples use the flat BacnetEventNotificationData rather than #25's refactored event model. Only the examples needing v4's missing request encoders (CreateObject/DeleteObject, AddListElement's BacnetObjectPropertyReference) are left out.

Co-Authored-By: Rainer Perl <rainer.perl@sprytech.com>
@gralin gralin merged commit 0e5335c into v4 Jul 2, 2026
@gralin gralin deleted the v4-ashrae-tests branch July 2, 2026 11:12
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