Commit Graph

3208 Commits

Author SHA1 Message Date
Steve Karg 3222244e4e Updated to version 1.3.6 for release on 2024-05-12 Mother's Day! (#635)
* Updated to version 1.3.6 for release on 2024-05-12 Mother's Day!
2024-05-12 09:06:23 -05:00
Steve Karg 06ff987b79 Issues/issue 632 invoke id mismatch (#633)
Fixed nuisance print messages in ports/linux/dlmstp by changing to debug print only.
2024-05-07 06:58:26 -05:00
Steve Karg 96222574f8 Bugfix/router mstp builds (#630)
* Fixed example app router-ipv6 to build under ports/win32

* Fixed example app router-mstp to build under ports/win32 with MinGW

* Added win32 builds of router-ipv6 and router-mstp to the Github pipeline
2024-04-30 13:52:00 -05:00
Tomasz Kazimierz Motyl b90b14e5f6 Merge pull request #39 from se-apc/devel/getters_and_setters_to_support_relative_permanence (#629)
Get/Set functions to support properties relative permanence requirement
2024-04-30 13:35:31 -05:00
Steve Karg fc56e8b4a6 Fixed invalid comparison in life-safety-zone basic object. 2024-04-29 09:46:55 -05:00
Steve Karg 3eff297a48 added some help about decoding complex data in WriteProperty example app. (#627) 2024-04-27 12:42:08 -05:00
Steve Karg bb276e2431 Refactored all the sprintf to use snprintf instead. (#628) 2024-04-27 12:41:45 -05:00
Steve Karg 70c54817fd Added AlignAfterOpenBracket: AlwaysBreak and BinPackArguments: true to clang-format. Updated test/bacnet c/h files with updated format. 2024-04-24 09:38:12 -05:00
Steve Karg 1aaebe9414 Added host_n_port_context_decode function. 2024-04-23 11:26:20 -05:00
Steve Karg de6287bedb Added datetime to ASCII function. 2024-04-23 10:26:30 -05:00
Steve Karg e73520a974 Add timestamp snprintf. Fix bacapp snprintf to account for string size zero behavior of snprintf. 2024-04-23 10:04:46 -05:00
Steve Karg 8729c00dbd zephyr OS changes after bacdef.h refactor. 2024-04-22 13:39:11 -05:00
Steve Karg 39ed5d8c09 zephyr OS changes after bacdef.h refactor. 2024-04-22 13:31:29 -05:00
Steve Karg a59e665ff2 Fixed CMake build for BDT and FDT to only apply to BIP and BIP6. 2024-04-22 09:05:07 -05:00
Tomasz Kazimierz Motyl 4add49b549 Setting logic behind valit transitions check straight (#623)
Co-authored-by: Tomasz Kazimierz Motyl <tomasz.motyl@se.com>
2024-04-22 08:18:16 -05:00
antocout 6e31a01086 fix build with readable objects (#622)
When building the stack with readable objects, the
My_Read_Property_Multiple_Ack_Handler function defined in
src/bacnet/basic/client/bac-rw.c calls rpm_ack_object_property_process
which is defined in src/bacnet/rpm.h but unreachable without
BACNET_STACK_EXPORT.

How to reproduce the bug:

$ mkdir build
$ cd build/
$ cmake -DCMAKE_C_FLAGS="-DMAX_ANALOG_INPUTS=100"  ..
$ make
...
[ 81%] Linking C executable bacpoll
/usr/bin/ld: CMakeFiles/bacpoll.dir/src/bacnet/basic/client/bac-rw.c.o: in function `My_Read_Property_Multiple_Ack_Handler':
bac-rw.c:(.text+0x188): undefined reference to `rpm_ack_object_property_process'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/bacpoll.dir/build.make:146: bacpoll] Error 1
make[1]: *** [CMakeFiles/Makefile2:523: CMakeFiles/bacpoll.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Signed-off-by: Antoine Coutant <antoine.coutant@smile.fr>
2024-04-22 08:17:19 -05:00
Steve Karg f929a10ad2 Fixed zephyr bip_get_addr endian UDP port number 2024-04-22 08:11:18 -05:00
Steve Karg 770be70688 Chore/bacnet-sc-unrelated-cleanup (#620)
* Added required linux Ethernet library for ethernet build

* Added .obj to gitignore

* Fixed BACnet port for APPLE to use BSD in CMake

* Changed format in CMake to enable cleaner SC merge

* Added create-object and delete-object recipes in GCC Makefile

* Added datalink timer to all example OS apps

* Changed most microcontroller ports to use BACAPP_MINIMAL to specify which datatypes can be written.

* Fixed zephyr OS for BACnet/IP warning

* Fixed zephyr OS log to not require log_strdup

* Added writefile API to file object example

* Added API to device-client to make it more robust.

* Added API in network-port object for getting the ASCII object-name

* Added debug print with a timestamp option

* Added debug print with hex dump print

* Added API to network port object for activate and discard

* Added default define for debug with timestamp

* Added prototype in header for disabled debug printf.

* Added fifo peek ahead function to peek at more than one byte.

* Added get-mac value for network port that uses buffer rather than octetstring
2024-04-19 12:54:56 -05:00
antocout 600508c357 Change first instance of an integer value from 1 to 0 (#619)
Integer_Values instances start at 1 while other object instances
start at 0. Change this to have the same start for all objects.

Signed-off-by: Antoine Coutant <antoine.coutant@smile.fr>
2024-04-17 08:53:12 -05:00
Steve Karg 7b6dcada60 Fixed UDP port endian for zephyr os BACnet/IP 2024-04-05 13:57:01 -05:00
Steve Karg 028f139a24 Fixed UDP port endian for zephyr os BACnet/IP 2024-04-05 13:42:32 -05:00
Steve Karg aca3a2bc82 Fixed basic network port object header dependency on readrange.h file. 2024-04-05 13:17:35 -05:00
Steve Karg e19cc0be1e Added API for multistate number-of-states 2024-04-04 17:09:51 -05:00
Steve Karg 5abdaf0916 Fixed binary object active and inactive text setting. 2024-04-04 13:04:02 -05:00
Steve Karg f3b1ea0ab9 Added reliability, active-text, inactive-text to binary-input object ReadProperty. 2024-04-04 12:35:52 -05:00
Steve Karg b8201dad26 Fixed unit test checking for unknown property. Added reliability property to binary-value ReadProperty. 2024-04-04 12:26:14 -05:00
Steve Karg d1f92cbb8f Change time-value object present-value to not report current time. Added out-of-service property to WriteProperty. 2024-04-04 11:33:54 -05:00
Steve Karg 0cebc83d88 Enable example apps to bind to device 4194303 (#615) 2024-04-04 10:58:44 -05:00
Steve Karg 41c11b23d3 Bugfix/basic object features cleanup (#614)
* Fixed compile warnings in basic objects

* Added API for setting multi state text with null-terminated name lists in basic objects
2024-04-03 16:57:36 -05:00
Steve Karg 7520930dc1 fixed life safety zone default object name (#613) 2024-04-03 16:47:46 -05:00
Steve Karg 76d3680b5e Feature - added create/delete/COV services for analog, binary, and multistate objects (#612)
* Added Create/Delete object services to Analog Input, Analog Value, Binary Input, Binary Value, Multistate Input, Multistate Value object examples, and updated their units tests.
2024-04-03 13:27:03 -05:00
Steve Karg 8a0a01c0fa Release/version 1.3.5 rc1 (#611)
* Updated to version 1.3.5 for release on 2024-04-01 April Fool's Day!
2024-04-01 16:39:10 -05:00
Steve Karg adf6b5f1fb Bugfix/zephyr defines kconfig (#610)
* Added COV features to time-value object

* Added zephyr config names with BACNET prefix
2024-04-01 13:58:37 -05:00
Steve Karg 6bd1942635 Refactor/property lists member function (#609)
* Refactor property lists member function for WriteProperty default case.

* Refactor time-value object unit testing

* Added test for unsupported property to common property test
2024-03-27 09:52:01 -05:00
Steve Karg 4e0a37fd75 Fix double promotion in format specifier %f by casting floats to double. (#608) 2024-03-26 15:23:49 -05:00
Steve Karg f6c6fe87c5 Completed the implementation of object-instance and object index differentiation object/basic/ai.c module. Thanks, GauiStori! (#607) 2024-03-26 14:51:39 -05:00
Steve Karg a4910d4117 Bugfix/zephyr build for minimal ram (#606)
* Removed BACnet objects from ports/zephyr. There should only be datalink and OS related interfaces in OS ports.

* Added Kconfig and bacnet-config.h options in ports/zephyr to keep small footprint for MCUs having less RAM

* Changed ports/zephry for BACnet/IP and date-time with latest zephyr OS
2024-03-26 14:21:30 -05:00
Steve Karg 80c51a06e3 Secured the WPM and RPM service encoders (#604)
* Secured the WPM and RPM client service encoders.

* Fixed RPM and WPM apps when fail to encode request. 

* Fixed WPM app number of arguments checking.
2024-03-26 12:29:15 -05:00
Steve Karg 31ffc8024e Bugfix/double float promotion warnings (#605)
* Fixed compile warnings from double-float promotions.

* Changed zephyr compile to suppress deprecation warnings

* Fixed CreateObject API return value in many objects header files

* Changed zephyr build defines as strdup is no longer required for log print of strings
2024-03-26 09:45:01 -05:00
Steve Karg 1520f2c612 Add core stack headers into bacdef.h and cleanup includes. (#602)
* Added dependent BACnet stack headers into bacdef.h file.

* Changed bacdef.h and other stack includes in c/h files to have a common pattern.

* Moved bits.h, bytes.h, and bacnet_stack_exports.h under bacnet/basic/sys/ folder.
2024-03-15 16:58:52 -05:00
Greg Shue 78f7340266 Issues/issue 593 update to zephyr v3 6 0 (#601)
* [WIP] update manifest to zephyr v3.6.0

* [WIP] Deprecated ZTEST_NEW_API adjustments

Zephyr v3.6.0 removed Kconfig ZTEST_NEW_API.
The old ZTEST API is still used by non-Zephyr builds,
so the config setting is moved from `prj.conf` to
the test's CMakeLists.txt as `add_compile_definitions()`.

Verified by:

1. make clean all test

2. ./zephyr/scripts/twister -p unit_testing \
        -T bacnet-stack/zephyr/tests/

---------

Co-authored-by: Gregory Shue <gregory.shue@legrand.com>
2024-03-15 08:29:05 -07:00
Steve Karg f0760e2b96 Require bacdef.h as first bacnet header to include (#598) (#600)
* Require bacdeps.h as first bacnet header to include

BACnet headers need to pull in optional configuration and
optional ecosystem overrides to allow integrators to control
builds.  This commit changes bacnet header files to first
include bacnet/bacdep.h to consistently introduce integrator
header files.

Verified by:

1. make clean all test

2. ./zephyr/scripts/twister -p unit_testing \
        -T bacnet-stack/zephyr/tests/



* Migrate BACNET_UNSIGNED_INTEGER defn to bacdef.h

Verified by:

1. make clean all test

2. ./zephyr/scripts/twister -p unit_testing \
        -T bacnet-stack/zephyr/tests/



---------

Signed-off-by: Gregory Shue <gregory.shue@legrand.com>
Co-authored-by: Greg Shue <32416235+gregshue@users.noreply.github.com>
Co-authored-by: Gregory Shue <gregory.shue@legrand.com>
2024-03-13 16:27:56 -05:00
Steve Karg a5f4ab3c88 Feature/life safety zone object example (#595)
* Added Keylist_Data_Free function to free all nodes and data in a list

* Added basic Life Safety Zone object type in the apps/server example, with unit testing.
2024-03-07 16:15:46 -06:00
Steve Karg 2ecb1a2bc8 Bugfix/mstp extended frames client (#592)
* Fix routing to a remote network in the router-mstp example.

The net, len and adr fields of remote_dest are not initialized
although they are used by the npdu_encode_pdu function in
case of "Routing to another Router". Thank you, Eugene!

* Fixed handling of received MS/TP extended frames.

mstp_port->DataLength should be set to the actual length of decoded data.

* Fix MSTP_Master_Node_FSM and MSTP_Slave_Node_FSM for extended frames.

BACNET_EXTENDED_DATA frames should be treated the same as
their corresponding BACNET_DATA frames.

* Fixed MSTP COBS frame encoding

cobs_frame_encode writes the encoded data to the
beginning of the buffer, overwriting the frame header.

The frame header is constructed before COBS frame encoding,
so it contains the wrong Frame Type and Data Length.

* Added extended frame client unit test

* Fix router-ipv6 application for remote networks
2024-03-06 18:32:00 -06:00
Steve Karg 4e94323619 Updated changelog and version for 1.3.4 release (#589) 2024-03-02 07:31:37 -06:00
Steve Karg cbe7d2a8ed Added support for both DFR0259 and LINKSPRITE RS485 shield in build (#588)
* Added SHIELD=dfr0259 or SHIELD=linksprite build options to RS485 driver for stm32f4xx port.
2024-03-02 07:20:27 -06:00
Steve Karg 8a23c9b244 Added FAQ 18 for firewall info (#587) 2024-03-01 16:13:57 -06:00
Steve Karg 3f4ccb55d5 Added a BASH script for parallel EPICS clients registering as foreign devices to a BBMD (#586) 2024-02-29 09:12:35 -06:00
Steve Karg 5c55683f86 Fixed makefile for building the Linux router application. (#585)
* Fixed Makefile for building the Linux router application.
2024-02-28 17:08:00 -06:00
Steve Karg 1176b0d966 Feature/bacnet discover dnet devices (#583)
* Added an example application to discover devices and their objects and properties on a specific destination network. The application uses a BACnet Discovery FSM module along with the BACnet R/W FSM.  The BACnet Discovery module stores the binary property data in Keylists and includes device object property queries and iterators.

* Added callback from BACnet R/W FSM module for I-Am messages.

* Removed dependency in BACnet R/W FSM module on rpm_ack_decode_service_request() which uses calloc/free value lists.  Created an alternate RPM-ACK to RP-ACK processing function.

* Changed RPM handler to skip over unknown property values
2024-02-28 12:56:09 -06:00