Strip tabs and trailing white spaces, and fix end of files (#748)

* format: Strip trailing whitespaces

We want to get rid of trailing whitespaces completly as they make just git
noice. Much better to start using automated tools to get rid of them once and
not getting them back again. This way git history will be cleaner and review
easier.

Commit was generated with:

    pre-commit run --all-files trailing-whitespace

* format: Files should have exactly one new line end of them

It is good practice that every file has one new line. It is not now days so
mandatory but it also is not nice if file has lot of newlines end of it. We will
use pre-commit which takes automatically care about this so let's fix all.

Commit was generated with:

    pre-commit run --all-files end-of-file-fixer

* format: Convert tabs to spaces

Project mostly use spaces over tabs. When mixing tabs and spaces this usually
makes formatting issues and also when changing those in commits it will make lot
of git noise. We will force spaces most of the time and use pre-commit to fix.

Commit was generated with:

    pre-commit run --all-files remove-tabs

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
This commit is contained in:
Kari Argillander
2024-08-25 22:13:57 +03:00
committed by GitHub
parent 9e0657424e
commit 369da70f2a
455 changed files with 7147 additions and 7249 deletions
+559 -559
View File
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -58,7 +58,7 @@ The git repositories are hosted at the following sites:
### Changed ### Changed
* Changed MS/TP master node self destination checks to be * Changed MS/TP master node self destination checks to be
located in receive FSM. Changed MSTP zero configuration: modified located in receive FSM. Changed MSTP zero configuration: modified
comments for state transition names; modified next station increment; comments for state transition names; modified next station increment;
refactored the UUID rand() to not be required by common refactored the UUID rand() to not be required by common
zero config implementation; added more unit tests. (#676) zero config implementation; added more unit tests. (#676)
@@ -75,7 +75,7 @@ The git repositories are hosted at the following sites:
Fixed Binary input/value set. (#672) Fixed Binary input/value set. (#672)
* Fixed wildcard check in create object for Binary Input objects. (#663) * Fixed wildcard check in create object for Binary Input objects. (#663)
* Fixed memory leaks in create object initialization if repeated. (#664)(#662) * Fixed memory leaks in create object initialization if repeated. (#664)(#662)
* Fixed the Zephyr-OS BIP6 datalink module. (#659) * Fixed the Zephyr-OS BIP6 datalink module. (#659)
* Fixed redundant GCC compiler flags in ARM, OS, and test builds, and made them * Fixed redundant GCC compiler flags in ARM, OS, and test builds, and made them
more consistent across various builds. (#658) more consistent across various builds. (#658)
* Fixed redundant redeclaration of various functions detected by change * Fixed redundant redeclaration of various functions detected by change
@@ -147,11 +147,11 @@ The git repositories are hosted at the following sites:
which datatypes can be written. (#620) which datatypes can be written. (#620)
* Changed format in CMake to enable cleaner SC merge. (#620) * Changed format in CMake to enable cleaner SC merge. (#620)
* Changed the first instance of a basic integer value object from 1 to 0. (#619) * Changed the first instance of a basic integer value object from 1 to 0. (#619)
* Changed basic time-value object present-value to be decoupled from * Changed basic time-value object present-value to be decoupled from
current time, and changed out-of-service property to be writable. current time, and changed out-of-service property to be writable.
### Fixed ### Fixed
* Fixed nuisance print messages in ports/linux/dlmstp by changing * Fixed nuisance print messages in ports/linux/dlmstp by changing
to debug print only. (#633) to debug print only. (#633)
* Fixed compile warnings in basic objects. (#630) * Fixed compile warnings in basic objects. (#630)
@@ -196,7 +196,7 @@ current time, and changed out-of-service property to be writable.
* Changed property lists member function for WriteProperty default case * Changed property lists member function for WriteProperty default case
by refactoring.(#609) by refactoring.(#609)
* Changed time-value object unit testing by refactoring.(#609) * Changed time-value object unit testing by refactoring.(#609)
* Changed ports/zephry for BACnet/IP and date-time with latest * Changed ports/zephry for BACnet/IP and date-time with latest
Zephyr OS.(#606) Zephyr OS.(#606)
* Changed Zephyr OS west manifest to target zephyr v3.6.0.(#601) * Changed Zephyr OS west manifest to target zephyr v3.6.0.(#601)
@@ -204,7 +204,7 @@ current time, and changed out-of-service property to be writable.
* Changed position of bacnet/bacdef.h to be the first bacnet header * Changed position of bacnet/bacdef.h to be the first bacnet header
to include. BACnet headers need to pull in optional configuration and to include. BACnet headers need to pull in optional configuration and
optional ecosystem overrides to allow integrators to control optional ecosystem overrides to allow integrators to control
builds. This change places bacnet/bacdef.h to the top of the BACnet builds. This change places bacnet/bacdef.h to the top of the BACnet
Stack header files to consistently introduce integrator and ports Stack header files to consistently introduce integrator and ports
header files.(#598)(#600) header files.(#598)(#600)
* Added dependent BACnet stack headers into bacdef.h file.(#602) * Added dependent BACnet stack headers into bacdef.h file.(#602)
@@ -267,7 +267,7 @@ current time, and changed out-of-service property to be writable.
* Changed BACnet R/W FSM module to remove dependency on * Changed BACnet R/W FSM module to remove dependency on
rpm_ack_decode_service_request() which uses large calloc/free rpm_ack_decode_service_request() which uses large calloc/free
value lists. Created an alternate RPM-ACK to RP-ACK processing value lists. Created an alternate RPM-ACK to RP-ACK processing
function. (#583) function. (#583)
* Changed basic RPM handler to skip over unknown property values. (#583) * Changed basic RPM handler to skip over unknown property values. (#583)
* Changed the release script to use tag option and remove tag reminder. * Changed the release script to use tag option and remove tag reminder.
+3 -3
View File
@@ -741,13 +741,13 @@ if(BACNET_STACK_BUILD_APPS)
target_compile_options(mstpcap PRIVATE target_compile_options(mstpcap PRIVATE
# NOTE: Might be that this example currently doesn't work on Windows because # NOTE: Might be that this example currently doesn't work on Windows because
# of the following warning: # of the following warning:
# 'strncasecmp': macro redefinition # 'strncasecmp': macro redefinition
$<$<C_COMPILER_ID:MSVC>:/wd4005> $<$<C_COMPILER_ID:MSVC>:/wd4005>
# 'gettimeofday' undefined; assuming extern returning int # 'gettimeofday' undefined; assuming extern returning int
$<$<C_COMPILER_ID:MSVC>:/wd4013> $<$<C_COMPILER_ID:MSVC>:/wd4013>
) )
add_executable(mstpcrc apps/mstpcrc/main.c) add_executable(mstpcrc apps/mstpcrc/main.c)
target_link_libraries(mstpcrc PRIVATE ${PROJECT_NAME}) target_link_libraries(mstpcrc PRIVATE ${PROJECT_NAME})
target_compile_options(mstpcrc PRIVATE target_compile_options(mstpcrc PRIVATE
@@ -842,7 +842,7 @@ if(BACNET_STACK_BUILD_APPS)
target_compile_options(router PRIVATE target_compile_options(router PRIVATE
# These make this example not totally C90 compatible but it is ok. # These make this example not totally C90 compatible but it is ok.
-Wno-declaration-after-statement -Wno-declaration-after-statement
-Wno-overlength-strings -Wno-overlength-strings
-Wno-variadic-macros -Wno-variadic-macros
+2 -3
View File
@@ -19,7 +19,7 @@ FROM ubuntu:focal as builder
# /opt/bacnet/bin/bacrp 1234 device 1234 object-name # /opt/bacnet/bin/bacrp 1234 device 1234 object-name
## etc. ## etc.
## Check bacnet-stack/bin/readme.txt for more docs related to the ## Check bacnet-stack/bin/readme.txt for more docs related to the
## example utilities and environment variables. Note that this docker ## example utilities and environment variables. Note that this docker
## image does not add the shell scripts in that folder as many of them ## image does not add the shell scripts in that folder as many of them
## are broken. Even so, reading them may be instructive. ## are broken. Even so, reading them may be instructive.
@@ -30,7 +30,7 @@ SHELL ["/bin/bash", "-c"]
RUN set -xe; \ RUN set -xe; \
apt-get update; apt-get upgrade -y; apt-get --purge autoremove -y; \ apt-get update; apt-get upgrade -y; apt-get --purge autoremove -y; \
apt-get install -y build-essential curl; \ apt-get install -y build-essential curl; \
apt-get -y autoclean; apt-get -y clean apt-get -y autoclean; apt-get -y clean
RUN set -euxo pipefail; \ RUN set -euxo pipefail; \
mkdir -p /build/bin; \ mkdir -p /build/bin; \
@@ -50,4 +50,3 @@ COPY --from=builder /build/bin/* /opt/bacnet/bin/
EXPOSE 47808/udp EXPOSE 47808/udp
ENTRYPOINT ["/opt/bacnet/bin/bacserv"] ENTRYPOINT ["/opt/bacnet/bin/bacserv"]
CMD ["1234", "test_server"] CMD ["1234", "test_server"]
+23 -23
View File
@@ -1,4 +1,4 @@
# BACnet Stack # BACnet Stack
BACnet open source protocol stack C library for embedded systems, BACnet open source protocol stack C library for embedded systems,
Linux, MacOS, BSD, and Windows Linux, MacOS, BSD, and Windows
@@ -38,18 +38,18 @@ the standard (just like IEEE or ANSI or ISO).
For software developers, the BACnet protocol is a standard way to send and For software developers, the BACnet protocol is a standard way to send and
receive messages containing data that are understood by other BACnet receive messages containing data that are understood by other BACnet
compliant devices. The BACnet standard defines a standard way to communicate compliant devices. The BACnet standard defines a standard way to communicate
over various wires or radios, known as Data Link/Physical Layers: Ethernet, over various wires or radios, known as Data Link/Physical Layers: Ethernet,
EIA-485, EIA-232, ARCNET, and LonTalk. The BACnet standard also defines a EIA-485, EIA-232, ARCNET, and LonTalk. The BACnet standard also defines a
standard way to communicate using UDP, IP, HTTP (Web Services), and Websockets. standard way to communicate using UDP, IP, HTTP (Web Services), and Websockets.
This BACnet protocol stack implementation is specifically designed for the This BACnet protocol stack implementation is specifically designed for the
embedded BACnet appliance, using a GPL with exception license (like eCos), embedded BACnet appliance, using a GPL with exception license (like eCos),
which means that any changes to the core code that are distributed are shared, which means that any changes to the core code that are distributed are shared,
but the BACnet library can be linked to proprietary code without the proprietary but the BACnet library can be linked to proprietary code without the proprietary
code becoming GPL. Note that some of the source files are designed as code becoming GPL. Note that some of the source files are designed as
skeleton or example or template files, and are not copyrighted as GPL. skeleton or example or template files, and are not copyrighted as GPL.
The text of the GPL exception included in each source file is as follows: The text of the GPL exception included in each source file is as follows:
* SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0 * SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
@@ -70,8 +70,8 @@ https://sourceforge.net/p/bacnet/src/ci/master/tree/doc/README.developer
This stack includes unit tests that can be run using the Makefile in the This stack includes unit tests that can be run using the Makefile in the
project root directory "make test". project root directory "make test".
The unit tests can also be run using individual make invocations. The unit tests can also be run using individual make invocations.
The unit tests run a PC and continue to do so with The unit tests run a PC and continue to do so with
every commit within the Continuous Integration environment. every commit within the Continuous Integration environment.
The BACnet stack was functionally tested using a variety of tools The BACnet stack was functionally tested using a variety of tools
@@ -80,7 +80,7 @@ in many products that successfully completed BTL testing.
Using the Makefile in the project root directory, a dozen sample applications Using the Makefile in the project root directory, a dozen sample applications
are created that run under Windows or Linux. They use the BACnet/IPv4 datalink are created that run under Windows or Linux. They use the BACnet/IPv4 datalink
layer for communication by default, but could be compiled to use BACnet IPv6, layer for communication by default, but could be compiled to use BACnet IPv6,
Ethernet, ARCNET, or MS/TP. Ethernet, ARCNET, or MS/TP.
Linux/Unix/Cygwin Linux/Unix/Cygwin
@@ -106,7 +106,7 @@ to generate a Code::Blocks project:
$ mkdir build $ mkdir build
$ cd build/ $ cd build/
$ cmake .. -G"CodeBlocks - Unix Makefiles" $ cmake .. -G"CodeBlocks - Unix Makefiles"
c:\> mkdir build c:\> mkdir build
c:\> cd build/ c:\> cd build/
c:\> cmake .. -G"CodeBlocks - MinGW Makefiles" c:\> cmake .. -G"CodeBlocks - MinGW Makefiles"
@@ -114,22 +114,22 @@ to generate a Code::Blocks project:
The unit tests also use CMake and may be run with the command sequence: The unit tests also use CMake and may be run with the command sequence:
$ make test $ make test
The unit test framework uses a slightly modified ztest, and the tests are located The unit test framework uses a slightly modified ztest, and the tests are located
in the test/ folder. The unit test builder uses CMake, and the test coverage in the test/ folder. The unit test builder uses CMake, and the test coverage
uses LCOV. The HTML results of the unit testing coverage are available starting uses LCOV. The HTML results of the unit testing coverage are available starting
in the test/build/lcoverage/index.html file. in the test/build/lcoverage/index.html file.
The demo applications are all client applications that provide one main BACnet The demo applications are all client applications that provide one main BACnet
service, except the one server application and one gateway application, service, except the one server application and one gateway application,
a couple router applications, and a couple of MS/TP specific applications. a couple router applications, and a couple of MS/TP specific applications.
Each application will accept command line parameters, and prints the output to Each application will accept command line parameters, and prints the output to
stdout or stderr. The client applications are command line based and can stdout or stderr. The client applications are command line based and can
be used in scripts or for troubleshooting. be used in scripts or for troubleshooting.
The demo applications make use of environment variables to The demo applications make use of environment variables to
setup the network options. See each individual demo for the options. setup the network options. See each individual demo for the options.
There are also projects in the ports/ directory for ARM7, AVR, RTOS-32, PIC, There are also projects in the ports/ directory for ARM7, AVR, RTOS-32, PIC,
and others. Each of those projects has a demo application for specific hardware. and others. Each of those projects has a demo application for specific hardware.
In the case of the ARM7 and AVR, their makefile works with GCC compilers and In the case of the ARM7 and AVR, their makefile works with GCC compilers and
there are project files for IAR Embedded Workbench and Rowley Crossworks for ARM. there are project files for IAR Embedded Workbench and Rowley Crossworks for ARM.
@@ -146,7 +146,7 @@ Project Mailing List and Help
If you want to contribute to this project and have some C coding skills, If you want to contribute to this project and have some C coding skills,
join us via https://github.com/bacnet-stack/bacnet-stack/ join us via https://github.com/bacnet-stack/bacnet-stack/
or via https://sourceforge.net/p/bacnet/src/ and create a or via https://sourceforge.net/p/bacnet/src/ and create a
fork or branch, and eventually a pull request to have fork or branch, and eventually a pull request to have
your code considered for inclusion. your code considered for inclusion.
If you find a bug in this project, please tell us about it at If you find a bug in this project, please tell us about it at
@@ -154,7 +154,7 @@ https://sourceforge.net/p/bacnet/bugs/
or or
https://github.com/bacnet-stack/bacnet-stack/issues https://github.com/bacnet-stack/bacnet-stack/issues
If you have a support request, you can post it at If you have a support request, you can post it at
https://sourceforge.net/p/bacnet/support-requests/ https://sourceforge.net/p/bacnet/support-requests/
If you have a feature request, you can post it at If you have a feature request, you can post it at
@@ -171,6 +171,6 @@ I hope that you get your BACnet Device working!
Steve Karg, Birmingham, Alabama USA Steve Karg, Birmingham, Alabama USA
skarg@users.sourceforge.net skarg@users.sourceforge.net
ASHRAE® and BACnet® are registered trademarks of the ASHRAE® and BACnet® are registered trademarks of the
American Society of Heating, Refrigerating and Air-Conditioning Engineers, Inc. American Society of Heating, Refrigerating and Air-Conditioning Engineers, Inc.
180 Technology Parkway NW, Peachtree Corners, Georgia 30092 US. 180 Technology Parkway NW, Peachtree Corners, Georgia 30092 US.
+1 -2
View File
@@ -148,7 +148,7 @@ DEBUGGING ?=
# enable all relevant warnings that find bugs # enable all relevant warnings that find bugs
WARNING_ALL := -Wall -Wextra -pedantic WARNING_ALL := -Wall -Wextra -pedantic
WARNING_ALL += -Wfloat-equal -Wconversion WARNING_ALL += -Wfloat-equal -Wconversion
WARNING_ALL += -Wredundant-decls -Wswitch-default WARNING_ALL += -Wredundant-decls -Wswitch-default
WARNING_ALL += -Wunused-variable WARNING_ALL += -Wunused-variable
# don't warn about conversion, sign, compares, long long and attributes # don't warn about conversion, sign, compares, long long and attributes
# since they are common in embedded # since they are common in embedded
@@ -459,4 +459,3 @@ fuzz-afl: $(BACNET_LIB_TARGET)
.PHONY: writepropm .PHONY: writepropm
writepropm: $(BACNET_LIB_TARGET) writepropm: $(BACNET_LIB_TARGET)
$(MAKE) -B -C $@ $(MAKE) -B -C $@
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief command line tool that sends a BACnet service Abort message * @brief command line tool that sends a BACnet service Abort message
* to the network * to the network
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
* @date 2016 * @date 2016
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -53,4 +53,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+9 -10
View File
@@ -5,7 +5,7 @@ for the eight RGB (red-green-blue) LEDs attached to the Blinkt! card.
## Installation ## Installation
The demo uses pigpiod (Pi GPIO Daemon) and developer library. To install The demo uses pigpiod (Pi GPIO Daemon) and developer library. To install
and run the daemon at powerup (and immediately): and run the daemon at powerup (and immediately):
$ sudo apt install libpigpio-dev libpigpiod-if-dev pigpiod $ sudo apt install libpigpio-dev libpigpiod-if-dev pigpiod
@@ -14,12 +14,12 @@ and run the daemon at powerup (and immediately):
## WiFi Power ## WiFi Power
If you are using a Raspberry Pi with WiFi, you will likely want If you are using a Raspberry Pi with WiFi, you will likely want
to disable WiFi Power saving. Under Raspberry Pi OS, so the following. to disable WiFi Power saving. Under Raspberry Pi OS, so the following.
### Startup service in systemd ### Startup service in systemd
To manage to start programs you should use systemd Unit files. To manage to start programs you should use systemd Unit files.
File name: /etc/systemd/system/wlan0pwr.service File name: /etc/systemd/system/wlan0pwr.service
@@ -44,9 +44,9 @@ In the empty editor insert these statements, save them and quit the editor:
Enable the new service with: Enable the new service with:
rpi ~$ sudo systemctl enable wlan0pwr.service rpi ~$ sudo systemctl enable wlan0pwr.service
## Building the Blinkt! BACnet Application ## Building the Blinkt! BACnet Application
Build from the root folder: Build from the root folder:
$ make blinkt $ make blinkt
@@ -59,8 +59,8 @@ Run from the bin/ folder:
## Blinkt! as a Startup service with systemd ## Blinkt! as a Startup service with systemd
To manage to start programs you should use systemd Unit files. To manage to start programs you should use systemd Unit files.
Here is a very simple template you can use to start to solve your problem. Here is a very simple template you can use to start to solve your problem.
Create a new service with: Create a new service with:
rpi ~$ sudo systemctl --full --force edit bacnet.service rpi ~$ sudo systemctl --full --force edit bacnet.service
@@ -81,13 +81,12 @@ Enable the new service after the next reboot with:
rpi ~$ sudo systemctl enable bacnet.service rpi ~$ sudo systemctl enable bacnet.service
Create your bacnet.sh shell script in your home folder (change from pi if Create your bacnet.sh shell script in your home folder (change from pi if
that is not your home folder). Use the shell script to set any environment that is not your home folder). Use the shell script to set any environment
variables that you want, or configuration settings for the bin/bacblinkt variables that you want, or configuration settings for the bin/bacblinkt
application such as a specific device ID. application such as a specific device ID.
A simplistic bacnet.sh script will look like this (with stdout/stderr to /dev/null): A simplistic bacnet.sh script will look like this (with stdout/stderr to /dev/null):
#!/bin/bash #!/bin/bash
/home/pi/bacnet-stack/bin/bacblinkt 9009 > /dev/null 2>&1 /home/pi/bacnet-stack/bin/bacblinkt 9009 > /dev/null 2>&1
+2 -2
View File
@@ -1,5 +1,5 @@
/** /**
* @file * @file
* @brief Base "class" for handling all BACnet objects belonging * @brief Base "class" for handling all BACnet objects belonging
* to a BACnet device, as well as Device-specific properties. * to a BACnet device, as well as Device-specific properties.
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
+3 -3
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief Example application using the BACnet Stack on a Raspberry Pi * @brief Example application using the BACnet Stack on a Raspberry Pi
* with Blinkt! LEDs. * with Blinkt! LEDs.
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
* @date 2023 * @date 2023
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+7 -7
View File
@@ -27,13 +27,13 @@
* Allows you to communicate with a localhost target. * Allows you to communicate with a localhost target.
* -t: declare target's MAC instead of using Who-Is to bind to * -t: declare target's MAC instead of using Who-Is to bind to
* device-instance. Format is "C0:A8:00:18:BA:C0" (as usual) * device-instance. Format is "C0:A8:00:18:BA:C0" (as usual)
* *
* Examples: * Examples:
* ./bacepics -v 1234 * ./bacepics -v 1234
* where the device instance to be addressed is 1234 * where the device instance to be addressed is 1234
* and the optional -v prints values out rather than the '?' that * and the optional -v prints values out rather than the '?' that
* the EPICS format for VTS3 wants. * the EPICS format for VTS3 wants.
* ./bacepics -p 0xBAC1 -t "7F:0:0:1:BA:C0" 4194303 * ./bacepics -p 0xBAC1 -t "7F:0:0:1:BA:C0" 4194303
* communicates with the BACnet device on localhost (127.0.0.1), using * communicates with the BACnet device on localhost (127.0.0.1), using
* port 47809 as "my" source port so it doesn't conflict with * port 47809 as "my" source port so it doesn't conflict with
* the device's port 47808. * the device's port 47808.
@@ -48,13 +48,13 @@
* ALL again with array index of 0, which should result mostly in errors * ALL again with array index of 0, which should result mostly in errors
* but will provide the list of supported properties. * but will provide the list of supported properties.
* - If that succeeds, build the list of properties to be accessed. <br> * - If that succeeds, build the list of properties to be accessed. <br>
* - If no RPM or failed to get ALL properties from the target device, then * - If no RPM or failed to get ALL properties from the target device, then
* fetch the coded Required and Optional properties from the demo/object * fetch the coded Required and Optional properties from the demo/object
* folder for this object type, and use this to build the list of * folder for this object type, and use this to build the list of
* properties to be accessed. * properties to be accessed.
* - If the Fetch All succeeded, print the values for each property * - If the Fetch All succeeded, print the values for each property
* - Otherwise, for each property in the list for this object, * - Otherwise, for each property in the list for this object,
* - Request the single property value with ReadProperty (RP) * - Request the single property value with ReadProperty (RP)
* - From the response, print the property's value * - From the response, print the property's value
* The Device Object will have fetched the Object List property and built a list * The Device Object will have fetched the Object List property and built a list
* of objects from that; use it now to cycle through each other Object and * of objects from that; use it now to cycle through each other Object and
+2 -2
View File
@@ -575,7 +575,7 @@ static void PrintReadPropertyData(BACNET_OBJECT_TYPE object_type,
} }
} else if (rpm_property->propertyIdentifier == } else if (rpm_property->propertyIdentifier ==
PROP_SUBORDINATE_LIST) { PROP_SUBORDINATE_LIST) {
if (value->tag != if (value->tag !=
BACNET_APPLICATION_TAG_DEVICE_OBJECT_REFERENCE) { BACNET_APPLICATION_TAG_DEVICE_OBJECT_REFERENCE) {
break; break;
} }
@@ -648,7 +648,7 @@ static void PrintReadPropertyData(BACNET_OBJECT_TYPE object_type,
/* Closing brace for this multi-valued array */ /* Closing brace for this multi-valued array */
fprintf(stdout, " }"); fprintf(stdout, " }");
} }
if (property_list_writable_member(object_type, if (property_list_writable_member(object_type,
rpm_property->propertyIdentifier)) { rpm_property->propertyIdentifier)) {
fprintf(stdout, " Writable"); fprintf(stdout, " Writable");
} }
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file * @file
* @brief command line tool that sends a BACnet service to the network: * @brief command line tool that sends a BACnet service to the network:
* BACnet Error message * BACnet Error message
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
* @date 2016 * @date 2016
* @copyright SPDX-License-Identifier: MIT * @copyright SPDX-License-Identifier: MIT
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+1 -4
View File
@@ -15,10 +15,7 @@ afl-cc 2.57b by <lcamtuf@google.com>
afl-fuzz -i </path/to/corpus/> -o </path/to/output_dir/> -m none ./apps/fuzz-afl/fuzz-afl afl-fuzz -i </path/to/corpus/> -o </path/to/output_dir/> -m none ./apps/fuzz-afl/fuzz-afl
``` ```
Caveats: Caveats:
* This builds the target with ASAN (Address Sanitizer). This makes AFL require the `-m none` to not interpret ASAN's behavior as a crash * This builds the target with ASAN (Address Sanitizer). This makes AFL require the `-m none` to not interpret ASAN's behavior as a crash
* AFL uses a fork/exec model to launch the target. This is nice because each testcase is from a clean state. But this also brings in a lot of overhead. If you need something faster, check out ../fuzz-libfuzzer/ * AFL uses a fork/exec model to launch the target. This is nice because each testcase is from a clean state. But this also brings in a lot of overhead. If you need something faster, check out ../fuzz-libfuzzer/
+2 -2
View File
@@ -35,7 +35,7 @@
#include "bacnet/datalink/bvlc.h" #include "bacnet/datalink/bvlc.h"
#include "bacnet/basic/bbmd/h_bbmd.h" #include "bacnet/basic/bbmd/h_bbmd.h"
// Pull in all of this... // Pull in all of this...
#include "../router-mstp/main.c" #include "../router-mstp/main.c"
static void Init_Service_Handlers() static void Init_Service_Handlers()
@@ -86,7 +86,7 @@ extern int Device_Reinitialize(void) {
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
BACNET_ADDRESS src = { 0 }; BACNET_ADDRESS src = { 0 };
uint16_t pdu_len = 0; uint16_t pdu_len = 0;
Init_Service_Handlers(); Init_Service_Handlers();
+5 -6
View File
@@ -17,12 +17,12 @@ INFO: seed corpus: files: 5790 min: 1b max: 483b total: 305068b rss: 40Mb
NPDU: Decoding failed; Discarded! NPDU: Decoding failed; Discarded!
... ...
NPDU: DNET=65280. Discarded! NPDU: DNET=65280. Discarded!
#5867 REDUCE cov: 208 ft: 249 corp: 66/1273b lim: 115 exec/s: 2933 rss: 106Mb L: 12/109 MS: 1 EraseBytes- #5867 REDUCE cov: 208 ft: 249 corp: 66/1273b lim: 115 exec/s: 2933 rss: 106Mb L: 12/109 MS: 1 EraseBytes-
Received Reserved for Use by ASHRAE Received Reserved for Use by ASHRAE
WP: Failed to send PDU (Success)! WP: Failed to send PDU (Success)!
NEW_FUNC[1/3]: 0x55a0d533f98a in abort_encode_apdu /mnt/net/lab_share/Bacnet/bacnet-stack-fixes/src/bacnet/abort.c:149 NEW_FUNC[1/3]: 0x55a0d533f98a in abort_encode_apdu /mnt/net/lab_share/Bacnet/bacnet-stack-fixes/src/bacnet/abort.c:149
NEW_FUNC[2/3]: 0x55a0d538f29a in wp_decode_service_request /mnt/net/lab_share/Bacnet/bacnet-stack-fixes/src/bacnet/wp.c:113 NEW_FUNC[2/3]: 0x55a0d538f29a in wp_decode_service_request /mnt/net/lab_share/Bacnet/bacnet-stack-fixes/src/bacnet/wp.c:113
#5940 NEW cov: 216 ft: 257 corp: 68/1282b lim: 115 exec/s: 2970 rss: 106Mb L: 6/109 MS: 2 EraseBytes-ChangeBit- #5940 NEW cov: 216 ft: 257 corp: 68/1282b lim: 115 exec/s: 2970 rss: 106Mb L: 6/109 MS: 2 EraseBytes-ChangeBit-
Received Reserved for Use by ASHRAE Received Reserved for Use by ASHRAE
... ...
================================================================= =================================================================
@@ -45,7 +45,6 @@ READ of size 1 at 0x60200003b656 thread T0
... ...
``` ```
Caveat: Caveat:
* Libfuzzer does not reinitialize the target on each testcase. This means that it will be much quicker than ../fuzz-afl/, BUT it will also be a little less stable. It also will not continue to fuzz after a crash is found (since the libfuzzer runtime shares a process with the target that just crashed). There may be some command line options to adopt a fork model. * Libfuzzer does not reinitialize the target on each testcase. This means that it will be much quicker than ../fuzz-afl/, BUT it will also be a little less stable. It also will not continue to fuzz after a crash is found (since the libfuzzer runtime shares a process with the target that just crashed). There may be some command line options to adopt a fork model.
+5 -5
View File
@@ -36,7 +36,7 @@
#include "bacnet/datalink/bvlc.h" #include "bacnet/datalink/bvlc.h"
#include "bacnet/basic/bbmd/h_bbmd.h" #include "bacnet/basic/bbmd/h_bbmd.h"
// Pull in all of this... // Pull in all of this...
#include "../router-mstp/main.c" #include "../router-mstp/main.c"
static void Init_Service_Handlers(void) { static void Init_Service_Handlers(void) {
@@ -83,7 +83,7 @@ extern int Device_Reinitialize(void) {
return 0; return 0;
} }
extern bool Device_COV(BACNET_OBJECT_TYPE object_type, uint32_t object_instance) { extern bool Device_COV(BACNET_OBJECT_TYPE object_type, uint32_t object_instance) {
return false; return false;
} }
extern void Device_COV_Clear(BACNET_OBJECT_TYPE object_type, uint32_t object_instance) { extern void Device_COV_Clear(BACNET_OBJECT_TYPE object_type, uint32_t object_instance) {
@@ -98,11 +98,11 @@ extern bool Device_Encode_Value_List(BACNET_OBJECT_TYPE object_type,
} }
extern int Device_Add_List_Element(BACNET_LIST_ELEMENT_DATA * list_element) { extern int Device_Add_List_Element(BACNET_LIST_ELEMENT_DATA * list_element) {
return BACNET_STATUS_ERROR; return BACNET_STATUS_ERROR;
} }
extern int Device_Remove_List_Element(BACNET_LIST_ELEMENT_DATA * list_element) { extern int Device_Remove_List_Element(BACNET_LIST_ELEMENT_DATA * list_element) {
return BACNET_STATUS_ERROR; return BACNET_STATUS_ERROR;
} }
@@ -111,7 +111,7 @@ extern bool Device_Write_Property_Local(BACNET_WRITE_PROPERTY_DATA *wp_data) {
} }
int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) { int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
BACNET_ADDRESS src = { 0 }; BACNET_ADDRESS src = { 0 };
Init_Service_Handlers(); Init_Service_Handlers();
+2 -2
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief Header for example gateway (ie, BACnet Router and Devices) * @brief Header for example gateway (ie, BACnet Router and Devices)
* using the BACnet Stack. * using the BACnet Stack.
* @author Tom Brennan <tbrennan3@users.sourceforge.net> * @author Tom Brennan <tbrennan3@users.sourceforge.net>
* @date 2010 * @date 2010
@@ -11,7 +11,7 @@
/** @defgroup GatewayDemo Demo of a BACnet virtual gateway (multiple Device). /** @defgroup GatewayDemo Demo of a BACnet virtual gateway (multiple Device).
* @ingroup Demos * @ingroup Demos
* This is a basic demonstration of a BACnet Router with child devices (ie, * This is a basic demonstration of a BACnet Router with child devices (ie,
* gateway) appearing on a virtual BACnet network behind the Router. * gateway) appearing on a virtual BACnet network behind the Router.
* This is an extension of the ServerDemo project. * This is an extension of the ServerDemo project.
*/ */
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief command line tool that sends a BACnet I-Am-Router-To-Network message * @brief command line tool that sends a BACnet I-Am-Router-To-Network message
* for one or more networks. * for one or more networks.
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
* @date 2008 * @date 2008
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+2 -2
View File
@@ -1,7 +1,7 @@
/** /**
* @file * @file
* @brief command line tool that sends a BACnet Initialize-Routing-Table * @brief command line tool that sends a BACnet Initialize-Routing-Table
* message to a network and waits for responses. Displays their network * message to a network and waits for responses. Displays their network
* information from the response. This is a router-to-router message. * information from the response. This is a router-to-router message.
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
* @date 2008 * @date 2008
+1 -1
View File
@@ -60,7 +60,7 @@ ${TARGET_BIN}: ${OBJS} Makefile
${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@
size $@ size $@
cp $@ ../../bin cp $@ ../../bin
.c.o: .c.o:
${CC} -c ${CFLAGS} $*.c -o $@ ${CC} -c ${CFLAGS} $*.c -o $@
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+48 -48
View File
@@ -16,68 +16,68 @@
<ul> <ul>
<li><a href="#name">NAME</a></li> <li><a href="#name">NAME</a></li>
<li><a href="#description">DESCRIPTION</a></li> <li><a href="#description">DESCRIPTION</a></li>
<li><a href="#options">OPTIONS</a></li> <li><a href="#options">OPTIONS</a></li>
<li><a href="#this_tool_s_api">This tool's API</a></li> <li><a href="#this_tool_s_api">This tool's API</a></li>
<ul> <ul>
<li><a href="#readproperty">ReadProperty</a></li> <li><a href="#readproperty">ReadProperty</a></li>
<ul> <ul>
<li><a href="#inputs_to_readproperty">Inputs to ReadProperty</a></li> <li><a href="#inputs_to_readproperty">Inputs to ReadProperty</a></li>
<li><a href="#outputs_from_readproperty">Outputs from ReadProperty</a></li> <li><a href="#outputs_from_readproperty">Outputs from ReadProperty</a></li>
<li><a href="#example_of_readproperty">Example of ReadProperty</a></li> <li><a href="#example_of_readproperty">Example of ReadProperty</a></li>
</ul> </ul>
<li><a href="#readpropertymultiple">ReadPropertyMultiple</a></li> <li><a href="#readpropertymultiple">ReadPropertyMultiple</a></li>
<ul> <ul>
<li><a href="#inputs_to_readpropertymultiple">Inputs to ReadPropertyMultiple</a></li> <li><a href="#inputs_to_readpropertymultiple">Inputs to ReadPropertyMultiple</a></li>
<li><a href="#outputs_from_readpropertymultiple">Outputs from ReadPropertyMultiple</a></li> <li><a href="#outputs_from_readpropertymultiple">Outputs from ReadPropertyMultiple</a></li>
<li><a href="#example_of_readpropertymultiple">Example of ReadPropertyMultiple</a></li> <li><a href="#example_of_readpropertymultiple">Example of ReadPropertyMultiple</a></li>
</ul> </ul>
<li><a href="#writeproperty">WriteProperty</a></li> <li><a href="#writeproperty">WriteProperty</a></li>
<ul> <ul>
<li><a href="#inputs_to_writeproperty">Inputs to WriteProperty</a></li> <li><a href="#inputs_to_writeproperty">Inputs to WriteProperty</a></li>
<li><a href="#outputs_from_writeproperty">Outputs from WriteProperty</a></li> <li><a href="#outputs_from_writeproperty">Outputs from WriteProperty</a></li>
<li><a href="#example_of_writeproperty">Example of WriteProperty</a></li> <li><a href="#example_of_writeproperty">Example of WriteProperty</a></li>
</ul> </ul>
<li><a href="#timesync">TimeSync</a></li> <li><a href="#timesync">TimeSync</a></li>
<ul> <ul>
<li><a href="#inputs_to_timesync">Inputs to TimeSync</a></li> <li><a href="#inputs_to_timesync">Inputs to TimeSync</a></li>
<li><a href="#outputs_from_timesync">Outputs from TimeSync</a></li> <li><a href="#outputs_from_timesync">Outputs from TimeSync</a></li>
<li><a href="#example_of_timesync">Example of TimeSync</a></li> <li><a href="#example_of_timesync">Example of TimeSync</a></li>
</ul> </ul>
<li><a href="#log">Log</a></li> <li><a href="#log">Log</a></li>
<ul> <ul>
<li><a href="#inputs_to_log">Inputs to Log</a></li> <li><a href="#inputs_to_log">Inputs to Log</a></li>
<li><a href="#example_of_log">Example of Log</a></li> <li><a href="#example_of_log">Example of Log</a></li>
</ul> </ul>
<li><a href="#silencelog">SilenceLog</a></li> <li><a href="#silencelog">SilenceLog</a></li>
<ul> <ul>
<li><a href="#inputs_to_silencelog">Inputs to SilenceLog</a></li> <li><a href="#inputs_to_silencelog">Inputs to SilenceLog</a></li>
<li><a href="#outputs_from_silencelog">Outputs from SilenceLog</a></li> <li><a href="#outputs_from_silencelog">Outputs from SilenceLog</a></li>
<li><a href="#example_of_silencelog">Example of SilenceLog</a></li> <li><a href="#example_of_silencelog">Example of SilenceLog</a></li>
</ul> </ul>
<li><a href="#retry">Retry</a></li> <li><a href="#retry">Retry</a></li>
<ul> <ul>
<li><a href="#inputs_to_retry">Inputs to Retry</a></li> <li><a href="#inputs_to_retry">Inputs to Retry</a></li>
<li><a href="#outputs_from_retry">Outputs from Retry</a></li> <li><a href="#outputs_from_retry">Outputs from Retry</a></li>
<li><a href="#example_of_retry">Example of Retry</a></li> <li><a href="#example_of_retry">Example of Retry</a></li>
</ul> </ul>
</ul> </ul>
</ul> </ul>
@@ -257,7 +257,7 @@ mechanisms. NOTE: all enumerations are defined in <em class="file">bacenum.h</em
<p>This function prints out to the desired method of logging (STDOUT or file). <p>This function prints out to the desired method of logging (STDOUT or file).
NewLine characters are not required when making calls to this function. If any NewLine characters are not required when making calls to this function. If any
NewLine characters are specified, they will be stripped out. To print an empty NewLine characters are specified, they will be stripped out. To print an empty
line, pass in a space as the message. NOTE: This function will honor previous line, pass in a space as the message. NOTE: This function will honor previous
requests to silence the log (see SilcenseLog for details)</p> requests to silence the log (see SilcenseLog for details)</p>
<p> <p>
</p> </p>
+9 -9
View File
@@ -39,37 +39,37 @@ ul {
} }
.quotedString .quotedString
{ {
color: #0000FF; color: #0000FF;
} }
.comment .comment
{ {
color: #999999; color: #999999;
} }
.operator .operator
{ {
color: #00CCCC; color: #00CCCC;
} }
.builtinVariable .builtinVariable
{ {
color: #CCCC00; color: #CCCC00;
} }
.variableSpecifier .variableSpecifier
{ {
color: #FF0000; color: #FF0000;
} }
.keyword .keyword
{ {
color: #AA0033; color: #AA0033;
} }
.builtinFunction .builtinFunction
{ {
color: #AA00AA; color: #AA00AA;
} }
.identifier .identifier
{ {
color: #009900; color: #009900;
} }
.number .number
{ {
color: #9999FF; color: #9999FF;
} }
+42 -43
View File
@@ -6,7 +6,7 @@ function emulateHTMLModel()
// This function is used to generate a html string for the text properties/methods // This function is used to generate a html string for the text properties/methods
// It replaces '\n' with "<BR"> as well as fixes consecutive white spaces // It replaces '\n' with "<BR"> as well as fixes consecutive white spaces
// It also repalaces some special characters // It also repalaces some special characters
function convertTextToHTML(s) { function convertTextToHTML(s) {
s = s.replace(/\&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\n/g, "<BR>").replace(/\t/g, " "); //tachyon s = s.replace(/\&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\n/g, "<BR>").replace(/\t/g, " "); //tachyon
while (/\s\s/.test(s)) while (/\s\s/.test(s))
@@ -17,7 +17,7 @@ function convertTextToHTML(s) {
HTMLElement.prototype.__defineSetter__("innerText", function (sText) { HTMLElement.prototype.__defineSetter__("innerText", function (sText) {
this.innerHTML = convertTextToHTML(sText); this.innerHTML = convertTextToHTML(sText);
return sText; return sText;
}); });
var tmpGet; var tmpGet;
@@ -29,7 +29,7 @@ HTMLElement.prototype.__defineGetter__("innerText", tmpGet = function () {
} }
if (moz) if (moz)
emulateHTMLModel(); emulateHTMLModel();
@@ -45,7 +45,7 @@ RE[0] = new RegExp(re);
// comment // comment
re = /\#.*?([\r\n]+|$)/; //tachyon re = /\#.*?([\r\n]+|$)/; //tachyon
RE[1] = new RegExp(re); RE[1] = new RegExp(re);
// operator // operator
re = /xor|\.\.\.|and|not|\|\|\=|cmp|\>\>\=|\<\<\=|\<\=\>|\&\&\=|or|\=\>|\!\~|\^\=|\&\=|\|\=|\.\=|x\=|\%\=|\/\=|\*\=|\-\=|\+\=|\=\~|\*\*|\-\-|\.\.|\|\||\&\&|\+\+|\-\>|ne|eq|\!\=|\=\=|ge|le|gt|lt|\>\=|\<\=|\>\>|\<\<|\,|\=|\:|\?|\^|\||x|\%|\/|\*|\<|\&|\\|\~|\!|\>|\.|\-|\+ /; re = /xor|\.\.\.|and|not|\|\|\=|cmp|\>\>\=|\<\<\=|\<\=\>|\&\&\=|or|\=\>|\!\~|\^\=|\&\=|\|\=|\.\=|x\=|\%\=|\/\=|\*\=|\-\=|\+\=|\=\~|\*\*|\-\-|\.\.|\|\||\&\&|\+\+|\-\>|ne|eq|\!\=|\=\=|ge|le|gt|lt|\>\=|\<\=|\>\>|\<\<|\,|\=|\:|\?|\^|\||x|\%|\/|\*|\<|\&|\\|\~|\!|\>|\.|\-|\+ /;
RE[2] = new RegExp(re); RE[2] = new RegExp(re);
@@ -86,46 +86,46 @@ var classes = new Array("quotedString", "comment", "operator", "builtinVariable
*/ */
function HighlightCode(object) function HighlightCode(object)
{ {
codeText = object.innerText; //HTML.replace(/<.*?>/g, ""); codeText = object.innerText; //HTML.replace(/<.*?>/g, "");
object.innerHTML = ''; object.innerHTML = '';
var left; var left;
var match; var match;
var right; var right;
while (codeText.length > 0) while (codeText.length > 0)
{ {
var mode = -1 ; var mode = -1 ;
var index = 999999999; var index = 999999999;
for (var i = 0; i < RE.length; i++) for (var i = 0; i < RE.length; i++)
{ {
if ((codeText.match(RE[i])) && (RegExp.leftContext.length < index)) if ((codeText.match(RE[i])) && (RegExp.leftContext.length < index))
{ {
left = RegExp.leftContext; left = RegExp.leftContext;
match = RegExp.lastMatch; match = RegExp.lastMatch;
right = RegExp.rightContext; right = RegExp.rightContext;
index = RegExp.leftContext.length; index = RegExp.leftContext.length;
mode = i; mode = i;
} }
} }
if (mode == -1) if (mode == -1)
{ {
object.appendChild(document.createTextNode(codeText)); //.replace(/\r\n/g, "\r"))); object.appendChild(document.createTextNode(codeText)); //.replace(/\r\n/g, "\r")));
codeText = ''; codeText = '';
} }
else else
{ {
// append the plain text to the <code> block // append the plain text to the <code> block
object.appendChild(document.createTextNode(left)); //.replace(/\r\n/g, "\r"))); object.appendChild(document.createTextNode(left)); //.replace(/\r\n/g, "\r")));
// create a new <span> with the current code // create a new <span> with the current code
var span = document.createElement("span"); var span = document.createElement("span");
span.setAttribute("className", classes[mode]); // ie span.setAttribute("className", classes[mode]); // ie
span.setAttribute("class", classes[mode]); //mozilla span.setAttribute("class", classes[mode]); //mozilla
span.appendChild(document.createTextNode(match)); span.appendChild(document.createTextNode(match));
object.appendChild(span); object.appendChild(span);
codeText = right; codeText = right;
} }
} }
} }
// little bit of JQuery to highlight code in all pre elements // little bit of JQuery to highlight code in all pre elements
@@ -134,4 +134,3 @@ $(document).ready(function(){
HighlightCode(this); HighlightCode(this);
}); });
}); });
+15 -16
View File
@@ -12,7 +12,7 @@ use Carp;
=head1 NAME =head1 NAME
bacnet.pl - Scriptable BACnet communications bacnet.pl - Scriptable BACnet communications
=head1 DESCRIPTION =head1 DESCRIPTION
@@ -33,7 +33,7 @@ Perl documentation, see http://perldoc.perl.org
Usage: bacnet.pl [program_options] [-- script_args] Usage: bacnet.pl [program_options] [-- script_args]
This program executes a script in perl syntax to perform BACnet/IP operations. This program executes a script in perl syntax to perform BACnet/IP operations.
Possible program options: Possible program options:
--script=s The script to execute. --script=s The script to execute.
--log=s The file to log all output. --log=s The file to log all output.
@@ -116,7 +116,7 @@ BEGIN {
} }
use Inline ( use Inline (
C => Config => C => Config =>
LIBS => "-L$libDir -lbacnet -liphlpapi", LIBS => "-L$libDir -lbacnet -liphlpapi",
INC => ["-I$incDir1", "-I$incDir2", "-I$incDir3"], INC => ["-I$incDir1", "-I$incDir2", "-I$incDir3"],
DIRECTORY => $inlineBuildDir, DIRECTORY => $inlineBuildDir,
@@ -141,7 +141,7 @@ my $answer = '';
'help|?' => \$ask_help, 'help|?' => \$ask_help,
'script=s' => \$script, 'script=s' => \$script,
'log=s' => \$log, 'log=s' => \$log,
); );
if (!defined($script) || !(-f $script)) if (!defined($script) || !(-f $script))
{ {
@@ -150,7 +150,7 @@ if (!defined($script) || !(-f $script))
} }
else else
{ {
# Add the script's location to @INC so that they can include other scripts # Add the script's location to @INC so that they can include other scripts
# using relative paths # using relative paths
my $scriptdir = File::Spec->rel2abs(dirname($script)); my $scriptdir = File::Spec->rel2abs(dirname($script));
push @INC,$scriptdir; push @INC,$scriptdir;
@@ -308,7 +308,7 @@ sub ReadProperty {
=head2 ReadPropertyMultiple =head2 ReadPropertyMultiple
This function implements the ReadPropertyMultiple service. There are no built in retry This function implements the ReadPropertyMultiple service. There are no built in retry
mechanisms. NOTE: all enumerations are defined in F<bacenum.h> mechanisms. NOTE: all enumerations are defined in F<bacenum.h>
=head3 Inputs to ReadPropertyMultiple =head3 Inputs to ReadPropertyMultiple
@@ -414,7 +414,7 @@ sub ReadPropertyMultiple
=head2 WriteProperty =head2 WriteProperty
This function implements the WriteProperty service. There are no built in retry This function implements the WriteProperty service. There are no built in retry
mechanisms. NOTE: all enumerations are defined in F<bacenum.h> mechanisms. NOTE: all enumerations are defined in F<bacenum.h>
=head3 Inputs to WriteProperty =head3 Inputs to WriteProperty
@@ -494,7 +494,7 @@ sub WriteProperty {
} }
else else
{ {
# a priority of 0 means we are not writing to a priority array # a priority of 0 means we are not writing to a priority array
$priority = 0; $priority = 0;
} }
$msg .= " in Device" . '[' . $deviceInstance . "] ==> "; $msg .= " in Device" . '[' . $deviceInstance . "] ==> ";
@@ -553,7 +553,7 @@ This function implements the TimeSync and UTCTimeSync services
=cut =cut
sub TimeSync sub TimeSync
{ {
my $deviceInstanceNumber = shift; my $deviceInstanceNumber = shift;
my $year = shift; my $year = shift;
@@ -574,7 +574,7 @@ sub TimeSync
# be a pessimist. Assume things will fail # be a pessimist. Assume things will fail
$isFailure = 1; $isFailure = 1;
if (defined($utcOffset)) if (defined($utcOffset))
{ {
$isUTC = 1; $isUTC = 1;
@@ -586,7 +586,7 @@ sub TimeSync
$utcOffset = 0; $utcOffset = 0;
$isUTC = 0; $isUTC = 0;
} }
if ($year < 1900 || $year > 2099) if ($year < 1900 || $year > 2099)
{ {
Log("Year '$year' is invalid."); Log("Year '$year' is invalid.");
@@ -610,7 +610,7 @@ sub TimeSync
Log("Hour '$hour' is invalid."); Log("Hour '$hour' is invalid.");
last; last;
} }
if ($minute < 0 || $minute > 59) if ($minute < 0 || $minute > 59)
{ {
Log("Minute '$minute' is invalid."); Log("Minute '$minute' is invalid.");
@@ -629,7 +629,7 @@ sub TimeSync
last; last;
} }
return $isFailure; return $isFailure;
} }
=head2 Log =head2 Log
@@ -637,7 +637,7 @@ sub TimeSync
This function prints out to the desired method of logging (STDOUT or file). This function prints out to the desired method of logging (STDOUT or file).
NewLine characters are not required when making calls to this function. If any NewLine characters are not required when making calls to this function. If any
NewLine characters are specified, they will be stripped out. To print an empty NewLine characters are specified, they will be stripped out. To print an empty
line, pass in a space as the message. NOTE: This function will honor previous line, pass in a space as the message. NOTE: This function will honor previous
requests to silence the log (see SilcenseLog for details) requests to silence the log (see SilcenseLog for details)
=head3 Inputs to Log =head3 Inputs to Log
@@ -671,7 +671,7 @@ sub Log {
# if there is nothing to print, then don't do it # if there is nothing to print, then don't do it
return if (scalar(@last) == 0); return if (scalar(@last) == 0);
# if there are newline-like characters, get rid of them. # if there are newline-like characters, get rid of them.
while ($msg =~/^(.*)[\r\n]+(.*)$/) while ($msg =~/^(.*)[\r\n]+(.*)$/)
{ {
@@ -866,4 +866,3 @@ sub LogAnswer {
$answer = '' unless $append; $answer = '' unless $append;
$answer .= $newAnswer; $answer .= $newAnswer;
} }
+1 -1
View File
@@ -884,7 +884,7 @@ int BacnetTimeSync(int deviceInstanceNumber,
&Target_Address, &npdu_data, &Handler_Transmit_Buffer[0], pdu_len); &Target_Address, &npdu_data, &Handler_Transmit_Buffer[0], pdu_len);
if (bytes_sent <= 0) { if (bytes_sent <= 0) {
char msg[64]; char msg[64];
snprintf(msg, sizeof(msg), snprintf(msg, sizeof(msg),
"Failed to Send Time-Synchronization Request (%s)!", "Failed to Send Time-Synchronization Request (%s)!",
strerror(errno)); strerror(errno));
LogError(msg); LogError(msg);
+3 -5
View File
@@ -1,14 +1,14 @@
The BACnet Scriptable (using Perl) Tool. The BACnet Scriptable (using Perl) Tool.
* Running this tool assumes that the library has been already built. The * Running this tool assumes that the library has been already built. The
library should be built with a command similar to library should be built with a command similar to
CC=/mingw/bin/gcc BACNET_DEFINES="-DPRINT_ENABLED -DBACAPP_ALL -DBACFILE CC=/mingw/bin/gcc BACNET_DEFINES="-DPRINT_ENABLED -DBACAPP_ALL -DBACFILE
-DINTRINSIC_REPORTING" BBMD_DEFINE=-DBBMD_ENABLED\=1 BACNET_PORT=win32 make -DINTRINSIC_REPORTING" BBMD_DEFINE=-DBBMD_ENABLED\=1 BACNET_PORT=win32 make
clean library clean library
* Currently, the tool assumes only win32 port, but should be easily modifiable * Currently, the tool assumes only win32 port, but should be easily modifiable
for any port build. for any port build.
* This tool has to be run from a path without any spaces. The presence of the * This tool has to be run from a path without any spaces. The presence of the
.Inline directory is required. .Inline directory is required.
* Run the tool without any arguments to see usage instructions * Run the tool without any arguments to see usage instructions
@@ -16,5 +16,3 @@ The BACnet Scriptable (using Perl) Tool.
Value) for Device at instance 1234 run the following command Value) for Device at instance 1234 run the following command
perl bacnet.pl --script example_readprop.pl -- 1234 perl bacnet.pl --script example_readprop.pl -- 1234
-1
View File
@@ -56,4 +56,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -17,4 +17,3 @@ fi
make -C libmcp23s17 make -C libmcp23s17
make -C libpifacedigital make -C libpifacedigital
+2 -2
View File
@@ -1,5 +1,5 @@
/** /**
* @file * @file
* @brief Base "class" for handling all BACnet objects belonging * @brief Base "class" for handling all BACnet objects belonging
* to a BACnet device, as well as Device-specific properties. * to a BACnet device, as well as Device-specific properties.
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
-2
View File
@@ -6,5 +6,3 @@ To build, start with the configure script:
$ ./configure.sh $ ./configure.sh
$ make clean all $ make clean all
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief command line tool that sends a BACnet BVLC message, and displays * @brief command line tool that sends a BACnet BVLC message, and displays
* the reply, for a Read-Broadcast-Distribution-Table message to a peer BBMD. * the reply, for a Read-Broadcast-Distribution-Table message to a peer BBMD.
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
* @date 2012 * @date 2012
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief command line tool that sends a BACnet BVLC message, and displays * @brief command line tool that sends a BACnet BVLC message, and displays
* the reply, for a Read-Foreign-Device-Table message to a peer BBMD. * the reply, for a Read-Foreign-Device-Table message to a peer BBMD.
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
* @date 2012 * @date 2012
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+2 -2
View File
@@ -1,7 +1,7 @@
/** /**
* @file * @file
* @brief command line tool that uses BACnet ReadPropertyMultiple service * @brief command line tool that uses BACnet ReadPropertyMultiple service
* message to read object property values from another device on * message to read object property values from another device on
* the network and prints the values to the console. * the network and prints the values to the console.
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
* @date 2008 * @date 2008
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+2 -2
View File
@@ -1,7 +1,7 @@
/** /**
* @file * @file
* @brief command line tool that uses BACnet ReadRange service * @brief command line tool that uses BACnet ReadRange service
* message to read device object BACnetList or BACnetARRAY property values * message to read device object BACnetList or BACnetARRAY property values
* from another device on the network and prints the values to the console. * from another device on the network and prints the values to the console.
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
* @date 2006 * @date 2006
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+5 -5
View File
@@ -565,7 +565,7 @@ static void send_who_is_router_to_network(uint16_t snet, uint16_t dnet)
* @param src [in] The routing source information, if any. * @param src [in] The routing source information, if any.
* If src->net and src->len are 0, there is no routing source information. * If src->net and src->len are 0, there is no routing source information.
* @param npdu_data [in] Contains a filled-out structure with information * @param npdu_data [in] Contains a filled-out structure with information
* decoded from the NCPI and other NPDU bytes. * decoded from the NCPI and other NPDU bytes.
* @param npdu [in] Buffer containing the rest of the NPDU, following the * @param npdu [in] Buffer containing the rest of the NPDU, following the
* bytes that have already been decoded. * bytes that have already been decoded.
* @param npdu_len [in] The length of the remaining NPDU message in npdu[]. * @param npdu_len [in] The length of the remaining NPDU message in npdu[].
@@ -618,7 +618,7 @@ static void who_is_router_to_network_handler(uint16_t snet,
* @param src [in] The routing source information, if any. * @param src [in] The routing source information, if any.
* If src->net and src->len are 0, there is no routing source information. * If src->net and src->len are 0, there is no routing source information.
* @param npdu_data [in] Contains a filled-out structure with information * @param npdu_data [in] Contains a filled-out structure with information
* decoded from the NCPI and other NPDU bytes. * decoded from the NCPI and other NPDU bytes.
* @param npdu [in] Buffer containing the rest of the NPDU, following the * @param npdu [in] Buffer containing the rest of the NPDU, following the
* bytes that have already been decoded. * bytes that have already been decoded.
* @param npdu_len [in] The length of the remaining NPDU message in npdu[]. * @param npdu_len [in] The length of the remaining NPDU message in npdu[].
@@ -899,7 +899,7 @@ static void routed_apdu_handler(uint16_t snet,
while (port != NULL) { while (port != NULL) {
if (port->net != snet) { if (port->net != snet) {
datalink_send_pdu(port->net, dest, npdu, &Tx_Buffer[0], datalink_send_pdu(port->net, dest, npdu, &Tx_Buffer[0],
npdu_len + apdu_len); npdu_len + apdu_len);
} }
port = port->next; port = port->next;
} }
@@ -979,7 +979,7 @@ static void my_routing_npdu_handler(
} }
} else { } else {
fprintf( fprintf(
stderr, "NPDU: unsupported protocol version %u. Discarded!\n", stderr, "NPDU: unsupported protocol version %u. Discarded!\n",
protocol_version); protocol_version);
} }
@@ -1118,7 +1118,7 @@ static void control_c_hooks(void)
* @note This is a proxy function to satisfy the BACnet Stack IPv6 port layer * @note This is a proxy function to satisfy the BACnet Stack IPv6 port layer
* requirements since this application omits a Device object. * requirements since this application omits a Device object.
*/ */
uint32_t Device_Object_Instance_Number(void) uint32_t Device_Object_Instance_Number(void)
{ {
return Device_Instance_Number; return Device_Instance_Number;
} }
+3 -3
View File
@@ -586,7 +586,7 @@ static void send_who_is_router_to_network(uint16_t snet, uint16_t dnet)
* @param src [in] The routing source information, if any. * @param src [in] The routing source information, if any.
* If src->net and src->len are 0, there is no routing source information. * If src->net and src->len are 0, there is no routing source information.
* @param npdu_data [in] Contains a filled-out structure with information * @param npdu_data [in] Contains a filled-out structure with information
* decoded from the NCPI and other NPDU bytes. * decoded from the NCPI and other NPDU bytes.
* @param npdu [in] Buffer containing the rest of the NPDU, following the * @param npdu [in] Buffer containing the rest of the NPDU, following the
* bytes that have already been decoded. * bytes that have already been decoded.
* @param npdu_len [in] The length of the remaining NPDU message in npdu[]. * @param npdu_len [in] The length of the remaining NPDU message in npdu[].
@@ -639,7 +639,7 @@ static void who_is_router_to_network_handler(uint16_t snet,
* @param src [in] The routing source information, if any. * @param src [in] The routing source information, if any.
* If src->net and src->len are 0, there is no routing source information. * If src->net and src->len are 0, there is no routing source information.
* @param npdu_data [in] Contains a filled-out structure with information * @param npdu_data [in] Contains a filled-out structure with information
* decoded from the NCPI and other NPDU bytes. * decoded from the NCPI and other NPDU bytes.
* @param npdu [in] Buffer containing the rest of the NPDU, following the * @param npdu [in] Buffer containing the rest of the NPDU, following the
* bytes that have already been decoded. * bytes that have already been decoded.
* @param npdu_len [in] The length of the remaining NPDU message in npdu[]. * @param npdu_len [in] The length of the remaining NPDU message in npdu[].
@@ -922,7 +922,7 @@ static void routed_apdu_handler(uint16_t snet,
while (port != NULL) { while (port != NULL) {
if (port->net != snet) { if (port->net != snet) {
datalink_send_pdu(port->net, dest, npdu, &Tx_Buffer[0], datalink_send_pdu(port->net, dest, npdu, &Tx_Buffer[0],
npdu_len + apdu_len); npdu_len + apdu_len);
} }
port = port->next; port = port->next;
} }
+1 -1
View File
@@ -48,7 +48,7 @@ SRCS = main.c \
msgqueue.c \ msgqueue.c \
network_layer.c network_layer.c
# note: router does not use common libbacnet.a library, # note: router does not use common libbacnet.a library,
# so use CFLAGS without common app defines or includes # so use CFLAGS without common app defines or includes
CFLAGS = -I${SOURCE_DIR} -I${BACNET_PORT_DIR} CFLAGS = -I${SOURCE_DIR} -I${BACNET_PORT_DIR}
CFLAGS += -DBACNET_STACK_DEPRECATED_DISABLE CFLAGS += -DBACNET_STACK_DEPRECATED_DISABLE
+52 -52
View File
@@ -2,67 +2,67 @@
configuration file that stores values for router ports initialization configuration file that stores values for router ports initialization
Common arguments: Common arguments:
device_type - "bip" or "mstp" (with quotes) device_type - "bip" or "mstp" (with quotes)
device - Connection device, for example "eth0" or "/dev/ttyS0" device - Connection device, for example "eth0" or "/dev/ttyS0"
network - Network number [1..65534]. Do not use network number 65535, it is broadcast number network - Network number [1..65534]. Do not use network number 65535, it is broadcast number
bip arguments: bip arguments:
port - bip UDP port, default 47808 port - bip UDP port, default 47808
mstp arguments: mstp arguments:
mac - MSTP MAC mac - MSTP MAC
max_master - MSTP max master max_master - MSTP max master
max_frames - 1 max_frames - 1
baud - one from the list: 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400 baud - one from the list: 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400
parity - one from the list (with quotes): "None", "Even", "Odd" parity - one from the list (with quotes): "None", "Even", "Odd"
databits - one from the list: 5, 6, 7, 8 databits - one from the list: 5, 6, 7, 8
stopbits - 1 or 2 stopbits - 1 or 2
Example: Example:
ports = ports =
( (
{ {
device_type = "bip"; device_type = "bip";
device = "eth0"; device = "eth0";
port = 47808; port = 47808;
network = 1; network = 1;
}, },
{ {
device_type = "mstp"; device_type = "mstp";
device = "/dev/ttyS0"; device = "/dev/ttyS0";
mac = 1; mac = 1;
max_master = 127; max_master = 127;
max_frames = 1; max_frames = 1;
baud = 38400; baud = 38400;
parity = "None"; parity = "None";
databits = 8; databits = 8;
stopbits = 1; stopbits = 1;
network = 2; network = 2;
} }
); );
*/ */
ports = ports =
( (
{ {
device_type = "bip"; device_type = "bip";
device = "eth0"; device = "eth0";
port = 47808; port = 47808;
network = 1; network = 1;
}, },
{ {
device_type = "mstp"; device_type = "mstp";
device = "/dev/ttyS0"; device = "/dev/ttyS0";
mac = 2; mac = 2;
max_master = 127; max_master = 127;
max_frames = 1; max_frames = 1;
baud = 38400; baud = 38400;
parity = "None"; parity = "None";
databits = 8; databits = 8;
stopbits = 1; stopbits = 1;
network = 2; network = 2;
} }
); );
+3 -3
View File
@@ -17,9 +17,9 @@
#include "portthread.h" #include "portthread.h"
#include "bacnet/datalink/bip.h" #include "bacnet/datalink/bip.h"
#define MAX_BIP_APDU 1476 #define MAX_BIP_APDU 1476
#define MAX_BIP_PDU (MAX_NPDU + MAX_BIP_APDU) #define MAX_BIP_PDU (MAX_NPDU + MAX_BIP_APDU)
#define MAX_BIP_MPDU (BIP_HEADER_MAX + MAX_BIP_PDU) #define MAX_BIP_MPDU (BIP_HEADER_MAX + MAX_BIP_PDU)
/* Yes, we know this is longer than an Ethernet Frame, /* Yes, we know this is longer than an Ethernet Frame,
a UDP payload and an IPv6 packet. a UDP payload and an IPv6 packet.
Grandfathered in from BACnet Ethernet days, Grandfathered in from BACnet Ethernet days,
+66 -69
View File
@@ -17,7 +17,7 @@ SPDX-License-Identifier: MIT
3. Build 3. Build
----------------------- -----------------------
1. Download, build and install libconfig C/C++ Configuration File Library 1. Download, build and install libconfig C/C++ Configuration File Library
from http://www.hyperrealm.com/libconfig or use APT to install from http://www.hyperrealm.com/libconfig or use APT to install
sudo apt-get install libconfig-dev sudo apt-get install libconfig-dev
2. Run "make clean all" from library root directory 2. Run "make clean all" from library root directory
@@ -32,101 +32,98 @@ SPDX-License-Identifier: MIT
//single line comment //single line comment
/* /*
multiline comment multiline comment
*/ */
ports = ports =
( (
//route_1 //route_1
{ {
device_type = "<value>"; device_type = "<value>";
//route specific arguments, see below //route specific arguments, see below
}, },
//route_2 //route_2
{ {
device_type = "<value>"; device_type = "<value>";
//route specific arguments, see below //route specific arguments, see below
}, },
//..... //.....
//route_n //route_n
{ {
device_type = "<value>"; device_type = "<value>";
//route specific arguments, see below //route specific arguments, see below
} }
); );
Note: - arguments are separeted with ';' Note: - arguments are separeted with ';'
- routes are separeted with ',' - routes are separeted with ','
- no ',' after the last route - no ',' after the last route
4.2. Configuration file arguments. 4.2. Configuration file arguments.
Common arguments: Common arguments:
device_type - Describes a type of route, may be "bip" (Etherent) or "mstp" (Serial port). Use quotes. device_type - Describes a type of route, may be "bip" (Etherent) or "mstp" (Serial port). Use quotes.
device - Connection device, for example "eth0" or "/dev/ttyS0"; default values: for BIP:"eth0", for MSTP: "/dev/ttyS0". Use quotes. device - Connection device, for example "eth0" or "/dev/ttyS0"; default values: for BIP:"eth0", for MSTP: "/dev/ttyS0". Use quotes.
network - Network number [1..65534]. Do not use network number 65535, it is broadcast number; default begins from 1 to routes count. network - Network number [1..65534]. Do not use network number 65535, it is broadcast number; default begins from 1 to routes count.
bip arguments: bip arguments:
port - bip UDP port; default port is 47808 (0xBAC0). port - bip UDP port; default port is 47808 (0xBAC0).
mstp arguments: mstp arguments:
mac - MSTP MAC; default value is 127. mac - MSTP MAC; default value is 127.
max_master - MSTP max master; default value is 127. max_master - MSTP max master; default value is 127.
max_frames - 1. Segmentation does not supported. max_frames - 1. Segmentation does not supported.
baud - one from the list: 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400; default baud is 9600 baud - one from the list: 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400; default baud is 9600
parity - one from the list (with quotes): "None", "Even", "Odd"; default parity "None". Use quotes. parity - one from the list (with quotes): "None", "Even", "Odd"; default parity "None". Use quotes.
databits - one from the list: 5, 6, 7, 8; default 8. databits - one from the list: 5, 6, 7, 8; default 8.
stopbits - 1 or 2; default 1. stopbits - 1 or 2; default 1.
4.3. Example of configuration file. 4.3. Example of configuration file.
ports = ports =
( (
{ {
device_type = "bip"; device_type = "bip";
device = "eth0"; device = "eth0";
port = 47808; port = 47808;
network = 1; network = 1;
}, },
{ {
device_type = "bip"; device_type = "bip";
device = "eth1"; device = "eth1";
port = 47808; port = 47808;
network = 2; network = 2;
}, },
{ {
device_type = "bip"; device_type = "bip";
device = "eth1"; device = "eth1";
port = 47809; port = 47809;
network = 3; network = 3;
}, },
{ {
device_type = "mstp"; device_type = "mstp";
device = "/dev/ttyS0"; device = "/dev/ttyS0";
mac = 1; mac = 1;
max_master = 127; max_master = 127;
max_frames = 1; max_frames = 1;
baud = 38400; baud = 38400;
parity = "None"; parity = "None";
databits = 8; databits = 8;
stopbits = 1; stopbits = 1;
network = 4; network = 4;
} }
); );
----------------------- -----------------------
5. Start 5. Start
----------------------- -----------------------
5.1. With configuration file 5.1. With configuration file
1. Copy configuration file in the router executable directory 1. Copy configuration file in the router executable directory
2. Start the router with "sudo ./router -c init.cfg" command in terminal 2. Start the router with "sudo ./router -c init.cfg" command in terminal
5.2. Passing params in command line 5.2. Passing params in command line
1. sudo ./router -D "mstp" "/dev/ttyS0" --mac 1 127 1 --baud 38400 --network 4 -D "bip" "eth0" --network 1 1. sudo ./router -D "mstp" "/dev/ttyS0" --mac 1 127 1 --baud 38400 --network 4 -D "bip" "eth0" --network 1
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+2 -2
View File
@@ -1,8 +1,8 @@
/** /**
* @file * @file
* @brief command line tool that uses BACnet SubscribeCOV service * @brief command line tool that uses BACnet SubscribeCOV service
* message to subscribe to a BACnet object for Change-of-Value notifications * message to subscribe to a BACnet object for Change-of-Value notifications
* in a BACnet device and print the Change-of-Value notifications values * in a BACnet device and print the Change-of-Value notifications values
* to the console. * to the console.
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
* @date 2006 * @date 2006
-1
View File
@@ -42,4 +42,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -42,4 +42,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -75,4 +75,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+7 -9
View File
@@ -36,19 +36,19 @@ BIBBs Supported:
-- SCHED-A SCHED-I-B SCHED-E-B -- SCHED-A SCHED-I-B SCHED-E-B
-- T-VMT-A T-VMT-I-B T-VMT-E-B -- T-VMT-A T-VMT-I-B T-VMT-E-B
-- T-ATR-A T-ATR-B -- T-ATR-A T-ATR-B
-- DM-DDB-A -- DM-DDB-A
DM-DDB-B DM-DDB-B
-- DM-DOB-A -- DM-DOB-A
DM-DOB-B DM-DOB-B
-- DM-DCC-A -- DM-DCC-A
DM-DCC-B DM-DCC-B
-- DM-PT-A DM-PT-B -- DM-PT-A DM-PT-B
-- DM-TM-A DM-TM-B -- DM-TM-A DM-TM-B
-- DM-TS-A -- DM-TS-A
DM-TS-B DM-TS-B
-- DM-UTC-A -- DM-UTC-A
DM-UTC-B DM-UTC-B
-- DM-RD-A -- DM-RD-A
DM-RD-B DM-RD-B
-- DM-BR-A DM-BR-B -- DM-BR-A DM-BR-B
-- DM-R-A DM-R-B -- DM-R-A DM-R-B
@@ -140,7 +140,7 @@ Data Link Layer Option:
-- ISO 8802-3, 10BASET -- ISO 8802-3, 10BASET
-- ISO 8802-3, Fiber -- ISO 8802-3, Fiber
-- ARCNET, coax star -- ARCNET, coax star
-- ARCNET, coax bus -- ARCNET, coax bus
-- ARCNET, twisted pair star -- ARCNET, twisted pair star
-- ARCNET, twisted pair bus -- ARCNET, twisted pair bus
-- ARCNET, fiber star -- ARCNET, fiber star
@@ -755,5 +755,3 @@ List of Objects in test device:
} }
End of BACnet Protocol Implementation Conformance Statement End of BACnet Protocol Implementation Conformance Statement
+10 -10
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief command line tool that simulates a BACnet server device on the * @brief command line tool that simulates a BACnet server device on the
* network using the BACnet Stack and all the example object types. * network using the BACnet Stack and all the example object types.
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
* @date 2006 * @date 2006
@@ -179,15 +179,15 @@ static void Init_Service_Handlers(void)
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_WHO_HAS, handler_who_has); apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_WHO_HAS, handler_who_has);
#if 0 #if 0
/* BACnet Testing Observed Incident oi00107 /* BACnet Testing Observed Incident oi00107
Server only devices should not indicate that they EXECUTE I-Am Server only devices should not indicate that they EXECUTE I-Am
Revealed by BACnet Test Client v1.8.16 ( www.bac-test.com/bacnet-test-client-download ) Revealed by BACnet Test Client v1.8.16 ( www.bac-test.com/bacnet-test-client-download )
BITS: BIT00040 BITS: BIT00040
Any discussions can be directed to edward@bac-test.com Any discussions can be directed to edward@bac-test.com
Please feel free to remove this comment when my changes accepted after suitable time for Please feel free to remove this comment when my changes accepted after suitable time for
review by all interested parties. Say 6 months -> September 2016 */ review by all interested parties. Say 6 months -> September 2016 */
/* In this demo, we are the server only ( BACnet "B" device ) so we do not indicate /* In this demo, we are the server only ( BACnet "B" device ) so we do not indicate
that we can execute the I-Am message */ that we can execute the I-Am message */
/* handle i-am to support binding to other devices */ /* handle i-am to support binding to other devices */
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_I_AM, handler_i_am_bind); apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_I_AM, handler_i_am_bind);
#endif #endif
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file * @file
* @brief command line tool that sends a BACnet TimeSynchronization service * @brief command line tool that sends a BACnet TimeSynchronization service
* message with the local or arbitrary time and date to sync another device * message with the local or arbitrary time and date to sync another device
* on the network. * on the network.
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
* @date 2006 * @date 2006
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief command line tool that sends a BACnet Unconfirmed Change-of-Value * @brief command line tool that sends a BACnet Unconfirmed Change-of-Value
* Notification to the network * Notification to the network
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
* @date 2006 * @date 2006
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief command line tool that sends a BACnet Who-Is-Router-To-Network * @brief command line tool that sends a BACnet Who-Is-Router-To-Network
* message for one or more networks, and prints any I-Am-Router-To-Network * message for one or more networks, and prints any I-Am-Router-To-Network
* responses received. This is useful for finding routers on the network. * responses received. This is useful for finding routers on the network.
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief command line tool that sends a BACnet BVLC message * @brief command line tool that sends a BACnet BVLC message
* Write-Broadcast-Distribution-Table to a BBMD on the network, * Write-Broadcast-Distribution-Table to a BBMD on the network,
* and prints the result code received. This is useful for * and prints the result code received. This is useful for
* configuring the BBMD on the network. * configuring the BBMD on the network.
-1
View File
@@ -37,4 +37,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief command line tool that uses BACnet AtomicWriteFile service * @brief command line tool that uses BACnet AtomicWriteFile service
* to send a local file to a another device on the network. * to send a local file to a another device on the network.
* This tool sends the file in chunks to the target device. * This tool sends the file in chunks to the target device.
* @author Steve Karg <skarg@users.sourceforge.net> * @author Steve Karg <skarg@users.sourceforge.net>
-1
View File
@@ -40,4 +40,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+2 -2
View File
@@ -1,7 +1,7 @@
/** /**
* @file * @file
* @brief command line tool that uses BACnet WriteProperty service * @brief command line tool that uses BACnet WriteProperty service
* message to write object property values to another device on * message to write object property values to another device on
* the network and prints an acknowledgment or error response of * the network and prints an acknowledgment or error response of
* this confirmed service request. This is useful for testing * this confirmed service request. This is useful for testing
* the WriteProperty service. * the WriteProperty service.
-1
View File
@@ -40,4 +40,3 @@ clean:
.PHONY: include .PHONY: include
include: .depend include: .depend
+2 -2
View File
@@ -1,7 +1,7 @@
/** /**
* @file * @file
* @brief command line tool that uses BACnet WritePropertyMultiple service * @brief command line tool that uses BACnet WritePropertyMultiple service
* message to write object property values to another device on * message to write object property values to another device on
* the network and prints an acknowledgment or error response of * the network and prints an acknowledgment or error response of
* this confirmed service request. This is useful for testing * this confirmed service request. This is useful for testing
* the WritePropertyMultiple service. * the WritePropertyMultiple service.
+1 -2
View File
@@ -36,7 +36,7 @@ package "gdb-multiarch"
# install AVR compiler and debugging tools # install AVR compiler and debugging tools
package "gcc-avr" package "gcc-avr"
package "avarice" package "avarice"
package "avr-libc" package "avr-libc"
package "avrdude" package "avrdude"
package "gdb-avr" package "gdb-avr"
package "avrdude-doc" package "avrdude-doc"
@@ -51,4 +51,3 @@ package "codespell"
# you can also execute arbitrary bash # you can also execute arbitrary bash
echo "🚀 ALL GOOD TO GO" echo "🚀 ALL GOOD TO GO"
+1 -1
View File
@@ -15,7 +15,7 @@ bacrp.exe %1 8 %1 139
bacrp.exe %1 8 %1 97 bacrp.exe %1 8 %1 97
bacrp.exe %1 8 %1 96 bacrp.exe %1 8 %1 96
bacrp.exe %1 8 %1 76 0 bacrp.exe %1 8 %1 76 0
bacrp.exe %1 8 %1 76 bacrp.exe %1 8 %1 76
bacrp.exe %1 8 %1 62 bacrp.exe %1 8 %1 62
bacrp.exe %1 8 %1 107 bacrp.exe %1 8 %1 107
bacrp.exe %1 8 %1 11 bacrp.exe %1 8 %1 11
+104 -106
View File
@@ -6,7 +6,7 @@ OPTIONAL=0
usage() usage()
{ {
echo "usage: $PROG [OPTIONS] <<BACnetID>> [ <<BACnetID>> ... ] echo "usage: $PROG [OPTIONS] <<BACnetID>> [ <<BACnetID>> ... ]
Will return Required and Optional property values Will return Required and Optional property values
from the requested device. from the requested device.
@@ -32,116 +32,114 @@ done
shift $(($OPTIND -1)) shift $(($OPTIND -1))
if [ $# -eq 0 ] || [ "$1" = "" ] ; then if [ $# -eq 0 ] || [ "$1" = "" ] ; then
usage usage
exit exit
fi fi
run_test() run_test()
{ {
echo -e -e "Test: Read Required Properties of Device Object $1\r" echo -e -e "Test: Read Required Properties of Device Object $1\r"
echo -n "OBJECT IDENTIFIER:" echo -n "OBJECT IDENTIFIER:"
./bacrp $1 8 $1 75 ./bacrp $1 8 $1 75
echo -n "OBJECT NAME:" echo -n "OBJECT NAME:"
./bacrp $1 8 $1 77 ./bacrp $1 8 $1 77
echo -n "OBJECT TYPE:" echo -n "OBJECT TYPE:"
./bacrp $1 8 $1 79 ./bacrp $1 8 $1 79
echo -n "SYSTEM STATUS:" echo -n "SYSTEM STATUS:"
./bacrp $1 8 $1 112 ./bacrp $1 8 $1 112
echo -n "VENDOR NAME:" echo -n "VENDOR NAME:"
./bacrp $1 8 $1 121 ./bacrp $1 8 $1 121
echo -n "VENDOR IDENTIFIER:" echo -n "VENDOR IDENTIFIER:"
./bacrp $1 8 $1 120 ./bacrp $1 8 $1 120
echo -n "MODEL NAME:" echo -n "MODEL NAME:"
./bacrp $1 8 $1 70 ./bacrp $1 8 $1 70
echo -n "FIRMWARE REVISION:" echo -n "FIRMWARE REVISION:"
./bacrp $1 8 $1 44 ./bacrp $1 8 $1 44
echo -n "APPLICATION SOFTWARE VERSION:" echo -n "APPLICATION SOFTWARE VERSION:"
./bacrp $1 8 $1 12 ./bacrp $1 8 $1 12
echo -n "PROTOCOL VERSION:" echo -n "PROTOCOL VERSION:"
./bacrp $1 8 $1 98 ./bacrp $1 8 $1 98
echo -n "PROTOCOL REVISION:" echo -n "PROTOCOL REVISION:"
./bacrp $1 8 $1 139 ./bacrp $1 8 $1 139
echo -n "PROTOCOL SERVICES SUPPORTED:" echo -n "PROTOCOL SERVICES SUPPORTED:"
./bacrp $1 8 $1 97 ./bacrp $1 8 $1 97
echo -n "OBJECT TYPES SUPPORTED:" echo -n "OBJECT TYPES SUPPORTED:"
./bacrp $1 8 $1 96 ./bacrp $1 8 $1 96
echo -n "OBJECT LIST LENGTH:" echo -n "OBJECT LIST LENGTH:"
./bacrp $1 8 $1 76 0 ./bacrp $1 8 $1 76 0
echo -n "OBJECT LIST:" echo -n "OBJECT LIST:"
./bacrp $1 8 $1 76 ./bacrp $1 8 $1 76
echo -n "MAX APDU LENGTH ACCEPTED:" echo -n "MAX APDU LENGTH ACCEPTED:"
./bacrp $1 8 $1 62 ./bacrp $1 8 $1 62
echo -n "SEGMENTATION SUPPORTED:" echo -n "SEGMENTATION SUPPORTED:"
./bacrp $1 8 $1 107 ./bacrp $1 8 $1 107
echo -n "APDU TIMEOUT:" echo -n "APDU TIMEOUT:"
./bacrp $1 8 $1 11 ./bacrp $1 8 $1 11
echo -n "NUMGER OF APDU ENTRIES:" echo -n "NUMGER OF APDU ENTRIES:"
./bacrp $1 8 $1 73 ./bacrp $1 8 $1 73
echo -n "DEVICE ADDRESS BINDING:" echo -n "DEVICE ADDRESS BINDING:"
./bacrp $1 8 $1 30 ./bacrp $1 8 $1 30
echo -n "DATABASE REVISION:" echo -n "DATABASE REVISION:"
./bacrp $1 8 $1 155 ./bacrp $1 8 $1 155
if [ $OPTIONAL -eq 1 ] ; then if [ $OPTIONAL -eq 1 ] ; then
echo -e "Test: Read Optional Properties of Device Object $1\r" echo -e "Test: Read Optional Properties of Device Object $1\r"
echo -n "LOCATION:" echo -n "LOCATION:"
./bacrp $1 8 $1 58 ./bacrp $1 8 $1 58
echo -n "DESCRIPTION:" echo -n "DESCRIPTION:"
./bacrp $1 8 $1 28 ./bacrp $1 8 $1 28
echo -n "MAX SEGMENTS SUPPORTED:" echo -n "MAX SEGMENTS SUPPORTED:"
./bacrp $1 8 $1 167 ./bacrp $1 8 $1 167
echo -n "VT CLASSES SUPPORTED:" echo -n "VT CLASSES SUPPORTED:"
./bacrp $1 8 $1 122 ./bacrp $1 8 $1 122
echo -n "ACTIVE VT SESSIONS:" echo -n "ACTIVE VT SESSIONS:"
./bacrp $1 8 $1 5 ./bacrp $1 8 $1 5
echo -n "LOCAL TIME:" echo -n "LOCAL TIME:"
./bacrp $1 8 $1 57 ./bacrp $1 8 $1 57
echo -n "LOCAL DATE:" echo -n "LOCAL DATE:"
./bacrp $1 8 $1 56 ./bacrp $1 8 $1 56
echo -n "UTC OFFSET:" echo -n "UTC OFFSET:"
./bacrp $1 8 $1 119 ./bacrp $1 8 $1 119
echo -n "DAYLIGHT SAVINGS STATUS:" echo -n "DAYLIGHT SAVINGS STATUS:"
./bacrp $1 8 $1 24 ./bacrp $1 8 $1 24
echo -n "APDU SEGMENT TIMEOUT:" echo -n "APDU SEGMENT TIMEOUT:"
./bacrp $1 8 $1 10 ./bacrp $1 8 $1 10
echo -n "LIST OF SESSION KEYS:" echo -n "LIST OF SESSION KEYS:"
./bacrp $1 8 $1 55 ./bacrp $1 8 $1 55
echo -n "TIME SYNCHRONIZATION RECIPIENTS:" echo -n "TIME SYNCHRONIZATION RECIPIENTS:"
./bacrp $1 8 $1 116 ./bacrp $1 8 $1 116
echo -n "MAX MASTER:" echo -n "MAX MASTER:"
./bacrp $1 8 $1 64 ./bacrp $1 8 $1 64
echo -n "MAX INFO FRAMES:" echo -n "MAX INFO FRAMES:"
./bacrp $1 8 $1 63 ./bacrp $1 8 $1 63
echo -n "ACK REQUIRED:" echo -n "ACK REQUIRED:"
./bacrp $1 8 $1 1 ./bacrp $1 8 $1 1
echo -n "CONFIGURATION FILES:" echo -n "CONFIGURATION FILES:"
./bacrp $1 8 $1 154 ./bacrp $1 8 $1 154
echo -n "LAST RESTORE TIME:" echo -n "LAST RESTORE TIME:"
./bacrp $1 8 $1 157 ./bacrp $1 8 $1 157
echo -n "BACKUP FAILURE TIMEOUT:" echo -n "BACKUP FAILURE TIMEOUT:"
./bacrp $1 8 $1 153 ./bacrp $1 8 $1 153
echo -n "ACTIVE COV SUBSCRIPTIONS:" echo -n "ACTIVE COV SUBSCRIPTIONS:"
./bacrp $1 8 $1 152 ./bacrp $1 8 $1 152
echo -n "SLAVE PROXY ENABLE:" echo -n "SLAVE PROXY ENABLE:"
./bacrp $1 8 $1 172 ./bacrp $1 8 $1 172
echo -n "MANUAL SLAVE ADDRESS BINDING:" echo -n "MANUAL SLAVE ADDRESS BINDING:"
./bacrp $1 8 $1 170 ./bacrp $1 8 $1 170
echo -n "AUTO SLAVE DISCOVERY:" echo -n "AUTO SLAVE DISCOVERY:"
./bacrp $1 8 $1 169 ./bacrp $1 8 $1 169
echo -n "SLAVE ADDRESS BINDING:" echo -n "SLAVE ADDRESS BINDING:"
./bacrp $1 8 $1 171 ./bacrp $1 8 $1 171
echo -n "PROFILE NAME:" echo -n "PROFILE NAME:"
./bacrp $1 8 $1 168 ./bacrp $1 8 $1 168
fi fi
echo -e " \r" echo -e " \r"
} }
while [ $# -gt 0 ] ; do while [ $# -gt 0 ] ; do
ID=$(( $1 + 0 )) ID=$(( $1 + 0 ))
shift shift
if [ $ID -eq 0 ] ; then if [ $ID -eq 0 ] ; then
echo "ERROR: Device ID must be an integer!! [ID=$ID]" >&2 echo "ERROR: Device ID must be an integer!! [ID=$ID]" >&2
fi fi
run_test $ID run_test $ID
done done
+2 -3
View File
@@ -18,8 +18,8 @@ declare -A device
# capture the devices from the command line # capture the devices from the command line
for d in "$@" for d in "$@"
do do
device[${port_key}]=${d} device[${port_key}]=${d}
epics_port_max=$((port_key++)) epics_port_max=$((port_key++))
done done
# spawn the epics clients # spawn the epics clients
@@ -42,4 +42,3 @@ for pid in ${pids[*]}; do
done done
killall bacserv killall bacserv
-1
View File
@@ -11,4 +11,3 @@ echo they register as a Foreign Device to it.
@echo on @echo on
set BACNET_BBMD_PORT=47808 set BACNET_BBMD_PORT=47808
set BACNET_BBMD_ADDRESS=%1 set BACNET_BBMD_ADDRESS=%1
+1 -1
View File
@@ -50,4 +50,4 @@ export BACNET_ROUTER_DEBUG
echo "BACNET_ROUTER_DEBUG=$BACNET_ROUTER_DEBUG" echo "BACNET_ROUTER_DEBUG=$BACNET_ROUTER_DEBUG"
echo Launching new shell using the BACnet Router environment... echo Launching new shell using the BACnet Router environment...
/bin/bash /bin/bash
+1 -1
View File
@@ -19,4 +19,4 @@ max_subargs_per_line: 2
max_pargs_hwrap: 2 max_pargs_hwrap: 2
max_subgroups_hwrap: 2 max_subgroups_hwrap: 2
-1
View File
@@ -23,4 +23,3 @@ do
${CONVERTER} ${filename} > ${TEMPFILE} ${CONVERTER} ${filename} > ${TEMPFILE}
mv ${TEMPFILE} ${filename} mv ${TEMPFILE} ${filename}
done done
Vendored
-1
View File
@@ -1,3 +1,2 @@
#!/bin/sh #!/bin/sh
# Nothing to do # Nothing to do
+17 -17
View File
@@ -40,8 +40,8 @@ Adding additional services is a matter of adding the encoding and decoding for
the service into/from meaningful data, and I like to add unit testing, a demo the service into/from meaningful data, and I like to add unit testing, a demo
handler and send function, as well as a demo command line example. handler and send function, as well as a demo command line example.
For each service that you add to your project or makefile, you will need to For each service that you add to your project or makefile, you will need to
add a handler and possibly a sending function. There are example handlers add a handler and possibly a sending function. There are example handlers
and send functions for all the services that the stack supports: and send functions for all the services that the stack supports:
* demo/handler/h_alarm_ack.c - Alarm ACK service handler example * demo/handler/h_alarm_ack.c - Alarm ACK service handler example
@@ -121,7 +121,7 @@ example object files in the BACnet stack include:
* demo/object/lsp.c - life safety point object demo * demo/object/lsp.c - life safety point object demo
* demo/object/mso.c - multi-step output object demo * demo/object/mso.c - multi-step output object demo
The BACnet stack includes a number of core files that handle the service The BACnet stack includes a number of core files that handle the service
packets that come in from the datalink layer. The core files include: packets that come in from the datalink layer. The core files include:
* apdu.c - handles dispatching the services to the proper handlers * apdu.c - handles dispatching the services to the proper handlers
@@ -134,11 +134,11 @@ packets that come in from the datalink layer. The core files include:
* demo/handler/h_npdu.c - handles dispatching of the network message * demo/handler/h_npdu.c - handles dispatching of the network message
to the apdu dispatcher. to the apdu dispatcher.
The DataLink Layer controls orderly access to the physical medium. The DataLink Layer controls orderly access to the physical medium.
The stack currently supports one datalink layer at a time, and uses a The stack currently supports one datalink layer at a time, and uses a
macro defined in config.h or your makefile/project to choose the macro macro defined in config.h or your makefile/project to choose the macro
functions defined in datalink.h. The following files are used for the functions defined in datalink.h. The following files are used for the
datalink handling in this BACnet stack, and may have to be developed for datalink handling in this BACnet stack, and may have to be developed for
your particular hardware: your particular hardware:
* bip.c - BACnet/IP functionality - depends on bip_init.c in port/xx * bip.c - BACnet/IP functionality - depends on bip_init.c in port/xx
@@ -149,15 +149,15 @@ your particular hardware:
* arcnet.c - ARCNET datalink layer functionality, in port/xx * arcnet.c - ARCNET datalink layer functionality, in port/xx
* ethernet.c - BACnet Ethernet datalink layer functionality, in port/xx * ethernet.c - BACnet Ethernet datalink layer functionality, in port/xx
There are a dozen demonstration applications in the demo directory, There are a dozen demonstration applications in the demo directory,
along with many demonstation objects and handlers. All the demos accept along with many demonstation objects and handlers. All the demos accept
command line options and have been tested under Win32 and Linux. command line options and have been tested under Win32 and Linux.
There is a makefile in the respective demo directory for Linux and There is a makefile in the respective demo directory for Linux and
for Borland C++ compilers, and a master makefile at the root level for Borland C++ compilers, and a master makefile at the root level
(Makefile=Linux, makefile.b32=Borland). (Makefile=Linux, makefile.b32=Borland).
The simplest demonstration is to run demo/server/bacserv on one PC (or The simplest demonstration is to run demo/server/bacserv on one PC (or
virtual PC), and run the other client demonstration applications one virtual PC), and run the other client demonstration applications one
at time on another PC (or virtual PC). Monitor the network communcations at time on another PC (or virtual PC). Monitor the network communcations
using Wireshark protocol analyzer, or test the BACnet server using using Wireshark protocol analyzer, or test the BACnet server using
BACnet Visual Test Shell VTS3. BACnet Visual Test Shell VTS3.
+14 -14
View File
@@ -1,38 +1,38 @@
To build the Doxygen documentation for the BACnet Stack: To build the Doxygen documentation for the BACnet Stack:
- Install doxygen as described at - Install doxygen as described at
http://www.stack.nl/~dimitri/doxygen/install.html http://www.stack.nl/~dimitri/doxygen/install.html
- If you want to generate call graphs (recommended - very nice! - but takes - If you want to generate call graphs (recommended - very nice! - but takes
signficantly longer to build the documents), you must also have signficantly longer to build the documents), you must also have
graphviz installed. graphviz installed.
- To build from the command line, just enter - To build from the command line, just enter
doxygen BACnet-stack.doxyfile doxygen BACnet-stack.doxyfile
- Output is built in doc/output/html, and there is a convenient - Output is built in doc/output/html, and there is a convenient
starting point at doc/output/BAC_stack.html. starting point at doc/output/BAC_stack.html.
- If you use Eclipse, - If you use Eclipse,
- install the eClox plugin to support doxygen within Eclipse - install the eClox plugin to support doxygen within Eclipse
- Build the documents by right clicking on BACnet-stack.doxyfile, - Build the documents by right clicking on BACnet-stack.doxyfile,
and selecting "@ Build Documentation" and selecting "@ Build Documentation"
- Feel free to tweak the doxygen output to your tastes, interests, and - Feel free to tweak the doxygen output to your tastes, interests, and
choice of output formats. choice of output formats.
- The Latex output could be converted into a PDF (see doxygen manual, - The Latex output could be converted into a PDF (see doxygen manual,
and google for your issues). and google for your issues).
- I have tried the PDF, man, and RTF outputs and not liked the results - I have tried the PDF, man, and RTF outputs and not liked the results
for any of them (500+ pages). I recommend the HTML output, as it is for any of them (500+ pages). I recommend the HTML output, as it is
well organized and has an obvious flow, both of which the others lack. well organized and has an obvious flow, both of which the others lack.
The doxygen output is not checked into this project because it consists of The doxygen output is not checked into this project because it consists of
over 5,000 little files (for HTML with call graphs), and it is easily over 5,000 little files (for HTML with call graphs), and it is easily
regenerated. regenerated.
For speed, the function call graphs are not enabled in the SVN version For speed, the function call graphs are not enabled in the SVN version
of the doxyfile. To enable them, edit BACnet-stack.doxyfile (with a of the doxyfile. To enable them, edit BACnet-stack.doxyfile (with a
text editor or with GUI-based editors in Eclipse or using the text editor or with GUI-based editors in Eclipse or using the
doxywizard application) and change doxywizard application) and change
HAVE_DOT = YES HAVE_DOT = YES
CALLER_GRAPH = YES CALLER_GRAPH = YES
Following the doxygen website's lead, I found the D-Bus project to be a good Following the doxygen website's lead, I found the D-Bus project to be a good
example of the sort of documentation we needed to have here. example of the sort of documentation we needed to have here.
http://dbus.freedesktop.org/doc/dbus/api/html/index.html http://dbus.freedesktop.org/doc/dbus/api/html/index.html
@@ -48,7 +48,7 @@ whitespace, like a function per page, ~600 pages, not usefully organized).
Ditto for RTF and man output. Ditto for RTF and man output.
I could not find a linux-based compiled help compiler, so I resorted to using I could not find a linux-based compiled help compiler, so I resorted to using
Microsoft's. They seem to be pushing some later generation tools, and Microsoft's. They seem to be pushing some later generation tools, and
maybe someone knows if that's a good thing, but I opted for their now maybe someone knows if that's a good thing, but I opted for their now
fairly old HTML Help Workshop, version 4.74. fairly old HTML Help Workshop, version 4.74.
Doxygen nicely arranges the html input, so pretty much all you have to do Doxygen nicely arranges the html input, so pretty much all you have to do
-1
View File
@@ -158,4 +158,3 @@ Q-18: I have downloaded the BACnet stack but can't get Who-Is or EPICS applicati
A-18: Firewalls on modern OS block incoming and outgoing network traffic and require you to 'allow' the port that BACnet/IP uses. To allow the default BACnet/IP UDP port 47808 Linux with UFW: A-18: Firewalls on modern OS block incoming and outgoing network traffic and require you to 'allow' the port that BACnet/IP uses. To allow the default BACnet/IP UDP port 47808 Linux with UFW:
$ sudo ufw allow 47808/udp $ sudo ufw allow 47808/udp

Some files were not shown because too many files have changed in this diff Show More