Commit Graph

2866 Commits

Author SHA1 Message Date
Carlos Gomes Martinho 9137531eb0 fix: compiler warnings Wtautological-pointer-compare (#93)
warning: comparison of array 'wp_data->application_data' equal to a null pointer is always false [-Wtautological-pointer-compare]
2020-05-28 08:56:58 -05:00
Carlos Gomes Martinho 5efc16d3e4 refactor: use const char * instead of char * for inputs (#92)
fixes: "ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]"
2020-05-28 08:55:50 -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
Carlos Gomes Martinho 3818f3d844 ci: run pipeline also on pull requests (#88) 2020-05-18 11:04:34 -05:00
Steve Karg 3553ae56c2 Fixed objects list helper and unit test (#86)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-05-15 15:41:02 -05:00
Roy Schneider 094ac1db00 Feature/safe decode npdu (#84)
* Added safe version to decode npdu

* Calling safe decoder function.

* Added comments and apdu_len checks.

* Fixed signed/unsigned warnings.
2020-05-11 08:30:18 -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
Roy Schneider 05aaee7f6b Comments and length checks. (#81)
* Comments and length checks.

* Added max_apdu checking.
2020-05-01 20:29:21 -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
Roy Schneider 0abcbea971 Feature/app data buffer check (#79)
* Added comments and buffer overflow checks

* Removed backslashs from C-code.
2020-04-28 08:45:03 -05:00
Steve Karg 89929ee802 Fix the Abort and Reject enumeration max and comments. Thanks Brad! (#78)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-04-27 11:47:57 -05:00
Steve Karg 1fe6b7e670 Fixed #15 bactext engineering units for new reserved range (#77)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-04-23 14:42:38 -05:00
Steve Karg 62bfeba2c5 Fixed #57 crash for get alarm summary. Thank you Walter! (#76)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-04-23 07:29:56 -05:00
Steve Karg 5e9cb90a09 Update README.md 2020-04-17 08:36:19 -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
Steve Karg 1ead6acea5 Fix BACnet IPv4 decode to allow for NULL (#72)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-04-15 00:03:21 -05:00
Steve Karg 5c8e3406cb Fixed BACnet integer decode for 40-48-56 bits (#71)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-04-15 00:03:06 -05:00
Steve Karg 33cc55db30 Fixed router app after BACnet IPv4 refactor 2020-04-13 14:55:18 -05:00
Steve Karg 40f7aaba74 Added macro to calculate the next power of two for FIFO data store (#69)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-04-13 11:45:57 -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 4d1aca2a71 Updated readme with additional CI badges
Added AppVeyor and GitHub workflow badges
Add CMake instructions for Code::Blocks
2020-04-12 09:41:53 -05:00
Steve Karg d7918bb2ea Feature/add bbmd unit tests (#65)
* Added som BBMD IPv4 and IPv6 unit tests

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-04-11 22:58:07 -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 b159402647 Feature/enable mingw build (#62)
* enabled mingw win32 build in travis

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-03-27 13:30:16 -05:00
Steve Karg 9749d42161 Change ringbuffer return type to void pointer to fix cast align warnings (#61)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-03-20 17:02:46 -05:00
Steve Karg d557522c1f Bugfix/atmel studio arm compile warnings (#60)
* Cleanup warnings generated by Atmel Studio compiling for SAMD21 ARM

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-03-20 16:42:41 -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 1b9c1ad3b3 Update README.build 2020-03-12 20:59:34 -05:00
Steve Karg e94bf1bd5e Update README.md 2020-03-12 20:53:34 -05:00
Steve Karg 92645a9aaa Update README.md 2020-03-12 20:48:29 -05:00
Steve Karg 8ef03cf58d Update README.md 2020-03-12 20:45:37 -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
Steve Karg 677f528aa4 Added OS detection into tests to add EXE extension to test executables for cleanup. (#46) 2020-02-18 08:22:16 -06:00
Steve Karg 9c41180145 Add ifdef to bit definitions to avoid conflicts with other libraries. Refactor BITx to use BIT macro. (#45) 2020-02-18 08:21:54 -06:00
Steve Karg cf963a63ca Added IPv6 ascii address decode (#43) 2020-02-10 17:15:47 -06:00
Steve Karg cf24303128 add mstp targets into Makefile. Add mstp as stage in CI jobs. (#41)
* add mstp targets into Makefile. Add mstp as stage in CI jobs.
2020-02-02 10:02:00 -06:00
Steve Karg 914f502cff Bugfix/add makefile lint fix warnings (#39)
* fix warnings indicated by scan-build lint tool

* add lint target to makefile using scan-build tool

* add lint into build script stages (note: uses scan-build-7)

* fix potential use of memory after it is freed
2020-01-28 18:48:29 -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
Geert Linders 09a7d3876f Fix + expand BACnetDoorStatus enum. (#36) 2020-01-22 17:05:46 -06:00
Roger Light 25f386bca7 Make all demo object variables static. (#14) 2020-01-22 17:04:39 -06:00