Skip to content

Release 1.3.0: four data links (BACnet/IP, BACnet/IPv6, MS/TP, BACnet/SC) - #22

Merged
sws-chipkin merged 10 commits into
mainfrom
ipv6
Oct 28, 2026
Merged

sws-chipkin merged 10 commits into
mainfrom
ipv6

Conversation

@sws-chipkin

Copy link
Copy Markdown
Collaborator

Release 1.3.0: one executable that runs on any one of four BACnet data links, chosen at start-up with --datalink ipv4|ipv6|mstp|sc, built on CAS BACnet Stack 6.x @ d9f39406 (6.0.23). It merges main (release 1.2.0) into the ipv6 branch; the merge commit resolves the conflicts (--deviceName now lives in command_line.cpp, and the version is 1.3.0 everywhere).

What changed

  • --datalink with each data link's own options; one Network Port object per data link (1 BACnet/IP, 2 BACnet/IPv6, 3 MS/TP, 4 BACnet/SC).
  • BACnet/IPv6, MS/TP on a USB-to-RS-485 adapter (the stack runs the MS/TP state machines), and a BACnet/SC node that follows the B-SCHUB example's CARI certificate flow.
  • The code review in Code review of the four-data-link build (ipv6 branch) #21 (fixed in fb079ed).
  • Linux build fixes found while retesting: Ubuntu's LibwebsocketsConfig.cmake file name, and LWS_PROTOCOL_LIST_TERM, which libwebsockets 4.0 lacks.
  • CHANGELOG.md 1.3.0 is written for readers outside Chipkin, and TODO.md records what was checked and how.

Verified (2026-10-28, at d9f39406)

Check Windows 11 Linux (Ubuntu 22.04, WSL2)
Wire Tests (tests/run_wire_tests.py) all 10 pass all pass
tests/ipv6_probe.py 14/14 14/14
MS/TP through a router (COM3, MAC 12, 38400) 6 reads OK not run (no adapter in WSL)
BACnet/SC against the B-SCHUB hub: enrolment, then Who-Is and reads through the hub 10/10, twice 10/10

Issues #15, #16 and #18 no longer reproduce at this pin: there are no UUID or date/time log lines, and every property reads.

Not covered

macOS; MS/TP at baud rates other than 38400; the BACnet/SC failover hub and the certificate procedures over BACnet (listed in TODO.md).

Closes #21, #15, #16, #18.

🤖 Generated with Claude Code

sws-chipkin and others added 10 commits October 28, 2026 00:43
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Moves the CAS BACnet Stack to b79d4b5bb (issues/runbook): BACnet/IPv6
VMAC resolution, the IPv6 Network Port object (network type 9) and its
activation properties (#4610, #4611, #4406).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BACnetExampleBBC --datalink ipv4|ipv6|mstp|sc picks the data link at
run time; ipv4 is the default and the same device as 1.1.0. Each data
link has its own Network Port (1 Vermilion, 2 Cerulean, 3 Amber,
4 Teal) and only the active one is added.

- command_line.cpp: every option checked, wrong-link options and
  unknown options reported with a pointer to --help.
- ipv6: BBC_IPV6 and its options header are gone. Network Port 2 serves
  IPv6_Address, prefix, gateway, DNS server and Link_Speed from the
  host; the stack serves the VMAC. No start-up I-Am/Who-Is on IPv6: the
  stack cannot send an application broadcast there (TODO.md).
- mstp: common/SimpleSerial plus mstp/MstpDataLink on the stack's
  byte-mode callbacks, LoopMSTP every 1 ms (timeBeginPeriod(1)).
  Network Port 3 serves MAC, Max_Master, Max_Info_Frames, Link_Speed;
  announcements wait for the token ring; counters on ring changes.
- sc: optional (BBC_SC, on when vcpkg/system libwebsockets, OpenSSL and
  zlib are found). sc/ScHubConnector (one TLS context, 1600-octet
  ingress ceiling, no stack calls from lws callbacks) and sc/ScNode
  (Network Port 4, Files 2-5, the B-SCHUB CARI flow, --import-cari).
  tools/sign_cari_request.py signs a request with a test CA.
- ReinitializeDevice ACTIVATE_CHANGES and a Network Port Command
  callback.

Verified on Windows 11:
- ipv4: tests/run_wire_tests.py, ALL WIRE TESTS PASSED.
- ipv6: tests/ipv6_probe.py --multicast, 14/14; DNS, prefix, gateway,
  multicast address read by hand.
- sc: B-SCHUB hub on 127.0.0.1:4443, CARI request -> signed ->
  imported -> connected; SC_Primary_Hub_Connection_Status read
  connected through the hub.
- mstp: CP210x RS-485 adapter on a live 38400-baud segment, MAC 12;
  joined the ring (1917 frames sent, 0 dropped in a minute); I-Am and
  ReadProperty through an MS/TP to BACnet/IP router (SNET 5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- README: four data links, the options table, "Building with
  BACnet/SC", a "Data links" section; build-ipv6 instructions removed.
- TUTORIAL: "Running on another data link", the BACnet/SC rules.
- ipv6/README: --datalink ipv6 instead of a separate build.
- docs/objects.json: Network Ports 2-4 and the SC certificate Files
  2-5; docs/PICS.md generated block regenerated (against the
  property-profile-reference.md at 64b2cfac5, which is no longer in
  the stack checkout at b79d4b5bb - see TODO.md) and its prose updated.
- TODO.md: the 1.2.0 stack gaps (no application broadcast on
  BACnet/IPv6, no ACK hook for MS/TP / SC reads), how each data link
  was checked, and what was not.
- CHANGELOG 1.2.0; common/CHANGELOG [Unreleased] (SimpleUDP6,
  SimpleSerial; COMMON_VERSION not bumped).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cas-bacnet-stack #4636 (merged into issues/runbook): on a BACnet/IPv6
port, BACnetStack_SendIAm / SendWhoIs with broadcast=true and an
18-octet connection string go out as an Original-Broadcast-NPDU, handed
to the host with broadcast=true and no connection string. Also adds
IPv6 BBMD / foreign-device support (Network Port properties).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the stack at 632165847 (#4636) the IPv6 data link turns a
SendIAm / SendWhoIs with broadcast=true and an 18-octet connection
string into an Original-Broadcast-NPDU, handed to the send callback
with broadcast=true and no connection string. --datalink ipv6 now
passes [FF02::BAC0]:<port> and announces itself like the other data
links; SendToUdp6 already multicasts such a frame. The FYI and the
stack gap in TODO.md are gone (moved to "Resolved during 1.2.0").

Verified on Windows 11 at 632165847:
- tshark on Ethernet: I-Am 82 02 0018 05ef8d 0100 1000 c4 0205ef8d
  ... and Who-Is 82 02 000b 05ef8d 0100 1008, both from fe80::..8f1
  to [ff02::bac0]:47808.
- tests/ipv6_probe.py --multicast 14/14; run_wire_tests.py (ipv4)
  ALL WIRE TESTS PASSED; sc against the B-SCHUB hub still connected
  (SC_Primary_Hub_Connection_Status 1); mstp on COM3 joined the ring
  and answered Who-Is / ReadProperty through the MS/TP router.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Core:
- Network Port activation: accept every value the stack accepted at the
  write. The stack applies pending writes after CallbackReinitializeDevice
  has accepted (and armed a WARMSTART), so refusing Max_Master below
  --mstp-mac, or a pending Network_Number, answered Error while the device
  restarted anyway. Max_Master below the MAC is accepted with a warning.
- IPv6 address (Windows): skip no-multicast adapters, temporary and
  non-preferred addresses; Link_Speed from the chosen adapter. POSIX: a
  comment.
- --mstp-baud 76800 refused at parse time where termios has no B76800.
- POSIX serial: poll instead of spinning on EAGAIN; report a read error
  such as EIO once.
- --sc-hub limited to 255 characters; ParseNumber refuses leading space.

BACnet/SC:
- Start-up warning while DCC_PASSWORD is empty.
- --import-cari: every issuer must be a CA; print each CA's SHA-256.
- ScHubConnector::Connect: close a still-alive earlier attempt and ignore
  events from any socket but the current attempt's (no shared pwsi).
- Check BIO_new and PEM write results (cert_store.cpp, cert_tool.cpp).
- sign_cari_request.py: no keyEncipherment for EC keys; note that the demo
  CA signs whatever names the request asks for.
- Comment: --import-cari overwrites the files in place.

Docs: PICS, ipv6/README.md, objects.json and README on IPv6 BBMD/FD
(writable through Network Port 2, but no destination address is passed,
so a BBMD would not pass its peers' broadcasts on); the generated PICS
table now lists Network Port 3's writable Max_Master / Max_Info_Frames.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ipv6 branch was cut before the 1.2.0 release commit and called its
own work 1.2.0 too. Conflicts resolved:
- main.cpp: the ipv6 branch's command_line.cpp parser stays; 1.2.0's
  --deviceName is read with CASExampleHelper::ParseDeviceNameArg as
  before (a bad name warns and keeps the default), and command_line.cpp
  accepts it and lists it in --help. The ready line and the BACnet/SC
  certificate use the configured name. The DCC_PASSWORD warning stays.
- PICS: File 2-5 (BACnet/SC) and 1.2.0's writable Trend Log properties
  and BUFFER_READY both kept.
- common/CHANGELOG: the unreleased SimpleUDP6 / SimpleSerial entries
  above 3.5.0.
- README, TODO, CHANGELOG: both sides kept; rewritten for 1.3.0 later.
APP_VERSION, the PICS and vcpkg.json say 1.3.0.

Built on Windows (MSVC, NMake, BBC_SC=ON).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Stack submodule at 6.x d9f394061 (the promotion that carries
  BACnet/IPv6, its client broadcasts and the MS/TP engine).
- Linux: find Ubuntu's LibwebsocketsConfig.cmake, and define
  LWS_PROTOCOL_LIST_TERM for libwebsockets 4.0 (Ubuntu 22.04).
- tools/sign_cari_request.py: needs cryptography 42 or later.
- CHANGELOG 1.3.0 rewritten for readers outside Chipkin; README
  version line; TODO records the Windows and Linux results at this
  pin (Wire Tests, IPv6 probe, MS/TP, BACnet/SC 10/10 on both).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Code review of the four-data-link build (ipv6 branch)

1 participant