Issue 2 move folders and use deep path include file names to prevent collisions (#4)

* moving folders and files and adjust server demo build

* Fix Makefile for apps/server on Linux

* fix unit test source file folders

* fix datetime convert UTC functions. Add Code::Blocks project for datetime testing

* added some ignore extensions

* disable parallel make option

* fix build for abort, dcc, and epics apps

* fix build for dcc, epics, error, and getevent apps.

* Fixed building of all apps

* fix the ipv4 to ipv6 router app build

* Change indent style from Google to Webkit

* make pretty to re-format style

* removed common Makefile since we already had one and two was too many

* remove scripts from root folder that are no longer maintained or used

* remove mercurial EOL and ignore files for git repo

* remove .vscodeconfig files from repo

* tweak clang-format style

* clang-format src and apps with tweaked style

* added clang-tidy to fix readability if braces in src

* result of make tidy for src and apps

* fix clang-tidy mangling

* Added code::blocks project for BACnet server simulation

* added code::blocks linux project for WhoIs app

* update text files for EOL

* fix EOL in some files

* fixed make win32 apps for older gcc

* Removed Borland C++ Makefile in apps. Unable to maintain support for Borland C++ compiler.

* created codeblocks project for apps/epics for Windows

* fixing ports/xplained to work with new data structure.

* fix ports/xplained example for Atmel Studio compile

* fix ports/stm32f10x example for gcc Makefile compile

* fix ports/stm32f10x example for IAR EWARM compile

* fix ports/xplained timer callback

* fix ports/bdk_atxx_mspt build with subdirs

* fix ports/bdk_atxx_mspt build with subdirs

* updated git ignore for IAR build artifacts

* updated gitignore for non-tracked files and folders

* fixed bdk-atxx4-mstp port for Rowley Crossworks project file

* fixed bdk-atxx4-mstp port for GCC AVR Makefile

* fixed atmega168 port for IAR AVR and GCC AVR Makefile

* fixed at91sam7s port for IAR ARM and GCC ARM Makefile

* removed unmaintainable DOS, RTOS32, and atmega8 ports.  Updated rx62n (untested).

* changed arm7 to uip port
This commit is contained in:
Steve Karg
2019-12-13 15:19:10 -06:00
committed by GitHub
parent 8a38dbe2cf
commit d50c190957
912 changed files with 36206 additions and 52502 deletions
+50
View File
@@ -0,0 +1,50 @@
#Makefile to build BACnet Application for the Linux Port
TARGET = bacepics
BACNET_OBJECT_DIR = $(BACNET_SRC_DIR)/bacnet/basic/object
SRC = main.c \
$(BACNET_OBJECT_DIR)/client/device-client.c \
$(BACNET_OBJECT_DIR)/netport.c
BACNET_BASIC_SRC += \
$(BACNET_SRC_DIR)/bacnet/basic/service/h_apdu.c \
$(BACNET_SRC_DIR)/bacnet/basic/service/h_iam.c \
$(BACNET_SRC_DIR)/bacnet/basic/service/h_noserv.c \
$(BACNET_SRC_DIR)/bacnet/basic/service/h_rp.c \
$(BACNET_SRC_DIR)/bacnet/basic/service/h_rp_a.c \
$(BACNET_SRC_DIR)/bacnet/basic/service/h_rpm_a.c \
$(BACNET_SRC_DIR)/bacnet/basic/service/h_whois.c \
$(BACNET_SRC_DIR)/bacnet/basic/service/s_iam.c \
$(BACNET_SRC_DIR)/bacnet/basic/service/s_rp.c \
$(BACNET_SRC_DIR)/bacnet/basic/service/s_rpm.c \
$(BACNET_SRC_DIR)/bacnet/basic/service/s_whois.c
# TARGET_EXT is defined in apps/Makefile as .exe or nothing
TARGET_BIN = ${TARGET}$(TARGET_EXT)
SRCS = $(SRC) $(BACNET_SRC) $(BACNET_BASIC_SRC) $(BACNET_PORT_SRC)
OBJS += ${SRCS:.c=.o}
.PHONY: all
all: Makefile ${TARGET_BIN}
${TARGET_BIN}: ${OBJS}
${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@
size $@
cp $@ ../../bin
.c.o:
${CC} -c ${CFLAGS} $*.c -o $@
.PHONY: depend
depend:
rm -f .depend
${CC} -MM ${CFLAGS} *.c >> .depend
.PHONY: clean
clean:
rm -f core ${TARGET_BIN} ${OBJS} $(TARGET).map
.PHONY: include
include: .depend
+305
View File
@@ -0,0 +1,305 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="BACnet EPICS Demo" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/bacepics" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/bacepics" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wmissing-declarations" />
<Add option="-Wall" />
<Add option="-m32" />
<Add option="-ffunction-sections" />
<Add option="-fdata-sections" />
<Add option="-DBACDL_BIP" />
<Add option="-DPRINT_ENABLED=1" />
<Add option="-DBACAPP_ALL" />
<Add option="-DBACFILE" />
<Add option="-DBACNET_TIME_MASTER" />
<Add option="-DBACNET_PROPERTY_LISTS=1" />
<Add option="-DBACNET_PROTOCOL_REVISION=17" />
<Add option="-D_NO_OLDNAMES" />
<Add directory="." />
<Add directory="../../ports/win32" />
<Add directory="../../src" />
</Compiler>
<Linker>
<Add option="-static" />
<Add option="-m32" />
<Add option="-Wl,--gc-sections" />
<Add library="ws2_32" />
<Add library="iphlpapi" />
<Add library="gcc" />
<Add library="m" />
<Add library="winmm" />
</Linker>
<Unit filename="../../ports/win32/bip-init.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../ports/win32/datetime-init.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../ports/win32/mstimer-init.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/abort.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/access_rule.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/alarm_ack.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/arf.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/assigned_access_rights.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/authentication_factor.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/authentication_factor_format.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/awf.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/bacaddr.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/bacapp.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/bacdcode.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/bacdevobjpropref.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/bacerror.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/bacint.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/bacprop.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/bacpropstates.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/bacreal.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/bacstr.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/bactext.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/bactimevalue.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/binding/address.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/npdu/h_npdu.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/object/client/device-client.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/object/netport.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/service/h_apdu.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/service/h_iam.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/service/h_noserv.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/service/h_rp.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/service/h_rp_a.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/service/h_rpm_a.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/service/h_whois.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/service/s_iam.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/service/s_rp.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/service/s_rpm.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/service/s_whois.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/sys/bigend.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/sys/debug.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/sys/fifo.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/sys/filename.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/sys/key.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/sys/keylist.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/sys/mstimer.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/sys/ringbuf.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/sys/sbuf.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/basic/tsm/tsm.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/cov.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/credential_authentication_factor.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/datalink/bip.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/datalink/bvlc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/datalink/dlenv.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/datetime.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/dcc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/event.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/get_alarm_sum.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/getevent.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/iam.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/ihave.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/indtext.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/lighting.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/lso.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/memcopy.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/npdu.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/property.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/proplist.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/ptransfer.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/rd.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/readrange.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/reject.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/rp.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/rpm.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/timestamp.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/timesync.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/whohas.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/whois.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/wp.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../src/bacnet/wpm.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="main.c">
<Option compilerVar="CC" />
</Unit>
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
+104
View File
@@ -0,0 +1,104 @@
/**************************************************************************
*
* Copyright (C) 2006 Steve Karg <skarg@users.sourceforge.net>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*********************************************************************/
#ifndef BACEPICS_H_
#define BACEPICS_H_
/** @file epics/bacepics.h Header for tool to generate EPICS-usable output. */
/** @defgroup BACEPICS Tool to generate EPICS-usable output.
* @ingroup Demos
* This tool will generate a list of Objects and their properties for use in
* an EPICS file.
* You will still need to provide the front part of the EPICS (see file
* demo/server/epics_vts3.tpi) which cannot be easily determined by observation,
* but this tool communicates with the test device and does the grunt work of
* creating the list of Objects and the supported properties for
* each of those Objects.
*
* Usage:
* bacepics [-v] [-p sport] [-t target_mac] device-instance
* -v: show values instead of '?'
* -p: Use sport for "my" port, instead of 0xBAC0 (BACnet/IP only)
* Allows you to communicate with a localhost target.
* -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)
*
* Examples:
* ./bacepics -v 1234
* where the device instance to be addressed is 1234
* and the optional -v prints values out rather than the '?' that
* the EPICS format for VTS3 wants.
* ./bacepics -p 0xBAC1 -t "7F:0:0:1:BA:C0" 4194303
* communicates with the BACnet device on localhost (127.0.0.1), using
* port 47809 as "my" source port so it doesn't conflict with
* the device's port 47808.
*
*
* The tool follows an optimal approach which will use efficient communication
* means if available or else fall back to simple-minded methods.
* Starting with the Device Object, the tool will
* - Try to fetch ALL the Properties with RPM
* - If RPM is not supported, will use coded properties in demo/object folder
* - If response is too big to fit (without segmentation), then will fetch
* ALL again with array index of 0, which should result mostly in errors
* but will provide the list of supported properties.
* - 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
* fetch the coded Required and Optional properties from the demo/object
* folder for this object type, and use this to build the list of
* properties to be accessed.
* - If the Fetch All succeeded, print the values for each property
* - Otherwise, for each property in the list for this object,
* - Request the single property value with ReadProperty (RP)
* - From the response, print the property's value
* 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
* repeat the above process to get and print out their property values.
*/
/** The allowed States of the bacepics State Machine.
* Important to distinguish the request from the response phases as well
* as which approach will get all the properties for us.
* @ingroup BACEPICS
*/
typedef enum {
/** Initial state to establish a binding with the target device. */
INITIAL_BINDING,
/** Get selected device information and put out the heading information. */
GET_HEADING_INFO, GET_HEADING_RESPONSE, PRINT_HEADING,
/** Getting ALL properties and values at once with RPM. */
GET_ALL_REQUEST, GET_ALL_RESPONSE,
/** Getting ALL properties with array index = 0, just to get the list. */
GET_LIST_OF_ALL_REQUEST, GET_LIST_OF_ALL_RESPONSE,
/** Processing the properties individually with ReadProperty. */
GET_PROPERTY_REQUEST, GET_PROPERTY_RESPONSE,
/** Done with this Object; move onto the next. */
NEXT_OBJECT
} EPICS_STATES;
#endif /* BACEPICS_H_ */
+1836
View File
File diff suppressed because it is too large Load Diff