Commit Graph

64 Commits

Author SHA1 Message Date
Steve Karg fa42e07ffd add missing bigend.c file to IAR project (#266)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-05-05 10:36:57 -05:00
Steve Karg 6cd58f469d Bugfix/confirmed request service decode error (#259)
* Fix confirmed service decode error handling. Thank you, Bryan!

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-05-04 15:33:46 -05:00
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 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
Nick Schaf aba098c450 Fix transmitted frame and pdu counters (#236) 2022-03-03 16:32:44 -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
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
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 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
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
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 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
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
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 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 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 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 7cb63dcf06 RP and RPM Network Port indefinite object instance (#146)
* RP and RPM Network Port indefinite object instance

Added ReadProperty and ReadPropertyMultiple handling for
Network Port object indefinite object instance 4194303.

* Add network port object to some examples

* Fix stm32f10x build

* Fix Endian order of network port IP UDP port

* Add network port object to BDK Makefile

* Add network port object header to BDK device.c

* fix BDK and AT91SAM7S port builds

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-01-07 10:21:11 -06:00
Steve Karg 63e4fa1f4b fixes #141 Linux BIP with no default gateway (#144)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-12-21 13:07:24 -06:00
Michael Francis cb9b166515 Replace "bits/pthreadtypes.h" include with <sys/types.h> in /ports/linux/dlmstp_linux.h (#139)
This resolves #129 by making this file able to be built on Alpine Linux
2020-11-20 21:38:27 -06:00
Steve Karg 84bfdb6c9d Fix STM32F10x CMSIS ASM for newer compilers (#137)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-10-30 12:04:32 -05:00
Steve Karg 06dde5050c Add MSTP port to nucleof429zi using DFR0259 RS485 shield (#136)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-10-30 11:53:57 -05:00
Steve Karg 762ffacc8e Bug#72 reading zero bytes in linux BIP. Thanks, Mikhail! (#132)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-10-10 10:45:12 -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 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
Gregory Shue 6ccc9505f3 Simplest Zephyr module + bacnet_stack config and hello sample 2020-08-29 13:08:08 -07:00
Steve Karg 645c1b7916 Fixed AVR ports IDE project builds (#111)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-08-19 10:05:01 -05:00
Carlos Gomes Martinho 981d4036c8 refactor: rename test macro to prevent collisions (#91)
* refactor: rename test macro to prevent collisions

* style: align cmake epilog

* refactor: rename define in makefiles
2020-05-28 08:55:05 -05:00
Steve Karg cbfa74e48d Bugfix/bacnet real endian simplify (#89)
* Remove dependence on endian define

* Make use of existing big_endian function if BACNET_BIG_ENDIAN is not defined

* Add efficient endian macro option if available

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-05-24 09:36:21 -05:00
Roy Schneider 764e0e8448 Feature/zeroing rx buffer remain (#90)
* Added zeroing rx buffer remain

* Added zeroing rx buffer remain

* Added safety margin for the rx-buffer in the different ports.

* Added safety margin for the receive buffer.

* Added DoxyGen comments.

* Fixed checking return value when calculating distance between opening and closing tag on multiple properties.
2020-05-24 09:19:52 -05:00
Steve Karg ec923e51a3 Bugfix/device object protocol revision 14 property list (#82)
* Added property-list to device object for client applications

* Added property-list to some AVR ARM and RX62 ports

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-05-02 14:01:09 -05:00
Steve Karg fdd49f1791 Feature/make pretty apps and ports (#80)
* Added pretty-apps and pretty-ports make targets

* pretty-fied apps folder C files

* Pretty-fied ports folder C and H files

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-04-30 10:13:11 -05:00
Steve Karg dbbcec3033 Feature/bacnet ipv4 default iface linux (#75)
* Added default IFACE for IPv4 on Linux

* fix potential leak of memory found by scan-build

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-04-16 15:55:38 -05:00
Roy Schneider 8f13d59629 Feature/comments and buffer checks (#73)
* Added comments

* Replaced Goto construct

* Added apdu_len check

* Added comments

* Added string limit and reworked printable check

* Mainly comments

* Just comments

* Just comments

* decode service request returns now non zero on success

* eliminated warnings

* Added character string init with length check.

* Paranoic length check

* Comments and object index checking on read/write.

* Check name/desc strings before returning.

* Eliminated Goto
2020-04-16 10:38:49 -05:00
Roy Schneider b55a0263f8 Feature/length check use pointers (#66)
* Added received bytes length check and some comments.

* Added more check for MAX_PDU
2020-04-13 06:15:50 -05:00
Steve Karg eedfa58a55 Feature/refactor bacnet ipv4 add unit tests (#64)
* refactor BACnet/IPv4 BVLC into encode-decode library with unit tests
Added Read-Broadcast-Distribution-Table encoding and unit test.
Added Read-Broadcast-Distribution-Table-Ack encoding and unit test.
Added Read-Foreign-Device-Table-Ack encoding and unit test.
Added some BDT/FDT diff copy functions with unit tests
Added some FDT add and delete entry functions with unit tests
Added some BDT set append and clear entry functions with unit tests
Added some BIPv4 address conversion functions with unit tests
Added non-BBMD handling unit test
Added basic unit test for BBMD handler
Added BBMD broadcast mask get set and unit tests
Added IPv6 maintenance timer.
Added ReadFDT app
Fixed ReadBDT app
Added Who-Is to Makefile for individual app build
Fixed debugging code blocks projects by swapping bip.c for h_bbmd.c module.
Ported BACnet/IPv4 to refactored BVLC for Linux, BSD, Windows
Fix datalink debug for DLENV module
Improve BIPv4 linux driver debug info
Added BDT mask functions
Reduce debug info clutter in Who-Is app by using environment option
Fix TTL seconds upper bounds addition
Fix CIDR prefix calculation on Linux BIPv4.
Convert BSD BIPv4 to BVLCv4
Fix CMake build for BIPv4 (Linux, BSD, Windows)
Added [U]nsigned to 0xBAC0 constants
Cleanup POSIX and Win32 API sockets
Remove unnecessary file scope variable initialization
Fix routed NPDU to depend on datalink; fix warning
Remove OS dependent network code from gateway
Enable BBMD client in library by default
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
Co-authored-by: Steve Karg <steve.karg@legrand.us>
2020-04-04 11:31:54 -05:00
Steve Karg 0ce6368b43 Feature/refactor datetime os dependency (#63)
* remove dependency on OS for time functions.

* add datetime epoch to and from seconds (yikes! 64-bit!). Add symmetric midnight seconds for unit test. Add unit tests.

* clean up BACnet date time warnings

* fix BACnet datetime warnings

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-04-04 11:23:26 -05:00
Steve Karg f18612f1ec Fix mstimer elapsed time (#58)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-03-17 17:27:25 -05:00
Steve Karg 81d3a0b4a4 fix BVLC6 Delete-Foreign-Device-Table-Entry (#56)
* fix BVLC6 Delete-Foreign-Device-Table-Entry

* Add unit test failure detection to Makefile report target

* Fix the IPv6 layers for sending PDU

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-03-12 12:24:07 -05:00
Anonymous Maarten 4a916468c6 Export symbols in order to support shared libraries (#54)
* Add BAC_ROUTING compile definition

* Reorder cmake

* Fix OpenSSL support: support both 1.0 and 1.1t pus

* Explicitly export symbols, hidden by default

* Build shared libraries on travis using cmake

* Learn Makefile about static library

* Fix build using mingw with cmake

* Do not cleanup twice or after potential free
2020-03-06 15:42:03 -06:00
Steve Karg bb5fafc06a feat remove openssl dependency functions and add missing file to cmake (#52)
* feat: remove openssl dependency functions and add missing file to cmake

* chore: also build shared lib

* chore: also build shared for github ci

* chore: do not test shared libs in ci for the moment
2020-03-04 13:35:14 -06:00
Steve Karg 5ed135c441 build: drop old visual studio / code blocks build files (#53)
* build: drop old visual studio build files

* build: also remove code blocks files
2020-03-04 13:30:38 -06:00
Carlos Gomes Martinho 5d4358030a ci: add mac os to github ci (#51)
* ci: add mac os to ci

* ci: add appveyor file
2020-02-19 10:48:36 -06:00
Steve Karg 7fe81c65c8 Feature/bacnet unsigned integer 64 bit (#47)
* Feature/bacnet unsigned 64 bit

* Added ACCUMULATOR object

* removed or modified stdint.h since we use at least C99 standard compilers.

* CMake: Add BACDL_NONE.
2020-02-18 14:04:54 -06:00