Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# interpreted, so `main.py` runs directly - `pip install` of anything beyond the standard
# library is NOT required (see README.md "Prerequisites"). The only compiled artifact is the
# CAS BACnet Stack shared library, built from the stack submodule's C++ source into the
# submodule's own bin/ folder with the stack's CMake, its only build (the windows-x64-dll
# preset on Windows, linux-x64-release-shared on Linux, then `cmake --install` into bin/ - see
# submodule's own dist/ folder with the stack's CMake, its only build (the windows-x64-dll
# preset on Windows, linux-x64-release-shared on Linux, then `cmake --install` into dist/ - see
# README.md "Build the CAS BACnet Stack library"), where main.py loads it with ctypes. main.py uses the stack's generated Python adapter in place from
# submodules/cas-bacnet-stack/adapters/python/.
#
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
if ($LASTEXITCODE -ne 0) { throw "windows-x64-dll build failed" }
cmake --install build-windows-x64-dll --config Release
if ($LASTEXITCODE -ne 0) { throw "windows-x64-dll install failed" }
Get-ChildItem bin\CASBACnetStack_x64_Release.dll
Get-ChildItem dist\CASBACnetStack_x64_Release.dll

- name: Build the CAS BACnet Stack library (Linux - CMake preset linux-x64-release-shared)
if: runner.os == 'Linux'
Expand All @@ -98,7 +98,7 @@ jobs:
cmake --preset linux-x64-release-shared
cmake --build --preset linux-x64-release-shared
cmake --install build-linux-x64-release-shared
ls -la bin/libCASBACnetStack_x64_Release.so
ls -la dist/libCASBACnetStack_x64_Release.so

- name: Smoke test + metrics (starts, binds, stays up; measures time to 'ready')
shell: bash
Expand All @@ -115,7 +115,7 @@ jobs:
if kill -0 "$PID" 2>/dev/null; then kill "$PID" 2>/dev/null || true; else echo "FAIL: device exited early"; cat smoke.log; exit 1; fi
[ -n "$ready_ms" ] || { echo "FAIL: no 'ready' line"; cat smoke.log; exit 1; }
cat smoke.log
lib="submodules/cas-bacnet-stack/bin/${{ matrix.nativelib }}"
lib="submodules/cas-bacnet-stack/dist/${{ matrix.nativelib }}"
bytes=$(stat -c %s "$lib" 2>/dev/null || wc -c < "$lib")
sha=$(sha256sum "$lib" | cut -c1-16)
stackver=$(grep -oE 'CAS BACnet Stack version: [0-9.]+' smoke.log | head -1 | grep -oE '[0-9.]+$' || true)
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ venv/
*.log

# The CAS BACnet Stack library is a BUILD ARTIFACT of the separately licensed stack, built
# from the submodule into submodules/cas-bacnet-stack/bin/ (README.md "Build the CAS BACnet
# from the submodule into submodules/cas-bacnet-stack/dist/ (README.md "Build the CAS BACnet
# Stack library"), and is never committed or released from this repository - whatever its
# name or platform.
*.dll
Expand Down
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ can learn from and copy-paste. Favour clarity over cleverness.
part of the licensed stack. If it is missing something, put the smallest
marked workaround in this repository's own code and report it as an
adapter defect.
- `bin/` - where the stack library is built (`CASBACnetStack_x64_Release.dll`
- `dist/` - where the stack library is installed (`CASBACnetStack_x64_Release.dll`
/ `libCASBACnetStack_x64_Release.so`) and where `main.py` loads it from.

The `PROFILE-TABLE` block in README.md is generated from the example-series
Expand All @@ -61,7 +61,7 @@ repository's `docs/profile-table.md`. Edit it there, not here.
## Build

No build step for Python. The stack library is built once from the submodule
into its `bin/` (README.md "Build the CAS BACnet Stack library"):
into its `dist/` (README.md "Build the CAS BACnet Stack library"):

```bash
git submodule update --init --recursive
Expand All @@ -74,7 +74,7 @@ python -m py_compile main.py common/*.py tests/*.py

CMake is the stack's only build: it no longer has `projects/msvs/` or
`projects/linux/` (removed before `6.x` @ `29b83de6`). `cmake --install` puts
the library in the submodule's `bin/`, where `main.py` loads it from. Always a
the library in the submodule's `dist/`, where `main.py` loads it from. Always a
customer-interface build, never the test-tool library.

**The stack binary is never committed and never released.** `.gitignore`
Expand Down Expand Up @@ -112,7 +112,7 @@ it).
`BACnetStack_RegisterCallbackSetProperty*` call.
- **Explicit library load**, like the C++ `LoadBACnetFunctions()`:
`main()`'s `load_cas_bacnet_stack()` looks in the run directory (the folder of
`main.py`), then `submodules/cas-bacnet-stack/bin/`, does `ctypes.CDLL` +
`main.py`), then `submodules/cas-bacnet-stack/dist/`, does `ctypes.CDLL` +
`bind()` before any `BACnetStack_*` call. Nothing imports or loads the stack
at module import time. Without it (or if `ctypes` cannot load it) the example
prints the series' missing-library message
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ and this project adheres to

## [Unreleased]

### Changed

- Updated to CAS BACnet Stack 6.x `83e04a2d` (6.1.2, 2026-12-02).
- The stack library is now found in the submodule's `dist/` folder, where 6.1.2's `cmake --install` puts it (it was `bin/`). The CI workflow, the run-time search and the build instructions all use `dist/`.

## [1.2.1] - 2026-11-02

Built on CAS BACnet Stack 6.x (`1e7dffe2b`).
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ This is a **self-contained** project. It ships:
call, generated by the stack's `_ci_scripts/generate-python-adapter.js`).
`main.py` puts that folder on `sys.path`; nothing of it is copied into this
repository.
- the **stack library** you build into its `bin/` folder (below).
- the **stack library** you build into its `dist/` folder (below).

## Prerequisites

Expand Down Expand Up @@ -217,15 +217,15 @@ What you do have to build, once, is the **CAS BACnet Stack library** that
`libCASBACnetStack_x64_Release.so` on Linux - in two places, in this order:

1. the **run directory**, the folder that holds `main.py`;
2. a development checkout's `submodules/cas-bacnet-stack/bin/`, where building
2. a development checkout's `submodules/cas-bacnet-stack/dist/`, where building
the stack puts it.

In a checkout, build it into the submodule's `bin/`. The stack has **one
In a checkout, build it into the submodule's `dist/`. The stack has **one
build, CMake** (`CMakeLists.txt` and `CMakePresets.json` in the submodule; its
README's "Building and testing" and AGENTS.md "Building" list the presets).
Each preset builds into `submodules/cas-bacnet-stack/build-<preset>/`, and
`cmake --install build-<preset>` copies the library into the submodule's
`bin/`, under exactly the name `main.py` loads. It is a customer-interface
`dist/`, under exactly the name `main.py` loads. It is a customer-interface
build (no test-tool exports). Run the commands from the submodule's folder,
because `cmake --preset` reads `CMakePresets.json` from the current directory.

Expand All @@ -237,7 +237,7 @@ Visual Studio 2022). PowerShell or a Developer Prompt:
cd submodules\cas-bacnet-stack
cmake --preset windows-x64-dll
cmake --build --preset windows-x64-dll-release
cmake --install build-windows-x64-dll --config Release # -> bin\CASBACnetStack_x64_Release.dll
cmake --install build-windows-x64-dll --config Release # -> dist\CASBACnetStack_x64_Release.dll
cd ..\..
```

Expand All @@ -250,11 +250,11 @@ static-library name and stays in the build tree; `main.py` does not need it.
cd submodules/cas-bacnet-stack
cmake --preset linux-x64-release-shared
cmake --build --preset linux-x64-release-shared
cmake --install build-linux-x64-release-shared # -> bin/libCASBACnetStack_x64_Release.so
cmake --install build-linux-x64-release-shared # -> dist/libCASBACnetStack_x64_Release.so
cd ../..
```

The stack's own `.gitignore` already ignores `build-*/` and `bin/`, so the
The stack's own `.gitignore` already ignores `build-*/` and `dist/`, so the
submodule stays clean.

(Before stack `6.x` @ `29b83de6` this README built the DLL with MSBuild from
Expand All @@ -278,7 +278,7 @@ ERROR: This example cannot run without the CAS BACnet Stack library.

Missing file: CASBACnetStack_x64_Release.dll
Looked in: C:\...\BACnetProfileExample-B-SS-Python
C:\...\BACnetProfileExample-B-SS-Python\submodules\cas-bacnet-stack\bin
C:\...\BACnetProfileExample-B-SS-Python\submodules\cas-bacnet-stack\dist

The CAS BACnet Stack is a commercially licensed (paid) library from Chipkin.
It is not included in this release, so the example cannot start without it.
Expand Down Expand Up @@ -417,7 +417,7 @@ Python talks to the stack through `ctypes`:
stack's own adapter from there. It is generated from the stack's C headers;
a fix to it belongs in the stack, never in a copy here.
- **An explicit load step, like C++.** `main.py` calls
`ctypes.CDLL(<run directory or submodule bin>/<libname>)` then `bind()`
`ctypes.CDLL(<run directory or submodule dist>/<libname>)` then `bind()`
itself, before any `BACnetStack_*` call - the C++ edition's
`LoadBACnetFunctions()`. A missing or unloadable library stops it there with
the missing-library message above, never a traceback.
Expand Down
2 changes: 1 addition & 1 deletion TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ defect, not a feature.

| Symptom | Cause / fix |
|---------|-------------|
| `ERROR: This example cannot run without the CAS BACnet Stack library.` and exit code 1, with `Missing file: CASBACnetStack_x64_Release.dll` (or `libCASBACnetStack_x64_Release.so`) | The stack library is in neither folder listed under `Looked in:` - the folder that holds `main.py`, then the checkout's `submodules/cas-bacnet-stack/bin/`. Build it (README.md [Build the CAS BACnet Stack library](README.md#build-the-cas-bacnet-stack-library)); a release never includes it. The same message appears if the file is there but cannot be loaded (wrong architecture, built for another OS, or from another stack commit than the adapter): rebuild it from the submodule as it is checked out now. |
| `ERROR: This example cannot run without the CAS BACnet Stack library.` and exit code 1, with `Missing file: CASBACnetStack_x64_Release.dll` (or `libCASBACnetStack_x64_Release.so`) | The stack library is in neither folder listed under `Looked in:` - the folder that holds `main.py`, then the checkout's `submodules/cas-bacnet-stack/dist/`. Build it (README.md [Build the CAS BACnet Stack library](README.md#build-the-cas-bacnet-stack-library)); a release never includes it. The same message appears if the file is there but cannot be loaded (wrong architecture, built for another OS, or from another stack commit than the adapter): rebuild it from the submodule as it is checked out now. |
| The same message with `Missing file: CASBACnetStackAdapterBindings.py` | The library was found but the stack's Python adapter was not: check out the submodule (`git submodule update --init --recursive`), or, running a release, put `CASBACnetStackAdapter.py` and `CASBACnetStackAdapterBindings.py` from the submodule's `adapters/python/` next to `main.py`. |
| `OSError` mentioning a mismatched architecture (`%1 is not a valid Win32 application`, or similar on Linux) | The native library's architecture does not match this Python interpreter's. This example expects an x64 build - make sure both your Python interpreter and the DLL/.so you built are x64. |
| App prints *"Failed to bind UDP port 47808"* | Another BACnet program is already using 47808. Stop it, or run with `--port <n>`. |
Expand Down
2 changes: 1 addition & 1 deletion common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import CASBACnetStackAdapterBindings as bacnet
from common.simple_udp import SimpleUDP
from common import cas_example_helper as helper

bacnet.bind(ctypes.CDLL(library_path)) # main.py: the run directory, then <submodule>/bin
bacnet.bind(ctypes.CDLL(library_path)) # main.py: the run directory, then <submodule>/dist
# (not found: helper.print_missing_stack_library(libname, folders); exit 1)
if helper.handle_help_and_version_args(sys.argv, APP_NAME, APP_VERSION):
sys.exit(0)
Expand Down
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# (nothing of it is copied into this repository), which means:
#
# - an EXPLICIT load step, like the C++ edition's LoadBACnetFunctions():
# `ctypes.CDLL(<run directory or submodule bin>/<libname>)` then
# `ctypes.CDLL(<run directory or submodule dist>/<libname>)` then
# `bind(library)`, both before any BACnetStack_* call (see "Load the CAS
# BACnet Stack" below). Without the library the example prints why and
# exits 1.
Expand Down Expand Up @@ -99,7 +99,7 @@
REPOSITORY = os.path.dirname(os.path.abspath(__file__))
CAS_BACNET_STACK = os.path.join(REPOSITORY, "submodules", "cas-bacnet-stack")
ADAPTER_DIRECTORIES = [REPOSITORY, os.path.join(CAS_BACNET_STACK, "adapters", "python")]
LIBRARY_DIRECTORIES = [REPOSITORY, os.path.join(CAS_BACNET_STACK, "bin")]
LIBRARY_DIRECTORIES = [REPOSITORY, os.path.join(CAS_BACNET_STACK, "dist")]
sys.path[:0] = [d for d in ADAPTER_DIRECTORIES if d not in sys.path]

# Show print() output immediately, even when stdout is redirected to a file or
Expand Down Expand Up @@ -629,7 +629,7 @@ def main(argv):
# Required before any other BACnetStack_* call, like the C++ edition's
# LoadBACnetFunctions(). The library is looked for in the run directory
# (the folder that holds main.py), then in a development checkout's
# submodules/cas-bacnet-stack/bin/, where building the stack puts it
# submodules/cas-bacnet-stack/dist/, where building the stack puts it
# (README.md "Build the CAS BACnet Stack library"). A release of this
# example does not include it: it is a separately licensed product.
missing = load_cas_bacnet_stack()
Expand Down
2 changes: 1 addition & 1 deletion submodules/cas-bacnet-stack
Loading