Commit Graph

3387 Commits

Author SHA1 Message Date
Ondřej Hruška e143066b29 object/nc: Fix incorrect apdu_len calculation (#517)
* object/nc: Fix incorrect apdu_len calculation when encoding Recipient_List which had resulted in malformed APDU.

* enabled unit testing on notification-class object example

---------

Co-authored-by: Tomasz Kazimierz Motyl <butterfly_tm666@yahoo.com>
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-10-18 11:10:17 -05:00
Steve Karg 20029d3f7a Issues/issue 513 how to reinitialize a bacnet stack on windows (#514)
* Check init flag before cleaning up WSA for BACnet/IP

* Check for valid socket before cleaning up WSA for BACnet/IPv6

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-10-17 23:40:28 -05:00
Jonathan e945c948d1 vmac.c : Fix a warning that 'device_id' is not used (#510) 2023-10-12 08:53:40 -05:00
BACnetEd 4188f88694 Added new linear.c to Microsoft Visual Studio project (#507) 2023-10-10 07:39:19 -05:00
Steve Karg af65a7066f added menu to release script (#506)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-10-02 09:27:56 -05:00
Steve Karg 357c3f746e update release script to manage dirty folders and create a better zip layout 2023-09-29 11:35:50 -05:00
Steve Karg 0bf5027fc7 update version to 1.3.1 for release on 29-September-2023. Happy Birthday, Krista! 2023-09-29 11:18:52 -05:00
Steve Karg d0dba10ddf update the blinkt readme with info on systemd services (#505)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-09-29 10:54:48 -05:00
BACnetEd 693c149644 Upgrading Microsoft Visual Studio toolchain (#502)
* Microsoft Visual Studio 2022 Community Edition contribution ( ports/win )

* Incorporated MSVC 2022 into ports/win32 directory

* merge readme.txt into README.md

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-09-28 17:20:04 -05:00
Steve Karg c9a85a1282 Refactor/write property object name (#504)
* refactor WriteProperty of object-name property rules into device object.

* remove dependence on device object inside some dynamic objects

* improve device object unit test coverage

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-09-28 15:30:28 -05:00
Steve Karg 95c2a86041 updated version to 1.3.0 for release on 28-Sept-2023 2023-09-28 11:26:30 -05: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
Steve Karg b0749572f6 Bugfix/fix write property decode deprecated (#499)
* fixed WriteProperty to use secure decode. Improve unit testing.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-09-16 10:23:08 -05:00
Steve Karg 75286cffe4 Bugfix/linux bip so bindtodevice error (#498)
* disable extraneous SO_BINDTODEVICE warning in Linux BIP

---------

Co-authored-by: Steve Karg <steve.karg@legrand.us>
2023-09-14 11:09:11 -05:00
Steve Karg 0cfe83d60b add support for building with deprecation bypass 2023-09-13 16:32:07 -05:00
Steve Karg 43db974e50 added [feature#14] EventTimeStamp decoding from ReadPropertyMultiple app (#496)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-09-13 09:08:35 -05:00
Steve Karg b14177672b Fixed datetime decode of invalid tag. (#495)
* Fixed datetime decode of invalid application tag.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-09-12 15:11:52 -05:00
Steve Karg e9bdb15684 update security promise for 1.2.x branch 2023-09-11 19:16:39 -05:00
Steve Karg 62982f9308 added release script 2023-09-11 14:20:24 -05:00
Steve Karg 08b28dd6f4 fix github release to sf.net workflow 2023-09-11 11:37:53 -05:00
Steve Karg 7f619e4245 fix github release to sf.net workflow 2023-09-11 10:40:29 -05:00
Steve Karg 40956dec10 Updated version to 1.2.0 for release on 11-September-2023 2023-09-11 10:07:19 -05:00
Steve Karg 94dd465e7b Change mstpcap to either write to pipe or file, not both. (#492)
* Change mstpcap to either write to pipe or file, not both.

Fixed bug#83 of mstpcap.exe Permission Denied in Wireshark

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-09-11 09:41:54 -05:00
bakmaria e4dd30ed89 Fix wrong calculation of frames in bacapp_data_len (#491)
* Fixed wrong calculation of data length.  In cases when 2 sets of opening & closing tags (first opening tag context tag is 3, second is 0) were sent, one of the frames wasn't added, and the resulted sum was wrong

* Added unit test for case with two sets of opening & closing tags
2023-09-11 09:41:06 -05:00
Steve Karg 55b8b3d93c fix BACnet/IP on OS to bind broadcast to specific port (#489)
* Fixes #346 by binding the broadcast socket to the port specific broadcast address rather than INADDR_ANY or INADDR_BROADCAST. Added additional compile and environment options for those who might need them. 

* Changed the define USE_CLASSADDR to BACNET_IP_BROADCAST_USE_CLASSADDR to help manage namespaces.

* Added BACNET_IP_BROADCAST_BIND_ADDR environment variable to override the default broadcast binding address.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-09-10 10:24:18 -05:00
Steve Karg 0001f85f29 Bugfix/network port object link speeds (#488)
* fix ports/xplained build under Linux

* fix network port object link-speeds property

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-09-08 17:41:56 -05:00
Steve Karg bd597082d2 Fix ReinitializeDevice service handling of optional password (#487)
* Fix ReinitializeDevice service handling of optional password

* Improve ReinitializeDevice service unit testing

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-09-08 14:58:04 -05:00
Steve Karg f641aacddb Bugfix/deprecate decode tag number and value (#481)
* 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>
2023-09-08 11:39:27 -05:00
dependabot[bot] bc8c261153 Bump actions/checkout from 3 to 4 (#484)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 13:53:52 -05:00
Steve Karg f61f4300be Feature/add create object service (#476)
Added BACnet CreateObject and DeleteObject services

* refactored codec for BACnetPropertyValue into bacapp module
* added unit tests for BACnetPropertyValue
* refactored COV and Events to use BACnetPropertyValue codec API
* added unit tests for COV
* added overrun safe decoders for tag numbers and boolean context
* added unit tests and codecs for CreateObject and DeleteObject services
* added APDU service handers and senders for CreateObject and DeleteObject services
* added command line apps bacco and bacdo for CreateObject and DeleteObject services
* added CreateObject and DeleteObject service handling in example server app and device object
* added new BACnetRejectReason, Error Class, and BACnetAbortReason enumerations and conversions

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-08-28 13:02:35 -05:00
Steve Karg 8184afea12 Chore/make test parallel build limits (#480)
* re-enable parallel build for CMake unit tests, but limited to ncores on supported OSes. Using MAKEFLAGS in .bashrc to set the '-j' flag size causes problem for Makefile build of BACnet library which doesn't tolerate parallel builds.  Using "-j" without limits for CMake of unit tests overwhelms my lesser endowed build machines.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-08-25 15:15:32 -05:00
Steve Karg c383514a62 Chore/fix release script tools archive (#479)
* fix the tool archive for release script

* fix the source archive for release script

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-08-25 11:17:30 -05:00
Steve Karg 58a6373ffb Update release.yml (#472)
fix tag name from releases
2023-08-21 08:56:24 -05:00
Steve Karg ac9b99d46c Update change log for v1.1.2 2023-08-18 15:20:24 -05:00
Steve Karg 8a4d530caf Incremented version to 1.1.2 for release on 18-Aug-2023 2023-08-18 15:20:14 -05:00
Steve Karg a7012fbd12 Feature/add release script (#471)
* add release script

* updated changelog

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-08-18 14:59:01 -05:00
Steve Karg 2a15a451d0 improve router-mstp app usage (#470)
* improve router-mstp app usage

* add router-mstp app environment shell script

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-08-15 11:24:22 -05:00
Steve Karg 2b35883df6 Added MSTP Slave Node option to stm32f10x port (#467)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-08-07 09:45:30 -05:00
anthony-crystalpeak acb3b0f57d [libbacnet]: bacapp_data_len() + bacnet_tag_number_and_value_decode() (#453)
* Bugfix: bacapp_data_len() + bacnet_tag_number_and_value_decode()

* Fix bacnet_tag_number_and_value_decode function.
Add read buffer safe functions for opening, closing, context specific tags.
Fix bacapp_data_len function changes as indicated by unit testing.

* refactor bacapp_data_len
---------
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-07-31 16:50:14 -05:00
Mateusz Klatecki 28de333b6e Fix encode_context_bacnet_address (#464)
the original solution caused that after encode_bacnet_address the apdu pointer was moved too far because apdu_len took into account the length of the opening_tag
2023-07-31 11:24:25 -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
Greg Shue 3f7a4d2e19 Trim west.yml imported repository set (#460) (#462)
Verified by:

1. cd $workspace && \
   rm -rf modules/ && \
   west update && \
   zephyr/scripts/twister -p unit_testing \
      -T bacnet-stack/zephyr/tests/

   Visually verified all tests passed.

Signed-off-by: Greg Shue <greg.shue@outlook.com>
2023-07-24 20:36:03 -05:00
Steve Karg 077be0005f Fix spurious interrupts from STM32 ORE (#456)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-07-17 13:49:59 -05:00
Steve Karg 7db03ac5e5 Fix spurious interrupts from STM32 ORE (#456)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-07-17 13:49:40 -05:00
anthony-crystalpeak fcc9647983 AFL + Libfuzzer harnesses (#455)
* Package fuzzers

* Provide ability to remove main

* Don't build fuzzers by default
2023-07-17 10:06:32 -05:00
Steve Karg 9e7f8978fa fix router apps action for unknown dnet (#454)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-07-13 16:52:30 -05:00
anthony-crystalpeak da4db7c65e BUG: Prevent npdu_len from wrapping around at npdu_len=1 (#452) 2023-07-13 14:44:48 -05:00
anthony-crystalpeak 758cac3bed DOS: port might be null (#451) 2023-07-13 14:12:38 -05:00
Steve Karg 2bf1e9a548 Bugfix/writeproperty app known property (#450)
* Fix write-property app known property option

* Fix write-property app priority handling

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-07-13 10:21:21 -05:00
Steve Karg 4efaf097c0 Fix [bug#80] npdu_decode via deprecation (#447)
* Fix [bug#80] npdu_decode via deprecation

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-07-10 17:27:10 -05:00