Commit Graph

262 Commits

Author SHA1 Message Date
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
Steve Karg 80875add0a Fixed BACnet/IP initialization on a network interface where the system reports the interface's unicast IP address as being the same. (#1011) 2025-06-03 19:49:03 -05:00
Ryan Mulder cb7ef20485 Fixed Linux MS/TP 76800 bitrate for Linux 2.6.20+ circa 2007 and added get/set API for config. (#1007) 2025-05-29 08:54:12 -05:00
Steve Karg 442f408c1a Bugfix/dlmstp api missing in ports os (#1003)
* Added missing API defined in header into ports/win32/dlmstp.c module, added a PDU queue and refactored receive thread, and refactored MS/TP timing parameters.

* Added missing API defined in header into ports/linux/dlmstp.c module, and refactored MS/TP timing parameters.

* Added missing API defined in header into ports/bsd/dlmstp.c module, and refactored MS/TP timing parameters.

* Reduce default MS/TP APDU to 480 to avoid extended frames by default.
2025-05-27 10:14:15 -05:00
Steve Karg f5b5db445c Fixed ports/xplained conversion of double warning. (#1004)
* Fixed ports/xplained conversion of double warning.

* Fixed BACNET_USE_DOUBLE usage in AVR ports.

* Fixed integer out-of-range in AVR port.

* Fixed missing function prototype for whois_request_encode().
2025-05-26 22:13:06 -05:00
Steve Karg b5b2fd5b7b Added multiple uBASIC program objects to stm32f4xx example port. (#995) 2025-05-19 14:57:43 -05:00
Steve Karg 62bf8274f7 Fixed missing exports in bacnet/basic header files. (#996)
* Fixed missing exports in bacnet/basic header files.

* Refactor uBASIC for unique namespace and project define overrides.
2025-05-19 13:44:52 -05:00
Steve Karg 5f646e9e5d Fixed NDPU comparison functions that were missing segment-ack PDU. (#991) 2025-05-08 09:12:41 -05:00
Steve Karg 54bf9b79c6 Added uBASIC-Plus program object example to STM32F4xx. (#967) 2025-04-16 12:03:42 -05:00
Ryan Mulder 5022976cf9 Fixed debug printf warnings in BACnet/SC modules. (#963) 2025-04-10 11:27:13 -05:00
Steve Karg 0c45b50574 Fixed bip cleanup to enable initializing interfaces after cleanup. (#949) 2025-03-25 08:40:18 -05:00
Steve Karg d7858c0b3a Updated readme for ports/atmega328 2025-03-13 17:17:38 -05:00
Steve Karg 4df896b820 Feature/basic-program-object (#940)
* Added basic Program object and unit test.

* Integrate the basic Program object with example applications.
2025-03-13 15:51:37 -05:00
Steve Karg 4ee129e249 Added bypass in basic WriteProperty handler to accept writes of NULL to non-commandable properties (#919) 2025-03-10 07:30:55 -05:00
Steve Karg 7e725ce028 Bugfix/win32 build warnings (#936)
* Changed win32 port of localtime to use secure OS API functions when compiled with MSVC

* Changed all the sprintf to use snprintf instead in BSC tests to ensure null string endings.
2025-03-03 10:32:28 -06:00