Commit Graph

245 Commits

Author SHA1 Message Date
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
Steve Karg 5cd453c925 Fixed WriteProperty error code for FD_BBMD_ADDRESS and FD_SUBSCRIPTION_LIFETIME (#925)
* Fixed WriteProperty error code for PROP_FD_BBMD_ADDRESS and PROP_FD_SUBSCRIPTION_LIFETIME properties.  

* Fixed dead-code warning after enabling all datalinks for basic network port object using the property list as the R/W checking for the port type.
2025-03-03 08:04:07 -06:00
Steve Karg 849cbb238b Fixed Device_Write_Property_Object_Name() to return WRITE_ACCESS_DENIED in case where an object name is not writable using BACnet protocol. (#927) 2025-02-26 17:00:51 -06:00
Steve Karg 7a5190f295 Fixed Who-Has object instance by checking for valid instance. (#922) 2025-02-20 17:29:39 -06:00
Steve Karg aa87bd8051 Bugfix/ipv6 leave multicast on foreign device registration (#899)
* Fixed IPv6 handler to ignore original-broadcast when registered as a foreign-device

* Fixed IPv6 to leave multicast when registering as foreign device.
2025-02-17 09:07:27 -06:00
Steve Karg f8e9ab8d86 Changed link-speed, network-number, network-number-quality, and apdu-length properties of the network port object to be optional when protocol-revision is 24 or greater. (#913) 2025-02-13 08:44:30 -06:00
Steve Karg 7b9d6d7dc5 Fixed error-code returned when an object does not support WriteProperty but has properties that are known. (#912) 2025-02-12 16:54:40 -06:00
Steve Karg ae135cd368 Bugfix/property list consistency testing (#910)
* Added unit test while reading all object properties to flag properties not in the property-list.

* Added enumeration for last-property used in unit testing.

* Added missing reliability property in the basic multistate output object example.

* Removed polarity property in binary value object as it is not standard.
2025-02-12 12:14:01 -06:00
Steve Karg 66329a05a0 Bugfix/property array element zero size (#908)
* Changed BACnetARRAY index validation into ReadProperty, ReadPropertyMultiple, WriteProperty, and WritePropertyMultiple handlers.

* Changed the basic and example objects after refactoring BACnetARRAY index validation into ReadProperty, ReadPropertyMultiple, WriteProperty, and WritePropertyMultiple handlers.

* Added BACnet application decoder that understands that an array element of zero is an unsigned integer tagged value.  Fixes RP and RPM apps when reading the array element zero of arrays.
2025-02-10 09:44:53 -06:00
Steve Karg 77bdaaf853 Fixed usage of 8-bit modulo operator off-by-one maximum. (#901) 2025-02-04 13:56:53 -06:00
Steve Karg 19ef7f74cd Added MS/TP automatic baudrate detection option into the core MS/TP state machine. (#900) 2025-02-03 15:10:31 -06:00
Steve Karg 94b3809a58 Bugfix/confirmed handlers empty service request (#885)
* Added reject in all confirmed service handlers, except GetEventInformation, when confirmed services with zero length occur which rejects with required parameters are missing message.

* Refactored errno use in service using debug_perror. Changed debug_perror usage to debug_fprintf. 

* Updated file and function headers in basic/service modules.

* Changed NDPU priority on confirmed messages to use requested NDPU priority.

* Renamed debug_aprintf to debug_printf_stdout for clarity.

* Convert most debug_fprintf usage to debug_print to reduce text bloat in AVR build
2025-01-05 10:09:39 -06:00
Steve Karg fd3be47d86 Feature/date time mstimer clock (#861)
* Added daylight savings time calculation module with unit testing.

* Added datetime daylight savings time and clock API

* Added basic datetime_local() clock using mstimer as basis and time-sync option.  Integrated clock with ports/stm32f4xx example.
2024-11-24 11:20:25 -06:00
Steve Karg 776b212995 Removed strcasecmp and strncasecmp because they are non-standand C functions. (#858) 2024-11-21 12:29:08 -06:00
Steve Karg 51c915a5da Bugfix/lighting output dimming refactor (#855)
* Refactored lighting command operations from the lighting output object, and added unit testing. Integrated the result back into lighting-output object.
2024-11-13 15:24:25 -06:00
Steve Karg b97f1705ce Systick Interrupt should never be activated using NVIC_EnableIRQ because it's an system exception (#850) 2024-11-06 08:17:23 -06:00
Steve Karg cf77abac9b Feature/bacnet secure connect hub (#818)
* Added BACnet Secure Connect datalink.

* Added BACnet/SC hub application
---------

Co-authored-by: Kirill Neznamov <kirill.neznamov@dsr-corporation.com>
Co-authored-by: Mikhail Antropov <michail.antropov@dsr-corporation.com>
Co-authored-by: Ondřej Hruška <ondra@ondrovo.com>
Co-authored-by: Patrick Grimm <patrick@lunatiki.de>
2024-11-04 07:05:26 -06:00
Steve Karg 7b6a0923f0 Added missing MS/TP zero configuration preferred address API and usage. (#840) 2024-10-29 20:09:16 -05:00