Commit Graph

276 Commits

Author SHA1 Message Date
jenahn0630 f8bbc0b006 Fix Bug: Update RS485 baud rate configuration to use dlmstp_baud_rate(mstp_port) instead of shared data enum value (#1294) 2026-04-08 16:36:21 -05:00
Kato Gangstad 589a61b287 esp32: replace port with PlatformIO implementation and add CI build (#1292) 2026-04-06 08:33:17 -05:00
Steve Karg 6f3d25b5ba Refactor CMakeLists.txt to replace BIG_ENDIAN definition with BACNET_BIG_ENDIAN to fix missing function in builds. (#1284) 2026-03-27 14:40:21 -05:00
Steve Karg d562374f53 Fixed javadoc header in bvlc-pico. Added ports/pico to CHANGELOG. 2026-03-25 08:55:04 -05:00
Testimony 17e94092a1 Add Raspberry Pi Pico port (#1232)
* Add Raspberry Pi Pico port
- Adds BACnet/IP with abstracted network layer
- Adds BACnet MS/TP support using RS485/UART
- Includes README with examples

* Add Pico 2 MS/TP demo, CI, and docs
2026-03-25 08:22:09 -05:00
Steve Karg 5724959132 Removed ifdef BACFILE where no longer needed. (#1225) 2026-02-12 08:42:35 -06:00
Steve Karg 1d1cf9bfac Feature/create object initial value backup (#1223)
* Added example Device object and property value backup using create-object list-of-initial-values and writable properties. Initiated using ReinitializeDevice with STARTBACKUP command. Added backup and restore required properties to the Device object.

* Fixed fwrite parameters in bacfile_posix_write_stream_data to return the correct number of bytes written.

* Added Device Management-Backup and Restore-B (DM-BR-B) conversion to Wireshark PCAP format command line utility in apps/dmbrcap which decodes and provides a view of the binary backup file.
2026-02-06 16:54:10 -06:00
Steve Karg 8cd1d82d81 Add segmentation support functions (#1218)
* Added segmentation support functions and example changes, but no support for segmentation in the TSM or APDU handlers.
2026-02-04 17:03:13 -06:00
Steve Karg 3a0878a254 Add API for writable object property lists (#1206)
Added a new API for writable property lists across all the basic example object types, preparing for the introduction of a Writable_Property_List property in every object in a future BACnet standard revision.

The lists can be used by backup and restore feature to automatically choose the object property values in the backup that can be restored via internal WriteProperty directly from BACnet CreateObject services with  List of Initial Values. 

Updated existing device object examples to include these writable property lists.
2026-01-21 10:02:21 -06:00
Steve Karg c5dc00a77b Bugfix/validate-user-provided-file-object-paths (#1197)
* Fixed BACnet file object path name unintended path traversals by optionally restricting path name content with BACNET_FILE_PATH_RESTRICTED define.

* Added POSIX file path name checking for AtomicReadFile and AtomicWriteFile example applications. Prohibits use of relative and absolute file paths when BACNET_FILE_PATH_RESTRICTED is non-zero.
2026-01-05 11:19:52 -06:00
Patrick Grimm a15ec5eac4 Fixed linux compile with musl (#1194)
missing include asm/ioctls.h with error 'TCGETS2' undeclared

The gcc warning "overflow in conversion from 'long unsigned int' to 'int' changes value from '2150388778' to '-2144578518' " can be surrpres wtith a musl patch
https://gist.github.com/stargieg/3dbfe94b5776d9dfb3e14d18ee43aade

from the musl mailing list with discussion on this bug, but no solution.
[PATCH] ioctl: Fix implicit constant conversion overflow
https://www.openwall.com/lists/musl/2024/06/01/1
2025-12-26 07:40:27 -06:00
Patrick Grimm 2f6132b13e Fix mstp on bsd port (#1193)
* fix mstp on macos NS_PER_S is 1s and 0ns

* fix compile on freebsd

* port bsd: add compile warnings and comments

* port bsd: limit pthred prio to OS defined min/max value
e.g. FreeBSD min=0 max=31

* port bsd: fix clangformat
2025-12-24 18:50:29 -06:00
Steve Karg 380540635c Refactored BACnetShedLevel encoding, decoding, and printing into separate file. Added unit testing. (#1187)
* Refactored BACnetShedLevel encoding, decoding, and printing into separate file.  Added unit testing.

* Added API to load control object for shed-level, start-time, duty-window, full-duty-baseline, and enable.

* Fixed bacapp sprintf for shed level and host-n-port found in scan build.
2025-12-12 08:32:42 -06:00
Steve Karg 95cdec459e Fix warnings during unit testing of BACnet secure connect node. (#1182) 2025-12-09 09:34:28 -06:00
Ryan Mulder 0fd814867d Change prints to debug (#1168) 2025-12-03 10:59:30 -06:00
matt7aylor f28c804969 Fixed ipv6 destination port and multicast interface issues. (#1161) 2025-11-27 23:14:35 -06:00
Amer 94b267d67e linux: cache netmask for accurate subnet prefix calculation to fix implementation which always returned 0 (#1155)
Co-authored-by: Syed Amer Gilani <syed.gilani@trilux.com>
2025-11-21 15:21:59 -06:00
Steve Karg 2a6c251803 Revert "Added segmentation support for server reply. (#974)"
This reverts commit 3ea710f92f.
2025-11-17 22:26:50 -06:00
BACnetEd 003073b71e Use BACNET_ENGINEERING_UNITS for basic object API for units properties (#1104)
Co-authored-by: Ed <edward@connect-ex.com>
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2025-11-17 22:17:22 -06:00
Steve Karg e9dd910b55 Convert the property list values into int32_t to support the larger property values when an int is 8-bit or 16-bit. (#1145) 2025-11-16 08:34:45 -06:00
Steve Karg 3ea710f92f Added segmentation support for server reply. (#974)
Added segmentation support for server devices for some services. Configure BACNET_SEGMENTATION_ENABLED=1 to include in the library, and adjust BACNET_MAX_SEGMENTS_ACCEPTED for maximum number of segments.
2025-11-15 13:33:36 -06:00
Steve Karg 9d1abbeba5 Added postpone reply because transmission of the segmented ComplexACK cannot begin until the node holds the token. (#1116) 2025-11-15 13:08:27 -06:00
Steve Karg 25d14c7c15 Fixed BACnet/SC secure connect VMAC, UUID, and initialization sequence (#1142)
* Refactored the BACnet/SC datalink initialization order by moving certificate file checks and hub connection registration to occur after datalink initialization
* Replaced stdlib rand() with platform-specific cryptographically secure random functions (RtlGenRandom for Windows, getrandom for Linux, arc4random_buf for BSD) to generate UUID and VMAC addresses, preventing duplicates that broke connections
* Enabled conditional debug output in BACnet/SC components when BUILD=debug is specified
2025-11-14 15:41:17 -06:00
Steve Karg 74972bd025 Added a basic creatable loop object with PID control (#1141)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-13 16:11:19 -06:00
Steve Karg 4dd13cf199 Added basic timer object, internal state machine, and unit tests (#1123)
* Added basic timer object, internal state machine, and unit tests

* Added BACnetTimerStateChangeValue encode, decode, parse, print, and diff with unit tests

* Changed handler of add/remove list element to check if the property is a BACnetLIST

* Added BACnetLIST utility for handling WriteProperty to a list.

* Fixed outlier ReadProperty object handlers to return zero when the RP parameter is NULL.
2025-11-05 15:11:45 -06:00
Steve Karg 17259b37f3 Fixing Makefile build for bip6 with win32 MinGW and in github workflows. (#1125) 2025-10-30 12:00:01 -05:00
Steve Karg b726458ab9 The NDPU priority is now passed through the stack via apdu.c or h_apdu.c module so the MS/TP compare DER function can include the value in the comparison. (#1119) 2025-10-16 10:31:21 -05:00
Steve Karg 7dfc840dfc Bugfix/using-uint16-for-units-property-storage (#1107)
* Fixed units property declaration in basic Analog Input header file to be uint16_t instead of uint8_t.

* Added range checking of units property in example objects WriteProperty handler.
2025-09-24 09:35:10 -05:00
Steve Karg f877ca0ebb Fixed MS/TP state WAIT_FOR_REPLY to allow reception of any frames that are not known to be not reply frames. (#1103)
This fixes segmented Complex-ACK frames which were dropped. This enables all proprietary frames and any new frames to be recieved to the higher layers.
2025-09-20 10:52:59 -05:00
Steve Karg 9b6173995c Fixed compiler warning format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=] by casting or increasing format specifier size and casting. (#1092)
* Fixed compiler warning format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=] by casting or increasing format specifier size and casting. Increased the size of the name string to handle larger possible integers.

* Fixed copied code that no longer needs static function scope variables for text names.
2025-09-12 15:08:47 -05:00
Steve Karg 0da61e52bb Added MS/TP statistics counters for BadCRC and Poll-For-Master. (#1081) 2025-09-11 10:53:16 -05:00
Steve Karg ad5a43042c Added MS/TP datalink option to BACnet basic server example. (#1077) 2025-08-25 11:02:43 -05:00
BACnetEd a3cd49eb37 Added fixups to Microsoft Visual Studio build: added server-mini, etc. (#1061) 2025-08-20 11:44:38 -05:00
Steve Karg 25c2aaa20d Secured I-Am request encoding and decoding, and updated the example apps and handlers to use secure version of I-Am decoder. (#1080) 2025-08-19 21:31:50 -05:00
Steve Karg f44330c180 Fixed win32 builds where UNICODE is defined. The code now uses CreateFileA instead of CreateFile due to ANSI-C filenames. (#1076) 2025-08-12 15:16:39 -05:00
Steve Karg 3a3d7fcc13 Fix point-to-point VPN tunnel sockets for BACnet/IP by using IFF_POINTTOPOINT flag when getting the broadcast address. (#1066) 2025-08-12 08:50:30 -05:00
Steve Karg 3f8b8b5619 Added dynamic and static RAM file systems to use with file objects. (#1058)
* Added dynamic RAM file system to use with basic bacnet file object.

* Added static RAM file system to use with basic bacnet file object.

* Added check for read-only during AtomicWriteFile service API for BACnet File object.

* Change stm32f4xx example to use static RAM file system.

* Fixed bacfile_count() function return type
2025-08-08 15:35:13 -05:00
Steve Karg 11c1338863 Fixed the signed value for start position and start record in BACnet file object abstraction. (#1057) 2025-08-01 13:10:05 -05:00
Steve Karg 4095a7f335 Feature/mstp valid frame not for us stats (#1053)
* Fixed ISO C90 forbids mixed declarations and code warning.

* Fixed the MS/TP invalid frame counter that was incremented for valid frames not for us.
2025-08-01 09:58:45 -05:00
Steve Karg 1bebd6ac81 Refactored the bacnet file object to be storage agnostic with callbacks. (#1056) 2025-08-01 09:58:07 -05:00
Steve Karg f88f5a3424 Fixed the Linux DLMSTP standalone test application Makefile. (#1055) 2025-07-31 09:40:18 -05:00
Steve Karg f31193998c Add BACnet Zigbee VMAC table and unit test. (#1054) 2025-07-31 08:57:53 -05:00
Ryan Mulder 85ba0b2315 Linux MS/TP Fixes (#1051)
* Linux MS/TP:
 * dlmstp_init:
   * Maximize thread priority if permitted

 * MSTP_Put_Receive/dlmstp_receive:
   * Use a buffer so incoming frames are not dropped during bursts

 * dlmstp_receive:
   * Make timeout optional

 * MSTP_Get_Reply:
   * Lock the mutex before using the PDU Queue
   * Iterate over all queued replies to find a match (instead of only checking the first)
   * Sleep for a millisecond before checking again to wait for the application provide a reply

 * RS485_Check_UART_Data:
   * Ensure waiter is initilized before using with select
   * Ensure bytes are read before adding to FIFO

TSM:
 * Add log when `datalink_send_pdu` fails for consistency with all other `datalink_send_pdu` calls

dlenv_maintenance_timer:
 * Fix Tx/Rx labels in MSTP statitistics print

* don't log on queued requests
2025-07-22 14:51:14 -05:00
BACnetEd 1a7852f58e Updating Microsoft Visual Studio compile environment (#1050)
Co-authored-by: Edward <edward@connect-ex.com>
2025-07-21 12:46:50 -05:00
Alonso Cárdenas 66bb52e7f0 Fixed issues on FreeBSD with CMake build for BSC and IPv6 datalinks. (#1046) 2025-07-16 09:48:50 -05:00
Ryan Mulder 3b410f7a07 add bip_get_interface and Device_Time_Of_Restart, fix Network_Port_Changes_Discard (#1038)
* added bip_get_interface

* basic/object/device get/set time of restart

* clear changes pending

* clang-format
2025-07-05 21:55:29 -05:00
Steve Karg 51b899fc36 Format ports/bsd for standard style. 2025-07-01 12:52:39 -05:00
Mikhail Antropov 267db756b8 Added a basic example Auditlog object. (#458)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2025-06-23 12:18:13 -05:00
Steve Karg 9e626e599b Feature/add spi master test example for bdk (#1027) 2025-06-21 13:04:54 -05:00
Ryan Mulder c2c987f11a Changed the ports/linux RS485_Set_Baud_Rate() function so that the MS/TP AutoBaud process succeeds. (#1022) 2025-06-17 14:28:25 -05:00