Commit Graph

2880 Commits

Author SHA1 Message Date
Steve Karg 12a5e48b3e Bugfix/btl mstp local broadcast discard (#248)
* Discard Confirmed PDU DNER on local broadcast. Discard DER on local broacast.

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-04-02 08:44:04 -05:00
Steve Karg 050efc2472 Update lint.yml 2022-03-30 08:29:30 -05:00
Steve Karg 14e6ba3619 add splint Makefile target 2022-03-30 08:25:12 -05:00
Steve Karg 0a87360755 Fix file object TSM lookup PDU type comparison 2022-03-30 08:10:20 -05:00
Steve Karg 902949a192 update LwIP BACnet/IP abstraction (#246)
* update LwIP BACnet/IP abstraction. Integrate LwIP build with continuous integration.

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-03-29 17:47:44 -05:00
Steve Karg d7d3fa2f60 Feature/property list extra handling (#245)
* Add extra handling when property-list is included in required list.

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-03-28 11:29:22 -05:00
Steve Karg 5b07b484d4 Bugfix/cppcheck error code fixes (#244)
* Add flawfinder. Add error code for exit status.

* fix errors found by cppcheck

* fix initialization warning in unit test compile

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-03-28 10:29:52 -05:00
Thomas Bracht Laumann Jespersen 7b685d0e3d basic/object/iv: Replace "{Analog -> Integer} Value" (#243)
There are a few instances of "Analog Value" in the comments. Make them
"Integer Value" instead.
2022-03-28 09:21:32 -05:00
Thomas Bracht Laumann Jespersen cd3eff013a basic/object/iv: Name it "INTEGER VALUE", not "ANALOG VALUE" (#242)
Running the sample BACnet demo server, we noticed that the names of
integer-value types were all "ANALOG VALUE <n>" for some number n which
creates multiple objects with the same object-name.

Signed-off-by: Thomas Jespersen <tj@omnio.net>
2022-03-27 12:19:54 -05:00
gducerf 0963f65fc5 Update main.c (#241)
Corrected a double free. rpm_data must be updated as in apps/readpropm/main.c.
2022-03-14 16:24:48 -05:00
Steve Karg 7239b0e362 Update README.md
updated ASHRAE address.
2022-03-12 16:49:46 -06:00
Alexander Wells b787173a56 Various minor fixes/improvements (#239)
Includes:
- Making "rpm_data_free" a public method and using it where appropriate
  - Includes fixing memory leak in epics demo application
    (note Valgrind indicates that there are more...)
- Fix typo in cov.c
- Allow NULL max_apdu parameter to address_get_by_device
- Add missing include to s_cov.h
2022-03-10 15:29:10 -06:00
Steve Karg ffe9697dc0 Added unit test for GetAlarmSummary service (#237)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-03-05 21:45:38 -06:00
Nick Schaf aba098c450 Fix transmitted frame and pdu counters (#236) 2022-03-03 16:32:44 -06:00
Steve Karg a0449ff62f Update README.md 2022-03-01 09:30:08 -06: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
Nick Schaf 585cdb4a7d dlmstp statistics enhancements (#235)
- Add lost-token count
- Add invalid-frame-received count
- Add function to reset statistics
- Add function to retrieve statistics
2022-02-28 17:40:32 -06:00
Steve Karg 728b17f11f revert clang-tidy sprintf integer changes for bactext results (#233)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-02-28 14:58:11 -06:00
Steve Karg d0fe77c030 Bugfix/clang tidy applied 2022 (#232)
* clang-tidy applied fixes to src folder
* clang-tidy applied fixes to apps folder

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-02-27 19:14:17 -06:00
Steve Karg 5e70eeecfc Issue 10 ci add support for code spelling checks (#231)
* added make targets spell and codespell for spelling checks

* fix spelling errors detected by codespell

* added codespell to github workflow

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-02-27 16:02:17 -06:00
Nick Schaf b31cb43e22 Avoid redefining MSTP timeouts (#230)
* Avoid redefining MSTP timeouts

* Remove duplicate MS/TP time definitions

Ports of MS/TP datalink included #defines of several time values, which
were already defined in src/bacnet/datalink/mstpdef.h.  All those ports
already include that header.
2022-02-26 08:58:57 -06:00
Nick Schaf f5017b71b1 Feature/MSTP promiscuous read (#228)
* dlmstp callbacks for prmiscuous read

Add callback functions for start and completion of received frames to
inform the caller of these events.

* Fix exports and grammar

* Clarify naming of frame-complete callback

* Fixup code style and variable naming
2022-02-26 08:58:34 -06:00
Steve Karg 24eb5d7c87 bitstring capacity 8-bit size bug (#227)
* bitstring capacity 8-bit size bug

Codify the 8-bit size limit for bit-string capacity.
Thank you, Chris Ellec!

* Allow up to 32 byte bitstrings

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-02-18 13:36:07 -06:00
Alexander Wells d3e2a0d33f Fix valgrind warnings in trendlog functions (#226)
mktime requires the structure passed must be fully initialised:
https://en.cppreference.com/w/c/chrono/mktime#Notes
2022-02-18 11:36:45 -06:00
Patrick Grimm f191ca1a96 Feature/bip6 add ipv6 support for BSD and macOS (#223)
* Fixed bsd compile error ld: unknown option: --gc-sections

Signed-off-by: Patrick Grimm <patrick@lunatiki.de>

* Revert "Fixed bsd compile error ld: unknown option: --gc-sections"

This reverts commit e186e396dadb1875018de8b0e738c05b04c8f7d7.

* Feature/bip6 add bsd support, cp bip6.c from linux port

Signed-off-by: Patrick Grimm <patrick@lunatiki.de>

* Feature/bip6 add bsd support, fix missing member named s6_addr16 in struct in6_addr

Signed-off-by: Patrick Grimm <patrick@lunatiki.de>

* Feature/bip6 add bsd support, rename default ifname from eth0 ton en0

Signed-off-by: Patrick Grimm <patrick@lunatiki.de>

* Feature/bip6 add bsd support, update reference from Linux to BSD and appropriate interface names

Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2022-02-13 09:32:01 -06:00
Steve Karg 65c7425e0e Cleanup Makefile build on Win32 (#222)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-01-30 13:56:16 -06:00
Steve Karg 71604664d5 Added example Visual Studio 2019 project. (#221)
Used Yaniv S posted solution for MS VS 2017 which took
the sln (solution) from version 0.9.1 and updated it to
compile as static lib for 1.x.x branch.

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-01-30 13:55:56 -06:00
Patrick Grimm 6fa5c4085e Fixed uci compile errors (#220)
* Fixed UCI=1 compile ld: warning: directory not found for option \-L/usr/local/lib,-luci'

Signed-off-by: Patrick Grimm <patrick@lunatiki.de>

* Fixed bsd compile error ld: unknown option: --gc-sections

Signed-off-by: Patrick Grimm <patrick@lunatiki.de>

* Revert "Fixed bsd compile error ld: unknown option: --gc-sections"

This reverts commit e186e396dadb1875018de8b0e738c05b04c8f7d7.

* Fixed UCI=1 Undefined symbols "_ucix_init" for bacserv

Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2022-01-29 18:23:28 -06:00
Patrick Grimm 3ddc851876 Fixed bsd compile error ld: unknown option: --gc-sections (#217)
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2022-01-29 16:08:47 -06:00
Patrick Grimm 5daa34dae3 Change uci device_init from src to apps. it is more maintainable. (#219)
* Change uci device_init from src/bacnet/basic/object/device to apps/server to make it more maintainable

Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2022-01-29 16:08:08 -06:00
Steve Karg 295f127c2b Feature/makefile add apps library (#218)
* add BACnet stack library at apps/lib

* convert apps to use apps/lib for smaller binary

* fix -DBACDL_ALL=1 build

* fix piface build

* datalink MAX_MPDU and MAX_HEADER cleanup

* add bip6 to git workflow

* fix system library dependency of BACnet library

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-01-29 15:55:40 -06:00
Steve Karg 9c72572692 Feature/bacnet time sync override (#215)
* add --time and --date options to command line time sync for override

* remove PRINT_ENABLED compile overreach

* fix bacstr.c for non-PRINT_ENABLED compile

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-01-20 16:42:47 -06:00
Steve Karg 8847d7eea1 Fixed BACDL=none build for makefile building (#213)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-01-12 09:10:00 -06:00
Alexander Wells ca32676662 Add bip_get_socket (#210)
* Add function to get BIP socket

* Add bip_get_socket to all applicable ports
2022-01-10 10:15:54 -06:00
Steve Karg 861eff121c Feature/bip6 win32 debug enhancements (#212)
* Move win32 specific checks to bacport.h module

* Create IPv6 snprintf function in bvlc6.c module

* Improve BIP6 debug for win32 port

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-01-10 10:13:51 -06:00
Steve Karg 889b7f9357 Feature/bip6 debug enable (#209)
* Added BACNET_BIP6_DEBUG environment variable to enhance BACnet/IPv6 debugging

* Added BACNET_BIP6_DEBUG environment variable to enhance BACnet/IPv6 debugging

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-01-08 11:34:11 -06:00
Steve Karg d77925a252 Added COV notification callbacks (#208)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-12-20 14:41:02 -06:00
Steve Karg 0d9ba89616 fix timesync to send time update (#207)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-12-16 19:10:19 -06:00
Chris Salisbury 94f02a9a21 Add a Dockerfile and update bin readme (#202)
* add dockerfile for easier testing

* whitespace

* update tools source location in bin readme

* add target to example build and remove optional CMD from example run
2021-10-29 10:52:28 -05:00
Steve Karg 36bd46c5e8 Modify WhoIs app to use APDU timeout between repeated WhoIs. Add --timeout option to bypass BACNET_APDU_TIMEOUT environment variable (#201)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-10-13 11:44:03 -05:00
Steve Karg 88a3921c5b Issue 188 compile failed when bbmd enabled 0 (#200)
* Fix compile for BBMD=none

* Add compile for BBMD=none to pipeline

* remove appveyor. add codeql badge

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-10-13 10:37:01 -05:00
Steve Karg 73bfda54ed Add --retry C option for repeating Who-Is or I-Am C number of times (#199)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-10-12 10:32:41 -05:00
Steve Karg eff691aedd Bugfix/codeql initial fixes (#195)
* Fix to BVLC6 bounds checking

* Convert MSTP capture to use datetime library

* Convert timesync app to use datetime and mstimer library

* fix workflow per warning

* fix BSD mstimer init function name

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-09-17 09:21:26 -05:00
Steve Karg 63a8735fa7 Create codeql-analysis.yml (#193)
* Create codeql-analysis.yml

* Update codeql-analysis.yml

* Update codeql-analysis.yml

fixing detected YML syntax error
2021-08-20 07:27:21 -05:00
Steve Karg efa975dac7 Copy travis CI workflow to github (#192)
* Initial port of travis CI workflow to github

* fix embedded github workflow

* fix embedded github workflow

* fix gcc and lint github workflow

* fix gcc and lint github workflow

* Remove appveyor and travis CI to reduce maintainence

* fix lint CI workflow

* restore appveyor CI

* restore appveyor CI badge

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-08-18 15:08:02 -05: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
Steve Karg 541f4024fb Bugfix/network port object bdt required (#184)
* Added BDT encoding to network port object.

* Added BDT encoding rules from clause 21

* Added FDT encoding to network port object.

* added more unit tests for BVLC

* Fix network port and device object unit tests

* fix router build for bvlc dependencies

* fix router build for bvlc dependencies

* fix network port MSTP compile

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
Co-authored-by: Steve Karg <steve.karg@legrand.us>
2021-08-03 09:55:01 -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
Steve Karg 4b9e154256 Feature/mstp extended frames cobs encoding (#183)
* added COBS encode and decode from BACnet standard

* Add unit tests for COBS encoding and decoding

* Improve COBS unit test and API.

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-07-30 16:16:12 -05:00
Steve Karg 810a2f93de Feature/write property type check refactor (#182)
* refactor write-property tag check

* modify ports objects to use write-property tag check API

* modify example objects to use write-property tag check API

* Fix object unit test builds

* Fix and run unit ztests via CMake

* Enable unit testing on Travis CI

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-06-23 10:10:12 -05:00