* 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
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.
* 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
* Fixed BVLC Write Broadcast Distribution Table for protocol revision 17 and later.
* Added check for Network Port object bbmd-accept-fd-registrations property in BBMD handler.
* Added bvlc_foreign_device_table_decode() function and unit test.
* Added BDT and FTD write property to network port for IPv4
* 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.
* 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.
* 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.
* Fixed IPv6 handler to ignore original-broadcast when registered as a foreign-device
* Fixed IPv6 to leave multicast when registering as foreign device.
* 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
* Added ringbuf API for testing.
* Fixed basic ms/tp datalink packet ringbuffer initialization buffer overrun.
* Added basic ms/tp datalink unit test
* Added Ringbuf_Initialize() API with buffer size checking.
* Changed examples to use Ringbuf_Initialize() API for buffer size checking.
* 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.
* Fixed mstpcap utility by setting This-Station to the MS/TP promiscuous mode address 255.
* Fixed MS/TP receive filter for valid data frames which was missing.
* Fixed MS/TP zero-config duplicate node detection
* Reset silence during MS/TP capture after writing packet to prevent endless packets when stream is interrupted.
* datalink/dlenv: Rename addr -> addr6 when ipv6
If we are building this file with BACDL_BIP6 and BACDL_BIP enabled we
get two definitions for addr. For this reason rename other addr6 so
there will be no conflict.
* config: Reorder MAX_APDU selection so biggest is first
When multiple datalinks are selected we should guess biggest MAX_APDU.
To do that we need to order selection based on biggest to lowest. With
this change MAX_APDU should be more correct most of the times and user
does not need to specifie that by hand.
* Make it possible to select multiple datalinks
Before we had option to select all datalinks. Many times you however do
not need all datalinks but just some. Change logic so that it does not
matter if user selects multiple datalinks. Now user just select what
they want and everything should just work.
* dlenv: Move variables start of function
Because we use C89 we need to move variables start of block.
* datalink: Hide strings.h because Windows
Windows does not support strings.h. Hide it from it.
---------
Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>