Commit Graph

51 Commits

Author SHA1 Message Date
Steve Karg 38d213b47c Feature/color objects color command (#302)
* added BACnetColorCommand and BACnetxyColor encoding and unit testing

* Added Color object and unit testing.

* Added Color Temperature object and Unit test

* Fix BVLC unit test warning.

* add port Makefile for extra types

* added RGB to and from CIE xy utility in sys folder, and add unit tests.

* added cmake-win32 target

* Change RP and RPM to use known property decoder.

Add color object RP and RPM decoding and printing
Fix RPM print for new reserved range above 4194303
Change default protocol-revision to 24 for Color object

* Integrate Color and Color Temperature objects into demo apps

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-07-13 09:54:36 -05:00
Steve Karg ff6fcf456c Feature/bacrpm dnet mac adr destinations (#295)
* add dnet,mac,adr for bacrpm explicit destinations

* add usage help to readpropm for dnet,mac,dadr

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-06-12 15:02:20 -05:00
Steve Karg 6a8adcce3d Feature/writepropertymultiple error handler (#289)
* Added extended BACnet Error PDU handling for WPM

* Added BACnetObjectPropertyReference to bacapp module.

* Added unit testing for BACnetObjectPropertyReference

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-06-03 15:47:30 -05:00
Steve Karg ba0cbc1fb8 Feature/bacnet server client app example (#273)
* Create example server-client for R/W polling application example.

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-05-16 15:02:17 -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
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 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 65c7425e0e Cleanup Makefile build on Win32 (#222)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-01-30 13:56:16 -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
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 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
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 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 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 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 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 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 4b1794f93a Fix atomic readfile app when file reports zero length (#133)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-10-10 10:45:34 -05:00
Steve Karg cbaa106c59 Ignore FF padding in mstpcap (#120)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-09-17 09:59:48 -05:00
Steve Karg a7b2e94cb7 Added repeat option to Who-Is and I-Am app (#117)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-09-03 22:03:10 -05:00
Steve Karg f41b5377cc Added UTF8 multibyte to wide char printing in some apps (#106)
* Added UTF8 multibyte to wide char printing in some apps

* Fix test compile

* Reduce diff churn

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-07-27 22:44:43 -05:00
Steve Karg de7f7e9782 Feature/router mstp example app (#101)
* Ported router-ipv6 app to router-mstp

* Fixed router-ipv6 build

* Added router-ipv6 and router-mstp to pipeline

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-07-02 22:46:13 -05:00
radolin be57c73508 Set name after call to Init_Service_Handlers(), as it calls Device_Init() from device.c which overwrites it to SimpleServer (#98) 2020-06-19 07:50:54 -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 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 33cc55db30 Fixed router app after BACnet IPv4 refactor 2020-04-13 14:55:18 -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 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
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
Geert Linders f8ce70470c Fix (most) compilation warnings in Intel C++ Compiler (#38)
* Use BACNET_OBJECT_TYPE for all object type variables.

* Fix ICC "mixing enumerated type" warnings for assignments and parameters.

* Network Port: Use enums for state structs and remove erroneous bounds checks copy-pasted from IP_Subnet_Prefix setter.

* Fix ICC "unreachable statement" warnings.

* Fix ICC "unused variable" warnings when printing is disabled.

* Fix ICC "mixing enumerated type" warnings for struct initializers { 0 } by ensuring the first member is an integer type.

* Send_GetEvent_Global: Return 0 (invalid TSM invoke ID) instead of -1 = 255 (technically valid invoke ID) on failure.

* Fix ICC "pointless comparison" warnings.

* Fix wrong import in objects.c (memset being used).

* Fix signedness warnings and inconsistencies. Include -1 = 255 check in cov_address_get().

* Add some guards for BACAPP_LIGHTING_COMMAND to avoid errors/warnings.

* RPM test fixes

* Address requested changes. (#38)
2020-01-23 08:18:47 -06:00
Geert Linders 76abcaedd1 Reduce Tusage_timeout for all ports. (#37) 2020-01-22 17:07:44 -06:00
shuegr-personal 7f5045ff3f zero init stack-based struct sockaddrin instances; rm refs to sin_zero padding in non-ports files (#28) 2020-01-15 23:48:55 -06:00
Steve Karg 63899e6606 Fix gateway app build (#22) 2020-01-15 08:02:15 -06:00
Carlos Gomes Martinho d3014c87fa build: improve cmake, add github actions (#16)
* build: install cmake config files to enable cmake find_package

fix: destination for header files

build: clean up build system

build: also install port directory header files

build: fix name of header files

ci: add github actions

build: add bsd port

chore: fix typos

build: remove not deeded mstpsnap

ci: disable ctests as not corrently

ci: disable macos for the moment

build: print compiler versions in cmake

* build: do not build apps by default

* build: add missing slash

* build: add more options to cmake (#3)

* build: add more options to cmake

* chore: disable ipv6

* build: guard around apps for options

* build: fix link lib on windows
2020-01-14 23:25:41 -06:00
Roger Light 5a7049557b apps - allow text strings for object-type and property arguments. (#8)
The existing method of calling various example apps requires the user to
know the enumeration value for the object-type and property values. This
patch enhances to allow the object-type and property arguments to be
specified as strings, using the strings as defined in the spec. It does
not remove the old behaviour.

Current:
  bacrp 1234 3 1 85

New:
  bacrp 1234 binary-input 1 present-value

This change does not currently apply to the property arguments of the
readm and writem applications.
2020-01-14 23:18:30 -06:00
Martin Kudláček 52cdb5e365 Fixing paths and includes according to changes in directory structure 2020-01-03 20:29:12 +01:00
Steve Karg 830ab2d788 cleaned clang compile warnings 2019-12-18 21:14:05 -06:00
Steve Karg 956acac299 removed unmaintainable project files from IDE 2019-12-17 17:24:22 -06:00