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
22 changes: 19 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ The git repository is hosted at the following site:
### Security

### Removed
* Removed BACnet basic objects and server framework into BACnet libraray
and removed zephyr version.
* Removed zephyr version of the BACnet basic objects and server framework
and placed them into BACnet Protocol Stack library.

### Fixed
* Fixed compile in BACnet/IP subsys using CONFIG_POSIX_API=y. (#47)
* Fixed missing const in bip6-init.c and used zsock API.
Replaced inet_ntoa with net_addr_ntop. Removed unnecessary select NET_SOCKETS_POSIX_NAMES. (#46)
* Fixed the BACnet light override clear shell command. (#44)
* Fixed our interface to Zephyr net manager API changes in v4.2.0. (#40)
* Fixed samples: subsys: nvs: stm32 overlays fixup.
Don't try to delete storage partitions that doesn't exist anymore. (#39)
* Fixed warning from using FD_ISSET instead of ZSOCK_FD_ISSET. (#37)
* Fixed readme for sample projects. Fixed JSON for bacnet objects
sub command in shell. (#31)
* Fixed network port object all datalink builds. (#26)
Expand All @@ -28,6 +36,8 @@ The git repository is hosted at the following site:
to avoid stack overflow.

### Changed
* Change the settings restore to load only BACnet settings by using
bacnet_storage_handler.name feature.
* Changed the number of sample board builds for twister to reduce minutes.
* Changed pipeline to use container ghcr.io/zephyrproject-rtos/ci:v0.26-branch
and build tests and samples using twister for Zephyr OS version 3.7 LTS
Expand All @@ -38,8 +48,14 @@ The git repository is hosted at the following site:
* Changed gitignore to ignore the build folder.

### Added
* Added BACnet Application Specific Control (B-ASC) sample. (#51)
* Added timer and audit-log objects to basic server. (#51)
* Added Model_Name config to the Kconfig for basic BACnet device. (#50)
* Added KERNEL_VERSION_MAJOR check in samples DTS overlay files to handle
changes in Zephyr OS version 4
changes in Zephyr OS version 4. (#48)
* Added shell command for lighting output overridden and tracking value. (#41)
* Added BACnet zephyr shell for device date, time, and lighting
output object. (#36)
* Added BACDL ZIGBEE and BSC datalink defines to Kconfig & CMakeLists.txt (#35)
* Added baclog, you-are, who-am-i, create-object, delete-object, write-group,
bramfs, bsramfs, and color-rgb modules to cmake. (#35)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ A device application demonstrating configuration of a
[BACnet Lighting Supervisor (B-LS) device profile](./zephyr/samples/profiles/b-ls/README.rst)
that can be used with any supported boards.

### Device Profile - BACnet Application Specific Controller (B-ASC)

A device application demonstrating configuration of a
[BACnet Application Specific Controller (B-ASC) device profile](./zephyr/samples/profiles/b-asc/README.rst)
that can be used with any supported boards.

# Coding Style and Guidelines

See Zephyr Project [Coding Guidelines](https://docs.zephyrproject.org/latest/contribute/coding_guidelines/index.html)
7 changes: 7 additions & 0 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ set(BACNETSTACK_SRCS
${BACNETSTACK_SRC}/bacnet/bacaddr.h
${BACNETSTACK_SRC}/bacnet/bacapp.c
${BACNETSTACK_SRC}/bacnet/bacapp.h
${BACNETSTACK_SRC}/bacnet/bacaudit.c
${BACNETSTACK_SRC}/bacnet/bacaudit.h
${BACNETSTACK_SRC}/bacnet/bacdcode.c
${BACNETSTACK_SRC}/bacnet/bacdcode.h
${BACNETSTACK_SRC}/bacnet/bacdef.h
Expand Down Expand Up @@ -190,6 +192,7 @@ set(BACNETSTACK_SRCS
${BACNETSTACK_SRC}/bacnet/basic/object/schedule.h
${BACNETSTACK_SRC}/bacnet/basic/object/structured_view.h
${BACNETSTACK_SRC}/bacnet/basic/object/time_value.h
${BACNETSTACK_SRC}/bacnet/basic/object/timer.h
${BACNETSTACK_SRC}/bacnet/basic/object/trendlog.h
${BACNETSTACK_SRC}/bacnet/basic/service/h_alarm_ack.h
${BACNETSTACK_SRC}/bacnet/basic/service/h_apdu.c
Expand Down Expand Up @@ -407,6 +410,8 @@ set(BACNETSTACK_SRCS
${BACNETSTACK_SRC}/bacnet/secure_connect.h
${BACNETSTACK_SRC}/bacnet/special_event.c
${BACNETSTACK_SRC}/bacnet/special_event.h
${BACNETSTACK_SRC}/bacnet/timer_value.c
${BACNETSTACK_SRC}/bacnet/timer_value.h
${BACNETSTACK_SRC}/bacnet/timestamp.c
${BACNETSTACK_SRC}/bacnet/timestamp.h
${BACNETSTACK_SRC}/bacnet/timesync.c
Expand Down Expand Up @@ -454,6 +459,7 @@ set(BACNETSTACK_BASIC_SRCS
$<$<BOOL:${CONFIG_BACNET_BASIC_OBJECT_ANALOG_INPUT}>:${BACNETSTACK_SRC}/bacnet/basic/object/ai.c>
$<$<BOOL:${CONFIG_BACNET_BASIC_OBJECT_ANALOG_OUTPUT}>:${BACNETSTACK_SRC}/bacnet/basic/object/ao.c>
$<$<BOOL:${CONFIG_BACNET_BASIC_OBJECT_ANALOG_VALUE}>:${BACNETSTACK_SRC}/bacnet/basic/object/av.c>
$<$<BOOL:${CONFIG_BACNET_BASIC_OBJECT_AUDIT_LOG}>:${BACNETSTACK_SRC}/bacnet/basic/object/auditlog.c>
$<$<BOOL:${CONFIG_BACNET_BASIC_OBJECT_FILE}>:${BACNETSTACK_SRC}/bacnet/basic/object/bacfile.c>
$<$<BOOL:${CONFIG_BACNET_BASIC_OBJECT_BINARY_INPUT}>:${BACNETSTACK_SRC}/bacnet/basic/object/bi.c>
$<$<BOOL:${CONFIG_BACNET_BASIC_OBJECT_BINARY_OUTPUT}>:${BACNETSTACK_SRC}/bacnet/basic/object/bo.c>
Expand Down Expand Up @@ -484,6 +490,7 @@ set(BACNETSTACK_BASIC_SRCS
$<$<BOOL:${CONFIG_BACNET_BASIC_OBJECT_SCHEDULE}>:${BACNETSTACK_SRC}/bacnet/basic/object/schedule.c>
$<$<BOOL:${CONFIG_BACNET_BASIC_OBJECT_STRUCTURED_VIEW}>:${BACNETSTACK_SRC}/bacnet/basic/object/structured_view.c>
$<$<BOOL:${CONFIG_BACNET_BASIC_OBJECT_TIME_VALUE}>:${BACNETSTACK_SRC}/bacnet/basic/object/time_value.c>
$<$<BOOL:${CONFIG_BACNET_BASIC_OBJECT_TIMER}>:${BACNETSTACK_SRC}/bacnet/basic/object/timer.c>
$<$<BOOL:${CONFIG_BACNET_BASIC_OBJECT_TRENDLOG}>:${BACNETSTACK_SRC}/bacnet/basic/object/trendlog.c>
${BACNETSTACK_SRC}/bacnet/basic/service/h_alarm_ack.c
${BACNETSTACK_SRC}/bacnet/basic/service/h_arf_a.c
Expand Down
12 changes: 12 additions & 0 deletions zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -655,12 +655,24 @@ config BACNET_BASIC_OBJECT_TIME_VALUE
help
Use the BACnet basic time value object

config BACNET_BASIC_OBJECT_TIMER
bool "Use the BACnet basic timer object"
default false
help
Use the BACnet basic timer

config BACNET_BASIC_OBJECT_TRENDLOG
bool "Use the BACnet basic trendlog object"
default false
help
Use the BACnet basic trendlog object

config BACNET_BASIC_OBJECT_AUDIT_LOG
bool "Use the BACnet basic audit log object"
default false
help
Use the BACnet basic audit log object

config BACNET_BASIC_DEVICE_OBJECT_VERSION
string "BACnet Device default Object Version string"
default "1.0.0"
Expand Down
13 changes: 13 additions & 0 deletions zephyr/samples/profiles/b-asc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# @brief CMake for BACnet basic sample
# @author Steve Karg <[email protected]>
# @date November 2025
# @copyright SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.13.1)

get_filename_component(MY_PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(${MY_PROJECT_NAME})

target_sources(app PRIVATE src/main.c)
101 changes: 101 additions & 0 deletions zephyr/samples/profiles/b-asc/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
.. _b-asc_sample:

BACnet Profile B-ASC Sample
###########################

Overview
********

This is a simple application demonstrating configuration of a
BACnet Application Specific Controller (B-ASC) device profile.

L.4.3 BACnet Application Specific Controller (B-ASC)
****************************************************

A B-ASC is a controller with limited resources relative to an
Advanced Application Controller (B-AAC).
A B-ASC is intended for use in a specific application
and supports limited programmability.

Data Sharing
************

* Ability to provide the values of any of its BACnet objects
* Ability to allow modification of some or all of its BACnet
objects by another device

Device and Network Management
*****************************

* Ability to respond to queries about its status
* Ability to respond to requests for information about any of its objects
* Ability to respond to communication control messages

Requirements
************

* A board with Ethernet support, for instance: nucleo_f429zi

Building and Running
********************

This sample can be found under :bacnet_file:`samples/profiles/b-asc` in
the BACnet tree.

The sample can be built for several platforms - use `west boards` to
list the supported boards.

Compile this sample for the `nucleo_f429zi` board:

west build -b nucleo_f429zi -p always bacnet/zephyr/samples/profiles/b-asc/

Compile this sample for the `rpi_pico` board:

west build -b rpi_pico -p always bacnet/zephyr/samples/profiles/b-asc/

Compile this sample for the `adafruit_grand_central_m4_express` board with

west build -b adafruit_grand_central_m4_express -p always bacnet/zephyr/samples/profiles/b-asc/

Using the Shell
***************

The shell is available on some boards via virtual communication port:

picocom --baud 115200 /dev/ttyACM0

Terminal ready
*** Booting Zephyr OS build v3.7.1 ***
uart:~$
bacnet clear device devmem help history kernel net
rem resize retval shell stats
uart:~$ bacnet object list
{"object-list": [
{"object-identifier":{"device":260127}},
{"object-identifier":{"analog-input":1}},
{"object-identifier":{"analog-output":1}},
{"object-identifier":{"analog-value":1}},
{"object-identifier":{"audit-log":1}},
{"object-identifier":{"binary-input":1}},
{"object-identifier":{"binary-output":1}},
{"object-identifier":{"binary-value":1}},
{"object-identifier":{"multi-state-input":1}},
{"object-identifier":{"multi-state-output":1}},
{"object-identifier":{"multi-state-value":1}},
{"object-identifier":{"network-port":1}},
{"object-identifier":{"calendar":1}},
{"object-identifier":{"integer-value":1}},
{"object-identifier":{"life-safety-point":1}},
{"object-identifier":{"load-control":1}},
{"object-identifier":{"lighting-output":1}},
{"object-identifier":{"channel":1}},
{"object-identifier":{"binary-lighting-output":1}},
{"object-identifier":{"color":1}},
{"object-identifier":{"color-temperature":1}},
{"object-identifier":{"file":1}},
{"object-identifier":{"structured-view":1}},
{"object-identifier":{"characterstring-value":1}},
{"object-identifier":{"time-value":1}},
{"object-identifier":{"timer":1}}],
"object-list-size": 26}
uart:~$
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2020 Google LLC.
* Copyright (c) 2024 Daikin Comfort Technologies North America, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

boot_partition: partition@0 {
label = "uf2";
reg = <0x00000000 DT_SIZE_K(16)>;
read-only;
};

code_partition: partition@4000 {
label = "code";
reg = <0x4000 DT_SIZE_K(512-16-16)>;
read-only;
};

/*
* The final 16 KiB is reserved for the application.
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@7c000 {
label = "storage";
reg = <0x7c000 DT_SIZE_K(16)>;
};
};
};
20 changes: 20 additions & 0 deletions zephyr/samples/profiles/b-asc/boards/nucleo_f429zi.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2022 STMicroelectronics
*
* SPDX-License-Identifier: Apache-2.0
*/
#if KERNEL_VERSION_MAJOR < 4
/delete-node/ &storage_partition;
#endif

&flash0 {
partitions {
/* Set 48KB of storage at the beginning of bank2 in order to have 3 sectors smaller than 32K
* (nvs.h: uint16_t sector_size)
*/
storage_partition: partition@100000 {
label = "storage";
reg = <0x000100000 DT_SIZE_K(48)>;
};
};
};
32 changes: 32 additions & 0 deletions zephyr/samples/profiles/b-asc/boards/rpi_pico.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2021 Yonatan Schachter
*
* SPDX-License-Identifier: Apache-2.0
*/

&flash0 {
reg = <0x10000000 DT_SIZE_M(2)>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

/* Reserved memory for the second stage bootloader */
second_stage_bootloader: partition@0 {
label = "second_stage_bootloader";
reg = <0x00000000 0x100>;
read-only;
};

slot0_partition: partition@100 {
label = "image-0";
reg = <0x100 (DT_SIZE_M(1) - 0xF000)>;
};

storage_partition: partition@1f9000 {
label = "storage";
reg = <0x1F9000 0x00007000>;
};
};
};
Loading