Skip to content

feat: implement the B-RTR (Router) profile example - #1

Merged
sws-chipkin merged 1 commit into
mainfrom
implement-rtr
Sep 15, 2026
Merged

sws-chipkin merged 1 commit into
mainfrom
implement-rtr

Conversation

@sws-chipkin

Copy link
Copy Markdown
Collaborator

Summary

Implements the B-RTR (Router) profile - the series' canonical example for F-ROUTER and F-MULTIPORT. Seeded from BACnetProfileExample-B-ASC-CPP minus DeviceCommunicationControl, per the profile card.

  • BIBBs: DS-RP-B, DS-WP-B, DM-DDB-A/B, DM-DOB-B, NM-RC-B (partial - see gaps below).
  • Two Network Port objects ("Vermilion" / network 1, "Vermilion 2" / network 2), using common/ 2.3.0's multi-port SetupUDP/SendIAm overloads.
  • Router configuration: AddRouterPort x2, AddRouterRoute (one demonstration route), SetRouterEnabled, SendIAmRouterToNetwork (bound to the new r key, common/ 2.4.0), SendWhoIsRouterToNetwork, SendNetworkNumberIs.
  • Pinned to CAS BACnet Stack 6.x @ abd4cee1 (6.0.21), STATIC link. Vendors common/ 2.5.0.

Known gaps (documented in TODO.md, filed upstream)

  1. DM-LM-B (AddListElement/RemoveListElement, services 8/9) not implemented. The customer-facing STATIC build does not compile in STACK_OPTION_DM_LM_LIST_MANIPULATION. chipkin/cas-bacnet-stack#2033
  2. Inter-network NPDU forwarding does not work. The pinned stack holds exactly one internal datalink instance per network type; two BACnet/IP router ports cannot both attribute inbound traffic, so nothing is actually forwarded between the two networks even though AddRouterPort/AddRouterRoute/SetRouterEnabled all succeed and Network_Number/Network_Number_Quality read back correctly. Root-caused to a scope gap in stack issue #304 (closed, but implemented for BACnet/SC only). chipkin/cas-bacnet-stack#2037
  3. Routing_Table cannot be read. Enabling it and reading it aborts the request - the stack has no UseCallbackGetList case for it outside a test-tool build. Not enabled in this example. chipkin/cas-bacnet-stack#2038

None of these are faked or worked around; the README's "Verify" section and a prominent notice at the top state plainly what does and does not work.

Verification

  • STATIC build (VS2022/v143 toolset), zero warnings/errors from main.cpp/common/.
  • Live-client wire verification (bacpypes3), against a running instance:
    • ReadProperty of the Device object (Object_Name = "Rainbow") directly on BOTH ports independently.
    • Network Port 1: Network_Number = 1, Network_Number_Quality = configured, Object_Name = "Vermilion".
    • Network Port 2: Network_Number = 2, Network_Number_Quality = configured, Object_Name = "Vermilion 2".
    • WriteProperty Analog Output 1 Present_Value = 25.5 @ priority 8, readback confirmed.
    • I-Am-Router-To-Network broadcast confirmed on both ports via the device's own TX log, at start-up and on the r key.
  • tools/check-series.sh BACnetProfileExample-B-RTR-CPP → SERIES CHECK PASSED.
  • Self-history grep: clean (no hits outside vendored common/'s pre-existing, already-reviewed comments).
  • docs/objects.json / generated "Objects and properties" README block: 0 ⚠ rows.

🤖 Generated with Claude Code

Seeded from BACnetProfileExample-B-ASC-CPP minus DeviceCommunicationControl,
per the profile card. Implements:

- DS-RP-B, DS-WP-B, DM-DDB-A/B, DM-DOB-B, NM-RC-B (partial - see below).
- Two Network Port objects ("Vermilion" / network 1, "Vermilion 2" /
  network 2), using common/ 2.3.0's multi-port SetupUDP/SendIAm overloads
  (F-MULTIPORT, series-canonical).
- Router configuration: AddRouterPort x2, AddRouterRoute (one demonstration
  route), SetRouterEnabled, SendIAmRouterToNetwork (bound to the new 'r' key,
  common/ 2.4.0), SendWhoIsRouterToNetwork, SendNetworkNumberIs (F-ROUTER,
  series-canonical).
- Pinned to CAS BACnet Stack 6.x @ abd4cee1 (6.0.21), STATIC link.
- Vendors common/ 2.5.0.

Known gaps, documented in TODO.md and filed upstream:
- DM-LM-B (AddListElement/RemoveListElement) not implemented: the customer
  STATIC build does not compile in STACK_OPTION_DM_LM_LIST_MANIPULATION.
  chipkin/cas-bacnet-stack#2033
- Inter-network NPDU forwarding does not work: the pinned stack holds one
  datalink instance per network type, so two BACnet/IP router ports cannot
  both attribute ingress traffic, even though AddRouterPort/AddRouterRoute/
  SetRouterEnabled all succeed. chipkin/cas-bacnet-stack#2037
- Routing_Table cannot be read (aborts outside a test-tool build); not
  enabled in this example. chipkin/cas-bacnet-stack#2038

Verified: STATIC build, zero warnings from main.cpp/common/; live-client
(bacpypes3) ReadProperty of the Device and both Network Port objects
directly on each port (Network_Number 1/2, Network_Number_Quality
configured, Object_Name correct); WriteProperty + readback on Analog
Output 1; I-Am-Router-To-Network transmission on both ports at start-up
and on the 'r' key. tools/check-series.sh: SERIES CHECK PASSED.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sws-chipkin
sws-chipkin merged commit 83debf7 into main Sep 15, 2026
3 checks passed
@sws-chipkin
sws-chipkin deleted the implement-rtr branch September 15, 2026 17:44
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