Skip to content

RX/TX diagnostics sync, stack pin update, and 4 correctness fixes - #8

Merged
sws-chipkin merged 5 commits into
mainfrom
sync-common-rx-tx-decode
Sep 18, 2026
Merged

sws-chipkin merged 5 commits into
mainfrom
sync-common-rx-tx-decode

Conversation

@sws-chipkin

Copy link
Copy Markdown
Collaborator

Summary

  • Synced common/ RX/TX object/property/DADR decode + off-by-default --xml dump from BACnetProfileExample-B-SS-CPP (common/ 2.7.0).
  • Updated the CAS BACnet Stack submodule pin to the latest 6.x (abd4cee1 -> 986c48a6); public C API header unchanged, rebuilt clean from source.
  • Fixed three findings from Reading the Device's Description aborts: DEVICE_DESCRIPTION is 286 chars, over the stack's 256-character limit #7 (BACnet Explorer discovery against a live instance):
    • Device.Description aborted the read (286 chars over the stack's 256-char buffer) - shortened and fixed the misleading truncation-guard comment. This was also the actual trigger behind ReadPropertyMultiple(ALL) aborting the whole Device read (chipkin/cas-bacnet-stack#2175) - verified RPM(ALL) now succeeds even before that stack-side fix lands.
    • Device.Local_Date/Local_Time read back read-access-denied despite this example claiming DM-TS-B/DM-UTC-B - now served with real wall-clock local time.
    • README.md/docs/PICS.md said Protocol_Revision 24; the running device reports 26 - docs-only correction.
  • Fixed Network Port Link_Speed reporting a hardcoded 0.0 instead of the real negotiated interface speed - new CASExampleHelper::GetLocalLinkSpeedBitsPerSecond() (common/ 2.9.0), verified live returning 1000000000.0 (1 Gbps) on this machine.
  • Version bumped to 1.0.1.

Test plan

  • Builds clean (cmake --build build --config Release), 0 errors.
  • Live smoke tests via crafted BACnet/IP packets against the rebuilt binary for every fix above (Description, Local_Date, Local_Time, Link_Speed, and a full RPM(ALL) on the Device object).
  • CI will run the example's own smoke test on push.

🤖 Generated with Claude Code

sws-chipkin and others added 5 commits September 17, 2026 14:52
…S-CPP

Ports the common/ 2.7.0 change verbatim (B-SS-CPP's originating commit has
the full rationale): RX/TX log lines now name the object/property being
requested and any NPDU routing destination, and a new --xml option (off by
default) prints every frame as a full indented XML block. main.cpp gains
the same one line (ParseXmlLogArg) as every other example that adopts
this - all decode/XML logic stays in common/.

Verified against a live rebuilt binary: a crafted ReadProperty decodes
correctly, and this example's own SCHED-E-B remote-discovery Who-Is
correctly showed 'DNET=65535' in its own real traffic, not just a crafted
test packet.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…-> 986c48a6)

Public C API header (source/CASBACnetStackDLL.h) is unchanged between these
two commits - no adapter/example code changes needed. Rebuilt from source
(the documented default build path; removed a stale prebuilt STATIC .lib
left over from earlier in this session so the build picked SOURCE mode
again, matching README.md's documented two-command build).

Verified: builds clean, 0 errors; smoke test confirms the device still
starts and answers correctly (Device 389005 "Rainbow" ready).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…_Revision docs

Three findings from #7 (BACnet Explorer
discovery against a live instance):

- DEVICE_DESCRIPTION was 286 chars, over the stack's 256-char buffer on a
  full build - contrary to the truncation guard's own comment claiming it
  fit with room to spare, the over-length read Aborted outright instead of
  truncating. Shortened to 214 chars, fixed the comment, made the guard
  warn loudly instead of clipping silently if this ever happens again. This
  was also the actual trigger behind ReadPropertyMultiple(ALL) aborting the
  whole Device read (chipkin/cas-bacnet-stack#2175) - verified live:
  RPM(ALL) on the Device object now returns a full 619-byte ComplexACK
  instead of an Abort, even before that stack-side fix lands.
- Device.Local_Date/Local_Time read back read-access-denied - undocumented
  as a defect (the stack deliberately never invents a default for either),
  but this example claims DM-TS-B/DM-UTC-B and never actually served them,
  which is exactly what a client reads to confirm a time sync took.
  GetPropertyDate/GetPropertyTime now answer both with real wall-clock
  local time. New PROPERTY_IDENTIFIER_LOCAL_DATE/_LOCAL_TIME constants in
  common/ (2.7.0 -> 2.8.0).
- README.md/docs/PICS.md said Protocol_Revision 24; the running device
  reports 26 (the stack computes this itself) - docs-only correction, plus
  refreshed the stale stack-commit/common-version banner.

Verified against a live rebuilt binary: Description, Local_Date and
Local_Time all now return ComplexACK (not Abort/Error), and a full
ReadPropertyMultiple(ALL) on the Device object succeeds end to end.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…_Time fixes

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…real speed

Nothing served Link_Speed (property 420), so the stack's 'no callback
answered' REAL-property fallback (a datatype zero-value) was silently
standing in as if 0.0 meant 'indeterminable' - it didn't, it meant
'unimplemented'.

New CASExampleHelper::GetLocalLinkSpeedBitsPerSecond() (common/ 2.8.0 ->
2.9.0): Windows reads it via GetIfEntry() keyed off the primary interface's
adapter index (same interface GetLocalIPv4 already selects); POSIX reads
/sys/class/net/<iface>/speed. Read once at start-up into
g_linkSpeedBitsPerSecond, same pattern as the IP addressing already cached
there. New PROPERTY_IDENTIFIER_LINK_SPEED = 420 constant.

Verified against a live rebuilt binary: Network Port 1's Link_Speed now
returns a ComplexACK with 1000000000.0 (1 Gbps) - this machine's actual
adapter speed - not 0.0.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sws-chipkin
sws-chipkin merged commit a13bf40 into main Sep 18, 2026
3 checks passed
@sws-chipkin
sws-chipkin deleted the sync-common-rx-tx-decode branch September 18, 2026 01:00
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