Commit Graph

210 Commits

Author SHA1 Message Date
Steve Karg 20f402f5b6 Fix lighting output commands for warn-off and warn-relinquish (#1212)
* Fixed lighting output object lighting-commands for warn-off and warn-relinquish when blink-warn notification shall not occur.

* Fixed timer object task to initiate a write-request at expiration.

* Added channel and timer object write-property observers in blinkt app to monitor internal writes.

* Added vacancy timer command line argument in blinkt app for testing initial timer object vacancy time for lights channel.
2026-01-28 06:39:02 -06:00
Steve Karg b6d895ccf0 Update BACnet protocol revision and enhance lighting output handling (#1211)
* Changed apps to build at protocol-revision 28 to be able to use the lighting output special values by default.

* Fixed blinkt app server name and removed the device.c module which was no longer needed.

* Added debug prints for lighting-output object for present-value and lighting-command property values which may be out-of-range.
2026-01-27 10:45:28 -06:00
Steve Karg 2b59aa1a99 Add RGB pixel and brightness APIs, update Blinkt example (#1210)
* Added API to get the RGB pixel and brightness values from the blinkt interface.

* Fixed Channel object for Color object present-value which does not use coercion.

* Added API to the color-RGB library to convert from ASCII CSS color name to X,Y and brightness.

* Converted the Blinkt example app to use the basic-server.  Added a default color name command line option --color that accepts CSS color names. Set the color and brightness at startup.

* Added vacancy timer for lights using timer object defaulted to 30m and started at startup.
2026-01-27 07:34:32 -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 5802bd0ecc Fixed CreateObject service list-of-initial-values encoding and decoding. (#1199)
Fixes the CreateObject service list-of-initial-values encoding and decoding by refactoring the data structure to be similar to WriteProperty. The implementation changes from using a linked list of property values to using a flat buffer approach with delayed decoding.

Changes:

* Refactored BACNET_CREATE_OBJECT_DATA structure to use an application_data buffer instead of a linked list for initial values
* Added a new create_object_process() and create_object_initializer_list_process() functions to centralize object creation logic and error reporting
* Updated all device implementations to use the new centralized creation functions
* Enhanced the create-object example application to support command-line specification of initial property values
* Added comprehensive test coverage for the new encoding/decoding and processing functions
2026-01-15 14:50:59 -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
Steve Karg cef68dc079 Feature/refactor-apps-string-parsing (#1152)
* Added bacnet_str functions for parsing various numeric strings.

* Renamed BACnet string API to be clearer when no stdlib function exists.

* Fixed  incompatible types - from 'BACNET_UNSIGNED_INTEGER *' to 'unsigned long *'  warning

* Changed bacnet-str-to functions to use ERANGE for error detection.

* Refactored some apps to use common string parsing for BACnet data types.

* Refactor bacapp_parse_application_data to use bacnet_string_to_unsigned for better clarity

* Added strtol for BACnetEventType.
2025-12-02 11:27:19 -06:00
matt7aylor f28c804969 Fixed ipv6 destination port and multicast interface issues. (#1161) 2025-11-27 23:14:35 -06:00
Steve Karg ca9836b099 Added BACnetRecipient and BACnetAddressBinding codecs for EPICS application (#1163)
* Added BACnetRecipient and BACnetAddressBinding encoding, decoding, ASCII conversion, comparison, and copy functions.

*  Added library specific string manipulation utilities including strcmp, strncmp, stptok, and snprintf with offset functions.

* Added test/README about verification and validation testing.
2025-11-27 23:12:39 -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
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 c1e685d490 Fixed the apps/blinkt example project to control 8 lighting outputs. (#1143) 2025-11-14 16:23:17 -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 28a30be5ec Fixed compiler warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args] (#1133)
* Fixed compiler  warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]

* Fixed compile error found in pipeline build.

* Fixed pre-commit
2025-11-09 13:26:35 -06:00
Steve Karg 4e52f26823 Added Audit Log and Time Value objects to basic device. (#1128)
* Added ListElement service callback for storing data.  

* Added Audit Log and Time Value objects to basic device.

* Added Audit Log object to Makefile and CMake builds.
2025-11-06 14:10:07 -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 5b7932ee62 Feature/add-device-object-functions-find-api (#1115)
* Added Device_Object_Functions_Find() API to enable override of basic object API function.

* Added Device_Object_Functions() API to return basic object API table of functions for all objects.
2025-09-30 15:59:08 -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 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 743c5845b3 Added WriteProperty to GTK Discover app. (#1071)
* Added WriteProperty to GTK Discover app.  For enumerated properties, the property text is converted to an integer.  For commandable object properties (present-value), priority is encoded after the value or null using @ symbol.
2025-08-16 13:40:48 -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 e2cd26df78 Fixed GTK Discover app display of proprietary property identifiers. (#1070) 2025-08-09 16:00:44 -05:00
Steve Karg 30b02349bf Added missing enumeration text for Program object: BACnetProgramError, BACnetProgramState, and BACnetProgramRequest (#1068) 2025-08-09 08:23:32 -05:00
Steve Karg e67777e345 Fixed Refresh click to clear object and property windows. Added icon. (#1065) 2025-08-08 10:40:09 -05:00
Steve Karg 3f89981b29 Created simple project for GTK BACnet Discovery Application. (#1064) 2025-08-07 17:16:34 -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 f31193998c Add BACnet Zigbee VMAC table and unit test. (#1054) 2025-07-31 08:57:53 -05:00
Steve Karg def3cb14bb Bugfix/ucov-timestamp-handler-and-notification (#1030)
* Added the ability for apps/ucov to send property specific application tagged data using -1 argument for tag.

* Added known property decoding in UnconfirmedCOVNotification handler.
2025-06-26 13:17:15 -05:00
Steve Karg 5072fb5913 Feature/add who am i and you are services (#1024)
* Added Who-Am-I-Request encoding, decoding, unit tests, and command line application bacwhoami.

* Added You-Are-Request encoding, decoding, unit tests, and command line application bacyouare.

* Added Who-Am-I with Who-Is and You-Are handling into the example server application when run as device 4194303.
2025-06-23 10:49:59 -05:00
Steve Karg 14f033ceda Fixed GetEvent initialization of linked list (#1026)
* Fixed GetEvent usage of linked list by initializing next in all the examples and unit test.

* Secured GetEventInformation encoders by accepting NULL for APDU for determining the size, and exploit the NULL APDU for size checking during encoding. Secured the GetEventInformation decoders and removed the use of deprecated decoder API.
2025-06-20 13:34:39 -05:00
Steve Karg b0a97c6f75 Bugfix/bactext enumeration updates 2024 (#1020)
* Extended some BACnet enumerations from 135-2024 protocol-revision 25-30.  

* Changed usage of _FIRST and _LAST to _MIN and _MAX in some enumerations to be consistent.

* Added object type and services supported BACnetBitString sizes for protocol revision 25-30

*Added new BACnetPropertyIdentifier, BACnetEngineeringUnits, BACnetEventState, BACnetRestartReason, BACnetLifeSafetyMode, BACnetLifeSafetyOperation, BACnetLifeSafetyState, BACnet_Services_Supported, BACnetLightingOperation, BACnetBinaryLightingPV, BACnetNetworkPortCommand, BACnetAuthenticationDecision, BACnetAuthorizationPosture, BACnetFaultType, BACnetPriorityFilter, BACnetResultFlags, and BACnetSuccessFilter enumerations.

* Added BACnet text for BACnetLifeSafetyMode, BACnetLifeSafetyOperation, BACnetRestartReason, BACnetNetworkType, BACnetNetworkNumberQuality, BACnetNetworkPortCommand, BACnetAuthenticationDecision, BACnetAuthorizationPosture, BACnetFaultType, BACnetPriorityFilter, BACnetSuccessFilter, and BACnetResultFlags.
2025-06-17 14:36:57 -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 2101748a0b Fixed apps/router BVLC to ignore dest->len which is always zero. (#989) 2025-05-07 08:09:58 -05:00
Steve Karg 44d727c13b Fixed network specific original broadcast for IP in apps/router. (#976) 2025-05-05 21:46:01 -05:00
Steve Karg 54dbf9d140 Changed dlenv to support multiple datalinks via environment variable. (#966) 2025-04-16 12:04:18 -05:00
Ryan Mulder 3621b3f424 Added the option to specify a target destination for apps/server-discover. (#958) 2025-04-09 10:52:10 -05:00
Steve Karg c0c46ef235 Removed duplicate code in apps/readprop. (#959) 2025-04-07 13:43:34 -05:00
Steve Karg 866de072ac Added BACNET_IP_BROADCAST_USE_INADDR_ANY ifdef option for router port binding. (#953) 2025-03-31 08:05:30 -05:00
Steve Karg 6f7f3649a5 Bugfix/read range trend log buffer (#947)
* Fixed ReadRange app to read and pretty-print a Trend Log log-buffer
2025-03-25 10:32:11 -05:00
Steve Karg f1ea03647f Bugfix/bacmini-updates-with-program-object-and-cmake (#941)
* Added bacmini example app with minimal analog and binary objects  (#934)

* Fixed bacmini app build for Makefile and CMake

* Changed the folder for bacmini application to server-mini

---------

Co-authored-by: Ben Bartling <ben.bartling@gmail.com>
2025-03-13 17:18:47 -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
Steve Karg b0a26cf2cd Changed BACnet app example server-basic name (#935) 2025-03-03 09:10:04 -06:00