Skip to content
Merged
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
20 changes: 19 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,26 @@ jobs:
- uses: actions/download-artifact@v4
with:
path: artifacts
# Every platform artifact carries the same docs (README.md, LICENSE, ...).
# Uploading two assets with one name makes the release action fail part-way
# and leaves a draft release behind (a real tagged release hit this). Flatten the
# artifacts into one folder with a single copy of each file name, and stop
# if two files share a name but differ.
- name: Collect release assets (one copy of each file name)
shell: bash
run: |
mkdir -p release
find artifacts -type f | sort | while read -r f; do
name=$(basename "$f")
if [ -e "release/$name" ]; then
cmp -s "$f" "release/$name" || { echo "FAIL: two different files are both named $name ($f)"; exit 1; }
else
cp "$f" "release/$name"
fi
done
ls -l release
- uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
generate_release_notes: true
files: artifacts/**/*
files: release/*
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Interactive keys while running: `h` help, `q` quit, up/down nudge Analog Input 1

## Conventions

- Device is named "Rainbow"; objects use the series' colour names; vendor id 389.
- Device is named "Chipkin Example B-ASC"; objects use the series' colour names; vendor id 389.
- Implement **only** the services and objects the B-ASC profile requires - but
expose **every required property** of each object for Protocol_Revision 24.
- Outputs are **commandable**: store the 16-slot `Priority_Array` +
Expand Down
38 changes: 37 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,43 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [1.2.2] - unreleased

### Changed

- **Device renamed from the series' colour placeholder "Rainbow" to "Chipkin
Example B-ASC"** so devices from different examples in the series are
distinguishable from each other on the same BACnet network - every example
previously announced the identical Object_Name "Rainbow", which made two
examples on one subnet indistinguishable by name. Sub-object names (Analog
Input 1 "Bronze", etc.) are unchanged - only the Device object's name
changed. `docs/colour-table.md` (series root) updated to match. APP_VERSION
bumped 1.2.1 -> 1.2.2.

## [1.2.1] - unreleased

### Fixed

- **`Application_Software_Version` (12) and `Firmware_Revision` (44) were
hardcoded and stale** - both properties were served from `static const
char*` constants (`APPLICATION_SOFTWARE_VERSION` / `FIRMWARE_REVISION`)
literally set to `"1.0.0"` in the `CHANGE ALL OF THIS BEFORE YOU SHIP`
block, unrelated to `APP_VERSION` ("1.2.1") or the linked CAS BACnet Stack
(6.0.21.0) and never updated across releases. Fixed: `Application_Software_
Version` now reads `APP_VERSION` directly (one source of truth, can't drift
from `--version`'s own banner again) and the separate stale constant is
gone. `Firmware_Revision` is now built at runtime from the CAS BACnet
Stack's own `BACnetStack_GetAPIMajorVersion()`/`GetAPIMinorVersion()`/
`GetAPIPatchVersion()`/`GetAPIBuildVersion()` (the same 4 calls
`common/CASExampleHelper.cpp`'s `PrintVersion()` already uses for the
startup banner) into `static std::string g_firmwareRevision`, populated
once right after `LoadBACnetFunctions()` succeeds in `main()` (these
getters need the stack loaded first). Verified with a clean SOURCE-mode
Release build and `--version`, which reports `CAS BACnet Stack version:
6.0.21.0` via the same 4 getters `g_firmwareRevision` now uses - a live
ReadProperty against the running device was attempted with `bacpypes3`
but did not get a response in a reasonable time, so this fix is verified
by build + code review rather than an on-the-wire read.

### Changed — documentation restructure, SOURCE link

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Set it to your device's secret to require one; a mismatch is rejected with
## The device this example creates

```
Device 389003 "Rainbow" (Vendor 389 - Chipkin Automation Systems)
Device 389003 "Chipkin Example B-ASC" (Vendor 389 - Chipkin Automation Systems)
│
├── Analog Input 1 "Bronze" Present_Value 21.5 (REAL, degrees Celsius; read-only)
├── Binary Input 1 "Emerald" Present_Value inactive (0 = inactive / 1 = active; read-only)
Expand All @@ -94,7 +94,7 @@ Device 389003 "Rainbow" (Vendor 389 - Chipkin Automation Systems)
The three **input** objects (Bronze, Emerald, Hot Pink) are the shared minimum
every example in this series carries; the three **output** objects (Chartreuse,
Fuchsia, Indigo) are commandable via a `Priority_Array`. Object names follow this
series' colour-naming convention (Device is always "Rainbow").
series' colour-naming convention (Device is always "Chipkin Example B-ASC").

## What this example supports

Expand Down Expand Up @@ -129,7 +129,7 @@ claims exactly one profile.

| Object type | Instance | Name | Access |
|-------------|:--------:|------|--------|
| Device | 389003 | Rainbow | - |
| Device | 389003 | Chipkin Example B-ASC | - |
| Analog Input | 1 | Bronze | read-only |
| Binary Input | 1 | Emerald | read-only |
| Multi-State Input | 1 | Hot Pink | read-only |
Expand Down Expand Up @@ -228,7 +228,7 @@ CAS BACnet Stack version: 6.0.21.0
Common helper (common/) version: 2.5.0
FYI: Listening for BACnet/IP on UDP port 47808 (Network Port 1).
TX 21 bytes to 192.168.3.255:47808 (broadcast) (Network Port 1)
FYI: Device 389003 ("Rainbow") ready. Vendor ID 389. Press 'h' for help.
FYI: Device 389003 ("Chipkin Example B-ASC") ready. Vendor ID 389. Press 'h' for help.
```

The `TX` line is the start-up I-Am the device broadcasts to announce itself. It
Expand Down Expand Up @@ -279,10 +279,10 @@ Use a BACnet client such as the
1. **Discover** - send a **Who-Is**. The device replies with **I-Am** from
instance **389003** (vendor **389**). It also broadcasts an I-Am at start-up.
2. **Browse the object model** - the device shows eight objects: the Device
(`Rainbow`), three inputs, three outputs, and the Network Port
(`Chipkin Example B-ASC`), three inputs, three outputs, and the Network Port
(`Vermilion`). Reading the Device's `Object_List` returns all eight.
3. **Read the Device** - ReadProperty `389003` -> `Object_Name` returns
`"Rainbow"`; `Protocol_Revision` returns `24`; `Description` returns the
`"Chipkin Example B-ASC"`; `Protocol_Revision` returns `24`; `Description` returns the
profile description string.
4. **Read a sensor** - ReadProperty Analog Input `1` -> `Present_Value` returns
`21.5`; `Units` returns `degrees-Celsius`. Repeat for Binary Input `1`
Expand Down
3 changes: 3 additions & 0 deletions common/CASBACnetStackExampleConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,16 @@ static const uint32_t PROPERTY_IDENTIFIER_APPLICATION_SOFTWARE_VERSION = 12;
static const uint32_t PROPERTY_IDENTIFIER_APDU_LENGTH = 399;
static const uint32_t PROPERTY_IDENTIFIER_DESCRIPTION = 28;
static const uint32_t PROPERTY_IDENTIFIER_FIRMWARE_REVISION = 44;
static const uint32_t PROPERTY_IDENTIFIER_LOCAL_DATE = 56;
static const uint32_t PROPERTY_IDENTIFIER_LOCAL_TIME = 57;
static const uint32_t PROPERTY_IDENTIFIER_LOCATION = 58;
static const uint32_t PROPERTY_IDENTIFIER_MODEL_NAME = 70;
static const uint32_t PROPERTY_IDENTIFIER_IP_ADDRESS = 400;
static const uint32_t PROPERTY_IDENTIFIER_IP_DEFAULT_GATEWAY = 401;
static const uint32_t PROPERTY_IDENTIFIER_BACNET_IP_MODE = 408;
static const uint32_t PROPERTY_IDENTIFIER_IP_SUBNET_MASK = 411;
static const uint32_t PROPERTY_IDENTIFIER_BACNET_IP_UDP_PORT = 412;
static const uint32_t PROPERTY_IDENTIFIER_LINK_SPEED = 420;
static const uint32_t PROPERTY_IDENTIFIER_MAC_ADDRESS = 423;
static const uint32_t PROPERTY_IDENTIFIER_NUMBER_OF_STATES = 74;
static const uint32_t PROPERTY_IDENTIFIER_OBJECT_IDENTIFIER = 75;
Expand Down
Loading
Loading