Commit Graph

53 Commits

Author SHA1 Message Date
Steve Karg 142d50db16 Added more kconfig for zephyr build. Added more creatable objects for zephyr build. 2024-07-22 15:40:20 -05:00
Steve Karg 3246d6bd72 Fixed zephyr B-SS sample build under native_sim 2024-07-22 14:56:12 -05:00
Steve Karg 1e889b633c Added Zephyr settings and basic device in subsys. (#697)
* Added Zephyr settings subsys to enable storing of BACnet values according to BACnet object property value path.

* Added BACnet Basic features to enable basic samples. Refactored the zephyr BACnet profile B-SS sample to use BACnet basic subsys.
2024-07-19 17:12:20 -05:00
Steve Karg 90714c094c Fixed BACnetHostNPort known property decoding. (#700)
* Fixed BACnetHostNPort known property decoding.

* Added BDT-Entry and FDT-Entry to BACapp for known property encoding/decoding.
2024-07-19 16:45:09 -05:00
Steve Karg 83ac107258 Added BACAPP Kconfig options for Zephyr OS builds. (#655) 2024-05-29 15:06:05 -05:00
Steve Karg 8eab077ebf Added function to determine if an object property is a BACnetARRAY. (#642)
* Added function to determine if an object property is a BACnetARRAY.  Added property test for BACnetARRAY members.
2024-05-15 13:25:44 -05:00
Steve Karg affb358139 Feature/add basic structured view object (#641)
* Added basic structured view object and unit test. Added example structured view into server example.

* Removed creation of objects from basic device object into the server example
2024-05-14 14:51:45 -05:00
Steve Karg f929a10ad2 Fixed zephyr bip_get_addr endian UDP port number 2024-04-22 08:11:18 -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 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 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 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 dfef5208d1 Bugfix/bacapp deprecation fixes (#578)
* Secured bacapp_decode_application_data_safe(), bacapp_decode_application_data_len(), bacapp_decode_context_data(), bacapp_decode_known_property() for timestamp, bacapp_decode_context_data_len(), and bacapp_data_len() functions.

* Fixed Command, Credential Data Input, and Schedule objects unit test
2024-02-27 14:03:14 -06:00
Mikhail Antropov 8f576461a8 Feature/oscbs 29 calendar time object (#440)
* 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>
2024-02-01 23:01:27 -06:00
Ondřej Hruška 340bd09561 Implement missing data types for calendar and schedule (#474)
* Added the SpecialEvent struct for the Exception_Schedule property of Schedule, encode/decode/same functions, unit tests, and integrated into bacapp functions.

* Added the CalendarEntry struct for the Date_List property of Calendar and the SpecialEvent struct, encode/decode functions, unit tests, and integrated into bacapp functions.

* Added the DateRange struct for the Effective_Period property of Schedule, encode/decode functions, unit tests, and integrated into bacapp functions.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2024-02-01 10:57:46 -06:00
Steve Karg c6dcab8f0a Change Life-Safety-Point object to use Create/Delete-Object (#555)
* Change Life-Safety-Point object to use Create/Delete-Object
2024-01-12 16:01:50 -06:00
Steve Karg da2dc9841a Feature/raspberry pi blinkt color objects (#503)
* fixed BACnetXYcolor and BACnetColorCommand encode and decoding and improved unit test coverage. Refactored BACnetXYcolor to/from ascii into lighting module.

* added to the color, color temperature, and lighting output objects a fade/ramp/step engine.  Added color and color command coercion into the channel object and enabled color temperature object coercion.  Added CreateObject and DeleteObject service handling to the color, color temperature, lighting output, and channel objects.

* added blinkt demo app for Raspberry Pi [WIP]

* updated gitignore to simplify handling of apps folder contents

* fixed piface demo build

* added RaspiOS to pipeline for piface and blinkt! demo builds

* added device object timer function for child object types into example Device object.  Refactored device object to increment database revision for create or delete object services.   Refactored example app/server to use mstimer library and device child object timers.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-09-28 10:50:32 -05:00
Greg Shue dad9e13485 Issues/issue 461 update to zephyr v3 4 0 in ci (#463)
* [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>
2023-07-26 14:47:01 -07:00
Ondřej Hruška dab95eec3f Implement parsing for proprietary events (complex-event-type) (#420)
* Implement parsing for proprietary events (complex-event-type)

* Fix unit test linking for event.c
---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-05-16 23:55:55 -05:00
Steve Karg ced9dff0f2 Added AddListElement and RemoveListElement services (#418)
* Added AddListElement and RemoveListElement services

Added list-element codec and unit tests.
Added BACnetDestination codec and unit tests.
Added RecipientList handling to NotificationClass object.
Added AddListElement and RemoveListElement client example app.

* Fix defects found by scan-build and CPPCHECK

* Update ports errors found during CI builds

* Update zephy os test build missing files in CMakeLists

---------

Co-authored-by: Ondřej Hruška <ondra@ondrovo.com>
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-04-16 14:12:11 -05:00
Greg Shue c74a8cf3a9 Feature/bacnet bacerror unit tests (#407)
* Add <zephyr/fff.h> from zephyr v3.1.0

Zephyr is deprecating the zmock library in favor of using
the FFF faking library for defining and controlling fake
implementations of depended-upon APIs called by the code-under-test.

Signed-off-by: Gregory Shue <gregory.shue@legrand.com>

* Fix bacerror_decode_service_request return value; add unit tests

bacerror_decode_service_request() return value now includes
the apdu bytes parsed for invoke_id and service.

Also added a unit test for functions in bacerror.c, using `fff`
for faking the depended-upon functions.

Verified by:

1. (Pass) cd $bacnet-stack/test && make test

2. (Pass) west build -p always -b unit_testing \
              bacnet-stack/zephyr/tests/unit/bacnet/bacerror/ && \
              ./build/testbinary

3. (Pass) ./zephyr/scripts/twister -p unit_testing  \
              -T bacnet-stack/zephyr/tests/unit/bacnet/bacerror/

Signed-off-by: Gregory Shue <gregory.shue@legrand.com>

---------

Signed-off-by: Gregory Shue <gregory.shue@legrand.com>
Co-authored-by: Gregory Shue <gregory.shue@legrand.com>
2023-03-07 17:01:33 -06:00
Greg Shue 7f7b419411 Fix decode_signed32(); Add unit/bacnet/bacint tests (#392)
Fix decode_signed32() length for -8388608 and NULL apdu handling.

Add comprehensive unit tests for bacint.c functionality.

Verified by:

1. (Pass) From $bacnet-stack/test:
            make clean test
2. (Pass) From $workspace (above $bacnet-stack):
            west build -p always -b unit_testing \
              bacnet-stack/zephyr/tests/unit/bacnet/bacint/ && \
            ./build/testbinary

3. (Pass) From $workspace (above $bacnet-stack):
            ./zephyr/scripts/twister -p unit_testing \
              -T bacnet-stack/zephyr/tests/unit/bacnet/bacint/

Signed-off-by: Gregory Shue <gregory.shue@legrand.com>
Co-authored-by: Gregory Shue <gregory.shue@legrand.com>
2023-02-03 09:47:42 -06:00
Greg Shue 338d445b99 unit/bacnet/bits test (#391)
Co-authored-by: Gregory Shue <gregory.shue@legrand.com>
2023-02-02 11:45:47 -08:00
Greg Shue eb36033fd8 [OSCBS-41] Update to Zephyr v3.2.0 (#382)
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>
2023-01-18 08:50:31 -08:00
Greg Shue 35fa602bc6 [OSCbS-42] skip tests failing unit_testing (temp) (#378)
Co-authored-by: Gregory Shue <gregory.shue@legrand.com>
2023-01-09 08:47:02 -06:00
Greg Shue b8d345679b Oscbs 33 ci zephyr port (#375)
* zephyr: twister build fixes/patches

* zephyr: hack: suppress bvlc test (build failures)

Co-authored-by: Gregory Shue <gregory.shue@legrand.com>
2023-01-05 16:53:29 -08:00
Mikhail Antropov 32a312f974 Fix regressive zephyr unit tests (#339) 2022-09-21 09:08:37 -05:00
Mikhail Antropov 4b742effe1 Fix tests: (#314)
- misprint in ports/zephyr/bip-init.c
- error processing PROP_TRACKING_VALUE for the Color Temperature object in
  src/bacnet/bacapp.c
- misprint MSV test
- add hostnport.c for each zephyr tests
- fix colors and ms-input tests - remove mocking Device_Inc_Database_Revision()
  for zephyr tests
- debug the color temperature test
2022-07-30 03:31:38 -05:00
Mikhail Antropov 1b147e2edc OSCBS-23 Scalable BACnet object arrays, part #2
Add processing object table as section iterable for zephyr
      - zephyr/subset/object/device.c
      - zephyr/subset/object/objects.ld
    Add object descriptor array as dynamic list
      - zephyr/subset/object/object.h
      - zephyr/subset/object/*.c
2022-06-17 11:56:17 +03:00
Mikhail Antropov 6490daacba Fix build apps/ (#291) 2022-06-08 13:10:15 -05:00
Greg Shue 89a81447cc Merge pull request #261 from Michail-Antropov/OSCBC-18-sample-device-profile-B-SS
Add a description of the steps for running the b-ss profile under qemu
2022-05-05 15:35:21 -07:00
Mikhail Antropov 825d342f5e Add a description of the steps for running the b-ss profile under qemu 2022-05-05 14:43:51 +03:00
Greg Shue 183f6d9f6b Merge pull request #253 from Michail-Antropov/OSCBC-15-testing-datalink-by-mock
Oscbc 15 testing datalink by mock
2022-04-26 07:14:56 -07:00
Mikhail Antropov 30bdb89040 Remove rx62n testing 2022-04-25 02:36:33 +03:00
Mikhail Antropov c5304699bc Fix datalink/mock test for non-unit_testing board 2022-04-21 17:08:12 +03:00
Mikhail Antropov c85eeba2da Fix code review.
Added datalink_receive test using ports/rx62n/bacnet.c as an example.
2022-04-21 16:34:38 +03:00
Mikhail Antropov 5d1eb03069 Add datalink/cobs unit test 2022-04-20 11:38:58 +03:00
Mikhail Antropov 183938cac7 Add test datalink using mock functions 2022-04-20 11:38:58 +03:00
Mikhail Antropov 584003bb0a Extend Zephyr tests for the unit_testing board
Fix tests: basic/object/ai, basic/object/av, basic/object/access_credential
2022-04-20 11:35:57 +03:00
Steve Karg c3a4c229fe Issue 87 execute tests with GitHub ci (#234)
* Enable lcov coverage in unit testing via cmake.

* fix pipeline build error

* add compile options for unit test to silence some warnings

* remove all BAC_TEST unit tests in src/bacnet/ folder. They are now in test/bacnet/ folders using ztest.

* removed key.c - only used for unit test.

* produce XML test result output for parsing

* produce junit XML test result output

* change lint workflow to quality

* update readme badge for quality results

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-02-28 20:09:46 -06:00
Greg Shue 8b8ef8f338 Issue 187 enable skipped ztest suites (#189)
* Fix some ztests that were skipped

* Expose bacapp_same_value()

* Fix bacapp, ptransfer tests

* Fix bugs in Load_Control object & tests

* refactor days functions from datetime module

* fix legacy ctests

* Add bacnet/basic/sys/days.[ch] to Zephyr build

* Update ztest to match from Zephyr v2.6.0; update ringbuf, datetime to build

* Fixup ztest test for object/acc

* Fix bvlc_address_from_ascii; enable/fix bvlc test

* Comment cleanup

* test/bacnet/basic/object/lc partially enabled

* Fix bacapp_decode_data_len return status on erroneous input

* fix ztest include fatal error

* fix ztest strsignal reference fatal error

* fix zassert_mem_equal reference syntax error

* fix zassert_mem_equal reference syntax error

Co-authored-by: Gregory Shue <gregory.shue@legrand.us>
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-08-16 17:29:40 -05:00
Greg Shue 9acca32ba8 Moved west.yml to root; updated to zephyr v2.6.0 (#186)
Co-authored-by: Gregory Shue <gregory.shue@legrand.us>
2021-08-03 09:12:45 -05:00
Greg Shue c5f59af14b Zephyr cleanup (fix date-time.c, cleanout device.c, use full C lib) (#124)
Co-authored-by: Gregory Shue <gregory.shue@legrand.us>
2020-09-23 14:27:52 -05:00
Greg Shue a95b7d597e Zephyr core bacnet server port; bacnet/device test (#123)
Co-authored-by: Gregory Shue <gregory.shue@legrand.us>
2020-09-22 09:24:38 -05:00
Greg Shue 5c2f198fd8 Issue 121 zephyr module cleanup west 0 8 0a1 (#122)
* Rm top-level west.yml; Cleanup manifests; Fix unit testing

* Cleanup sample

* Cleanup test CMakeLists

Co-authored-by: Gregory Shue <gregory.shue@legrand.us>
2020-09-17 09:58:06 -05:00
Greg Shue 19869dccdb Feature/zephyr ztest (#118)
* 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>
2020-09-16 07:33:34 -05:00