9662a76ebd
* ci: Fix compile warning as errors was not correct
We want to enable warning as errors both Windows and Linux. This is
easiest to do with cmake option as -Werror does not work with MSVC. Also
it is self explaining what it does so no comment needed.
* dlmstp_linux: Fix -Wdeclaration-after-statement compiler warnings
Make dlmstp_linux C89/C90 combatible
```
/bacnet-stack/ports/linux/dlmstp_linux.c: In function ‘Timer_Silence’:
/bacnet-stack/ports/linux/dlmstp_linux.c:56:5: warning:
ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
56 | int32_t res;
| ^~~~~~~
/bacnet-stack/ports/linux/dlmstp_linux.c: In function ‘dlmstp_init’:
/bacnet-stack/ports/linux/dlmstp_linux.c:795:5: warning:
ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
795 | struct termios newtio;
| ^~~~~~
```
* Fix warnings produces by MSVC
Now that we have enabled /Wall for MSVC we get some warnings with it
which can be easily fixed.
We get following warnings:
```
src\bacnet\bacstr.c(223,39): warning C4127: conditional expression is constant
apps\router-mstp\main.c(1123,1): warning C4702: unreachable code
apps\epics\main.c(885,53): warning C4459: declaration of 'myState' hides global declaration
```
* cmake: Use /Wall with MSVC
Make MSVC to build cleanly with Wall. This might matter for some Windows
developers. And you never know if MSVC will find more bugs.
* cmake: Improve router build
Router build gives some warnings as it is not C90 compatible. It is ok
that example is not following C90 rules. Also it is annoing to new user
to build this cmake as first error usually is that libconfig is not
found. Let's just give warning about this so first build will usually go
smoother.
---------
Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
BACnet Simple Router Demo ========================= The Simple Router demo connects one BACnet/IP and one BACnet MS/TP network. The router demo also includes a BBMD so that Foreign Device Registration can be used to tunnel local command line demos to BACnet/IP and BACnet MS/TP networks. Configuration ============= It uses environment variables to configure the MS/TP COM port and BACnet/IP address on Windows: set BACNET_IFACE=192.168.0.1 set BACNET_MSTP_IFACE=COM1 set BACNET_MSTP_BAUD=38400 set BACNET_MSTP_MAC=99 It uses environment variables to configure the MS/TP COM port and BACnet/IP address on Linux: export BACNET_IFACE=eth0 export BACNET_MSTP_IFACE=/dev/ttyUSB0 export BACNET_MSTP_BAUD=38400 export BACNET_MSTP_MAC=99 Also uses these configurations, but defaults to these values if not set: set BACNET_MAX_INFO_FRAMES=128 set BACNET_MAX_MASTER=127 set BACNET_IP_PORT=47808 set BACNET_IP_NET=1 set BACNET_MSTP_NET=2 Note: NET number must be unique and 1..65534 (never 0 or 65535) Example Usage ============= Build the demo applications for BACnet/IP: $ make Build the simple router demo: $ make router-mstp Configure the router demo: $ ./bin/router-mstp.sh enp0s3 /dev/ttyUSB0 Run the router demo: $ ./bin/router-mstp In another terminal, configure client apps for Foreign Device Registration: $ ./bin/bvlc.sh 192.168.0.1 $ ./bin/bacwi -1 $ ./bin/bacepics 123