Skip to content

Commit bcbd54e

Browse files
Feature/bacnet zigbee link layer handler (#70)
* Added the BZLL files to build when datalink Zigbee is selected * Added configurable BZLL timing parameters time-to-live and interval-to-scan.
1 parent 6f6d08d commit bcbd54e

6 files changed

Lines changed: 34 additions & 2 deletions

File tree

zephyr/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,13 @@ set(BACNETSTACK_BASIC_SRCS
451451
$<$<BOOL:${CONFIG_BACDL_BIP6}>:${BACNETSTACK_SRC}/bacnet/basic/bbmd6/h_bbmd6.c>
452452
$<$<BOOL:${CONFIG_BACDL_BIP6}>:${BACNETSTACK_SRC}/bacnet/basic/bbmd6/vmac.c>
453453
$<$<BOOL:${CONFIG_BACDL_ZIGBEE}>:${BACNETSTACK_SRC}/bacnet/basic/bzll/bzllvmac.c>
454+
$<$<BOOL:${CONFIG_BACDL_ZIGBEE}>:${BACNETSTACK_SRC}/bacnet/basic/bzll/h_bzll.c>
454455
$<$<BOOL:${CONFIG_BACNET_BASIC_SERVER}>:${BACNETSTACK_SRC}/bacnet/basic/server/bacnet_basic.c>
455456
$<$<BOOL:${CONFIG_BACNET_BASIC_SERVER}>:${BACNETSTACK_SRC}/bacnet/basic/server/bacnet_device.c>
456457
$<$<BOOL:${CONFIG_BACNET_BASIC_SERVER}>:${BACNETSTACK_SRC}/bacnet/basic/server/bacnet_port.c>
457458
$<$<BOOL:${CONFIG_BACNET_BASIC_SERVER}>:${BACNETSTACK_SRC}/bacnet/basic/server/bacnet_port_ipv4.c>
458459
$<$<BOOL:${CONFIG_BACNET_BASIC_SERVER}>:${BACNETSTACK_SRC}/bacnet/basic/server/bacnet_port_ipv4.c>
460+
$<$<BOOL:${CONFIG_BACNET_BASIC_SERVER}>:${BACNETSTACK_SRC}/bacnet/basic/server/bacnet_port_bzll.c>
459461
$<$<BOOL:${CONFIG_BACNET_BASIC_OBJECTS_ACCESS}>:${BACNETSTACK_SRC}/bacnet/basic/object/access_credential.c>
460462
$<$<BOOL:${CONFIG_BACNET_BASIC_OBJECTS_ACCESS}>:${BACNETSTACK_SRC}/bacnet/basic/object/access_door.c>
461463
$<$<BOOL:${CONFIG_BACNET_BASIC_OBJECTS_ACCESS}>:${BACNETSTACK_SRC}/bacnet/basic/object/access_point.c>
@@ -587,6 +589,8 @@ zephyr_compile_definitions(
587589
BACNET_VENDOR_NAME="${CONFIG_BACNET_VENDOR_NAME}"
588590
BACNET_PROTOCOL_REVISION=${CONFIG_BACNET_PROTOCOL_REVISION}
589591
BACNET_STACK_DEPRECATED_DISABLE=1
592+
$<$<BOOL:${CONFIG_BZLL_NODE_TIME_TO_LIVE_S}>:BZLL_NODE_TIME_TO_LIVE_S=${CONFIG_BZLL_NODE_TIME_TO_LIVE_S}>
593+
$<$<BOOL:${CONFIG_BZLL_SCAN_NODES_INTERVAL_S}>:BZLL_SCAN_NODES_INTERVAL_S=${CONFIG_BZLL_SCAN_NODES_INTERVAL_S}>
590594
# datalink API
591595
$<$<BOOL:${CONFIG_BACDL_NONE}>:BACDL_NONE>
592596
$<$<BOOL:${CONFIG_BACDL_ALL}>:BACAPP_ALL>

zephyr/subsys/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
comment "BACnet Subsystems"
66

7+
rsource "bacnet_datalink/Kconfig"
78
rsource "bacnet_settings/Kconfig"
89
rsource "bacnet_shell/Kconfig"
910
rsource "object/Kconfig"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Kconfig - Subsystem configuration options
2+
#
3+
# @author Luiz Santana <luiz.santana@dsr-corporation.com>
4+
# @date May 2026
5+
# @copyright SPDX-License-Identifier: Apache-2.0
6+
menuconfig BACNET_DATALINK_SETTINGS
7+
bool "BACNET_DATALINK_SETTINGS"
8+
default y if BACNETSTACK
9+
help
10+
This option enables BACnet datalink settings.
11+
12+
if BACNET_DATALINK_SETTINGS
13+
14+
config BZLL_NODE_TIME_TO_LIVE_S
15+
int "BZLL node time-to-live in the VMAC table"
16+
default 600
17+
help
18+
Time in seconds to keep a node in the VMAC table before it must be updated.
19+
20+
config BZLL_SCAN_NODES_INTERVAL_S
21+
int "BZLL interval for scanning the Zigbee network for BACnet nodes and updating the VMAC table"
22+
default 3600
23+
help
24+
Time interval in seconds between scans of the Zigbee network for BACnet nodes to update the VMAC table.
25+
26+
endif # BACNET_DATALINK_SETTINGS

zephyr/subsys/bacnet_settings/bacnet_settings.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ bool bacnet_settings_value_parse(
323323
return false;
324324
}
325325
/* convert the string value into a tagged union value */
326-
if (isalpha(value_string[0])) {
326+
if (isalpha((unsigned char)value_string[0])) {
327327
if (property_list_commandable_member(object_type, property_id) &&
328328
(bacnet_strnicmp(value_string, "NULL", 4) == 0)) {
329329
/* check for case insensitive NULL string */

zephyr/subsys/bacnet_settings/bacnet_storage_shell.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <errno.h>
1111
#include <zephyr/shell/shell.h>
1212
#include <bacnet_settings/bacnet_storage.h>
13+
#include <stdio.h>
1314

1415
static const char Storage_Base_Name[] = CONFIG_BACNET_STORAGE_BASE_NAME;
1516

zephyr/subsys/bacnet_shell/bacnet_shell_property.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ int bacnet_shell_property_parse(
117117
}
118118
err = bacnet_shell_object_type_instance_parse(
119119
sh, argc, argv, object_type, object_instance);
120-
if (isalpha(argv[3][0])) {
120+
if (isalpha((unsigned char)argv[3][0])) {
121121
/* choose a property by name with optional [] to denote array */
122122
scan_count = sscanf(argv[3], "%79[^[][%u]", name, &array_value);
123123
if (scan_count < 1) {

0 commit comments

Comments
 (0)