Commit Graph

587 Commits

Author SHA1 Message Date
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 f5bc0620e7 Added new enumerations, text, BACnetARRAY and BACnetList from protocol-revision 30 (#1114) 2025-09-28 21:36:38 -05:00
Steve Karg b74af37720 Refactored CharacterString_Value_Out_Of_Service_Set() function to remove confusion about an assignment inside an if-statement. (#1113) 2025-09-28 21:35:23 -05:00
Steve Karg 2416157351 Added a context variable in basic object data structure and API to get or set the context pointer. (#1111) 2025-09-26 13:19:58 -05:00
Steve Karg d91282be16 Fixed basic program object internal datatype for reason-for-fault and change properties. (#1110) 2025-09-25 14:11:28 -05:00
Steve Karg 814eea5fd9 Fixed compile errors in basic/server/device when BACAPP_TIMESTAMP or Channel object are not enabled. (#1109) 2025-09-24 11:01:49 -05:00
Steve Karg f93f4fecf8 Added uBASIC+BACnet README document to describe the programming language, porting, and integration. (#1108) 2025-09-24 09:48:08 -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 b357bca5dd Converted device object test to use common read-write property test. Extended the basic BACnet device object example API. (#1106)
* Converted device object test to use common read-write property test. Extended the basic BACnet device object example API.

* Created BACnet/IP and COV test mocks to enable device object testing with less dependencies.
2025-09-24 07:09:56 -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 203cb102e7 Fixed Lighting Output object STOP lighting command so that it sets the present-value. (#1101) 2025-09-18 17:03:08 -05:00
Steve Karg 6061c36ac2 Fixed the lighting command RAMP TO ramp rate to always clamp within 0.1 and 100.0 to avoid endless rate of 0.0. (#1100)
* Fixed the lighting command RAMP TO ramp rate to always clamp within 0.1 and 100.0 to avoid endless rate of 0.0.

* Fixed the use of default fade, ramp, or step when those optional parameters are missing from lighting command.
2025-09-18 16:18:50 -05:00
Steve Karg bc2e0866e3 Fixed Lighting Output Step Up/On and Down/Off mixup. (#1099) 2025-09-18 15:01:39 -05:00
Steve Karg 547d7dfa98 Fixed Lighting Output step operations to set the Priority_Array slot appropriately. (#1098) 2025-09-18 14:15:14 -05:00
Steve Karg a7956e6082 Fixed the lighting output objects current priority comparison during lighting commands by using priority 17 (relinquish default) instead of 0. (#1097) 2025-09-18 10:57:03 -05:00
Steve Karg e3ef352f2d Added API to output objects for priority-array property value inspection. (#1096) 2025-09-17 15:57:53 -05:00
Steve Karg e8e996d9d9 Fixed Lighting Output Relinquish values. (#1094)
* Fixed Lighting Output Relinquish values.

* Added lighting command refresh from tracking value API.
2025-09-16 17:21:47 -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 7b727279bc Refactor Who-Am-I and You-Are JSON handlers to eliminate dynamic memory allocation for model and serial number strings, improving memory management and simplifying code. (#1089) 2025-09-11 10:52:36 -05:00
Steve Karg 71c03b29e8 Bugfix/lighting-output-internal-process-api (#1086)
* Fixed Lighting_Command to ignore write priority and use its own. 

* Fixed BACnetLightingOperation reserved range.

* Refactor overridden into the lighting command module. Added Overridden status flags API.  Added Lighting Output API to implement a momentary override to the output that is cleared at the next lighting command.  Integrated lighting command overridden behavior into the lighting output object.

* Added Trim_Fade_Time, High_End_Trim, Low_End_Trim, Last_On_Value and Default_On_Value properties to lighting output.
Added TRIM_ACTIVE flag to lighting command. Added Last_On_Value and Default_On_Value to lighting command for restore and toggle.
2025-09-04 15:04:42 -05:00
Steve Karg 8a9c808b76 Fixed test code headers to be consistent and accurate having been derived from original C files. (#1087) 2025-09-04 11:44:24 -05:00
Steve Karg a70a02a6f9 Fixed missing prototype warning in lighting.c module. (#1085) 2025-08-29 17:00:15 -05:00
Steve Karg 55107e96b7 Bugfix/issues 1082 AddListElement and RemoveListElement and Notification Class object (#1083)
* Fixed AddListElement and RemoveListElement which were checking the wrong return value from Device object.

* Fixed decoding of ListElement Tag 0: Object ID instance.

* Fixed Notification_Class_Add_List_Element() and Notification_Class_Remove_List_Element() element counter index, and empty slot detection.

* Added bacnet_recipient_device_set() and bacnet_recipient_address_set() API

* Added unit test coverage for Notification Class object.
2025-08-27 16:37:46 -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 a28dbcf262 Fixed the usage of index vs instance in the basic trend log object example. (#1074) 2025-08-12 12:21:23 -05:00
Steve Karg e18b9c6030 Removed filter from bacapp_encode_context_data_value() to enable all non-primative value context encoding. (#1075) 2025-08-12 11:05:00 -05:00
Steve Karg e0293e7063 Added text sprintf for Network Port object BACnetNetworkType, BACnetNetworkNumberQuality, and BACnetProtocolLevel enumerations. (#1069) 2025-08-09 08:43:24 -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 64d3f2c875 Added missing enumeration text for BACnetNodeType, BACnetSilencedState, BACnetLoggingType (#1067) 2025-08-09 07:04:17 -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 f31193998c Add BACnet Zigbee VMAC table and unit test. (#1054) 2025-07-31 08:57:53 -05:00
Steve Karg b326563a3c Added BACnet Zigbee Link Layer (#1052) 2025-07-28 13:06:48 -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
Steve Karg b819dc329f Fixed the use of uninitialized values in COV handlers. (#1049) 2025-07-16 16:30:39 -05:00
Steve Karg 4f11defc4e Fixed MS/TP zero-config FSM getting stuck when duplicate address is detected. (#1048) 2025-07-16 10:04:45 -05:00
Ryan Mulder f010c8e2e8 add a debug print when tsm retries (#1040) 2025-07-05 22:01:47 -05:00
Ryan Mulder 310124cc61 add bvlc_delete_from_bbmd to unregister as a foreign device and become normal (not foreign) (#1041) 2025-07-05 22:00:51 -05:00
Ryan Mulder e244ca22fc host_n_port_to_minimal: support ipv4 address (#1039)
* support ipv4 address

* clang-format
2025-07-05 21:57:14 -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 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
Ryan Mulder 284a5198a5 Fix bbmd_register_as_foreign_device when only BBMD_CLIENT_ENABLED and not BBMD_ENABLED (#1032)
* fix timer for mstp statistics

* fix `bbmd_register_as_foreign_device` when only `BBMD_CLIENT_ENABLED` and not  `BBMD_ENABLED`
2025-06-26 13:15:14 -05:00
Steve Karg d5db36bc1f Added BACnetErrorCode text for new enumerations. 2025-06-24 21:29:40 -05:00
Ryan Mulder d1361b128b enable writing mstp mac address and link speed via network_port (#1025) 2025-06-23 17:08:22 -05:00