Commit Graph

3006 Commits

Author SHA1 Message Date
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
Steve Karg 31b7fb3c40 Fix keylist signed integer wraparound (#179)
* Fix keylist signed integer wraparound

Fix the keylist to handle large number of nodes where the signed integer
would wrap around.

* Add explict keylist new size case for less than zero

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
Co-authored-by: Steve Karg <steve.karg@legrand.us>
2021-06-12 22:37:51 -05:00
Steve Karg 89d7af707e Fix FreeBSD 11 compile via gmake gcc (#180)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-06-12 19:27:29 -05:00
Steve Karg 40cce9f97c TSM transmit buffer static init not needed. Thank you, John Kehr (#177)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-06-11 08:20:33 -05:00
Steve Karg 3e9807327b Added characterstring change of value example (#175)
* Added characterstring change of value example

* Add COV to unit tests

* Add memcopy to object COV unit tests

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-05-24 20:15:03 -05:00
Steve Karg 3ed77e2491 DSR-1471: fixes data race issues on ring buffer for MSTP (#9) (#174)
* DSR-1471: fixes data race issues on ring buffer

* DSR-1471: added missing semi-colon

Co-authored-by: Fraser Gordon <51318560+FraserG01@users.noreply.github.com>
2021-05-24 18:53:59 -05:00
Steve Karg 4349e53203 Added cppcheck of BACnet source into pipeline (#171)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-05-21 09:00:57 -05:00
Steve Karg b38d975f35 Bugfix/compiler warning (#172)
* Fix compiler and static analysis warning

* revise to use for loop pattern

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-05-21 09:00:40 -05:00
Steve Karg cea8c0e64c Added ethernet target for Makefile and Travis (#173)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-05-21 09:00:21 -05:00
Steve Karg a4fe367ac0 Added write BDT application (#170)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-04-23 13:46:21 -05:00
Steve Karg 70c1d8bd7a IPv6 MAC length is 3 after public review. (#169)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-04-23 13:45:57 -05:00
Steve Karg 9bc40ea9bd Check length of packet before decoding it (#168)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-04-23 13:45:41 -05:00
Steve Karg 5490101a4f Bug#76 Fix Send_WhoIs_Local destination address. Thanks, Duffy! (#167)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-04-23 13:45:02 -05:00
Steve Karg 541d4591e9 Reject DCC password out of range (#166)
* Reject DCC password out of range

* Fix unit test after return value change

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-04-23 13:44:39 -05:00
Steve Karg 297a11665b Fix MSTP skip data state to result in not-for-us (#165)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-04-23 13:44:20 -05:00
Steve Karg a7bc145c43 Feature/alarm ack application (#164)
* Added alarm-ack application

* fix error and simple ack handling for event notification

* Added ack-alarm application

* Update CMake for ack-alarm

* update example objects for alarm and events

* Allow repeated ack-alarm for same transition

* add event state API. Fix COV event state.

* add event state API to AV. Fix COV event state.

* Use event time for ack notification

* Enable notifications for all transitions by default. For testing.

* Use unconfirmed device notification to 4194303 for testing.

* initialize local vars

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-04-22 08:33:04 -05:00
Steve Karg 2277ff903a Fix the gateway example routing and lookups. Thanks, Sam! (#163)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-04-02 14:13:31 -05:00
Steve Karg 7664b744d9 Fix the gateway example routing and lookups. Thanks, Sam! (#163)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-04-02 14:12:49 -05:00
Stephen Dawson-Haggerty adf66f412d Fixes Issue #157 (Router segfaults) (#159)
Found a number of problems with the router when compiling on linux

* Expected malloc()'ed memory to be zeroed resulting in segfault
* IPC_NOWAIT in iplayer loop means incoming traffic will be delayed until outgoing traffic is received.
* When configured with two BIP interfaces, broadcast loops ensue because the broacast traffic is not correctly filtered.  I think the safest thing to do here is to use the SO_BINDTODEVICE setsockopt.
2021-03-11 14:54:11 -06:00
Steve Karg 038ba9ec2b Feature/access event notification (#156)
* Added event notification for access event. Thank you, Ojdanic Andrijana!

* Added event notification for command failure. Thank you, Ojdanic Andrijana!

* Fix event notification ztest

* Fix event notification ztest

* Added ztest for command failure and access event

* fix zassert_equal test function args

* fix zassert_equal test function args

* fix zassert_true test function args.

Fix verifyBaseEventState().

* Fix octetstring_value_same to use zassert_true

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-02-22 13:23:48 -06:00
Steve Karg b2da64d93d Fix WPM for BTL - 9.23.2.X1 (#155)
* Fix WPM for BTL - 9.23.2.X1

* Fix WPM handler from scan-build error

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-02-15 19:39:26 -06:00
Steve Karg 117db88ce6 Feature/confirmed event notification app (#153)
* Initial ConfirmedEventNotification app

* Fixed event argument processing

* Adjust event argument processing.

Move the common event arguments
Enable text lookup for some event arguments.

* Fix CMAKE for event app.

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-02-10 10:58:47 -06:00
Steve Karg 80114088f9 Fix the encoding of network port number for BACnet IP (#147)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-01-14 00:00:27 -06:00
Steve Karg 69f876f1c9 Discard confirmed APDU from original broadcast in BIP and BIP6 datalink (#149)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-01-13 13:59:16 -06:00
Steve Karg 0a9fbaf438 Bug#74 Printing of the Read property acknowledgement when APDU len is > 255 bytes. Thank you unnakb! (#148)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-01-13 13:58:50 -06:00