Commit Graph

3738 Commits

Author SHA1 Message Date
Steve Karg 7535953235 Prevent deletion of backup files during restore process (#1249) 2026-03-03 11:37:21 -06:00
Steve Karg c65083af97 Fix macro naming for Octet String configuration in BACnet device object to align with existing Zephyr RTOS port. 2026-02-27 10:49:25 -06:00
Steve Karg 1e9347f8f3 Bugfix/backup restore failure timeout (#1247)
* Added backup failure timeout functionality and related methods in device management

* Fixed STARTBACKUP to hold at PERFORMING_A_BACKUP per spec, not IDLE.

* Added error handling for reinitialization during restore process to prevent accidental delete of all objects.

* Added some missing Create/Delete object functions. Formatting.

* Fixed Program object type in bacnet_device.c module.
2026-02-27 10:33:10 -06:00
Steve Karg 1437a68ce1 Add CreateObject and DeleteObject for Octet String and Positive Integer Values (#1246)
* Added CreateObject and DeleteObject for basic Octet String Value and Positive Integer Value objects.

* Changed PositiveInteger present-value datatype to BACNET_UNSIGNED_INTEGER.
2026-02-26 16:25:03 -06:00
Steve Karg 24587dfc27 Add PROP_TIMER_RUNNING to writable properties and implement Timer_Running_Set functionality (#1245) 2026-02-26 11:26:42 -06:00
Steve Karg a70ce07507 Secure BACnet decoders and service requests (#1244)
* Secured BACnetAssignedAccessRights decoder.

* Secured BACnetPropertyState decoder.

* Secured BACnetCredentialAuthenticationFactor decoder.

* Secured BACnetEventState change-of-state [1] SEQUENCE decoder.

* Secured I-Have-Request service decoder.

* Secured Add/Remove ListElement service request decoder.

* Secured ConfirmedPrivateTransfer-Request and UnconfirmedPrivateTransfer-Request decoders.

* Secured ReadPropertyMultiple-Request and -Ack decoders.

* Secured TimeSynchronization-Request decoder.

* Secured WritePropertyMultiple service decoders

* Secured Trend Log object TL_fetch_property() function.

* Secured ReadProperty-Ack decider,

* Refactor BACnet time sync recipient handling by moving timesync linked list structure into bacdest where the recipient encoder and decoder already existed.

* Secured decoding of BACnetPropertyState.

* Secured decoding in the LifeSafetyOperation-Request service.

* Secured BACnetAuthenticationFactor decoding in the Credential Data Input object.

* Fixed WriteProperty decoder to avoid read buffer overrun.  Improved WriteProperty error reporting by adding specific reject codes during decoding similar to WritePropertyMultiple. Deduplicated the WriteProperty handling of abort, reject and error codes.

* Added BACNET_STACK_DEPRECATED_DISABLE guards around all of the deprecated decoding functions to ensure they are not used except intentionally for legacy code bases.

* Changed version to 1.5.0.rc5 for security fix tracking in branch.
2026-02-26 10:48:25 -06:00
Steve Karg cf4f62f7e0 Added Who-Is-Router process for Notification Class recipient unknown router addresses. (#1243)
* Added Who-Is-Router-To-Network process in basic Notification Class when recipient address is missing the router MAC address.

* Added buffer_length parameter to octet string buffer decode functions

* Fixed BACnet address handling for I-Am-Router address updating the recipient list address for the next hop router.

* Changed VMAC encoding and decoding to use octet string buffer API to reduce stack RAM.
2026-02-25 09:58:38 -06:00
Steve Karg e11cd319da Add initialization and unpacking functions for BACnet Character String buffer decoder. (#1242) 2026-02-24 21:15:29 -06:00
Steve Karg 578f507125 Secure the BVLC decoders by replacing deprecated primitive and complex data decoders. (#1241) 2026-02-20 10:30:46 -06:00
Steve Karg 7d78889aa9 Chore/unit-test-cmake-and-ztest-time-duration (#1240)
* Fixed cmake for unit test so that indivisual build and test works from vscode

* Fixed the time duration in the ztest used for unit testing.
2026-02-20 09:15:55 -06:00
Steve Karg 8209673c43 Add Host-N-Port minimal encode and decode (#1239)
* Added Host-N-Port minimal encode and decode which utilizes the octet string buffer and character string buffer encode and decode API.
2026-02-20 08:55:40 -06:00
Steve Karg 4597dfe7ef Added API for extending the basic Device object and children with proprietary properties for ReadProperty and WriteProperty services. (#1238)
* Added callback API for extending the basic Device object and children with proprietary properties for ReadProperty and WriteProperty services. The callback API includes a function to get the specific proprietary property list for any specific object instance in the device, functions to handle the ReadProperty or WriteProperty of the proprietary property.

* Added a new property_list_function typedef to proplist.h for proprietary property list callbacks

* Removed the object-specific proprietary property implementation from the Loop object

* Added test coverage in the Device test validating the proprietary property API usage
2026-02-20 06:57:05 -06:00
GauiStori f9a0386614 Schedule sets the correct value but only in the schedule object. References are not set yet. (#1236)
Add device_moc.c to tests cmake. Thanks Steve
2026-02-19 15:03:52 -06:00
Steve Karg 2874dcea5e Add octet and character string buffer codecs to used with fixed size buffers that are not declared as BACNET_OCTET_STRING or BACNET_CHARACTER_STRING. (#1237) 2026-02-19 13:52:23 -06:00
GauiStori 44b230a068 Fixes the problem of Object properties references not being written. (#1235) 2026-02-18 13:21:45 -06:00
Steve Karg b931226135 Updated CHANGELOG for pull-request #1230 2026-02-17 09:54:46 -06:00
Ingmar Krause 125e17848a Split dlenv_init in order to use bsc node registration from outside (#1230) 2026-02-17 08:31:47 -06:00
Steve Karg 6bd2b42334 Add Create & Delete to Accumulator object (#1234)
* Added CreateObject and DeleteObject for basic Accumulator objects.
 
* Added WriteProperty handling for object-name, scale, out-of-service, units, and max-pres-value.
2026-02-17 08:31:00 -06:00
Steve Karg b022d2bcbb Update Structured View Node Type to BACNET_NODE_POINT and adjust relationships to the subordinate. (#1233) 2026-02-17 08:13:47 -06:00
Steve Karg 3dd582eb0e Changed version to 1.5.0.rc4 for security fix tracking in branch. 2026-02-13 14:43:51 -06:00
Steve Karg 4f9e3ceba4 Update SECUIRTY for recent CVE published. 2026-02-13 14:38:51 -06:00
Steve Karg c9f2836025 Add BACnet reinitialized state names and parser (#1228) 2026-02-13 10:23:25 -06:00
Steve Karg 4cc8067c86 WriteProperty decoding length underflow (#1231)
When decoding the optional priority context tag in wp_decode_service_request(), the code passes apdu_len - apdu_size to bacnet_unsigned_context_decode instead of apdu_size - apdu_len. Similar typo in bacnet_action_command_decode().
2026-02-13 08:44:39 -06:00
Hyeongjun Kim 05027855ef Fixed conditional compilation of mstp.c and mstptext.c based on BACDL_MSTP option (#1229)
* Changed mstp.c and mstptext.c to be conditionally included using CMake generator expression
* Files are now only compiled when BACDL_MSTP is enabled

Signed-off-by: kimhyeongjun <hjun1.kim@samsung.com>
2026-02-13 08:40:09 -06:00
Steve Karg 9330c47a34 Remove BACFILE dependency in RAM file systems and add mock file object functions for testing (#1227) 2026-02-12 17:15:31 -06:00
Steve Karg 9f508c8f2f Refactor comments in Device_Write_Property_Local() for clarity and consistency 2026-02-12 14:46:37 -06:00
Steve Karg c54378dc11 Sync service handler initialization in bacnet_basic_init() with apps/server when backup and restore, time master, and COV subscription features are enabled. 2026-02-12 14:45:58 -06:00
Steve Karg 5724959132 Removed ifdef BACFILE where no longer needed. (#1225) 2026-02-12 08:42:35 -06:00
Steve Karg cc432b8a6d Fixed debug printf compiler warning for float as double in Lighting_Output_Present_Value_Set() function. 2026-02-10 14:11:38 -06:00
Steve Karg 576cac784e Fixed compile warning in bacnet_strtof() from double fabs() to float FLT_MAX by using same pattern as Channel and Timer objects for float range validation. 2026-02-10 14:05:50 -06:00
Steve Karg a4ba359fde Add writable properties test for CreateObject service when used as backup-restore file format. 2026-02-10 07:49:31 -06:00
Steve Karg 7e13980899 Updated CHANGELOG for recent changes. 2026-02-09 16:25:50 -06:00
Steve Karg 20ffb81d2f Add conditional check for object creation in create_object_process 2026-02-09 16:14:43 -06:00
Steve Karg 8b2a40b9be Fixed basic Load Control object example WritableProperties list. 2026-02-09 16:07:23 -06:00
Steve Karg 548acfe563 Fix loop condition in server example app during object creation in Init_Service_Handlers. 2026-02-09 16:07:13 -06:00
Steve Karg 145d026224 Added BACnet file object restore using CreateObject handling after a backup for the STARTRESTORE state. 2026-02-09 16:07:04 -06:00
Steve Karg 45ed68e8b8 Added bacfile_read_offset() API to read offsets into a file during a restore after a backup. 2026-02-09 16:06:54 -06:00
Steve Karg 0f325b1529 Added CreateObject continue-on-error flag to be able to use for restoring a backup when object exists or object doesn't support dynamic creation. 2026-02-09 16:06:42 -06:00
Steve Karg 420c74635c Updated CHANGELOG for recent pull-request. 2026-02-06 21:05:54 -06:00
xiang33 741748f929 Fix stack buffer overflow in Schedule_Weekly_Schedule_Set (#1222)
* Fix stack buffer overflow in Schedule_Weekly_Schedule_Set

The memcpy was using sizeof(BACNET_WEEKLY_SCHEDULE) instead of
sizeof(BACNET_DAILY_SCHEDULE), causing it to read 6784 bytes from
a 968-byte source buffer, leading to stack buffer overflow and
segmentation fault in the test_schedule unit test.

This fixes the test_schedule test failure detected by ASAN:
ERROR: AddressSanitizer: stack-buffer-overflow on address ...
READ of size 6784 at 0x... partially underflows this variable

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update src/bacnet/basic/object/schedule.c

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: kent.liu <kent.liu@designlibro.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Steve Karg <steve@kargs.net>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-06 21:01:44 -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 94e79efead Bugfix/example-app-uevent-event-parsing (#1221)
* Added Send_UEvent_Notify_Device function for device-specific unconfirmed event notifications.

* Fixed event_notify_parse() loop index to start from zero.

* Added device ID binding support in the UEvent command-line application.

* Fixed the UEvent command-line application help output.

* Fixed initialization of event data in the UEvent command-line application by adding static CharacterString for message text and handling the failure case.
2026-02-05 13:41:56 -06:00
Steve Karg edff06a9c0 Fix You-Are-Request encoding and decoding to use object-id instead of unsigned. (#1220) 2026-02-05 08:10:45 -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 577ecf8d7f Added handling for abort and reject errors in Write Property service (#1216) 2026-02-02 13:54:26 -06:00
Steve Karg 59218819c1 Added end-of-blink callback for warn-off and warn-relinquish lighting commands (#1214)
* Added Blink.Callback and Blink.Priority to support end-of-blink actions for WARN_OFF/WARN_RELINQUISH. The Blink.Callback is invoked when a blink sequence ends or when a new command interrupts a WARN_OFF/WARN_RELINQUISH in progress.

* Added Lighting Output (LO) WARN_OFF/WARN_RELINQUISH post-egress priority array handling using the Blink.Callback
2026-01-29 16:03:55 -06:00
Ryan Mulder 503472fdb5 fix spelling of BACfile_Writable_Property_List (#1213) 2026-01-28 16:47:47 -06:00
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