* Added basic timer object, internal state machine, and unit tests
* Added BACnetTimerStateChangeValue encode, decode, parse, print, and diff with unit tests
* Changed handler of add/remove list element to check if the property is a BACnetLIST
* Added BACnetLIST utility for handling WriteProperty to a list.
* Fixed outlier ReadProperty object handlers to return zero when the RP parameter is NULL.
* 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.
* format: Strip trailing whitespaces
We want to get rid of trailing whitespaces completly as they make just git
noice. Much better to start using automated tools to get rid of them once and
not getting them back again. This way git history will be cleaner and review
easier.
Commit was generated with:
pre-commit run --all-files trailing-whitespace
* format: Files should have exactly one new line end of them
It is good practice that every file has one new line. It is not now days so
mandatory but it also is not nice if file has lot of newlines end of it. We will
use pre-commit which takes automatically care about this so let's fix all.
Commit was generated with:
pre-commit run --all-files end-of-file-fixer
* format: Convert tabs to spaces
Project mostly use spaces over tabs. When mixing tabs and spaces this usually
makes formatting issues and also when changing those in commits it will make lot
of git noise. We will force spaces most of the time and use pre-commit to fix.
Commit was generated with:
pre-commit run --all-files remove-tabs
---------
Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
* Change MIT license texts to SPDX-License-Identifier
SPDX-License-Identifier is much easier to understand and grep than
license text so use that instead.
* Change GPL exception license texts to SPDX-License-Identifier
SPDX-License-Identifier is much easier to understand and grep than
license text so use that instead.
* Change misc license texts to SPDX-License-Identifier
There are some external code in repo which are not licenses as most of
the stuff in this repo. We still want every file to have SPDX identifier
to easily grep licenses.
* Add currently used license files
Even though Bacnet-Stack is using SPDX identifiers we still need to give
those license files with source. For this reason add all license files
to license/ folder.
SPDX has also files which would make same thing but this is style which
example Linux kernel is using and it is quite clear so I choose that one
for now.
I choosed not yet bring CC-PDDC as that is not right license for those
files.
---------
Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
* [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>
* 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>
* Added basic Calendar object, unit tests, and integration with example device object.
* Added basic Time Value object, unit tests, and integration with example device object.
---------
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
* added or updated secure the BACnet primitive value decoders - the core codecs - named bacnet_x_decode(), bacnet_x_application_decode() and bacnet_x_context_decode where x is one of the 13 BACnet primitive value names. The updated API includes an APDU size to prevent over-reading of an APDU buffer while decoding. Improved or added unit test code coverage for the BACnet primitive value decoders.
* marked the insecure decoding API as 'deprecated' which is defined in src/bacnet/basic/sys/platform.h and can be disabled during a build.
* added secure decoders for BACnetTimeValue, BACnetHostNPort, BACnetTimeStamp, BACnetAddress, and Weekly_Schedule and improved unit test code coverage.
* improved test code coverage for BACnet objects and properties.
* secured AtomicReadFile and AtomicWriteFile service decoders and improved unit test code coverage.
* secured BACnet Error service decoder and improved unit test code coverage.
---------
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
* [WIP] Remove unit testcases duplicated under non-unit tree
* [WIP] Update west.yml to Zephyr v3.3.0 (twister verified)
* Update CI to Zephyr v3.4.0 w/ reduced module set
- Update zephyr/module.yml to use Zephyr v3.4.0 + cmsis;
- Update tests to use ZTEST_NEW_API for zephyr builds
Verified by:
1. make clean test
2. ./zephyr/scripts/twister -p unit_testing -T bacnet/zephyr/tests/bacnet
---------
Co-authored-by: Gregory Shue <gregory.shue@legrand.com>
Updating to integrate with Zephyr v3.2.0 required:
- Update `west.yml` to import Zephyr v3.2.0 manifest
- Prefix include pathname of ztest.h with `zephyr/`
- Prefix every Zephyr header included pathname with `zephyr/`
- Change all Zephyr tests/samples to use `find_package`
- For unit_testing, use a distinct prj.conf which only references
Kconfigs defined in the Zephyr repo. (Zephyr constraint.)
- Move ztest headers into a zephyr-prefixed pathname
Co-authored-by: Gregory Shue <gregory.shue@legrand.com>
* Leverage (older) embedded unit tests into external unit tests build upon copy of Zephyr's ztest library and CMake.
* Expand top-level CMake build to run external unit tests.
* Expand Zephyr module extension to run external unit tests via west or sanitycheck.
Co-authored-by: Gregory Shue <gregory.shue@legrand.us>