Giter Club home page Giter Club logo

bacnet-stack / bacnet-stack Goto Github PK

View Code? Open in Web Editor NEW
346.0 38.0 173.0 31.28 MB

BACnet Protocol Stack library provides a BACnet application layer, network layer and media access (MAC) layer communications services.

Home Page: http://bacnet.sourceforge.net/

GDB 0.01% Makefile 1.84% Shell 0.15% Batchfile 0.02% C 90.56% C++ 0.85% HTML 0.92% Assembly 3.22% Lua 0.07% Perl 0.16% CMake 2.19% Dockerfile 0.01%
bacnet bacnet-ip bacnet-library bacnet-client bacnet-server c ip ipv4 ipv6 embedded linux windows command-line command-line-tool command-line-tools mstp iot

bacnet-stack's Introduction

BACnet Stack

BACnet open source protocol stack C library for embedded systems, Linux, MacOS, BSD, and Windows http://bacnet.sourceforge.net/

Welcome to the wonderful world of BACnet and true device interoperability!

Continuous Integration

This library uses automated continuous integration services to assist in automated compilation, validation, linting, security scanning, and unit testing to produce robust C code and BACnet functionality.

Actions Status GitHub Workflow: CMake build of library and demo apps on Ubuntu, Windows and MacOS

Actions Status GitHub Workflow: Ubuntu Makefile GCC build of library, BACnet/IP demo apps with and without BBMD, BACnet/IPv6, BACnet Ethernet, and BACnet MSTP demo apps, gateway, router, router-ipv6, router-mstp, ARM ports (STM, Atmel), AVR ports, and BACnet/IP demo apps compiled with MinGW32.

Actions Status GitHub Workflow: scan-build (LLVM Clang Tools), cppcheck, codespell, unit tests and code coverage.

Actions Status GitHub Workflow CodeQL Analysis

About this Project

This BACnet library provides a BACnet application layer, network layer and media access (MAC) layer communications services for an embedded system.

BACnet - A Data Communication Protocol for Building Automation and Control Networks - see bacnet.org. BACnet is a standard data communication protocol for Building Automation and Control Networks. BACnet is an open protocol, which means anyone can contribute to the standard, and anyone may use it. The only caveat is that the BACnet standard document itself is copyrighted by ASHRAE, and they sell the document to help defray costs of developing and maintaining the standard (just like IEEE or ANSI or ISO).

For software developers, the BACnet protocol is a standard way to send and receive messages containing data that are understood by other BACnet compliant devices. The BACnet standard defines a standard way to communicate 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 standard way to communicate using UDP, IP, HTTP (Web Services), and Websockets.

This BACnet protocol stack implementation is specifically designed for the 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, 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 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:

"As a special exception, if other files instantiate templates or use macros or inline functions from this file, or you compile this file and link it with other works to produce a work based on this file, this file does not by itself cause the resulting work to be covered by the GNU General Public License. However the source code for this file must still be made available in accordance with section (3) of the GNU General Public License."

The code is written in C for portability, and includes unit tests (PC based unit tests). Since the code is designed to be portable, it compiles with GCC as well as other compilers, such as Clang or IAR.

The BACnet protocol is an ASHRAE/ANSI/ISO standard, so this library adheres to that standard. BACnet has no royalties or licensing restrictions, and registration for a BACnet vendor ID is free.

What the code does

For an overview of this library architecture and how to use it, see 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 project root directory "make test". The unit tests can also be run using individual make invocations. The unit tests run a PC and continue to do so with every commit within the Continuous Integration environment.

The BACnet stack was functionally tested using a variety of tools as well as various controllers and workstations. It has been included in many products that successfully completed BTL testing.

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 layer for communication by default, but could be compiled to use BACnet IPv6, Ethernet, ARCNET, or MS/TP.

Linux/Unix/Cygwin

$ make clean all

Windows MinGW Bash

$ make win32

Windows Command Line

c:\> build.bat

The BACnet stack can be compiled by a variety of compilers. The most common free compiler is GCC (or MinGW under Windows). The makefiles use GCC by default.

The library is also instrumented to use CMake which can generate a project or Makefiles for a variety of IDE or compiler. For example, to generate a Code::Blocks project:

$ mkdir build
$ cd build/
$ cmake .. -G"CodeBlocks - Unix Makefiles"

c:\> mkdir build
c:\> cd build/
c:\> cmake .. -G"CodeBlocks - MinGW Makefiles"

The unit tests also use CMake and may be run with the command sequence:

$ make test

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 uses LCOV. The HTML results of the unit testing coverage are available starting in the test/build/lcoverage/index.html file.

The demo applications are all client applications that provide one main BACnet service, except the one server application and one gateway application, a couple router applications, and a couple of MS/TP specific applications. Each application will accept command line parameters, and prints the output to stdout or stderr. The client applications are command line based and can be used in scripts or for troubleshooting.
The demo applications make use of environment variables to 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, 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 there are project files for IAR Embedded Workbench and Rowley Crossworks for ARM.

Project Documentation

The project documentation is in the doc/ directory. Similar documents are on the project website at http://bacnet.sourceforge.net/.

Project Mailing List and Help

If you want to contribute to this project and have some C coding skills, join us via https://github.com/bacnet-stack/bacnet-stack/ or via https://sourceforge.net/p/bacnet/src/ and create a fork or branch, and eventually a pull request to have your code considered for inclusion.

If you find a bug in this project, please tell us about it at https://sourceforge.net/p/bacnet/bugs/ or https://github.com/bacnet-stack/bacnet-stack/issues

If you have a support request, you can post it at https://sourceforge.net/p/bacnet/support-requests/

If you have a feature request, you can post it at https://sourceforge.net/p/bacnet/feature-requests/

If you have a problem getting this library to work for your device, or have a BACnet question, join the developers mailing list at: http://lists.sourceforge.net/mailman/listinfo/bacnet-developers or post the question to the Open Discussion, Developers, or Help forums at https://sourceforge.net/p/bacnet/discussion/

I hope that you get your BACnet Device working!

Steve Karg, Birmingham, Alabama USA [email protected]

ASHRAE® and BACnet® are registered trademarks of the American Society of Heating, Refrigerating and Air-Conditioning Engineers, Inc. 180 Technology Parkway NW, Peachtree Corners, Georgia 30092 US.

bacnet-stack's People

Contributors

alexanderwells-diamond avatar anthony-crystalpeak avatar antocout avatar bacneted avatar bakmaria avatar dependabot[bot] avatar docsepp avatar gducerf avatar geertl avatar gocarlos avatar gregshue avatar jci-zimm avatar laumann avatar machinegon avatar metelik avatar mfrancis95 avatar michail-antropov avatar mightypork avatar nickschaf-jci avatar pabigot avatar radolin avatar ralight avatar rcb-tcs avatar skarg avatar spaceim avatar stargieg avatar stevedh avatar thorrockstar avatar txinto avatar yegorich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bacnet-stack's Issues

do new release to github

some build systems normally take tags and not commits e.g. yocto build system, conan package manager

It would be great if we could make a e.g. patch release as now we have cmake support and can use this to be cross platform.

Add SPDX license short-form identifier to source file headers

Software Package Data Exchange® (SPDX®) is an open standard for communicating software bill of material information (including components, licenses, copyrights, and security references).

Use SPDX short-form identifiers to communicate FOSS license information
in a simple, efficient, portable and machine-readable manner

The core source files are licensed:
/* SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0 */

Most basic (demo) files are licensed as MIT:
/* SPDX-License-Identifier: MIT */

Move folders and use deep path include file names to prevent collisions

Compiling and linking the BACnet Stack library with other libraries
has been a challenge to me and others over the years due to header
name collisions, function naming collisions, file name collisions, and
argument name collisions. I have some ideas about fixing those, but it
will require some movement in the folder structure, file name changes,
and some include file name changes. I've become a big fan of the
Linnaeus naming convention, and have been working with other libraries
(Contiki, cryptoauthlib, mbedtls) that do a good job of handling file
and folder naming to avoid collisions (mostly!).

References:
namingconventions.htm
contiki-ng
cryptoauthlib
mbedtls

Stm32 port: pin remapping

the two default I/O in the stm32 example dont appear to change actual physical pins when requested to set or clear its values. Which physical IOs are mapped to the ones recognized by the software? And how could one change those?

Python wrapper for BACnet/MSTP

Hi ! I'm wondering if I could have some help from you to build a C Extension from the stack to allow Python to use MSTP.

Speed and timers being at the core of MSTP, it's very hard (let say it won't be possible) to have MSTP working in pure Python... but it would be possible as a C extension.

My C knowledge is -2 on a scale of 0 to 10... but I could help with the Python part.

[ref] https://docs.python.org/3/extending/building.html

That would be a super nice add-on to our projects.

https://github.com/ChristianTremblay/BAC0
https://github.com/JoelBender/bacpypes

Thanks !

APDU Timeout! and TSM Timeout!

Hello,

I've built the latest source from github on Ubuntu 16.04 and trying to connect to Legrand RCU (Bacnet enabled Room Control Unit).

Ethernet: eth0 - 192.168.0.222 by DHCP.

root@Milan-One:/var/www/Milan/bacnet-stack-master/bin# ./bacwi -1
;Device MAC (hex) SNET SADR (hex) APDU
;-------- -------------------- ----- -------------------- ----
7141 C0:A8:00:DE:BA:C0 0 00 1000
;
; Total Devices: 1

  1. APDU Timotout Error
    root@Milan-One:/var/www/Milan/bacnet-stack-master/bin# cd bacnet-stack-master/bin/./bacepics -v 7141
    -bash: cd: bacnet-stack-master/bin/./bacepics: No such file or directory
    root@Milan-One:/var/www/Milan/bacnet-stack-master/bin# ./bacepics -v 7141
    Error: APDU Timeout! (10s)
    }
    End of BACnet Protocol Implementation Conformance Statement

  2. TSM Timotout Error:
    root@Milan-One:/var/www/Milan/bacnet-stack-master/bin# ./bacwp 7141 1 0 85 16 -1 0 0
    Error: TSM Timeout!
    root@Milan-One:/var/www/Milan/bacnet-stack-master/bin# ./bacrp 7141 1 1 87
    Error: TSM Timeout!

What should I do to get the communication working? My understanding is that this should work out of box, if compile was successful.

Thanks

AI object value range

regarding ai object, is there a default range stated by the bacnet specification? like 0-100? or can it be just any float number? Im having an issue porting ai.c to the stm32 port, in which the max value being read by the ADC(around 4095 for the 12-bit ADC), is being read by the bacnet client as 5.7, and around half that(around 1.66V at the ADC input) is being read as 2.9~. Why is 4095~ integer being interpreted as 5.7? I know it's probably a type casting issue, but I can't figure it out. if there's an easy fix I'm not seeing, please help.

Arduino_uno port

Dear Steve;

I still have troubles compiling Arduino_uno port. Did you know who was the developer of that part of the stack?

Regards

Adriano

Changing Project Name Causes Issues

Hello, I am looking to change the Cmakelists file slightly so it can build two separate shared libraries of the stack, one for IP and the other for MSTP. It would look something like this:

if(BACDL_BIP)
project(bacnet-ip VERSION 1.0.0 LANGUAGES C)
elseif(BACDL_MSTP)
project(bacnet-mstp VERSION 1.0.0 LANGUAGES C)
endif()

However, before even adding that, if I try change the existing project from:

project(bacnet-stack VERSION 1.0.0 LANGUAGES C)

to something slightly different:

project(bacnet-stack1 VERSION 1.0.0 LANGUAGES C)

When set to "bacnet-stack", the library produced works and is usable in my project. If set to "bacnet-stack1" though, the library is over 100 KB smaller and seems to be missing a lot of symbols and cannot be used with my project.

I am just wondering do you know if there is a way to get around this so the resultant stack library produced can be named something other than libbacnet-stack.so

execute tests with github ci

currently we are only building for the three major OSs, linux, mac, win32.

there are no tests beiing executed.
If tests were executed with CI, we could also get test coverage reports etc.

win32 port: undefined reference to mstimer_now'

root@debian:/home/kmd/bacnet-stack# make  BACNET_PORT=win32  router-mstp
make -s -C apps router-mstp
/usr/bin/i686-w64-mingw32-ld: /home/kmd/bacnet-stack/src/bacnet/basic/sys/mstimer.o:mstimer.c:(.text$mstimer_set+0xf): undefined reference to `mstimer_now'
/usr/bin/i686-w64-mingw32-ld: /home/kmd/bacnet-stack/src/bacnet/basic/sys/mstimer.o:mstimer.c:(.text$mstimer_elapsed+0x7): undefined reference to `mstimer_now'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:63: router-mstp.exe] Error 1
make[1]: *** [Makefile:287: router-mstp] Error 2
make: *** [Makefile:110: router-mstp] Error 2




Cant build on FreeBSD 11

Is anyone trying even to run and build BACNET stack on FreeBSD 11/12 ? Under FreeBSD 11 64bit I cannot go far:

krmx@fbsd11:~/bacnet-stack-bacnet-stack-1.0.0 % gmake BACNET_PORT=bsd all
gmake -s -C apps all
/usr/home/krmx/bacnet-stack-bacnet-stack-1.0.0/ports/bsd/bip-init.c:435:16: warning: variable 'addr_ptr' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    } else if (sockaddr_ptr->sa_family == AF_INET6) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/home/krmx/bacnet-stack-bacnet-stack-1.0.0/ports/bsd/bip-init.c:438:12: note: uninitialized use occurs here
    return addr_ptr;
           ^~~~~~~~
/usr/home/krmx/bacnet-stack-bacnet-stack-1.0.0/ports/bsd/bip-init.c:435:12: note: remove the 'if' if its condition is always true
    } else if (sockaddr_ptr->sa_family == AF_INET6) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/home/krmx/bacnet-stack-bacnet-stack-1.0.0/ports/bsd/bip-init.c:432:19: note: initialize the variable 'addr_ptr' to silence this warning
    void *addr_ptr;
                  ^
                   = NULL
/usr/home/krmx/bacnet-stack-bacnet-stack-1.0.0/ports/bsd/bip-init.c:465:24: warning: variable 'rv' is uninitialized when used here [-Wuninitialized]
                return rv;
                       ^~
/usr/home/krmx/bacnet-stack-bacnet-stack-1.0.0/ports/bsd/bip-init.c:451:12: note: initialize the variable 'rv' to silence this warning
    char rv; /* return value */
           ^
            = '\0'
/usr/home/krmx/bacnet-stack-bacnet-stack-1.0.0/ports/bsd/bip-init.c:471:24: warning: variable 'addr_ptr' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
            } else if (strcmp(request, "netmask") == 0) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/home/krmx/bacnet-stack-bacnet-stack-1.0.0/ports/bsd/bip-init.c:474:17: note: uninitialized use occurs here
            if (addr_ptr) {
                ^~~~~~~~
/usr/home/krmx/bacnet-stack-bacnet-stack-1.0.0/ports/bsd/bip-init.c:471:20: note: remove the 'if' if its condition is always true
            } else if (strcmp(request, "netmask") == 0) {
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/home/krmx/bacnet-stack-bacnet-stack-1.0.0/ports/bsd/bip-init.c:463:27: note: initialize the variable 'addr_ptr' to silence this warning
            void *addr_ptr;
                          ^
                           = NULL
/usr/home/krmx/bacnet-stack-bacnet-stack-1.0.0/ports/bsd/bip-init.c:625:9: warning: unused variable 'sock_fd' [-Wunused-variable]
    int sock_fd = 0;
        ^
4 warnings generated.
/usr/home/krmx/bacnet-stack-bacnet-stack-1.0.0/ports/bsd/mstimer-init.c:31:10: fatal error: 'mach/clock.h' file not found
#include <mach/clock.h>
         ^~~~~~~~~~~~~~
1 error generated.
gmake[2]: *** [Makefile:37: /usr/home/krmx/bacnet-stack-bacnet-stack-1.0.0/ports/bsd/mstimer-init.o] Error 1
gmake[1]: *** [Makefile:210: readprop.all] Error 2
gmake: *** [Makefile:34: apps] Error 2

Questions:

  • what is this prefix ? bacnet-stack-bacnet-stack-1.0.0 ? can't you fix the release properly to have bacnet-stack only ?
  • any ideas about FreeBSD 11 compile errors ?

Add cmake support

Cmake is the most used build system which is supported by most ides now (vscode, qtcreator, visual studio, clion, etc)

It is now also natively supported on windows with visual studio (open project and it works)

It would be great therefore to add cmaks support to this project
We could sponsor this feature

@skarg what do you think?

unused var warnings when not PRINT_ENABLED

While compiling for Zephyr with PRINT_ENABLED false, the following warnings were reported. Each needs the auto variable definition to also be conditionally compiled.

src/bacnet/basic/service/h_ccov.c:71:28: warning: unused variable 'pProperty_value' [-Wunused-variable]
BACNET_PROPERTY_VALUE *pProperty_value = NULL;

src/bacnet/basic/service/h_rpm_a.c:201:10: warning: unused variable 'array_value' [-Wunused-variable]
bool array_value = false;

src/bacnet/basic/service/h_ucov.c:64:28: warning: unused variable 'pProperty_value' [-Wunused-variable]
BACNET_PROPERTY_VALUE *pProperty_value = NULL;

make BACDL_DEFINE=-DBACDL_ALL=1 fail

make BACDL_DEFINE=-DBACDL_ALL=1 fail
make BACDL_ALL=1 fail
make BACDL_DEFINE=-DBACDL_ALL=1 BACDL_ALL=1 fail

So how to make it support all the datalinks?

Crash with Alarms in Inneasoft BACnet Explorer

Inneasoft BACnet Explorer sends only 4 Bytes for getAlarmSummary: ADPU 02 75 2b 03
That leads to a crash because service_choice is NULL.

Fix: Replace line 334 in h_apdu.c if (apdu_len >= (len+2))
with

	if (apdu_len == (len + 1)) {
		*service_choice = apdu[len++];		// no request data as seen with Inneasoft BACnet Explorer
		*service_request = NULL;
		*service_request_len = 0;
	} else if (apdu_len >= (len+2)) {

Building shared bacnet-stack libraries using cmake fails + openssl

Hello,

While helping to package this project at conan-io/conan-center-index#909, I noticed some problems with bacnet-stack.

  • When building shared libraries using cmake, the build fails.
    I think this is because the linux build has not all files included.
  • Also, some files use OpenSSL, but the cmake script does not look for it.
    It requires a find_package(OpenSSL) somewhere + use of the variables/targets.
  • macos fails to build

Fixing these issues should also fix some potential problems with the static build.

travis output
https://travis-ci.com/madebr/bacnet-stack/jobs/288603211
changes to .travis.yml:
madebr@4204122

Higher Level Abstraction

Hello, are there any plans for higher levels of abstraction for your stack? Something like a communication object for client/server use with methods for reading/writing data or subscripe covs. Its really hard to start working with your stack. All demos work fine but there is no starting point for using the stack in own applications.

Error Build ESP32

I get an error when I build a project ..\ports\esp32.
I have followed the readme.txt but failed
libraries/bacnet/bacnet/datalink/bip.h:26:21: fatal error: bacport.h: No such file or directory
Can Team help me?

APDU Timeout!

Hello,

I've built the latest source from github on Fedora 31 and trying to connect to Siemens PXC100E.D (configured and running).

Ethernet: enp6s0 - 10.180.220.8 by DHCP
Controller: 10.180.220.6 static, BDT/FDT enabled
Firewall: off

[zoltan@fedora bin]$ env BACNET_IFACE=enp6s0 ./bacwi -1
Device MAC (hex) SNET SADR (hex) APDU


4194303 0A:B4:DC:02:BA:C0 0 00 1476
2124801 0A:B4:DC:06:BA:C0 0 00 1476

Total Devices: 2

[zoltan@fedora bin]$ env BACNET_IFACE=enp6s0 ./bacepics -v 2124801
Error: APDU Timeout! (10s)
}
End of BACnet Protocol Implementation Conformance Statement

[zoltan@fedora bin]$ env BACNET_IFACE=enp6s0 ./bacepics -v 4194303
Error: Unable to bind to 4194303 after waiting 10 seconds.
Error: APDU Timeout! (11s)

[zoltan@fedora bin]$ env BACNET_IFACE=enp6s0 ./bacepics -t 0A:B4:DC:06:BA:C0 -v 2124801
Error: APDU Timeout! (10s)
}
End of BACnet Protocol Implementation Conformance Statement

[zoltan@fedora bin]$ env BACNET_IFACE=enp6s0 ./bacepics -t 0A:B4:DC:02:BA:C0 -v 4194303
Error: APDU Timeout! (10s)
}
End of BACnet Protocol Implementation Conformance Statement

What should I do to get the communication working? My understanding is that this should work out of box, if compile was successful.
I have no clue what is the 4194303 device, only one Bacnet device is on the network.

Thanks

Manually setting the RTS pin for RS-485

First of all, thank you for this library, great work :)
I'm trying to to communicate with a BMT-DO4. This is working fine when using an USB RS-485 dongle. But as soon as I try to use the native RS-485 port instead of the USB dongle, the communication fails (sending a bind request, but can never bind until it timeouts).
My understanding is that I would need to manually set the RTS pin high and low depending on when I'm transmitting or receiving a frame.
Where would be the best place to add such a change? As far as I know/understand, libmodbus did something similar as it can be seen here:
https://github.com/stephane/libmodbus/blob/master/src/modbus-rtu.c

Zephyr module cleanup (west 0.8.0a1)

west 0.8.0a1 supports specifying manifest files elsewhere in the tree. This introduces the config setting 'manifest.file config' and clarifies the meaning of the config 'manifest.path'. This requires updating how this repository uses manifest files.

To Do:

  • Remove the top level west.yml
  • Add self to the zephyr/modules/** manifest files
    ? Clean out ZEPHYR_EXTRA_MODULES if no longer needed.

CMakeLists MS/TP issue

Wondering if the CMakeLists.txt should be changed like so:

    ...
-   $<$<BOOL:${BACDL_MSTP}>:src/bacnet/datalink/mstp.h>
+   $<$<BOOL:${BACDL_MSTP}>:src/bacnet/datalink/mstp.c>
    src/bacnet/datalink/mstpdef.h
    src/bacnet/datalink/mstp.h
    ...

Currently if BACDL_MSTP is defined, the line will be the same as the one two lines down.

If so, I can create a PR.

How to set network number in bacserv

I use Network_Port_Network_Number_Set(1, 49999) to set the network number as 49999 in bacserv sample app,
and then I use YABE to explore my sample bacserv, I can find the network number is 49999 in "OBJECT_NETWORK_PORT:1" of my simulated device.

But when I use "./bacwi --dnet 49999" to request bacnet device with network 49999, I can not find any device, only find device by "./bacwi --dnet 0".

Does any one can help me to know what wrong and guide me to correct it? Thanks a lot.

Zephyr struct sockaddr_in has no explicit padding field

In the Zephyr environment, the struct sockaddr_in definition does not include explicit padding fields. This means the src/BACnet/datalink references to the sin_zero padding field are invalid for that environment, resulting in portability issues.

Can't build /ports/linux/dlmstp_linux.h on Alpine Linux

In file included from /src/ports/linux/rs485.c:73:
/src/ports/linux/dlmstp_linux.h:29:10: fatal error: bits/pthreadtypes.h: No such file or directory
   29 | #include "bits/pthreadtypes.h"
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
cc: error: /src/ports/linux/rs485.o: No such file or directory
size: 'mstpcap': No such file
cp: can't stat 'mstpcap': No such file or directory

I think all that needs to be done is to replace bits/pthreadtypes.h with sys/types.h.

Add app handler in the demo of router?

I'm developing my bacnet program base on the demo of router. The demo currently can only route message from this port to the other.
How can the router handle the App message incoming for itself?

I try to add some app handler, for example, "read property", "I-am", etc., on the demo, but it seems not appropriately to do this because it has to judge which port to request/ack the message and it works not quite well.
can Anybody give me some suggestions?

Large BSS Size

Hi All,
Trying to implement a small server example based on ti-rtos gcc (~256k SRAM), I thought I read somewhere this stack had a very small footprint (on the order of 40k but I can't find where I got this information). So far I have enabled only the "I am" service, "Read Property" Service enabled. I really only need Analog Input objects for my demo, but even without using those i am still 190k over the BSS size in my chip. Is this target just too small to handle this stack?

Best,

Indent and style for source code

Indent and style. It has been harder to find 'indent' on some platforms. I've been using clang-format for a lot of other projects, and it is easier to integrate into the continuous integration tools.
https://clang.llvm.org/docs/ClangFormat.html

Of course, finding a similar indent style to match the existing indent style in the BACnet Stack library using clang-format configurations has been challenging. But, clang-format does a much better job of preventing ugly code. Thus far I use the following - do you have any suggestions?

BasedOnStyle: google
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
BreakBeforeBraces: Linux
IndentWidth: 4
SortIncludes: false

How to add multiple device object in BACnet server demo(using BACnet/IP).

Setup details:
BACnet server application running on Linux system (Ubuntu 18.04).
Yabe(Yet another BACnet explorer) on windows system to get the BACnet the server information.
Bacnet Stack from branch bacnet-stack-1.0

  • To add multiple device object, we have modified Device_Count API so that we can have more than one device object. we can see multiple device objects in Yabe(yet another BACnet explorer) tool, but the fields(instance number, name) are same for all the device objects.

Checked multiple demos but not able to find the one with multiple device object. The gateway demo is adding multiple routing device but the demo is not getting compiled(instruction used: make -s -C apps/gateway). Inside CMakeLists.txt gateway related lines(527 and 528) are commented.

The objective of my project is to have multiple BACnet device object and each device object should have multiple analog/binary input/output objects.

apps/router need bip.o?

admin@ubuntu:~/bacnet-stack/apps$ make router make -s -b -C router make[1]: *** No rule to make target '../../src/bacnet/datalink/bip.o', needed by 'router'. Stop. Makefile:278: recipe for target 'router' failed make: *** [router] Error 2

Bacnet MSTP

Hello, I'm working on io for bacnet.
bacnet ip successfully completed but I do not know about mstp.

1.Do I need to separate devices as master slaves ? And how can I do this.?
2. Can you share with me sample code for mstp ?

Segmentation fault apps/router using Debian 10 & CentOS 8

I am getting "Segmentation fault" errors while running the router app using Debian 10.7 and CentOS 8.3 Linux. Also tested Oracle Linux 8 and Fedora 33, same error. I had success running the router app using Debian 9.13 and CentOS 7.7. See gdb debug below:

(gdb) run -c init.cfg
Starting program: /home/router -c init.cfg
Missing separate debuginfos, use: yum debuginfo-install glibc-2.28-127.el8.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
warning: Loadable section ".note.gnu.property" outside of ELF segments
I am router
opt = c
dev_type = bip
dev_type = mstp
cmd file parse success
[New Thread 0x7ffff7059700 (LWP 4545)]
Interface: ens18
IP Address: 10.42.32.183
IP Broadcast Address: 10.42.32.255
UDP Port: 0xBAC0 [47808]
[New Thread 0x7ffff6858700 (LWP 4546)]
Initializing...
RS485: Initializing /dev/ttyUSB0=success!
[New Thread 0x7ffff6057700 (LWP 4547)]

Thread 1 "router" received signal SIGSEGV, Segmentation fault.
0x00000000004083f4 in create_network_message ()
Missing separate debuginfos, use: yum debuginfo-install libconfig-1.5-9.el8.x86_64
(gdb)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.