Commit Graph

3162 Commits

Author SHA1 Message Date
Steve Karg 8a23c9b244 Added FAQ 18 for firewall info (#587) 2024-03-01 16:13:57 -06:00
Steve Karg 3f4ccb55d5 Added a BASH script for parallel EPICS clients registering as foreign devices to a BBMD (#586) 2024-02-29 09:12:35 -06:00
Steve Karg 5c55683f86 Fixed makefile for building the Linux router application. (#585)
* Fixed Makefile for building the Linux router application.
2024-02-28 17:08:00 -06:00
Steve Karg 1176b0d966 Feature/bacnet discover dnet devices (#583)
* Added an example application to discover devices and their objects and properties on a specific destination network. The application uses a BACnet Discovery FSM module along with the BACnet R/W FSM.  The BACnet Discovery module stores the binary property data in Keylists and includes device object property queries and iterators.

* Added callback from BACnet R/W FSM module for I-Am messages.

* Removed dependency in BACnet R/W FSM module on rpm_ack_decode_service_request() which uses calloc/free value lists.  Created an alternate RPM-ACK to RP-ACK processing function.

* Changed RPM handler to skip over unknown property values
2024-02-28 12:56:09 -06:00
Steve Karg dfef5208d1 Bugfix/bacapp deprecation fixes (#578)
* Secured bacapp_decode_application_data_safe(), bacapp_decode_application_data_len(), bacapp_decode_context_data(), bacapp_decode_known_property() for timestamp, bacapp_decode_context_data_len(), and bacapp_data_len() functions.

* Fixed Command, Credential Data Input, and Schedule objects unit test
2024-02-27 14:03:14 -06:00
Steve Karg 33c7df249a Feature/arbitrary apdu application (#580)
* Added application to send an arbitrary APDU string of hex-ASCII
2024-02-23 09:24:05 -06:00
Steve Karg fd2c49bf65 Fixed apps/Makefile to use apps/lib/libbacnet.a module instead of omodule in system /usr/lib folder. 2024-02-19 10:32:02 -06:00
Steve Karg 8401f01b75 add a clean target in apps to remove stale library 2024-02-18 10:01:38 -06:00
Steve Karg 58419602da improve release script - only write to tmp folder 2024-02-17 17:38:28 -06:00
Sebastian Weyer d43d818400 Add missing binary input functions (#574)
* bi.c: add possibility to set custom object names

Add an array of MAX_BINARY_INPUTS values containing the custom object
names.

When calling Binary_Input_Object_Name, if no custom name has been set,
return a string with the object type and the object instance number.
Otherwise, return the custom object name.

When setting the object name, first check that the string is not NULL,
then set the name in the new array.

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>

* bi.c: add possibility to set custom description

Implement functions Binary_Input_Description and
Binary_Input_Description_Set. Binary_Input_Description will return an
empty string if no custom description has been set yet.

In order to store the custom descriptions, we declare a new array with
MAX_BINARY_INPUTS amount of values.

When setting a new description using Binary_Input_Description_Set, we
first check that the new description is not NULL and then store it in
array at the object_instance position.

In the Binary_Input_Read_Property function, we need to split
PROP_DESCRIPTION from PROP_OBJECT_NAME in the switch case as before the
object name would be returned when the description was being read by a
client. Now we properly call Binary_Input_Description.

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>

---------

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
Co-authored-by: Sebastian Weyer <sebastian.weyer@smile.fr>
2024-02-16 12:07:28 -06:00
Sebastian Weyer 20b969d26b ao.c: set proper bounds for Analog_Output_Present_Value_Set and Analog_Output_Present_Value_Write (#575)
* ao.c: set proper bounds for Analog_Output_Present_Value_Write

The lower and upper bounds to the value passed to this function were
hard-coded to 0 and 100 respectively. This meant that a client was not
able to write a value outside of these bounds, regardless of the values
of `Min_Pres_Value` and `Max_Pres_Value`.

Now properly compare the new value against `Min_Pres_Value` and
`Max_Pres_Value` and only return `ERROR_CODE_VALUE_OUT_OF_RANGE` when it
is outside of this range.

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>

* ao.c: make Analog_Output_Present_Value_Set return 0 when out of range

Compare the new value passsed to `Analog_Output_Present_Value_Set`
against `Min_Pres_Value` and `Max_Pres_Value`. If the new value is
outside of these bounds, don't update the present value and return false.

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>

---------

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
Co-authored-by: Sebastian Weyer <sebastian.weyer@smile.fr>
2024-02-16 12:06:40 -06:00
Steve Karg d044736ecb enable rebuilding tagged release code and zips in a working tree in temp folder 2024-02-16 12:03:05 -06:00
Steve Karg 93d47d95d5 fix release tool to have a prefix folder with the tag version name 2024-02-16 11:10:39 -06:00
Steve Karg 84c638e5a1 remove ARM library for stm32f4xx port 2024-02-16 10:24:06 -06:00
Steve Karg 89fa3cea77 Fixed the Network Port object subnet mask for IP example. (#573) 2024-02-13 14:15:59 -06:00
Steve Karg 190183966c update keylist to use bool and stdint value for key not found. (#572)
* Updated keylist to use bool and stdint value for key not found.

* Added Keylist_Index_Key to deprecate Keylist_Key function

* Changed the deprecated Keylist_Key API to Keylist_Index_Key

* Added unit test for Keylist_Index_Key API
2024-02-12 17:35:15 -06:00
Steve Karg 7eedaa406d Bugfix/bacaddr dnet only init (#570)
* Fixed bacnet_address_init() when setting only the dnet value.

* Fixed MSVC snprintf from C99
2024-02-08 16:39:49 -06:00
Steve Karg 58c19ebd2a fix function header comment 2024-02-08 14:55:33 -06:00
Steve Karg 851d10bc02 Move some platform compile fixes into platform.h file 2024-02-08 14:54:17 -06:00
Sebastian Weyer 46d686a8ab Add missing object functions to analog inputs and values (#568)
* ai.c: add possibility to set a custom object name

The Name_Set function is already declared in the header but not
implemented. With this implementation, one can set a custom object name
from a server application.

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>

* av.c: add possibility to set a custom object name

The Name_Set function is already declared in the header but not
implemented. With this implementation, one can set a custom object name
from a server application.

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>

* ai.c: implement function to set custom description

For now the hard-coded behaviour was to return the object name whenever
a client requested the value for the description.

Therefore implement the functions Description and Description_Set already
declared in the header and add a Description property to the data
structure used. We also need to properly implement PROP_DESCRIPTION in
the Read_Property function.

This way we can set and read a custom decsription from a server application
and send the appropriate response to a read-property request asking for
PROP_DESCRIPTION.

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>

* av.c: implement function to set custom description

For now the hard-coded behaviour was to return the object name whenever
a client requested the value for the description.

Therefore implement the functions Description and Description_Set already
declared in the header and add a Description property to the data
structure used. We also need to properly implement PROP_DESCRIPTION in
the Read_Property function.

This way we can set and read a custom decsription from a server application
and send the appropriate response to a read-property request asking for
PROP_DESCRIPTION.

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>

* ai.c: implement function to set custom units

Implement the object functions related to Units already declared in the
header.

By default Analog Inputs will have the Unit UNITS_PERCENT. Add
functionality to be able to set and read custom units from a server
application.

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>

* av.c: implement function to set custom units

Implement the object functions related to Units already declared in the
header.

By default Analog Values will have the Unit UNITS_NO_UNIT. Add
functionality to be able to set and read custom units from a server
application.

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>

---------

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
Co-authored-by: Sebastian Weyer <sebastian.weyer@smile.fr>
2024-02-05 11:32:02 -06:00
Steve Karg f326b1347f fix compile warnings 2024-02-03 08:02:44 -06:00
Steve Karg 9ece658575 update release script to use tag option and remove tag reminder 2024-02-02 16:45:29 -06:00
Steve Karg d9fe85eee1 Updated version to 1.3.3 on 2024-02-02. Groundhog day! 2024-02-02 16:40:06 -06:00
Steve Karg e450da87f5 update the changelog to the current master branch 2024-02-02 14:51:17 -06:00
Steve Karg 1fa0f2a766 Added bacapp decoding for accumulator SCALE property (#566) 2024-02-02 11:18:57 -06:00
Steve Karg 1f591db6e7 Feature/mstp zero config option (#564)
* Added a MS/TP zero-config (automatically choose an unused MAC address) using an algorithm that starts with MAC=64 and waits for a random number of PFM (minimum of 8 plus modulo 64) before attempting to choose a MAC sequentially from 64..127. The confirmation uses a 128-bit UUID with the MSTP Test Request frame. The modifications are in src/bacnet/datalink/mstp.c and src/bacnet/datalink/dlmstp.c modules enabling any device to use zero-config if enabled. A working demonstration is in the ports/stm32f4xx for the NUCLEO board. Complete unit testing is included.  Options include lurking forever (wait for a router or another master node before joining) or lurking for a minimum time (enables self forming automatic MAC addressing device nodes).
2024-02-02 11:18:20 -06:00
Mikhail Antropov 8f576461a8 Feature/oscbs 29 calendar time object (#440)
* Added basic Calendar object, unit tests, and integration with example device object.

* Added basic Time Value object, unit tests, and integration with example device object.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2024-02-01 23:01:27 -06:00
Ondřej Hruška 340bd09561 Implement missing data types for calendar and schedule (#474)
* Added the SpecialEvent struct for the Exception_Schedule property of Schedule, encode/decode/same functions, unit tests, and integrated into bacapp functions.

* Added the CalendarEntry struct for the Date_List property of Calendar and the SpecialEvent struct, encode/decode functions, unit tests, and integrated into bacapp functions.

* Added the DateRange struct for the Effective_Period property of Schedule, encode/decode functions, unit tests, and integrated into bacapp functions.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2024-02-01 10:57:46 -06:00
Sebastian Weyer 7ad82f19a0 CMakeLists.txt: exclude h_routed_npdu.c when BAC_ROUTING=OFF (#562)
Fixed CMakeLists.txt: to exclude h_routed_npdu.c when BAC_ROUTING=OFF

When calling cmake with -DBAC_ROUTING=OFF,
basic/object/gateway/gw_device.c is correctly excluded from the build.
It does contain however the definition for the functions
Routed_Device_GetNext and Routed_Device_Is_Valid_Network, both of which
are called in the routed_apdu_handler function of basic/npdu/h_routed_npdu.c.
This is fine during compilation since these functions' prototypes are
declared in basic/object/device.h but linking will fail.

Thus, make the compilation of h_routed_npdu.c conditional depending on
the value of BAC_ROUTING.

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
Co-authored-by: Sebastian Weyer <sebastian.weyer@smile.fr>
2024-01-30 15:05:31 -06:00
Sebastian Weyer 5924c0c6ab ao.h: add BACNET_STACK_EXPORT macro to Analog_Output_Read_Property function (#561)
* Fixed BACNET_STACK_EXPORT macro to Analog_Output_Read_Property function

Added the call to this macro so that Analog_Output_Read_Property is
properly exported as a global symbol when the library is compiled with
-DBUILD_SHARED_LIBS=ON using cmake. This macro expands to
__declspec(dllexport) on Windows and __attribute__((visibility("default")))
on Linux. It is necessary when compiling with the -fvisibility-hidden flag.

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
Co-authored-by: Sebastian Weyer <sebastian.weyer@smile.fr>
2024-01-29 10:43:16 -06:00
Steve Karg 6cb875aae6 Feature/add bacnet binary lighting object (#522)
* Added Binary Lighting Output object example.

* Changed piface example app to support binary-lighting-output object type and blink warn

* Changed example device object to not create objects when device object-table is overridden

* Fixed unit testing for device object
2024-01-29 09:41:40 -06:00
Steve Karg 34b1d24bb7 Build/add cmake to ports at91sam7 (#560)
* added CMake to AT91SAM7S port example

* Add ports AT91SAM7S and STM32F4xx CMake builds into pipeline
2024-01-27 16:00:22 -06:00
Steve Karg ef762118a6 Chore/refactor dlmstp core mstp (#559)
* Create common DLMSTP using core MSTP FSM in STM32F4xx example

* add openocd debug launcher under vscode in STM32F4xx example

* Add generic property list member checking for write property members of network port object in STM32F4xx example
2024-01-27 15:16:42 -06:00
Steve Karg 587e3c5a11 Chore/refactor automac unit test (#557)
* move ports automac module into bacnet/datalink and add unit test.
2024-01-12 16:14:24 -06:00
Steve Karg c6dcab8f0a Change Life-Safety-Point object to use Create/Delete-Object (#555)
* Change Life-Safety-Point object to use Create/Delete-Object
2024-01-12 16:01:50 -06:00
Steve Karg ebc47571ba Bugfix/stm32f4xx port example updates (#556)
* Added CMake build option for stm32f4xx

* port some fixes and comments from bacnet/basic/object/device.c module
2024-01-08 15:27:46 -06:00
Alonso Cárdenas a459b0feca Fix build on FreeBSD (#554) 2024-01-05 21:34:51 -06:00
Steve Karg 1db2119bf2 fix apps that use old BACnetPropertyStates enumeration. 2024-01-05 17:20:28 -06:00
Steve Karg c7c2e1c6ef Fix enumerations syntax 2024-01-05 17:12:59 -06:00
Steve Karg 889ea5ae12 Fix enumerations syntax 2024-01-05 17:11:13 -06:00
Steve Karg ba4b0ca7c6 Changed BACnetPropertyStates to support more enumerations. Added apdu size checking on decode. Removed BACnetPropertyStates local enumeration. Increased BACnetPropertyStates codec unit test coverage. 2024-01-05 16:00:42 -06:00
Steve Karg bb081d28da Bugfix/service request refactor size check (#553)
* refactor service requests from service header

* add APDU size checking and length feature

* add unit tests to check for length when passing NULL buffer

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2024-01-05 08:59:45 -06:00
Steve Karg 5ca14e5320 update changelog 2024-01-03 14:46:01 -06:00
Steve Karg 7f3b82db9a Fixed compilation with BACNET_SVC_SERVER=1 for apps. (#552)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2024-01-03 10:35:03 -06:00
Steve Karg ead190584c Fix COBS conversion for large MSTP data-not-expecting-reply frames. (#550)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-12-31 19:38:00 -06:00
Steve Karg 73ee75635b Changed npdu_encode function to return length when given a NULL buffer. (#549)
* Changed npdu_encode function to return length when given a NULL buffer.

* reduce TSM dependency in NPDU handler and use local buffer

* add bacnet API with additional size of PDU argument.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-12-27 10:29:42 -06:00
Steve Karg 0aa6b242b3 updated bin/readme.txt with additional tool descriptions 2023-12-22 20:39:09 -06:00
Steve Karg c84afb2aff fixed spelling in bacucov help message. 2023-12-22 14:53:09 -06:00
Steve Karg 6656b57703 updated release script for tag menu option 2023-12-21 10:04:52 -06:00
Steve Karg f64eab736e Incremented version to 1.3.2 for release on 2023-12-21. 2023-12-21 09:53:21 -06:00