adjust root folder

This commit is contained in:
Steve Karg
2019-10-08 23:47:53 -05:00
parent b6fc50ddea
commit a42e8f507c
1258 changed files with 26 additions and 214 deletions
+139
View File
@@ -0,0 +1,139 @@
#
# Simple makefile to build an executable for Win32 console
#
# This makefile assumes Borland bcc32 development environment
# on Windows NT/9x/2000/XP, which includes make, bcc32, and ilink
#
!ifndef BORLAND_DIR
BORLAND_DIR_Not_Defined:
@echo .
@echo You must define environment variable BORLAND_DIR to compile.
!endif
PRODUCT = bacnet
PRODUCT_EXE = $(PRODUCT).exe
# tools
CC = $(BORLAND_DIR)\bin\bcc32
MAKE=$(BORLAND_DIR)\bin\make.exe
#LINK = $(BORLAND_DIR)\bin\tlink32
LINK = $(BORLAND_DIR)\bin\ilink32
BACNET_LIB_DIR = ..\..\lib
BACNET_LIB = $(BACNET_LIB_DIR)\bacnet.lib
# directories
BACNET_PORT = .
BACNET_INCLUDE = ..\..\include
BACNET_OBJECT = ..\..\demo\object
BACNET_HANDLER = ..\..\demo\handler
BACNET_CORE = ..\..\src
INCLUDES = \
-I$(BACNET_INCLUDE) \
-I$(BACNET_OBJECT) \
-I$(BACNET_HANDLER) \
-I$(BACNET_PORT) \
-I$(BORLAND_DIR)\include
#
BACNET_DEFINES = -DPRINT_ENABLED=1
#BACDL_DEFINE=-DBACDL_MSTP=1
BACDL_DEFINE=-DBACDL_BIP=1 -DUSE_INADDR=1
DEFINES = $(BACNET_DEFINES) $(BACDL_DEFINE)
SRCS = main.c
OBJS = $(SRCS:.c=.obj)
#
# Compiler definitions
#
BCC_CFG = bcc32.cfg
#
# Include directories
#
CFLAGS = $(INCLUDES) $(DEFINES)
#
# Libraries
#
C_LIB_DIR = $(BORLAND_DIR)\lib
LIBS = $(BACNET_LIB) \
$(C_LIB_DIR)\IMPORT32.lib \
$(C_LIB_DIR)\CW32MT.lib \
#
# Main target
#
# This should be the first one in the makefile
all : $(BACNET_LIB) $(BCC_CFG) $(OBJS) $(PRODUCT_EXE)
del $(BCC_CFG)
install: $(PRODUCT_EXE)
copy $(PRODUCT_EXE) ..\..\utils\$(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly.
#
# need a temp response file (@&&| ... |) because command line is too long
# $** lists each dependency
# $< target name
# $* target name without extension
$(PRODUCT_EXE) : $(OBJS)
@echo Running Linker for $(PRODUCT_EXE)
$(LINK) -L$(C_LIB_DIR) -L$(BACNET_LIB_DIR) -m -c -s -v @&&|
$(BORLAND_DIR)\lib\c0x32.obj $**
$<
$*.map
$(LIBS)
|
#
# Utilities
clean :
del $(OBJS)
del $(PRODUCT_EXE)
del $(PRODUCT).map
del $(PRODUCT).ilc
del $(PRODUCT).ild
del $(PRODUCT).ilf
del $(PRODUCT).ils
del $(PRODUCT).tds
del $(BCC_CFG)
#
# Generic rules
#
.SUFFIXES: .cpp .c .sbr .obj
#
# cc generic rule
#
.c.obj:
$(CC) +$(BCC_CFG) -o$@ $<
# Compiler configuration file
$(BCC_CFG) :
Copy &&|
$(CFLAGS)
-c
-y #include line numbers in OBJ's
-v #include debug info
-w+ #turn on all warnings
-Od #disable all optimizations
#-a4 #32 bit data alignment
#-M # generate link map
#-ls # linker options
#-WM- #not multithread
-WM #multithread
-w-aus # ignore warning assigned a value that is never used
-w-sig # ignore warning conversion may lose sig digits
| $@
# EOF: makefile
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{9D4C3515-CA91-4C54-93DC-9962A3139A38}</ProjectGuid>
<RootNamespace>BACnetHandlerLibrary</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\;..\..\..\..\demo\object;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_MBCS;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Lib>
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\;..\..\..\..\demo\object;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_MBCS;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\handler\dlenv.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_arf.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_arf_a.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_awf.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_cov.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_dcc.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_iam.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_ihave.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_lso.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_npdu.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_rd.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_rp.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_rpm.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_rpm_a.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_rp_a.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_rr.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_ts.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_ucov.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_upt.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_whohas.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_whois.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_wp.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_wpm.c" />
<ClCompile Include="..\..\..\..\demo\handler\noserv.c" />
<ClCompile Include="..\..\..\..\demo\handler\objects.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_arfs.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_awfs.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_cov.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_dcc.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_iam.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_ihave.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_rd.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_router.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_rp.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_rpm.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_ts.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_uevent.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_whohas.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_whois.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_wp.c" />
<ClCompile Include="..\..\..\..\demo\handler\txbuf.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\demo\handler\client.h" />
<ClInclude Include="..\..\..\..\demo\handler\dlenv.h" />
<ClInclude Include="..\..\..\..\demo\handler\txbuf.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,149 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\handler\dlenv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\txbuf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_arf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_arf_a.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_awf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_cov.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_dcc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_iam.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_ihave.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_lso.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_npdu.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_rd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_rp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_rp_a.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_rpm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_rpm_a.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_rr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_ts.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_ucov.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_upt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_whohas.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_whois.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_wp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_wpm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\noserv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\objects.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_arfs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_awfs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_cov.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_dcc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_iam.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_ihave.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_rd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_router.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_rp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_rpm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_ts.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_uevent.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_whohas.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_whois.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_wp.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\demo\handler\client.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\handler\txbuf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\handler\dlenv.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
@@ -0,0 +1,218 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="BACnet Object Definitions"
ProjectGUID="{6A8668E1-F08E-496B-B624-D6C05001806D}"
RootNamespace="BACnetObjectDefinitions"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;H:\Program Files\Microsoft SDKs\Windows\v5.0\Include&quot;;..\..;..\..\..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\..\..\demo\object\ai.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\object\ao.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\object\av.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\object\bacfile.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\object\bi.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\object\bo.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\object\bv.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\object\device.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\object\lc.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\object\lo.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\object\lsp.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\object\ms-input.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\object\mso.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\object\trendlog.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{6A8668E1-F08E-496B-B624-D6C05001806D}</ProjectGuid>
<RootNamespace>BACnetObjectDefinitions</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\object\ai.c" />
<ClCompile Include="..\..\..\..\demo\object\ao.c" />
<ClCompile Include="..\..\..\..\demo\object\av.c" />
<ClCompile Include="..\..\..\..\demo\object\bacfile.c" />
<ClCompile Include="..\..\..\..\demo\object\bi.c" />
<ClCompile Include="..\..\..\..\demo\object\bo.c" />
<ClCompile Include="..\..\..\..\demo\object\bv.c" />
<ClCompile Include="..\..\..\..\demo\object\channel.c" />
<ClCompile Include="..\..\..\..\demo\object\command.c" />
<ClCompile Include="..\..\..\..\demo\object\csv.c" />
<ClCompile Include="..\..\..\..\demo\object\device.c" />
<ClCompile Include="..\..\..\..\demo\object\iv.c" />
<ClCompile Include="..\..\..\..\demo\object\lc.c" />
<ClCompile Include="..\..\..\..\demo\object\lo.c" />
<ClCompile Include="..\..\..\..\demo\object\lsp.c" />
<ClCompile Include="..\..\..\..\demo\object\ms-input.c" />
<ClCompile Include="..\..\..\..\demo\object\mso.c" />
<ClCompile Include="..\..\..\..\demo\object\msv.c" />
<ClCompile Include="..\..\..\..\demo\object\osv.c" />
<ClCompile Include="..\..\..\..\demo\object\piv.c" />
<ClCompile Include="..\..\..\..\demo\object\schedule.c" />
<ClCompile Include="..\..\..\..\demo\object\trendlog.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\demo\object\ai.h" />
<ClInclude Include="..\..\..\..\demo\object\ao.h" />
<ClInclude Include="..\..\..\..\demo\object\av.h" />
<ClInclude Include="..\..\..\..\demo\object\bacfile.h" />
<ClInclude Include="..\..\..\..\demo\object\bi.h" />
<ClInclude Include="..\..\..\..\demo\object\bo.h" />
<ClInclude Include="..\..\..\..\demo\object\bv.h" />
<ClInclude Include="..\..\..\..\demo\object\csv.h" />
<ClInclude Include="..\..\..\..\demo\object\device.h" />
<ClInclude Include="..\..\..\..\demo\object\lc.h" />
<ClInclude Include="..\..\..\..\demo\object\lo.h" />
<ClInclude Include="..\..\..\..\demo\object\lsp.h" />
<ClInclude Include="..\..\..\..\demo\object\ms-input.h" />
<ClInclude Include="..\..\..\..\demo\object\mso.h" />
<ClInclude Include="..\..\..\..\demo\object\msv.h" />
<ClInclude Include="..\..\..\..\demo\object\nc.h" />
<ClInclude Include="..\..\..\..\demo\object\trendlog.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\object\ai.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\trendlog.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\ao.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\av.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\bacfile.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\bi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\bo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\bv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\csv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\device.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\lc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\lo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\lsp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\ms-input.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\mso.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\msv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\channel.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\iv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\osv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\piv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\command.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\schedule.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{0fb9e4a6-2022-41c3-8485-25f28414e444}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{ae49cf6c-09f0-4231-a375-627ecc8940a6}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\demo\object\ai.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\ao.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\av.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\bacfile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\bi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\bo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\bv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\csv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\device.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\lc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\lo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\lsp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\ms-input.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\mso.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\msv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\nc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\trendlog.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
@@ -0,0 +1,98 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BACnet Stack Library", "BACnet Stack Library\BACnet Stack Library.vcxproj", "{E9A65567-B028-4278-881D-674604B2E126}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BACnet Object Definitions", "BACnet Object Definitions\BACnet Object Definitions.vcxproj", "{6A8668E1-F08E-496B-B624-D6C05001806D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Server", "Server\Server.vcxproj", "{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}"
ProjectSection(ProjectDependencies) = postProject
{9D4C3515-CA91-4C54-93DC-9962A3139A38} = {9D4C3515-CA91-4C54-93DC-9962A3139A38}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bacwi", "Who-Is\Who-Is.vcxproj", "{A6287B6E-0BCE-43FA-ADFB-9263DB069BA4}"
ProjectSection(ProjectDependencies) = postProject
{9D4C3515-CA91-4C54-93DC-9962A3139A38} = {9D4C3515-CA91-4C54-93DC-9962A3139A38}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bacdcc", "dcc\dcc.vcxproj", "{CC217FCF-AEF6-4859-8452-1E222C393383}"
ProjectSection(ProjectDependencies) = postProject
{E9A65567-B028-4278-881D-674604B2E126} = {E9A65567-B028-4278-881D-674604B2E126}
{6A8668E1-F08E-496B-B624-D6C05001806D} = {6A8668E1-F08E-496B-B624-D6C05001806D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BACnet Handler Library", "BACnet Handler Library\BACnet Handler Library.vcxproj", "{9D4C3515-CA91-4C54-93DC-9962A3139A38}"
ProjectSection(ProjectDependencies) = postProject
{E9A65567-B028-4278-881D-674604B2E126} = {E9A65567-B028-4278-881D-674604B2E126}
{6A8668E1-F08E-496B-B624-D6C05001806D} = {6A8668E1-F08E-496B-B624-D6C05001806D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bacwp", "writeprop\writeprop.vcxproj", "{826EF765-7828-44D3-B8AF-7AEDBAA8E0D2}"
ProjectSection(ProjectDependencies) = postProject
{9D4C3515-CA91-4C54-93DC-9962A3139A38} = {9D4C3515-CA91-4C54-93DC-9962A3139A38}
{E9A65567-B028-4278-881D-674604B2E126} = {E9A65567-B028-4278-881D-674604B2E126}
{6A8668E1-F08E-496B-B624-D6C05001806D} = {6A8668E1-F08E-496B-B624-D6C05001806D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bacwir", "bacwir\bacwir.vcxproj", "{7E30D4FE-B8A7-442D-B6FB-E8DC3129EFEB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bacrp", "bacrp\bacrp.vcxproj", "{2DED9AEF-13AB-408B-B914-F7F30AE15EC0}"
ProjectSection(ProjectDependencies) = postProject
{9D4C3515-CA91-4C54-93DC-9962A3139A38} = {9D4C3515-CA91-4C54-93DC-9962A3139A38}
{E9A65567-B028-4278-881D-674604B2E126} = {E9A65567-B028-4278-881D-674604B2E126}
{6A8668E1-F08E-496B-B624-D6C05001806D} = {6A8668E1-F08E-496B-B624-D6C05001806D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bacepics", "bacepics\bacepics.vcxproj", "{17BEB9AD-5DA8-4B49-9369-B6715831C381}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E9A65567-B028-4278-881D-674604B2E126}.Debug|Win32.ActiveCfg = Debug|Win32
{E9A65567-B028-4278-881D-674604B2E126}.Debug|Win32.Build.0 = Debug|Win32
{E9A65567-B028-4278-881D-674604B2E126}.Release|Win32.ActiveCfg = Release|Win32
{E9A65567-B028-4278-881D-674604B2E126}.Release|Win32.Build.0 = Release|Win32
{6A8668E1-F08E-496B-B624-D6C05001806D}.Debug|Win32.ActiveCfg = Debug|Win32
{6A8668E1-F08E-496B-B624-D6C05001806D}.Debug|Win32.Build.0 = Debug|Win32
{6A8668E1-F08E-496B-B624-D6C05001806D}.Release|Win32.ActiveCfg = Release|Win32
{6A8668E1-F08E-496B-B624-D6C05001806D}.Release|Win32.Build.0 = Release|Win32
{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}.Debug|Win32.ActiveCfg = Debug|Win32
{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}.Debug|Win32.Build.0 = Debug|Win32
{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}.Release|Win32.ActiveCfg = Release|Win32
{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}.Release|Win32.Build.0 = Release|Win32
{A6287B6E-0BCE-43FA-ADFB-9263DB069BA4}.Debug|Win32.ActiveCfg = Debug|Win32
{A6287B6E-0BCE-43FA-ADFB-9263DB069BA4}.Debug|Win32.Build.0 = Debug|Win32
{A6287B6E-0BCE-43FA-ADFB-9263DB069BA4}.Release|Win32.ActiveCfg = Release|Win32
{A6287B6E-0BCE-43FA-ADFB-9263DB069BA4}.Release|Win32.Build.0 = Release|Win32
{CC217FCF-AEF6-4859-8452-1E222C393383}.Debug|Win32.ActiveCfg = Debug|Win32
{CC217FCF-AEF6-4859-8452-1E222C393383}.Debug|Win32.Build.0 = Debug|Win32
{CC217FCF-AEF6-4859-8452-1E222C393383}.Release|Win32.ActiveCfg = Release|Win32
{CC217FCF-AEF6-4859-8452-1E222C393383}.Release|Win32.Build.0 = Release|Win32
{9D4C3515-CA91-4C54-93DC-9962A3139A38}.Debug|Win32.ActiveCfg = Debug|Win32
{9D4C3515-CA91-4C54-93DC-9962A3139A38}.Debug|Win32.Build.0 = Debug|Win32
{9D4C3515-CA91-4C54-93DC-9962A3139A38}.Release|Win32.ActiveCfg = Release|Win32
{9D4C3515-CA91-4C54-93DC-9962A3139A38}.Release|Win32.Build.0 = Release|Win32
{826EF765-7828-44D3-B8AF-7AEDBAA8E0D2}.Debug|Win32.ActiveCfg = Debug|Win32
{826EF765-7828-44D3-B8AF-7AEDBAA8E0D2}.Debug|Win32.Build.0 = Debug|Win32
{826EF765-7828-44D3-B8AF-7AEDBAA8E0D2}.Release|Win32.ActiveCfg = Release|Win32
{826EF765-7828-44D3-B8AF-7AEDBAA8E0D2}.Release|Win32.Build.0 = Release|Win32
{7E30D4FE-B8A7-442D-B6FB-E8DC3129EFEB}.Debug|Win32.ActiveCfg = Debug|Win32
{7E30D4FE-B8A7-442D-B6FB-E8DC3129EFEB}.Debug|Win32.Build.0 = Debug|Win32
{7E30D4FE-B8A7-442D-B6FB-E8DC3129EFEB}.Release|Win32.ActiveCfg = Release|Win32
{7E30D4FE-B8A7-442D-B6FB-E8DC3129EFEB}.Release|Win32.Build.0 = Release|Win32
{2DED9AEF-13AB-408B-B914-F7F30AE15EC0}.Debug|Win32.ActiveCfg = Debug|Win32
{2DED9AEF-13AB-408B-B914-F7F30AE15EC0}.Debug|Win32.Build.0 = Debug|Win32
{2DED9AEF-13AB-408B-B914-F7F30AE15EC0}.Release|Win32.ActiveCfg = Release|Win32
{2DED9AEF-13AB-408B-B914-F7F30AE15EC0}.Release|Win32.Build.0 = Release|Win32
{17BEB9AD-5DA8-4B49-9369-B6715831C381}.Debug|Win32.ActiveCfg = Debug|Win32
{17BEB9AD-5DA8-4B49-9369-B6715831C381}.Debug|Win32.Build.0 = Debug|Win32
{17BEB9AD-5DA8-4B49-9369-B6715831C381}.Release|Win32.ActiveCfg = Release|Win32
{17BEB9AD-5DA8-4B49-9369-B6715831C381}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -0,0 +1,528 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="BACnet Stack Library"
ProjectGUID="{E9A65567-B028-4278-881D-674604B2E126}"
RootNamespace="BACnetStackLibrary"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..;..\..\..\..\include;&quot;H:\Program Files\Microsoft SDKs\Windows\v5.0\Include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="C:\dev\bacnet\ports\win32;C:\dev\bacnet\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="2"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\..\..\src\abort.c"
>
</File>
<File
RelativePath="..\..\..\..\src\address.c"
>
</File>
<File
RelativePath="..\..\..\..\src\apdu.c"
>
</File>
<File
RelativePath="..\..\..\..\src\arf.c"
>
</File>
<File
RelativePath="..\..\..\..\src\awf.c"
>
</File>
<File
RelativePath="..\..\..\..\src\bacaddr.c"
>
</File>
<File
RelativePath="..\..\..\..\src\bacapp.c"
>
</File>
<File
RelativePath="..\..\..\..\src\bacdcode.c"
>
</File>
<File
RelativePath="..\..\..\..\src\bacdevobjpropref.c"
>
</File>
<File
RelativePath="..\..\..\..\src\bacerror.c"
>
</File>
<File
RelativePath="..\..\..\..\src\bacint.c"
>
</File>
<File
RelativePath="..\..\..\..\src\bacprop.c"
>
</File>
<File
RelativePath="..\..\..\..\src\bacpropstates.c"
>
</File>
<File
RelativePath="..\..\..\..\src\bacreal.c"
>
</File>
<File
RelativePath="..\..\..\..\src\bacstr.c"
>
</File>
<File
RelativePath="..\..\..\..\src\bactext.c"
>
</File>
<File
RelativePath="..\..\..\..\src\bigend.c"
>
</File>
<File
RelativePath="..\..\..\..\src\bip.c"
>
</File>
<File
RelativePath="..\..\..\..\src\bvlc.c"
>
</File>
<File
RelativePath="..\..\..\..\src\cov.c"
>
</File>
<File
RelativePath="..\..\..\..\src\crc.c"
>
</File>
<File
RelativePath="..\..\..\..\src\datalink.c"
>
</File>
<File
RelativePath="..\..\..\..\src\datetime.c"
>
</File>
<File
RelativePath="..\..\..\..\src\dcc.c"
>
</File>
<File
RelativePath="..\..\..\..\src\debug.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\dlenv.c"
>
</File>
<File
RelativePath="..\..\..\..\src\event.c"
>
</File>
<File
RelativePath="..\..\..\..\src\fifo.c"
>
</File>
<File
RelativePath="..\..\..\..\src\filename.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_arf.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_arf_a.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_awf.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_cov.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_dcc.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_iam.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_ihave.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_lso.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_npdu.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_rd.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_rp.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_rp_a.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_rpm.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_rpm_a.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_ts.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_ucov.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_whohas.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_whois.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\h_wp.c"
>
</File>
<File
RelativePath="..\..\..\..\src\iam.c"
>
</File>
<File
RelativePath="..\..\..\..\src\ihave.c"
>
</File>
<File
RelativePath="..\..\..\..\src\indtext.c"
>
</File>
<File
RelativePath="..\..\..\..\src\key.c"
>
</File>
<File
RelativePath="..\..\..\..\src\keylist.c"
>
</File>
<File
RelativePath="..\..\..\..\src\lso.c"
>
</File>
<File
RelativePath="..\..\..\..\src\memcopy.c"
>
</File>
<File
RelativePath="..\..\..\..\src\mstp.c"
>
</File>
<File
RelativePath="..\..\..\..\src\mstptext.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\noserv.c"
>
</File>
<File
RelativePath="..\..\..\..\src\npdu.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\objects.c"
>
</File>
<File
RelativePath="..\..\..\..\src\ptransfer.c"
>
</File>
<File
RelativePath="..\..\..\..\src\rd.c"
>
</File>
<File
RelativePath="..\..\..\..\src\reject.c"
>
</File>
<File
RelativePath="..\..\..\..\src\ringbuf.c"
>
</File>
<File
RelativePath="..\..\..\..\src\rp.c"
>
</File>
<File
RelativePath="..\..\..\..\src\rpm.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\s_arfs.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\s_awfs.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\s_cov.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\s_dcc.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\s_iam.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\s_ihave.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\s_rd.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\s_router.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\s_rp.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\s_rpm.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\s_ts.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\s_uevent.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\s_whohas.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\s_whois.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\s_wp.c"
>
</File>
<File
RelativePath="..\..\..\..\src\sbuf.c"
>
</File>
<File
RelativePath="..\..\..\..\src\timestamp.c"
>
</File>
<File
RelativePath="..\..\..\..\src\timesync.c"
>
</File>
<File
RelativePath="..\..\..\..\src\tsm.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\handler\txbuf.c"
>
</File>
<File
RelativePath="..\..\..\..\src\version.c"
>
</File>
<File
RelativePath="..\..\..\..\src\whohas.c"
>
</File>
<File
RelativePath="..\..\..\..\src\whois.c"
>
</File>
<File
RelativePath="..\..\..\..\src\wp.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\..\net.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
@@ -0,0 +1,217 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{E9A65567-B028-4278-881D-674604B2E126}</ProjectGuid>
<RootNamespace>BACnetStackLibrary</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;PRINT_ENABLED=1;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
<AdditionalIncludeDirectories>$(SolutionPath)\..\..\..\..\Demo\Object;$(SolutionPath)\..\..\..\..\Include;$(SolutionPath)\..\..</AdditionalIncludeDirectories>
</ClCompile>
<Lib>
<AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;PRINT_ENABLED=1;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
<PrecompiledHeader>
</PrecompiledHeader>
<AdditionalIncludeDirectories>$(SolutionPath)\..\..\..\..\Include;$(SolutionPath)\..\..\..\..\demo\object;$(SolutionPath)\..\..</AdditionalIncludeDirectories>
</ClCompile>
<Lib>
<AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\src\abort.c" />
<ClCompile Include="..\..\..\..\src\address.c" />
<ClCompile Include="..\..\..\..\src\apdu.c" />
<ClCompile Include="..\..\..\..\src\arf.c" />
<ClCompile Include="..\..\..\..\src\awf.c" />
<ClCompile Include="..\..\..\..\src\bacaddr.c" />
<ClCompile Include="..\..\..\..\src\bacapp.c" />
<ClCompile Include="..\..\..\..\src\bacdcode.c" />
<ClCompile Include="..\..\..\..\src\bacdevobjpropref.c" />
<ClCompile Include="..\..\..\..\src\bacerror.c" />
<ClCompile Include="..\..\..\..\src\bacint.c" />
<ClCompile Include="..\..\..\..\src\bacprop.c" />
<ClCompile Include="..\..\..\..\src\bacpropstates.c" />
<ClCompile Include="..\..\..\..\src\bacreal.c" />
<ClCompile Include="..\..\..\..\src\bacstr.c" />
<ClCompile Include="..\..\..\..\src\bactext.c" />
<ClCompile Include="..\..\..\..\src\bigend.c" />
<ClCompile Include="..\..\..\..\src\bip.c" />
<ClCompile Include="..\..\..\..\src\bvlc.c" />
<ClCompile Include="..\..\..\..\src\cov.c" />
<ClCompile Include="..\..\..\..\src\crc.c" />
<ClCompile Include="..\..\..\..\src\datalink.c" />
<ClCompile Include="..\..\..\..\src\datetime.c" />
<ClCompile Include="..\..\..\..\src\dcc.c" />
<ClCompile Include="..\..\..\..\src\debug.c" />
<ClCompile Include="..\..\..\..\src\event.c" />
<ClCompile Include="..\..\..\..\src\fifo.c" />
<ClCompile Include="..\..\..\..\src\filename.c" />
<ClCompile Include="..\..\..\..\src\iam.c" />
<ClCompile Include="..\..\..\..\src\ihave.c" />
<ClCompile Include="..\..\..\..\src\indtext.c" />
<ClCompile Include="..\..\..\..\src\key.c" />
<ClCompile Include="..\..\..\..\src\keylist.c" />
<ClCompile Include="..\..\..\..\src\lighting.c" />
<ClCompile Include="..\..\..\..\src\lso.c" />
<ClCompile Include="..\..\..\..\src\memcopy.c" />
<ClCompile Include="..\..\..\..\src\mstp.c" />
<ClCompile Include="..\..\..\..\src\mstptext.c" />
<ClCompile Include="..\..\..\..\src\npdu.c" />
<ClCompile Include="..\..\..\..\src\proplist.c" />
<ClCompile Include="..\..\..\..\src\ptransfer.c" />
<ClCompile Include="..\..\..\..\src\rd.c" />
<ClCompile Include="..\..\..\..\src\readrange.c" />
<ClCompile Include="..\..\..\..\src\reject.c" />
<ClCompile Include="..\..\..\..\src\ringbuf.c" />
<ClCompile Include="..\..\..\..\src\rp.c" />
<ClCompile Include="..\..\..\..\src\rpm.c" />
<ClCompile Include="..\..\..\..\src\sbuf.c" />
<ClCompile Include="..\..\..\..\src\timestamp.c" />
<ClCompile Include="..\..\..\..\src\timesync.c" />
<ClCompile Include="..\..\..\..\src\tsm.c" />
<ClCompile Include="..\..\..\..\src\version.c" />
<ClCompile Include="..\..\..\..\src\whohas.c" />
<ClCompile Include="..\..\..\..\src\whois.c" />
<ClCompile Include="..\..\..\..\src\wp.c" />
<ClCompile Include="..\..\..\..\src\wpm.c" />
<ClCompile Include="..\..\bip-init.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\include\abort.h" />
<ClInclude Include="..\..\..\..\include\address.h" />
<ClInclude Include="..\..\..\..\include\alarm_ack.h" />
<ClInclude Include="..\..\..\..\include\apdu.h" />
<ClInclude Include="..\..\..\..\include\arcnet.h" />
<ClInclude Include="..\..\..\..\include\arf.h" />
<ClInclude Include="..\..\..\..\include\awf.h" />
<ClInclude Include="..\..\..\..\include\bacaddr.h" />
<ClInclude Include="..\..\..\..\include\bacapp.h" />
<ClInclude Include="..\..\..\..\include\bacdcode.h" />
<ClInclude Include="..\..\..\..\include\bacdef.h" />
<ClInclude Include="..\..\..\..\include\bacdevobjpropref.h" />
<ClInclude Include="..\..\..\..\include\bacenum.h" />
<ClInclude Include="..\..\..\..\include\bacerror.h" />
<ClInclude Include="..\..\..\..\include\bacint.h" />
<ClInclude Include="..\..\..\..\include\bacnet.h" />
<ClInclude Include="..\..\..\..\include\bacprop.h" />
<ClInclude Include="..\..\..\..\include\bacpropstates.h" />
<ClInclude Include="..\..\..\..\include\bacreal.h" />
<ClInclude Include="..\..\..\..\include\bacstr.h" />
<ClInclude Include="..\..\..\..\include\bactext.h" />
<ClInclude Include="..\..\..\..\include\bigend.h" />
<ClInclude Include="..\..\..\..\include\bip.h" />
<ClInclude Include="..\..\..\..\include\bits.h" />
<ClInclude Include="..\..\..\..\include\bvlc.h" />
<ClInclude Include="..\..\..\..\include\bytes.h" />
<ClInclude Include="..\..\..\..\include\config.h" />
<ClInclude Include="..\..\..\..\include\cov.h" />
<ClInclude Include="..\..\..\..\include\crc.h" />
<ClInclude Include="..\..\..\..\include\datalink.h" />
<ClInclude Include="..\..\..\..\include\datetime.h" />
<ClInclude Include="..\..\..\..\include\dcc.h" />
<ClInclude Include="..\..\..\..\include\debug.h" />
<ClInclude Include="..\..\..\..\include\dlmstp.h" />
<ClInclude Include="..\..\..\..\include\ethernet.h" />
<ClInclude Include="..\..\..\..\include\event.h" />
<ClInclude Include="..\..\..\..\include\fifo.h" />
<ClInclude Include="..\..\..\..\include\filename.h" />
<ClInclude Include="..\..\..\..\include\getevent.h" />
<ClInclude Include="..\..\..\..\include\get_alarm_sum.h" />
<ClInclude Include="..\..\..\..\include\handlers.h" />
<ClInclude Include="..\..\..\..\include\iam.h" />
<ClInclude Include="..\..\..\..\include\ihave.h" />
<ClInclude Include="..\..\..\..\include\indtext.h" />
<ClInclude Include="..\..\..\..\include\key.h" />
<ClInclude Include="..\..\..\..\include\keylist.h" />
<ClInclude Include="..\..\..\..\include\lso.h" />
<ClInclude Include="..\..\..\..\include\memcopy.h" />
<ClInclude Include="..\..\..\..\include\mstp.h" />
<ClInclude Include="..\..\..\..\include\mstpdef.h" />
<ClInclude Include="..\..\..\..\include\mstptext.h" />
<ClInclude Include="..\..\..\..\include\mydata.h" />
<ClInclude Include="..\..\..\..\include\npdu.h" />
<ClInclude Include="..\..\..\..\include\objects.h" />
<ClInclude Include="..\..\..\..\include\proplist.h" />
<ClInclude Include="..\..\..\..\include\ptransfer.h" />
<ClInclude Include="..\..\..\..\include\rd.h" />
<ClInclude Include="..\..\..\..\include\readrange.h" />
<ClInclude Include="..\..\..\..\include\reject.h" />
<ClInclude Include="..\..\..\..\include\ringbuf.h" />
<ClInclude Include="..\..\..\..\include\rp.h" />
<ClInclude Include="..\..\..\..\include\rpm.h" />
<ClInclude Include="..\..\..\..\include\sbuf.h" />
<ClInclude Include="..\..\..\..\include\timestamp.h" />
<ClInclude Include="..\..\..\..\include\timesync.h" />
<ClInclude Include="..\..\..\..\include\tsm.h" />
<ClInclude Include="..\..\..\..\include\version.h" />
<ClInclude Include="..\..\..\..\include\whohas.h" />
<ClInclude Include="..\..\..\..\include\whois.h" />
<ClInclude Include="..\..\..\..\include\wp.h" />
<ClInclude Include="..\..\..\..\include\wpm.h" />
<ClInclude Include="..\..\..\net.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,405 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\..\src\abort.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\wpm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\address.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\apdu.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\arf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\awf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacaddr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacapp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacdcode.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacdevobjpropref.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacerror.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacprop.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacpropstates.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacreal.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacstr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bactext.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bigend.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bip.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bvlc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\cov.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\crc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\datalink.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\datetime.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\dcc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\debug.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\event.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\fifo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\filename.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\iam.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\ihave.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\indtext.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\key.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\keylist.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\lso.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\memcopy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\mstp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\mstptext.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\npdu.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\ptransfer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\rd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\readrange.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\reject.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\ringbuf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\rp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\rpm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\sbuf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\timestamp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\timesync.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\tsm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\version.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\whohas.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\whois.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\wp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\proplist.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\bip-init.c">
<Filter>Source Files\ports</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\lighting.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="Header Files">
<UniqueIdentifier>{d035e6b4-7d12-4cd1-80ec-84a204cca157}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{cf725f1a-11cb-4b24-b6e5-56569b3222c7}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\ports">
<UniqueIdentifier>{13605cea-96c0-47ba-84c4-7afc96b43b5b}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\net.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\abort.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\address.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\alarm_ack.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\apdu.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\arcnet.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\arf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\awf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacaddr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacapp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacdcode.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacdef.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacdevobjpropref.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacenum.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacerror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacint.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacnet.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacprop.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacpropstates.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacreal.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacstr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bactext.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bigend.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bip.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bits.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bvlc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bytes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\cov.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\crc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\datalink.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\datetime.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\dcc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\debug.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\dlmstp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\ethernet.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\event.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\fifo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\filename.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\get_alarm_sum.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\getevent.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\handlers.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\iam.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\ihave.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\indtext.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\key.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\keylist.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\lso.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\memcopy.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\mstp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\mstpdef.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\mstptext.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\mydata.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\npdu.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\objects.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\proplist.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\ptransfer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\rd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\readrange.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\reject.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\ringbuf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\rp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\rpm.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\sbuf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\timestamp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\timesync.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\tsm.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\whohas.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\whois.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\wp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\wpm.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\config.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
@@ -0,0 +1,193 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="Server"
ProjectGUID="{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}"
RootNamespace="Server"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..;..\..\..\..\include;&quot;H:\Program Files\Microsoft SDKs\Windows\v5.0\Include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ws2_32.lib iphlpapi.lib"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\bip-init.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\server\main.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}</ProjectGuid>
<RootNamespace>Server</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\object;..\..\..\..\demo\handler</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\object;..\..\..\..\demo\handler</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\server\main.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BACnet Handler Library\BACnet Handler Library.vcxproj">
<Project>{9d4c3515-ca91-4c54-93dc-9962a3139a38}</Project>
</ProjectReference>
<ProjectReference Include="..\BACnet Object Definitions\BACnet Object Definitions.vcxproj">
<Project>{6a8668e1-f08e-496b-b624-d6c05001806d}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\BACnet Stack Library\BACnet Stack Library.vcxproj">
<Project>{e9a65567-b028-4278-881d-674604b2e126}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,199 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="Who-Is"
ProjectGUID="{A6287B6E-0BCE-43FA-ADFB-9263DB069BA4}"
RootNamespace="WhoIs"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..;..\..\..\..\include;&quot;H:\Program Files\Microsoft SDKs\Windows\v5.0\Include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ws2_32.lib iphlpapi.lib"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\bip-init.c"
>
</File>
<File
RelativePath="..\..\..\..\demo\whois\main.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{A6287B6E-0BCE-43FA-ADFB-9263DB069BA4}</ProjectGuid>
<RootNamespace>WhoIs</RootNamespace>
<Keyword>Win32Proj</Keyword>
<ProjectName>bacwi</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\handler;..\..\..\..\demo\object</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\handler;..\..\..\..\demo\object</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\whois\main.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BACnet Handler Library\BACnet Handler Library.vcxproj">
<Project>{9d4c3515-ca91-4c54-93dc-9962a3139a38}</Project>
</ProjectReference>
<ProjectReference Include="..\BACnet Object Definitions\BACnet Object Definitions.vcxproj">
<Project>{6a8668e1-f08e-496b-b624-d6c05001806d}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\BACnet Stack Library\BACnet Stack Library.vcxproj">
<Project>{e9a65567-b028-4278-881d-674604b2e126}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\epics\main.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\demo\epics\bacepics.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BACnet Handler Library\BACnet Handler Library.vcxproj">
<Project>{9d4c3515-ca91-4c54-93dc-9962a3139a38}</Project>
</ProjectReference>
<ProjectReference Include="..\BACnet Object Definitions\BACnet Object Definitions.vcxproj">
<Project>{6a8668e1-f08e-496b-b624-d6c05001806d}</Project>
</ProjectReference>
<ProjectReference Include="..\BACnet Stack Library\BACnet Stack Library.vcxproj">
<Project>{e9a65567-b028-4278-881d-674604b2e126}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{17BEB9AD-5DA8-4B49-9369-B6715831C381}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>bacepics</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;PRINT_ENABLED=1;BACAPP_ALL;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\handler;..\..\..\..\demo\object</AdditionalIncludeDirectories>
<UndefinePreprocessorDefinitions>
</UndefinePreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;PRINT_ENABLED=1;BACAPP_ALL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\handler;..\..\..\..\demo\object</AdditionalIncludeDirectories>
<UndefinePreprocessorDefinitions>
</UndefinePreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>
</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{918f6766-951a-45ed-b03f-c27eb7a36311}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\epics\main.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\demo\epics\bacepics.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2DED9AEF-13AB-408B-B914-F7F30AE15EC0}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>bacrp</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\handler;..\..\..\..\demo\object</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\handler;..\..\..\..\demo\object</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>
</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\readprop\main.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BACnet Handler Library\BACnet Handler Library.vcxproj">
<Project>{9d4c3515-ca91-4c54-93dc-9962a3139a38}</Project>
</ProjectReference>
<ProjectReference Include="..\BACnet Object Definitions\BACnet Object Definitions.vcxproj">
<Project>{6a8668e1-f08e-496b-b624-d6c05001806d}</Project>
</ProjectReference>
<ProjectReference Include="..\BACnet Stack Library\BACnet Stack Library.vcxproj">
<Project>{e9a65567-b028-4278-881d-674604b2e126}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\readprop\main.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7E30D4FE-B8A7-442D-B6FB-E8DC3129EFEB}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>bacwir</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\object;..\..\..\..\demo\handler</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\object;..\..\..\..\demo\handler</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\whoisrouter\main.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BACnet Handler Library\BACnet Handler Library.vcxproj">
<Project>{9d4c3515-ca91-4c54-93dc-9962a3139a38}</Project>
</ProjectReference>
<ProjectReference Include="..\BACnet Object Definitions\BACnet Object Definitions.vcxproj">
<Project>{6a8668e1-f08e-496b-b624-d6c05001806d}</Project>
</ProjectReference>
<ProjectReference Include="..\BACnet Stack Library\BACnet Stack Library.vcxproj">
<Project>{e9a65567-b028-4278-881d-674604b2e126}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\whoisrouter\main.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{CC217FCF-AEF6-4859-8452-1E222C393383}</ProjectGuid>
<RootNamespace>dcc</RootNamespace>
<ProjectName>bacdcc</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\object;..\..\..\..\demo\handler;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_MBCS;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\object;..\..\..\..\demo\handler;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_MBCS;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\dcc\main.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BACnet Handler Library\BACnet Handler Library.vcxproj">
<Project>{9d4c3515-ca91-4c54-93dc-9962a3139a38}</Project>
</ProjectReference>
<ProjectReference Include="..\BACnet Object Definitions\BACnet Object Definitions.vcxproj">
<Project>{6a8668e1-f08e-496b-b624-d6c05001806d}</Project>
</ProjectReference>
<ProjectReference Include="..\BACnet Stack Library\BACnet Stack Library.vcxproj">
<Project>{e9a65567-b028-4278-881d-674604b2e126}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\dcc\main.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{826EF765-7828-44D3-B8AF-7AEDBAA8E0D2}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>writeprop</RootNamespace>
<ProjectName>bacwp</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;PRINT_ENABLED=1;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\handler;..\..\..\..\demo\object</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;PRINT_ENABLED=1;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\handler;..\..\..\..\demo\object</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\writeprop\main.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BACnet Handler Library\BACnet Handler Library.vcxproj">
<Project>{9d4c3515-ca91-4c54-93dc-9962a3139a38}</Project>
</ProjectReference>
<ProjectReference Include="..\BACnet Object Definitions\BACnet Object Definitions.vcxproj">
<Project>{6a8668e1-f08e-496b-b624-d6c05001806d}</Project>
</ProjectReference>
<ProjectReference Include="..\BACnet Stack Library\BACnet Stack Library.vcxproj">
<Project>{e9a65567-b028-4278-881d-674604b2e126}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\writeprop\main.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_PropertySheetDisplayName>BACnet Solution Settings</_PropertySheetDisplayName>
<IncludePath>..\..;..\..\..\..\include;..\..\..\..\demo\object;..\..\..\..\demo\handler;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;PRINT_ENABLED=1;BIP_DEBUG;INTRINSIC_REPORTING=1;BBMD_ENABLED=1;DEBUG_ENABLED=1;BACFILE;WIN32;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4214;4245;4389;4244;4996;4018;4100;4267;4701;4189;</DisableSpecificWarnings>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
@@ -0,0 +1,57 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BACnet_Handler_Library", "BACnet_Handler_Library\BACnet_Handler_Library.vcxproj", "{2001A15D-2D0E-4FFA-8B90-5E7938AE6ECF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BACnet_Object_Definitions", "BACnet_Object_Definitions\BACnet_Object_Definitions.vcxproj", "{6D42B11A-84DA-46DB-9D08-319329D51473}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BACnet_Stack_Library", "BACnet_Stack_Library\BACnet_Stack_Library.vcxproj", "{D0875CC6-8B68-404C-ABD7-823FE0C084DD}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "Server\Server.vcxproj", "{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2001A15D-2D0E-4FFA-8B90-5E7938AE6ECF}.Debug|x64.ActiveCfg = Debug|x64
{2001A15D-2D0E-4FFA-8B90-5E7938AE6ECF}.Debug|x64.Build.0 = Debug|x64
{2001A15D-2D0E-4FFA-8B90-5E7938AE6ECF}.Debug|x86.ActiveCfg = Debug|Win32
{2001A15D-2D0E-4FFA-8B90-5E7938AE6ECF}.Debug|x86.Build.0 = Debug|Win32
{2001A15D-2D0E-4FFA-8B90-5E7938AE6ECF}.Release|x64.ActiveCfg = Release|x64
{2001A15D-2D0E-4FFA-8B90-5E7938AE6ECF}.Release|x64.Build.0 = Release|x64
{2001A15D-2D0E-4FFA-8B90-5E7938AE6ECF}.Release|x86.ActiveCfg = Release|Win32
{2001A15D-2D0E-4FFA-8B90-5E7938AE6ECF}.Release|x86.Build.0 = Release|Win32
{6D42B11A-84DA-46DB-9D08-319329D51473}.Debug|x64.ActiveCfg = Debug|x64
{6D42B11A-84DA-46DB-9D08-319329D51473}.Debug|x64.Build.0 = Debug|x64
{6D42B11A-84DA-46DB-9D08-319329D51473}.Debug|x86.ActiveCfg = Debug|Win32
{6D42B11A-84DA-46DB-9D08-319329D51473}.Debug|x86.Build.0 = Debug|Win32
{6D42B11A-84DA-46DB-9D08-319329D51473}.Release|x64.ActiveCfg = Release|x64
{6D42B11A-84DA-46DB-9D08-319329D51473}.Release|x64.Build.0 = Release|x64
{6D42B11A-84DA-46DB-9D08-319329D51473}.Release|x86.ActiveCfg = Release|Win32
{6D42B11A-84DA-46DB-9D08-319329D51473}.Release|x86.Build.0 = Release|Win32
{D0875CC6-8B68-404C-ABD7-823FE0C084DD}.Debug|x64.ActiveCfg = Debug|x64
{D0875CC6-8B68-404C-ABD7-823FE0C084DD}.Debug|x64.Build.0 = Debug|x64
{D0875CC6-8B68-404C-ABD7-823FE0C084DD}.Debug|x86.ActiveCfg = Debug|Win32
{D0875CC6-8B68-404C-ABD7-823FE0C084DD}.Debug|x86.Build.0 = Debug|Win32
{D0875CC6-8B68-404C-ABD7-823FE0C084DD}.Release|x64.ActiveCfg = Release|x64
{D0875CC6-8B68-404C-ABD7-823FE0C084DD}.Release|x64.Build.0 = Release|x64
{D0875CC6-8B68-404C-ABD7-823FE0C084DD}.Release|x86.ActiveCfg = Release|Win32
{D0875CC6-8B68-404C-ABD7-823FE0C084DD}.Release|x86.Build.0 = Release|Win32
{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}.Debug|x64.ActiveCfg = Debug|x64
{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}.Debug|x64.Build.0 = Debug|x64
{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}.Debug|x86.ActiveCfg = Debug|Win32
{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}.Debug|x86.Build.0 = Debug|Win32
{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}.Release|x64.ActiveCfg = Release|Win32
{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}.Release|x86.ActiveCfg = Release|Win32
{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -0,0 +1,210 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2001A15D-2D0E-4FFA-8B90-5E7938AE6ECF}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>BACnet_Handler_Library</RootNamespace>
<UseAppLocalVCLibs>true</UseAppLocalVCLibs>
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\BACnet Solution Settings.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\BACnet Solution Settings.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\BACnet Solution Settings.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\BACnet Solution Settings.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(VC_IncludePath);$(UniversalCRT_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(VC_IncludePath);$(UniversalCRT_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(VC_IncludePath);$(UniversalCRT_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\ports\win32;..\..\..\..\demo\object;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4214;4244;4267;4189;4100;4701</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;BACDL_BIP;USE_INADDR=0;BACAPP_ALL;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\ports\win32;..\..\..\..\demo\object;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Async</ExceptionHandling>
<DisableSpecificWarnings>4214;4244;4267;4189;4100;4701</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;BACDL_BIP;USE_INADDR=0;BACAPP_ALL;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\ports\win32;..\..\..\..\demo\object;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4214;4244;4267;4189;4100;4701</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\handler\h_alarm_ack.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_getevent.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_get_alarm_sum.c" />
<ClCompile Include="..\..\..\..\demo\handler\dlenv.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_arf.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_arf_a.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_awf.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_ccov.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_cov.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_dcc.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_iam.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_ihave.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_lso.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_npdu.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_rd.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_rp.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_rpm.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_rpm_a.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_rp_a.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_rr.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_rr_a.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_ts.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_ucov.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_upt.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_whohas.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_whois.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_wp.c" />
<ClCompile Include="..\..\..\..\demo\handler\h_wpm.c" />
<ClCompile Include="..\..\..\..\demo\handler\noserv.c" />
<ClCompile Include="..\..\..\..\demo\handler\objects.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_arfs.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_awfs.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_cevent.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_cov.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_dcc.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_iam.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_ihave.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_lso.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_rd.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_router.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_rp.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_rpm.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_ts.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_uevent.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_upt.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_whohas.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_whois.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_wp.c" />
<ClCompile Include="..\..\..\..\demo\handler\s_wpm.c" />
<ClCompile Include="..\..\..\..\demo\handler\txbuf.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\handler\dlenv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_arf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_arf_a.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_awf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_ccov.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_cov.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_dcc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_iam.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_ihave.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_lso.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_npdu.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_rd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_rp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_rpm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_rpm_a.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_rp_a.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_rr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_rr_a.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_ts.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_ucov.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_upt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_whohas.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_whois.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_wp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_wpm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\noserv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\objects.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_arfs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_awfs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_cevent.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_cov.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_dcc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_iam.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_ihave.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_lso.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_rd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_router.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_rp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_rpm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_ts.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_uevent.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_upt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_whohas.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_whois.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_wp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\s_wpm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\txbuf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_get_alarm_sum.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_getevent.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\handler\h_alarm_ack.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
@@ -0,0 +1,217 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{6D42B11A-84DA-46DB-9D08-319329D51473}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>BACnet_Object_Definitions</RootNamespace>
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\BACnet Solution Settings.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\BACnet Solution Settings.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\BACnet Solution Settings.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\BACnet Solution Settings.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(VC_IncludePath);$(UniversalCRT_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(VC_IncludePath);$(UniversalCRT_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(VC_IncludePath);$(UniversalCRT_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Lib>
<IgnoreAllDefaultLibraries>
</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\ports\win32;..\..\..\..\include;..\..\..\..\demo\object;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4244;4100;4701</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Lib>
<IgnoreAllDefaultLibraries>
</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;BACDL_BIP;USE_INADDR=0;BACAPP_ALL;BACAPP_ALLNDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\ports\win32;..\..\..\..\include;..\..\..\..\demo\object;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Async</ExceptionHandling>
<DisableSpecificWarnings>4244;4100;4701</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<Lib>
<IgnoreAllDefaultLibraries>
</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;BACDL_BIP;USE_INADDR=0;BACAPP_ALL;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\ports\win32;..\..\..\..\include;..\..\..\..\demo\object;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4244;4100;4701</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<Lib>
<IgnoreAllDefaultLibraries>
</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\object\ai.c" />
<ClCompile Include="..\..\..\..\demo\object\ao.c" />
<ClCompile Include="..\..\..\..\demo\object\av.c" />
<ClCompile Include="..\..\..\..\demo\object\bacfile.c" />
<ClCompile Include="..\..\..\..\demo\object\bi.c" />
<ClCompile Include="..\..\..\..\demo\object\bo.c" />
<ClCompile Include="..\..\..\..\demo\object\bv.c" />
<ClCompile Include="..\..\..\..\demo\object\channel.c" />
<ClCompile Include="..\..\..\..\demo\object\command.c" />
<ClCompile Include="..\..\..\..\demo\object\csv.c" />
<ClCompile Include="..\..\..\..\demo\object\gw_device.c" />
<ClCompile Include="..\..\..\..\demo\object\iv.c" />
<ClCompile Include="..\..\..\..\demo\object\lc.c" />
<ClCompile Include="..\..\..\..\demo\object\lo.c" />
<ClCompile Include="..\..\..\..\demo\object\lsp.c" />
<ClCompile Include="..\..\..\..\demo\object\ms-input.c" />
<ClCompile Include="..\..\..\..\demo\object\mso.c" />
<ClCompile Include="..\..\..\..\demo\object\msv.c" />
<ClCompile Include="..\..\..\..\demo\object\nc.c" />
<ClCompile Include="..\..\..\..\demo\object\osv.c" />
<ClCompile Include="..\..\..\..\demo\object\piv.c" />
<ClCompile Include="..\..\..\..\demo\object\schedule.c" />
<ClCompile Include="..\..\..\..\demo\object\trendlog.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\demo\object\ai.h" />
<ClInclude Include="..\..\..\..\demo\object\ao.h" />
<ClInclude Include="..\..\..\..\demo\object\av.h" />
<ClInclude Include="..\..\..\..\demo\object\bacfile.h" />
<ClInclude Include="..\..\..\..\demo\object\bi.h" />
<ClInclude Include="..\..\..\..\demo\object\bo.h" />
<ClInclude Include="..\..\..\..\demo\object\bv.h" />
<ClInclude Include="..\..\..\..\demo\object\csv.h" />
<ClInclude Include="..\..\..\..\demo\object\device.h" />
<ClInclude Include="..\..\..\..\demo\object\lc.h" />
<ClInclude Include="..\..\..\..\demo\object\lo.h" />
<ClInclude Include="..\..\..\..\demo\object\lsp.h" />
<ClInclude Include="..\..\..\..\demo\object\ms-input.h" />
<ClInclude Include="..\..\..\..\demo\object\mso.h" />
<ClInclude Include="..\..\..\..\demo\object\msv.h" />
<ClInclude Include="..\..\..\..\demo\object\nc.h" />
<ClInclude Include="..\..\..\..\demo\object\trendlog.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\object\ai.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\ao.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\av.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\bacfile.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\bi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\bo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\bv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\channel.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\command.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\csv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\gw_device.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\iv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\lc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\lo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\lsp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\ms-input.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\mso.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\msv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\nc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\trendlog.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\piv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\schedule.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\osv.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\demo\object\ai.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\ao.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\av.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\bacfile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\bi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\bo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\bv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\csv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\device.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\lc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\lo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\lsp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\ms-input.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\mso.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\msv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\nc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\demo\object\trendlog.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
@@ -0,0 +1,301 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D0875CC6-8B68-404C-ABD7-823FE0C084DD}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>BACnet_Stack_Library</RootNamespace>
<UseAppLocalVCLibs>true</UseAppLocalVCLibs>
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\BACnet Solution Settings.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\BACnet Solution Settings.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\BACnet Solution Settings.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\BACnet Solution Settings.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LibraryPath>$(VC_LibraryPath_x86);$(UniversalCRT_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;</LibraryPath>
<IncludePath>$(VC_IncludePath);$(UniversalCRT_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(VC_IncludePath);$(UniversalCRT_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(VC_IncludePath);$(UniversalCRT_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\ports\win32;..\..\..\..\demo\object;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4245;4389;4244;4996;4018;4100;4267;4701</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;BACDL_BIP;USE_INADDR=0;BACAPP_ALL;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\ports\win32;..\..\..\..\demo\object;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Async</ExceptionHandling>
<DisableSpecificWarnings>4245;4389;4244;4996;4018;4100;4267;4701</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;BACDL_BIP;USE_INADDR=0;BACAPP_ALL;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\ports\win32;..\..\..\..\demo\object;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4245;4389;4244;4996;4018;4100;4267;4701</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\ports\win32\bip-init.c" />
<ClCompile Include="..\..\..\..\src\abort.c" />
<ClCompile Include="..\..\..\..\src\address.c" />
<ClCompile Include="..\..\..\..\src\alarm_ack.c" />
<ClCompile Include="..\..\..\..\src\apdu.c" />
<ClCompile Include="..\..\..\..\src\arf.c" />
<ClCompile Include="..\..\..\..\src\awf.c" />
<ClCompile Include="..\..\..\..\src\bacaddr.c" />
<ClCompile Include="..\..\..\..\src\bacapp.c" />
<ClCompile Include="..\..\..\..\src\bacdcode.c" />
<ClCompile Include="..\..\..\..\src\bacdevobjpropref.c" />
<ClCompile Include="..\..\..\..\src\bacerror.c" />
<ClCompile Include="..\..\..\..\src\bacint.c" />
<ClCompile Include="..\..\..\..\src\bacprop.c" />
<ClCompile Include="..\..\..\..\src\bacpropstates.c" />
<ClCompile Include="..\..\..\..\src\bacreal.c" />
<ClCompile Include="..\..\..\..\src\bacstr.c" />
<ClCompile Include="..\..\..\..\src\bactext.c" />
<ClCompile Include="..\..\..\..\src\bactimevalue.c" />
<ClCompile Include="..\..\..\..\src\bigend.c" />
<ClCompile Include="..\..\..\..\src\bip.c" />
<ClCompile Include="..\..\..\..\src\bvlc.c" />
<ClCompile Include="..\..\..\..\src\cov.c" />
<ClCompile Include="..\..\..\..\src\crc.c" />
<ClCompile Include="..\..\..\..\src\datalink.c" />
<ClCompile Include="..\..\..\..\src\datetime.c" />
<ClCompile Include="..\..\..\..\src\dcc.c" />
<ClCompile Include="..\..\..\..\src\debug.c" />
<ClCompile Include="..\..\..\..\src\event.c" />
<ClCompile Include="..\..\..\..\src\fifo.c" />
<ClCompile Include="..\..\..\..\src\filename.c" />
<ClCompile Include="..\..\..\..\src\getevent.c" />
<ClCompile Include="..\..\..\..\src\get_alarm_sum.c" />
<ClCompile Include="..\..\..\..\src\iam.c" />
<ClCompile Include="..\..\..\..\src\ihave.c" />
<ClCompile Include="..\..\..\..\src\indtext.c" />
<ClCompile Include="..\..\..\..\src\key.c" />
<ClCompile Include="..\..\..\..\src\keylist.c" />
<ClCompile Include="..\..\..\..\src\lighting.c" />
<ClCompile Include="..\..\..\..\src\lso.c" />
<ClCompile Include="..\..\..\..\src\memcopy.c" />
<ClCompile Include="..\..\..\..\src\mstp.c" />
<ClCompile Include="..\..\..\..\src\mstptext.c" />
<ClCompile Include="..\..\..\..\src\npdu.c" />
<ClCompile Include="..\..\..\..\src\proplist.c" />
<ClCompile Include="..\..\..\..\src\ptransfer.c" />
<ClCompile Include="..\..\..\..\src\rd.c" />
<ClCompile Include="..\..\..\..\src\readrange.c" />
<ClCompile Include="..\..\..\..\src\reject.c" />
<ClCompile Include="..\..\..\..\src\ringbuf.c" />
<ClCompile Include="..\..\..\..\src\rp.c" />
<ClCompile Include="..\..\..\..\src\rpm.c" />
<ClCompile Include="..\..\..\..\src\sbuf.c" />
<ClCompile Include="..\..\..\..\src\timestamp.c" />
<ClCompile Include="..\..\..\..\src\timesync.c" />
<ClCompile Include="..\..\..\..\src\tsm.c" />
<ClCompile Include="..\..\..\..\src\version.c" />
<ClCompile Include="..\..\..\..\src\whohas.c" />
<ClCompile Include="..\..\..\..\src\whois.c" />
<ClCompile Include="..\..\..\..\src\wp.c" />
<ClCompile Include="..\..\..\..\src\wpm.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\include\abort.h" />
<ClInclude Include="..\..\..\..\include\address.h" />
<ClInclude Include="..\..\..\..\include\alarm_ack.h" />
<ClInclude Include="..\..\..\..\include\apdu.h" />
<ClInclude Include="..\..\..\..\include\arcnet.h" />
<ClInclude Include="..\..\..\..\include\arf.h" />
<ClInclude Include="..\..\..\..\include\awf.h" />
<ClInclude Include="..\..\..\..\include\bacaddr.h" />
<ClInclude Include="..\..\..\..\include\bacapp.h" />
<ClInclude Include="..\..\..\..\include\bacdcode.h" />
<ClInclude Include="..\..\..\..\include\bacdef.h" />
<ClInclude Include="..\..\..\..\include\bacdevobjpropref.h" />
<ClInclude Include="..\..\..\..\include\bacenum.h" />
<ClInclude Include="..\..\..\..\include\bacerror.h" />
<ClInclude Include="..\..\..\..\include\bacint.h" />
<ClInclude Include="..\..\..\..\include\bacnet.h" />
<ClInclude Include="..\..\..\..\include\bacprop.h" />
<ClInclude Include="..\..\..\..\include\bacpropstates.h" />
<ClInclude Include="..\..\..\..\include\bacreal.h" />
<ClInclude Include="..\..\..\..\include\bacstr.h" />
<ClInclude Include="..\..\..\..\include\bactext.h" />
<ClInclude Include="..\..\..\..\include\bactimevalue.h" />
<ClInclude Include="..\..\..\..\include\bigend.h" />
<ClInclude Include="..\..\..\..\include\bip.h" />
<ClInclude Include="..\..\..\..\include\bits.h" />
<ClInclude Include="..\..\..\..\include\bvlc.h" />
<ClInclude Include="..\..\..\..\include\bytes.h" />
<ClInclude Include="..\..\..\..\include\client.h" />
<ClInclude Include="..\..\..\..\include\config.h" />
<ClInclude Include="..\..\..\..\include\cov.h" />
<ClInclude Include="..\..\..\..\include\crc.h" />
<ClInclude Include="..\..\..\..\include\datalink.h" />
<ClInclude Include="..\..\..\..\include\datetime.h" />
<ClInclude Include="..\..\..\..\include\dcc.h" />
<ClInclude Include="..\..\..\..\include\debug.h" />
<ClInclude Include="..\..\..\..\include\dlenv.h" />
<ClInclude Include="..\..\..\..\include\dlmstp.h" />
<ClInclude Include="..\..\..\..\include\ethernet.h" />
<ClInclude Include="..\..\..\..\include\event.h" />
<ClInclude Include="..\..\..\..\include\fifo.h" />
<ClInclude Include="..\..\..\..\include\filename.h" />
<ClInclude Include="..\..\..\..\include\getevent.h" />
<ClInclude Include="..\..\..\..\include\get_alarm_sum.h" />
<ClInclude Include="..\..\..\..\include\handlers.h" />
<ClInclude Include="..\..\..\..\include\iam.h" />
<ClInclude Include="..\..\..\..\include\ihave.h" />
<ClInclude Include="..\..\..\..\include\indtext.h" />
<ClInclude Include="..\..\..\..\include\key.h" />
<ClInclude Include="..\..\..\..\include\keylist.h" />
<ClInclude Include="..\..\..\..\include\lighting.h" />
<ClInclude Include="..\..\..\..\include\lso.h" />
<ClInclude Include="..\..\..\..\include\memcopy.h" />
<ClInclude Include="..\..\..\..\include\mstp.h" />
<ClInclude Include="..\..\..\..\include\mstpdef.h" />
<ClInclude Include="..\..\..\..\include\mstptext.h" />
<ClInclude Include="..\..\..\..\include\mydata.h" />
<ClInclude Include="..\..\..\..\include\npdu.h" />
<ClInclude Include="..\..\..\..\include\objects.h" />
<ClInclude Include="..\..\..\..\include\proplist.h" />
<ClInclude Include="..\..\..\..\include\ptransfer.h" />
<ClInclude Include="..\..\..\..\include\rd.h" />
<ClInclude Include="..\..\..\..\include\readrange.h" />
<ClInclude Include="..\..\..\..\include\reject.h" />
<ClInclude Include="..\..\..\..\include\ringbuf.h" />
<ClInclude Include="..\..\..\..\include\rp.h" />
<ClInclude Include="..\..\..\..\include\rpm.h" />
<ClInclude Include="..\..\..\..\include\sbuf.h" />
<ClInclude Include="..\..\..\..\include\timestamp.h" />
<ClInclude Include="..\..\..\..\include\timesync.h" />
<ClInclude Include="..\..\..\..\include\tsm.h" />
<ClInclude Include="..\..\..\..\include\txbuf.h" />
<ClInclude Include="..\..\..\..\include\ucix.h" />
<ClInclude Include="..\..\..\..\include\version.h" />
<ClInclude Include="..\..\..\..\include\whohas.h" />
<ClInclude Include="..\..\..\..\include\whois.h" />
<ClInclude Include="..\..\..\..\include\wp.h" />
<ClInclude Include="..\..\..\..\include\wpm.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,441 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Source Files\ports">
<UniqueIdentifier>{a9f457e3-60ed-4628-8e52-08b365a2a53f}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\ports\win32\bip-init.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\abort.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\address.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\alarm_ack.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\apdu.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\arf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\awf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacaddr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacapp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacdcode.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacdevobjpropref.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacerror.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacprop.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacpropstates.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacreal.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bacstr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bactext.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bigend.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bip.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bvlc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\cov.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\crc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\datalink.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\datetime.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\dcc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\debug.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\event.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\fifo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\filename.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\getevent.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\get_alarm_sum.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\iam.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\ihave.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\indtext.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\key.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\keylist.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\lighting.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\lso.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\memcopy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\mstp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\mstptext.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\npdu.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\proplist.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\ptransfer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\rd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\readrange.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\reject.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\ringbuf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\rp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\rpm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\sbuf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\timestamp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\timesync.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\tsm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\version.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\whohas.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\whois.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\wp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\wpm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\bactimevalue.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\include\abort.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\address.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\alarm_ack.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\apdu.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\arcnet.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\arf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\awf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacaddr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacapp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacdcode.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacdef.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacdevobjpropref.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacenum.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacerror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacint.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacnet.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacprop.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacpropstates.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacreal.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bacstr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bactext.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bactimevalue.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bigend.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bip.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bits.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bvlc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bytes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\client.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\cov.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\crc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\datalink.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\datetime.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\dcc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\debug.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\dlenv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\dlmstp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\ethernet.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\event.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\fifo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\filename.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\get_alarm_sum.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\getevent.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\handlers.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\iam.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\ihave.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\indtext.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\key.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\keylist.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\lighting.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\lso.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\memcopy.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\mstp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\mstpdef.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\mstptext.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\mydata.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\npdu.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\objects.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\proplist.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\ptransfer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\rd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\readrange.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\reject.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\ringbuf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\rp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\rpm.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\sbuf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\timestamp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\timesync.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\tsm.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\txbuf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\ucix.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\whohas.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\whois.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\wp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\wpm.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
@@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{EF250061-B9E3-4EEF-8C87-4AB52AF30B3E}</ProjectGuid>
<RootNamespace>Server</RootNamespace>
<Keyword>Win32Proj</Keyword>
<ProjectName>server</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="..\BACnet Solution Settings.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="..\BACnet Solution Settings.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="..\BACnet Solution Settings.props" />
<Import Project="..\BACnet Demo Settings.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="..\BACnet Solution Settings.props" />
<Import Project="..\BACnet Demo Settings.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>..\..;..\..\..\..\include;..\..\..\..\demo\object;..\..\..\..\demo\handler;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\object;..\..\..\..\demo\handler</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\object;..\..\..\..\demo\handler</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;PRINT_ENABLED=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>..\..;..\..\..\..\include;..\..\..\..\demo\object;..\..\..\..\demo\handler</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\object\device.c" />
<ClCompile Include="..\..\..\..\demo\server\main.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\demo\server\server.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BACnet_Handler_Library\BACnet_Handler_Library.vcxproj">
<Project>{2001a15d-2d0e-4ffa-8b90-5e7938ae6ecf}</Project>
</ProjectReference>
<ProjectReference Include="..\BACnet_Object_Definitions\BACnet_Object_Definitions.vcxproj">
<Project>{6d42b11a-84da-46db-9d08-319329d51473}</Project>
</ProjectReference>
<ProjectReference Include="..\BACnet_Stack_Library\BACnet_Stack_Library.vcxproj">
<Project>{d0875cc6-8b68-404c-abd7-823fe0c084dd}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{a99eabbe-5157-4999-8c10-9f9f93f1778d}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\demo\server\main.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\demo\object\device.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\demo\server\server.h" />
</ItemGroup>
</Project>
+66
View File
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="BACnet Client Server Win32 Demo" />
<Option makefile="makefile" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin\Debug\bacnet" 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\bacnet" 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="-Wall" />
<Add option="-fexceptions" />
<Add option="-DBACDL_BIP" />
<Add option="-DPRINT_ENABLED=1" />
<Add option="-DBACAPP_ALL" />
<Add directory="." />
<Add directory="..\..\include" />
<Add directory="..\..\demo\handler" />
<Add directory="..\..\demo\object" />
</Compiler>
<Linker>
<Add library="..\..\lib\libbacnet.a" />
<Add library="ws2_32" />
<Add library="iphlpapi" />
</Linker>
<Unit filename="..\..\include\bacaddr.h" />
<Unit filename="..\..\include\bacdef.h" />
<Unit filename="..\..\include\bacint.h" />
<Unit filename="..\..\include\crc.h" />
<Unit filename="..\..\include\datalink.h" />
<Unit filename="..\..\include\indtext.h" />
<Unit filename="..\..\include\mstp.h" />
<Unit filename="..\..\include\mstptext.h" />
<Unit filename="..\..\include\npdu.h" />
<Unit filename="main.c">
<Option compilerVar="CC" />
</Unit>
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
Binary file not shown.
+478
View File
@@ -0,0 +1,478 @@
/*####COPYRIGHTBEGIN####
-------------------------------------------
Copyright (C) 2005 Steve Karg
Contributions by Thomas Neumann in 2008.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
The Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA.
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.
This exception does not invalidate any other reasons why a work
based on this file might be covered by the GNU General Public
License.
-------------------------------------------
####COPYRIGHTEND####*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h> /* for standard integer types uint8_t etc. */
#include <stdbool.h> /* for the standard bool type. */
#include "bacdcode.h"
#include "config.h"
#include "bip.h"
#include "net.h"
#if defined(_MSC_VER)
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "IPHLPAPI.lib")
#endif
bool BIP_Debug = false;
/* gets an IP address by name, where name can be a
string that is an IP address in dotted form, or
a name that is a domain name
returns 0 if not found, or
an IP address in network byte order */
long bip_getaddrbyname(
const char *host_name)
{
struct hostent *host_ent;
if ((host_ent = gethostbyname(host_name)) == NULL)
return 0;
return *(long *) host_ent->h_addr;
}
/* To fill a need, we invent the gethostaddr() function. */
static long gethostaddr(
void)
{
struct hostent *host_ent;
char host_name[255];
if (gethostname(host_name, sizeof(host_name)) != 0)
return -1;
if ((host_ent = gethostbyname(host_name)) == NULL)
return -1;
if (BIP_Debug) {
printf("host: %s at %u.%u.%u.%u\n", host_name,
(unsigned) ((uint8_t *) host_ent->h_addr)[0],
(unsigned) ((uint8_t *) host_ent->h_addr)[1],
(unsigned) ((uint8_t *) host_ent->h_addr)[2],
(unsigned) ((uint8_t *) host_ent->h_addr)[3]);
}
/* note: network byte order */
return *(long *) host_ent->h_addr;
}
#if (!defined(USE_INADDR) || (USE_INADDR == 0)) && \
(!defined(USE_CLASSADDR) || (USE_CLASSADDR == 0))
/* returns the subnet mask in network byte order */
static uint32_t getIpMaskForIpAddress(
uint32_t ipAddress)
{
/* Allocate information for up to 16 NICs */
IP_ADAPTER_INFO AdapterInfo[16];
/* Save memory size of buffer */
DWORD dwBufLen = sizeof(AdapterInfo);
uint32_t ipMask = INADDR_BROADCAST;
bool found = false;
PIP_ADAPTER_INFO pAdapterInfo;
/* GetAdapterInfo:
[out] buffer to receive data
[in] size of receive data buffer */
DWORD dwStatus = GetAdaptersInfo(AdapterInfo,
&dwBufLen);
if (dwStatus == ERROR_SUCCESS) {
/* Verify return value is valid, no buffer overflow
Contains pointer to current adapter info */
pAdapterInfo = AdapterInfo;
do {
IP_ADDR_STRING *pIpAddressInfo = &pAdapterInfo->IpAddressList;
do {
unsigned long adapterAddress =
inet_addr(pIpAddressInfo->IpAddress.String);
unsigned long adapterMask =
inet_addr(pIpAddressInfo->IpMask.String);
if (adapterAddress == ipAddress) {
ipMask = adapterMask;
found = true;
}
pIpAddressInfo = pIpAddressInfo->Next;
} while (pIpAddressInfo && !found);
/* Progress through linked list */
pAdapterInfo = pAdapterInfo->Next;
/* Terminate on last adapter */
} while (pAdapterInfo && !found);
}
return ipMask;
}
#endif
static void set_broadcast_address(
uint32_t net_address)
{
#if defined(USE_INADDR) && USE_INADDR
/* Note: sometimes INADDR_BROADCAST does not let me get
any unicast messages. Not sure why... */
net_address = net_address;
bip_set_broadcast_addr(INADDR_BROADCAST);
#elif defined(USE_CLASSADDR) && USE_CLASSADDR
long broadcast_address = 0;
if (IN_CLASSA(ntohl(net_address)))
broadcast_address =
(ntohl(net_address) & ~IN_CLASSA_HOST) | IN_CLASSA_HOST;
else if (IN_CLASSB(ntohl(net_address)))
broadcast_address =
(ntohl(net_address) & ~IN_CLASSB_HOST) | IN_CLASSB_HOST;
else if (IN_CLASSC(ntohl(net_address)))
broadcast_address =
(ntohl(net_address) & ~IN_CLASSC_HOST) | IN_CLASSC_HOST;
else if (IN_CLASSD(ntohl(net_address)))
broadcast_address =
(ntohl(net_address) & ~IN_CLASSD_HOST) | IN_CLASSD_HOST;
else
broadcast_address = INADDR_BROADCAST;
bip_set_broadcast_addr(htonl(broadcast_address));
#else
/* these are network byte order variables */
long broadcast_address = 0;
long net_mask = 0;
net_mask = getIpMaskForIpAddress(net_address);
if (BIP_Debug) {
struct in_addr address;
address.s_addr = net_mask;
printf("IP Mask: %s\n", inet_ntoa(address));
}
broadcast_address = (net_address & net_mask) | (~net_mask);
bip_set_broadcast_addr(broadcast_address);
#endif
}
/* on Windows, ifname is the dotted ip address of the interface */
void bip_set_interface(
char *ifname)
{
struct in_addr address;
/* setup local address */
if (bip_get_addr() == 0) {
bip_set_addr(inet_addr(ifname));
}
if (BIP_Debug) {
address.s_addr = bip_get_addr();
fprintf(stderr, "Interface: %s\n", ifname);
}
/* setup local broadcast address */
if (bip_get_broadcast_addr() == 0) {
address.s_addr = bip_get_addr();
set_broadcast_address(address.s_addr);
}
}
static char *winsock_error_code_text(
int code)
{
switch (code) {
case WSAEACCES:
return "Permission denied.";
case WSAEINTR:
return "Interrupted system call.";
case WSAEBADF:
return "Bad file number.";
case WSAEFAULT:
return "Bad address.";
case WSAEINVAL:
return "Invalid argument.";
case WSAEMFILE:
return "Too many open files.";
case WSAEWOULDBLOCK:
return "Operation would block.";
case WSAEINPROGRESS:
return "Operation now in progress. "
"This error is returned if any Windows Sockets API "
"function is called while a blocking function "
"is in progress.";
case WSAENOTSOCK:
return "Socket operation on nonsocket.";
case WSAEDESTADDRREQ:
return "Destination address required.";
case WSAEMSGSIZE:
return "Message too long.";
case WSAEPROTOTYPE:
return "Protocol wrong type for socket.";
case WSAENOPROTOOPT:
return "Protocol not available.";
case WSAEPROTONOSUPPORT:
return "Protocol not supported.";
case WSAESOCKTNOSUPPORT:
return "Socket type not supported.";
case WSAEOPNOTSUPP:
return "Operation not supported on socket.";
case WSAEPFNOSUPPORT:
return "Protocol family not supported.";
case WSAEAFNOSUPPORT:
return "Address family not supported by protocol family.";
case WSAEADDRINUSE:
return "Address already in use.";
case WSAEADDRNOTAVAIL:
return "Cannot assign requested address.";
case WSAENETDOWN:
return "Network is down. "
"This error may be reported at any time "
"if the Windows Sockets implementation "
"detects an underlying failure.";
case WSAENETUNREACH:
return "Network is unreachable.";
case WSAENETRESET:
return "Network dropped connection on reset.";
case WSAECONNABORTED:
return "Software caused connection abort.";
case WSAECONNRESET:
return "Connection reset by peer.";
case WSAENOBUFS:
return "No buffer space available.";
case WSAEISCONN:
return "Socket is already connected.";
case WSAENOTCONN:
return "Socket is not connected.";
case WSAESHUTDOWN:
return "Cannot send after socket shutdown.";
case WSAETOOMANYREFS:
return "Too many references: cannot splice.";
case WSAETIMEDOUT:
return "Connection timed out.";
case WSAECONNREFUSED:
return "Connection refused.";
case WSAELOOP:
return "Too many levels of symbolic links.";
case WSAENAMETOOLONG:
return "File name too long.";
case WSAEHOSTDOWN:
return "Host is down.";
case WSAEHOSTUNREACH:
return "No route to host.";
case WSASYSNOTREADY:
return "Returned by WSAStartup(), "
"indicating that the network subsystem is unusable.";
case WSAVERNOTSUPPORTED:
return "Returned by WSAStartup(), "
"indicating that the Windows Sockets DLL cannot support "
"this application.";
case WSANOTINITIALISED:
return "Winsock not initialized. "
"This message is returned by any function "
"except WSAStartup(), "
"indicating that a successful WSAStartup() has not yet "
"been performed.";
case WSAEDISCON:
return "Disconnect.";
case WSAHOST_NOT_FOUND:
return "Host not found. " "This message indicates that the key "
"(name, address, and so on) was not found.";
case WSATRY_AGAIN:
return "Nonauthoritative host not found. "
"This error may suggest that the name service itself "
"is not functioning.";
case WSANO_RECOVERY:
return "Nonrecoverable error. "
"This error may suggest that the name service itself "
"is not functioning.";
case WSANO_DATA:
return "Valid name, no data record of requested type. "
"This error indicates that the key "
"(name, address, and so on) was not found.";
default:
return "unknown";
}
}
/** Initialize the BACnet/IP services at the given interface.
* @ingroup DLBIP
* -# Gets the local IP address and local broadcast address from the system,
* and saves it into the BACnet/IP data structures.
* -# Opens a UDP socket
* -# Configures the socket for sending and receiving
* -# Configures the socket so it can send broadcasts
* -# Binds the socket to the local IP address at the specified port for
* BACnet/IP (by default, 0xBAC0 = 47808).
*
* @note For Windows, ifname is the dotted ip address of the interface.
*
* @param ifname [in] The named interface to use for the network layer.
* If NULL, the "eth0" interface is assigned.
* @return True if the socket is successfully opened for BACnet/IP,
* else False if the socket functions fail.
*/
bool bip_init(
char *ifname)
{
int rv = 0; /* return from socket lib calls */
struct sockaddr_in sin = { -1 };
int value = 1;
int sock_fd = -1;
int Result;
int Code;
WSADATA wd;
struct in_addr address;
struct in_addr broadcast_address;
Result = WSAStartup((1 << 8) | 1, &wd);
/*Result = WSAStartup(MAKEWORD(2,2), &wd); */
if (Result != 0) {
Code = WSAGetLastError();
printf("TCP/IP stack initialization failed\n" " error code: %i %s\n",
Code, winsock_error_code_text(Code));
exit(1);
}
atexit(bip_cleanup);
if (ifname)
bip_set_interface(ifname);
/* has address been set? */
address.s_addr = bip_get_addr();
if (address.s_addr == 0) {
address.s_addr = gethostaddr();
if (address.s_addr == (unsigned) -1) {
Code = WSAGetLastError();
printf("Get host address failed\n" " error code: %i %s\n", Code,
winsock_error_code_text(Code));
exit(1);
}
bip_set_addr(address.s_addr);
}
if (BIP_Debug) {
fprintf(stderr, "IP Address: %s\n", inet_ntoa(address));
}
/* has broadcast address been set? */
if (bip_get_broadcast_addr() == 0) {
set_broadcast_address(address.s_addr);
}
if (BIP_Debug) {
broadcast_address.s_addr = bip_get_broadcast_addr();
fprintf(stderr, "IP Broadcast Address: %s\n",
inet_ntoa(broadcast_address));
fprintf(stderr, "UDP Port: 0x%04X [%hu]\n", ntohs(bip_get_port()),
ntohs(bip_get_port()));
}
/* assumes that the driver has already been initialized */
sock_fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
bip_set_socket(sock_fd);
if (sock_fd < 0) {
fprintf(stderr, "bip: failed to allocate a socket.\n");
return false;
}
/* Allow us to use the same socket for sending and receiving */
/* This makes sure that the src port is correct when sending */
rv = setsockopt(sock_fd, SOL_SOCKET, SO_REUSEADDR, (char *) &value,
sizeof(value));
if (rv < 0) {
fprintf(stderr, "bip: failed to set REUSEADDR socket option.\n");
close(sock_fd);
bip_set_socket(-1);
return false;
}
/* Enables transmission and receipt of broadcast messages on the socket. */
rv = setsockopt(sock_fd, SOL_SOCKET, SO_BROADCAST, (char *) &value,
sizeof(value));
if (rv < 0) {
fprintf(stderr, "bip: failed to set BROADCAST socket option.\n");
close(sock_fd);
bip_set_socket(-1);
return false;
}
#if 0
/* probably only for Apple... */
/* rebind a port that is already in use.
Note: all users of the port must specify this flag */
rv = setsockopt(sock_fd, SOL_SOCKET, SO_REUSEPORT, (char *) &value,
sizeof(value));
if (rv < 0) {
fprintf(stderr, "bip: failed to set REUSEPORT socket option.\n");
close(sock_fd);
bip_set_socket(-1);
return false;
}
#endif
/* bind the socket to the local port number and IP address */
sin.sin_family = AF_INET;
#if defined(USE_INADDR) && USE_INADDR
/* by setting sin.sin_addr.s_addr to INADDR_ANY,
I am telling the IP stack to automatically fill
in the IP address of the machine the process
is running on.
Some server computers have multiple IP addresses.
A socket bound to one of these will not accept
connections to another address. Frequently you prefer
to allow any one of the computer's IP addresses
to be used for connections. Use INADDR_ANY (0L) to
allow clients to connect using any one of the host's
IP addresses. */
sin.sin_addr.s_addr = htonl(INADDR_ANY);
#else
/* or we could use the specific adapter address
note: already in network byte order */
sin.sin_addr.s_addr = address.s_addr;
#endif
sin.sin_port = bip_get_port();
memset(&(sin.sin_zero), '\0', sizeof(sin.sin_zero));
rv = bind(sock_fd, (const struct sockaddr *) &sin,
sizeof(struct sockaddr));
if (rv < 0) {
fprintf(stderr, "bip: failed to bind to %s port %hu\n",
inet_ntoa(sin.sin_addr), ntohs(bip_get_port()));
close(sock_fd);
bip_set_socket(-1);
return false;
}
return true;
}
/** Cleanup and close out the BACnet/IP services by closing the socket.
* @ingroup DLBIP
*/
void bip_cleanup(
void)
{
int sock_fd = 0;
if (bip_valid()) {
sock_fd = bip_socket();
close(sock_fd);
}
bip_set_socket(-1);
WSACleanup();
return;
}
+528
View File
@@ -0,0 +1,528 @@
/*####COPYRIGHTBEGIN####
-------------------------------------------
Copyright (C) 2016 Steve Karg
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
The Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA.
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.
This exception does not invalidate any other reasons why a work
based on this file might be covered by the GNU General Public
License.
-------------------------------------------
####COPYRIGHTEND####*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h> /* for standard integer types uint8_t etc. */
#include <stdbool.h> /* for the standard bool type. */
#include "bacdcode.h"
#include "config.h"
#include "debug.h"
#include "device.h"
#include "bip6.h"
#include "net.h"
/* Win32 Socket */
static SOCKET BIP6_Socket = INVALID_SOCKET;
/* local address - filled by init functions */
static BACNET_IP6_ADDRESS BIP6_Addr;
static BACNET_IP6_ADDRESS BIP6_Broadcast_Addr;
static void debug_print_ipv6(const char *str, const struct in6_addr * addr) {
debug_printf( "BIP6: %s %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
str,
(int)addr->s6_addr[0], (int)addr->s6_addr[1],
(int)addr->s6_addr[2], (int)addr->s6_addr[3],
(int)addr->s6_addr[4], (int)addr->s6_addr[5],
(int)addr->s6_addr[6], (int)addr->s6_addr[7],
(int)addr->s6_addr[8], (int)addr->s6_addr[9],
(int)addr->s6_addr[10], (int)addr->s6_addr[11],
(int)addr->s6_addr[12], (int)addr->s6_addr[13],
(int)addr->s6_addr[14], (int)addr->s6_addr[15]);
}
static LPSTR PrintError(int ErrorCode)
{
static char Message[1024];
// If this program was multithreaded, we'd want to use
// FORMAT_MESSAGE_ALLOCATE_BUFFER instead of a static buffer here.
// (And of course, free the buffer when we were done with it)
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_MAX_WIDTH_MASK, NULL, ErrorCode,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR) Message, 1024, NULL);
return Message;
}
/* on Windows, ifname is the IPv6 address of the interface */
void bip6_set_interface(
char *ifname)
{
int i, RetVal;
struct addrinfo Hints, *AddrInfo, *AI;
struct sockaddr_in6* sin;
struct sockaddr_in6 server;
struct in6_addr broadcast_address;
struct ipv6_mreq join_request;
SOCKET ServSock[FD_SETSIZE];
char port[6] = "";
int sockopt = 0;
// By setting the AI_PASSIVE flag in the hints to getaddrinfo, we're
// indicating that we intend to use the resulting address(es) to bind
// to a socket(s) for accepting incoming connections. This means that
// when the Address parameter is NULL, getaddrinfo will return one
// entry per allowed protocol family containing the unspecified address
// for that family.
//
memset(&Hints, 0, sizeof (Hints));
Hints.ai_family = PF_INET6;
Hints.ai_socktype = SOCK_DGRAM;
Hints.ai_protocol = IPPROTO_UDP;
Hints.ai_flags = AI_NUMERICHOST | AI_PASSIVE;
snprintf(port, sizeof(port), "%u", BIP6_Addr.port);
debug_printf("BIP6: getaddrinfo - IPv6 address %s port %s\n", ifname, port);
RetVal = getaddrinfo(ifname, &port[0], &Hints, &AddrInfo);
if (RetVal != 0) {
fprintf(stderr, "BIP6: getaddrinfo failed with error %d: %s\n",
RetVal, gai_strerror(RetVal));
WSACleanup();
return;
}
//
// Find the first matching address getaddrinfo returned so that
// we can create a new socket and bind that address to it,
// and create a queue to listen on.
//
for (i = 0, AI = AddrInfo; AI != NULL; AI = AI->ai_next) {
// Highly unlikely, but check anyway.
if (i == FD_SETSIZE) {
fprintf(stderr,
"BIP6: getaddrinfo returned more addresses than we could use.\n");
break;
}
// only support PF_INET6.
if (AI->ai_family != PF_INET6) {
continue;
}
// only support SOCK_DGRAM.
if (AI->ai_socktype != SOCK_DGRAM) {
continue;
}
// only support IPPROTO_UDP.
if (AI->ai_protocol != IPPROTO_UDP) {
continue;
}
BIP6_Socket = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP);
if (BIP6_Socket == INVALID_SOCKET) {
fprintf(stderr, "BIP6: socket() failed with error %d: %s\n",
WSAGetLastError(), PrintError(WSAGetLastError()));
continue;
}
if ((AI->ai_family == PF_INET6) &&
IN6_IS_ADDR_LINKLOCAL(AI->ai_addr) &&
(((SOCKADDR_IN6 *) (AI->ai_addr))->sin6_scope_id == 0)) {
fprintf(stderr,
"BIP6: IPv6 link local addresses needs a scope ID!\n");
}
/* Allow us to use the same socket for sending and receiving */
/* This makes sure that the src port is correct when sending */
sockopt = 1;
RetVal =
setsockopt(BIP6_Socket, SOL_SOCKET, SO_REUSEADDR,
(char *)&sockopt, sizeof(sockopt));
if (RetVal < 0) {
closesocket(BIP6_Socket);
BIP6_Socket = INVALID_SOCKET;
continue;
}
/* allow us to send a broadcast */
RetVal =
setsockopt(BIP6_Socket, SOL_SOCKET, SO_BROADCAST,
(char *)&sockopt, sizeof(sockopt));
if (RetVal < 0) {
closesocket(BIP6_Socket);
BIP6_Socket = INVALID_SOCKET;
fprintf(stderr, "BIP6: setsockopt(SO_BROADCAST) failed "
"with error %d: %s\n",
WSAGetLastError(), PrintError(WSAGetLastError()));
continue;
}
/* subscribe to a multicast address */
memcpy(&broadcast_address.s6_addr[0], &BIP6_Broadcast_Addr.address[0],
IP6_ADDRESS_MAX);
memcpy(&join_request.ipv6mr_multiaddr, &broadcast_address,
sizeof(struct in6_addr));
/* Let system choose the interface */
join_request.ipv6mr_interface = 0;
RetVal = setsockopt(BIP6_Socket, IPPROTO_IPV6, IPV6_JOIN_GROUP,
(char *)&join_request, sizeof(join_request));
if (RetVal < 0) {
fprintf(stderr, "BIP6: setsockopt(IPV6_JOIN_GROUP) failed "
"with error %d: %s\n",
WSAGetLastError(), PrintError(WSAGetLastError()));
}
//
// bind() associates a local address and port combination
// with the socket just created. This is most useful when
// the application is a server that has a well-known port
// that clients know about in advance.
//
memset(&server, 0, sizeof(server));
server.sin6_family = PF_INET6;
server.sin6_port = htons(BIP6_Addr.port);
server.sin6_addr = in6addr_any;
if (bind(BIP6_Socket, (struct sockaddr *) &server, sizeof(server)) ==
SOCKET_ERROR) {
fprintf(stderr, "BIP6: bind() failed with error %d: %s\n",
WSAGetLastError(), PrintError(WSAGetLastError()));
closesocket(ServSock[i]);
continue;
} else {
sin = (struct sockaddr_in6*)AI->ai_addr;
bvlc6_address_set(&BIP6_Addr,
ntohs(sin->sin6_addr.s6_addr16[0]),
ntohs(sin->sin6_addr.s6_addr16[1]),
ntohs(sin->sin6_addr.s6_addr16[2]),
ntohs(sin->sin6_addr.s6_addr16[3]),
ntohs(sin->sin6_addr.s6_addr16[4]),
ntohs(sin->sin6_addr.s6_addr16[5]),
ntohs(sin->sin6_addr.s6_addr16[6]),
ntohs(sin->sin6_addr.s6_addr16[7]));
/* https://msdn.microsoft.com/en-us/library/windows/desktop/ms740496(v=vs.85).aspx */
}
i++;
if (BIP6_Socket != INVALID_SOCKET) {
break;
}
}
freeaddrinfo(AddrInfo);
}
/**
* Set the BACnet IPv6 UDP port number
*
* @param port - IPv6 UDP port number
*/
void bip6_set_port(
uint16_t port)
{
BIP6_Addr.port = port;
BIP6_Broadcast_Addr.port = port;
}
/**
* Get the BACnet IPv6 UDP port number
*
* @return IPv6 UDP port number
*/
uint16_t bip6_get_port(
void)
{
return BIP6_Addr.port;
}
/**
* Get the BACnet broadcast address for my interface.
* Used as dest address in messages sent as BROADCAST
*
* @param addr - IPv6 source address
*/
void bip6_get_broadcast_address(
BACNET_ADDRESS * addr)
{
if (addr) {
addr->net = BACNET_BROADCAST_NETWORK;
addr->mac_len = 0;
addr->len = 0;
}
}
/**
* Get the IPv6 address for my interface. Used as src address in messages sent.
*
* @param addr - IPv6 source address
*/
void bip6_get_my_address(
BACNET_ADDRESS * addr)
{
uint32_t device_id = 0;
if (addr) {
device_id = Device_Object_Instance_Number();
bvlc6_vmac_address_set(addr, device_id);
}
}
/**
* Set the BACnet/IP address
*
* @param addr - network IPv6 address
*/
bool bip6_set_addr(
BACNET_IP6_ADDRESS *addr)
{
return bvlc6_address_copy(&BIP6_Addr, addr);
}
/**
* Get the BACnet/IP address
*
* @return BACnet/IP address
*/
bool bip6_get_addr(
BACNET_IP6_ADDRESS *addr)
{
return bvlc6_address_copy(addr, &BIP6_Addr);
}
/**
* Determine if the BACnet/IPv6 address matches our own address
*
* @param addr - network IPv6 address
*
* @return true if the BACnet/IPv6 address matches our own address
*/
bool bip6_address_match_self(
BACNET_IP6_ADDRESS *addr)
{
return !bvlc6_address_different(addr, &BIP6_Addr);
}
/**
* Set the BACnet/IP address
*
* @param addr - network IPv6 address
*/
bool bip6_set_broadcast_addr(
BACNET_IP6_ADDRESS *addr)
{
return bvlc6_address_copy(&BIP6_Broadcast_Addr, addr);
}
/**
* Get the BACnet/IP address
*
* @return BACnet/IP address
*/
bool bip6_get_broadcast_addr(
BACNET_IP6_ADDRESS *addr)
{
return bvlc6_address_copy(addr, &BIP6_Broadcast_Addr);
}
/**
* The send function for BACnet/IPv6 driver layer
*
* @param dest - Points to a BACNET_IP6_ADDRESS structure containing the
* destination address.
* @param mtu - the bytes of data to send
* @param mtu_len - the number of bytes of data to send
*
* @return Upon successful completion, returns the number of bytes sent.
* Otherwise, -1 shall be returned and errno set to indicate the error.
*/
int bip6_send_mpdu(
BACNET_IP6_ADDRESS *dest,
uint8_t * mtu,
uint16_t mtu_len)
{
struct sockaddr_in6 bvlc_dest = { 0 };
uint16_t addr16[8];
/* assumes that the driver has already been initialized */
if (BIP6_Socket < 0) {
return 0;
}
/* load destination IP address */
bvlc_dest.sin6_family = AF_INET6;
bvlc6_address_get(dest, &addr16[0], &addr16[1], &addr16[2], &addr16[3],
&addr16[4], &addr16[5], &addr16[6], &addr16[7]);
bvlc_dest.sin6_addr.s6_addr16[0] = htons(addr16[0]);
bvlc_dest.sin6_addr.s6_addr16[1] = htons(addr16[1]);
bvlc_dest.sin6_addr.s6_addr16[2] = htons(addr16[2]);
bvlc_dest.sin6_addr.s6_addr16[3] = htons(addr16[3]);
bvlc_dest.sin6_addr.s6_addr16[4] = htons(addr16[4]);
bvlc_dest.sin6_addr.s6_addr16[5] = htons(addr16[5]);
bvlc_dest.sin6_addr.s6_addr16[6] = htons(addr16[6]);
bvlc_dest.sin6_addr.s6_addr16[7] = htons(addr16[7]);
bvlc_dest.sin6_port = htons(dest->port);
debug_print_ipv6("BIP6: Sending MPDU->", &bvlc_dest.sin6_addr);
/* Send the packet */
return sendto(BIP6_Socket, (char *) mtu, mtu_len, 0,
(struct sockaddr *) &bvlc_dest, sizeof(bvlc_dest));
}
/**
* BACnet/IP Datalink Receive handler.
*
* @param src - returns the source address
* @param npdu - returns the NPDU buffer
* @param max_npdu -maximum size of the NPDU buffer
* @param timeout - number of milliseconds to wait for a packet
*
* @return Number of bytes received, or 0 if none or timeout.
*/
uint16_t bip6_receive(
BACNET_ADDRESS * src,
uint8_t * npdu,
uint16_t max_npdu,
unsigned timeout)
{
uint16_t npdu_len = 0; /* return value */
fd_set read_fds;
int max = 0;
struct timeval select_timeout;
struct sockaddr_in6 sin = { 0 };
BACNET_IP6_ADDRESS addr = {{ 0 }};
socklen_t sin_len = sizeof(sin);
int received_bytes = 0;
int offset = 0;
uint16_t i = 0;
/* Make sure the socket is open */
if (BIP6_Socket < 0) {
return 0;
}
/* we could just use a non-blocking socket, but that consumes all
the CPU time. We can use a timeout; it is only supported as
a select. */
if (timeout >= 1000) {
select_timeout.tv_sec = timeout / 1000;
select_timeout.tv_usec =
1000 * (timeout - select_timeout.tv_sec * 1000);
} else {
select_timeout.tv_sec = 0;
select_timeout.tv_usec = 1000 * timeout;
}
FD_ZERO(&read_fds);
FD_SET(BIP6_Socket, &read_fds);
max = BIP6_Socket;
/* see if there is a packet for us */
if (select(max + 1, &read_fds, NULL, NULL, &select_timeout) > 0) {
received_bytes =
recvfrom(BIP6_Socket, (char *) &npdu[0], max_npdu, 0,
(struct sockaddr *) &sin, &sin_len);
} else {
return 0;
}
/* See if there is a problem */
if (received_bytes < 0) {
return 0;
}
/* no problem, just no bytes */
if (received_bytes == 0) {
return 0;
}
/* the signature of a BACnet/IPv6 packet */
if (npdu[0] != BVLL_TYPE_BACNET_IP6) {
return 0;
}
/* pass the packet into the BBMD handler */
memcpy(&addr.address[0], &(sin.sin6_addr), 16);
memcpy(&addr.port, &sin.sin6_port, 2);
offset = bvlc6_handler(&addr, src, npdu, received_bytes);
if (offset > 0) {
npdu_len = received_bytes - offset;
if (npdu_len <= max_npdu) {
/* shift the buffer to return a valid NPDU */
for (i = 0; i < npdu_len; i++) {
npdu[i] = npdu[offset + i];
}
} else {
npdu_len = 0;
}
}
return npdu_len;
}
/** Cleanup and close out the BACnet/IP services by closing the socket.
* @ingroup DLBIP6
*/
void bip6_cleanup(
void)
{
if (BIP6_Socket != -1) {
close(BIP6_Socket);
}
BIP6_Socket = -1;
WSACleanup();
return;
}
/** Initialize the BACnet/IP services at the given interface.
* @ingroup DLBIP6
* -# Gets the local IP address and local broadcast address from the system,
* and saves it into the BACnet/IPv6 data structures.
* -# Opens a UDP socket
* -# Configures the socket for sending and receiving
* -# Configures the socket so it can send multicasts
* -# Binds the socket to the local IP address at the specified port for
* BACnet/IPv6 (by default, 0xBAC0 = 47808).
*
* @note For Windows, ifname is the IPv6 address of the interface.
*
* https://msdn.microsoft.com/en-us/library/windows/desktop/ms738639(v=vs.85).aspx
*
* @param ifname [in] The named interface to use for the network layer.
*
* @return True if the socket is successfully opened for BACnet/IPv6,
* else False if the socket functions fail.
*/
bool bip6_init(
char *ifname)
{
WSADATA wd;
int RetVal;
// Ask for Winsock version 2.2.
if ((RetVal = WSAStartup(MAKEWORD(2, 2), &wd)) != 0) {
fprintf(stderr, "BIP6: WSAStartup failed with error %d: %s\n",
RetVal, PrintError(RetVal));
WSACleanup();
exit(1);
}
if (BIP6_Addr.port == 0) {
bip6_set_port(0xBAC0);
}
debug_printf("BIP6: IPv6 UDP port: 0x%04X\n", BIP6_Addr.port);
bip6_set_interface(ifname);
if (BIP6_Broadcast_Addr.address[0] == 0) {
bvlc6_address_set(&BIP6_Broadcast_Addr,
BIP6_MULTICAST_LINK_LOCAL, 0, 0, 0, 0, 0, 0,
BIP6_MULTICAST_GROUP_ID);
}
if (BIP6_Socket == INVALID_SOCKET) {
fprintf(stderr, "BIP6: Fatal error: unable to serve on any address.\n");
WSACleanup();
exit(1);
}
return true;
}
+7
View File
@@ -0,0 +1,7 @@
@echo off
echo Build for Borland 5.5 tools
set BORLAND_DIR=c:\borland\bcc55
%BORLAND_DIR%\bin\make -f makefile.mak clean
%BORLAND_DIR%\bin\make -f makefile.mak all
+734
View File
@@ -0,0 +1,734 @@
/**************************************************************************
*
* Copyright (C) 2006 Steve Karg <skarg@users.sourceforge.net>
* Multimedia Timer contribution by Cameron Crothers, 2008
*
* 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.
*
*********************************************************************/
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "bacdef.h"
#include "bacaddr.h"
#include "mstp.h"
#include "dlmstp.h"
#include "rs485.h"
#include "npdu.h"
#include "bits.h"
#define WIN32_LEAN_AND_MEAN
#define STRICT 1
#include <windows.h>
#include <MMSystem.h> /* for multimedia timers */
/* Number of MS/TP Packets Rx/Tx */
uint16_t MSTP_Packets = 0;
/* packet queues */
static DLMSTP_PACKET Receive_Packet;
static HANDLE Receive_Packet_Flag;
/* mechanism to wait for a frame in state machine */
HANDLE Received_Frame_Flag;
static DLMSTP_PACKET Transmit_Packet;
/* local MS/TP port data - shared with RS-485 */
volatile struct mstp_port_struct_t MSTP_Port;
/* buffers needed by mstp port struct */
static uint8_t TxBuffer[MAX_MPDU];
static uint8_t RxBuffer[MAX_MPDU];
/* Timer that indicates line silence - and functions */
static uint32_t SilenceStartTime;
static uint32_t TimeBeginPeriod;
/* 1-millisecond target resolution */
#define TARGET_RESOLUTION 1
static uint16_t Timer_Silence(
void)
{
uint32_t now = timeGetTime();
uint32_t delta_time = 0;
if (SilenceStartTime < now) {
delta_time = now - SilenceStartTime;
} else {
delta_time = (UINT32_MAX - SilenceStartTime) + now + 1;
}
if (delta_time > 0xFFFF) {
delta_time = 0xFFFF;
}
return (uint16_t) delta_time;
}
static void Timer_Silence_Reset(
void)
{
SilenceStartTime = timeGetTime();
}
void dlmstp_reinit(
void)
{
/*RS485_Reinit(); */
dlmstp_set_mac_address(DEFAULT_MAC_ADDRESS);
dlmstp_set_max_info_frames(DEFAULT_MAX_INFO_FRAMES);
dlmstp_set_max_master(DEFAULT_MAX_MASTER);
/* reset timer resolution */
timeEndPeriod(TimeBeginPeriod);
}
void dlmstp_cleanup(
void)
{
/* nothing to do for static buffers */
if (Received_Frame_Flag) {
CloseHandle(Received_Frame_Flag);
}
if (Receive_Packet_Flag) {
CloseHandle(Receive_Packet_Flag);
}
}
/* returns number of bytes sent on success, zero on failure */
int dlmstp_send_pdu(
BACNET_ADDRESS * dest, /* destination address */
BACNET_NPDU_DATA * npdu_data, /* network information */
uint8_t * pdu, /* any data to be sent - may be null */
unsigned pdu_len)
{ /* number of bytes of data */
int bytes_sent = 0;
unsigned i = 0;
if (!Transmit_Packet.ready) {
if (npdu_data->data_expecting_reply) {
Transmit_Packet.frame_type =
FRAME_TYPE_BACNET_DATA_EXPECTING_REPLY;
} else {
Transmit_Packet.frame_type =
FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY;
}
Transmit_Packet.pdu_len = pdu_len;
for (i = 0; i < pdu_len; i++) {
Transmit_Packet.pdu[i] = pdu[i];
}
bacnet_address_copy(&Transmit_Packet.address, dest);
bytes_sent = pdu_len + MAX_HEADER;
Transmit_Packet.ready = true;
}
return bytes_sent;
}
uint16_t dlmstp_receive(
BACNET_ADDRESS * src, /* source address */
uint8_t * pdu, /* PDU data */
uint16_t max_pdu, /* amount of space available in the PDU */
unsigned timeout)
{ /* milliseconds to wait for a packet */
uint16_t pdu_len = 0;
DWORD wait_status = 0;
(void) max_pdu;
/* see if there is a packet available, and a place
to put the reply (if necessary) and process it */
wait_status = WaitForSingleObject(Receive_Packet_Flag, timeout);
if (wait_status == WAIT_OBJECT_0) {
if (Receive_Packet.ready) {
if (Receive_Packet.pdu_len) {
MSTP_Packets++;
if (src) {
memmove(src, &Receive_Packet.address,
sizeof(Receive_Packet.address));
}
if (pdu) {
memmove(pdu, &Receive_Packet.pdu,
sizeof(Receive_Packet.pdu));
}
pdu_len = Receive_Packet.pdu_len;
}
Receive_Packet.ready = false;
}
}
return pdu_len;
}
static void dlmstp_receive_fsm_task(
void *pArg)
{
bool received_frame;
(void) pArg;
(void) SetThreadPriority(GetCurrentThread(),
THREAD_PRIORITY_TIME_CRITICAL);
while (TRUE) {
/* only do receive state machine while we don't have a frame */
if ((MSTP_Port.ReceivedValidFrame == false) &&
(MSTP_Port.ReceivedInvalidFrame == false)) {
do {
RS485_Check_UART_Data(&MSTP_Port);
MSTP_Receive_Frame_FSM(&MSTP_Port);
received_frame = MSTP_Port.ReceivedValidFrame ||
MSTP_Port.ReceivedInvalidFrame;
if (received_frame) {
ReleaseSemaphore(Received_Frame_Flag, 1, NULL);
break;
}
} while (MSTP_Port.DataAvailable);
}
}
}
static void dlmstp_master_fsm_task(
void *pArg)
{
DWORD dwMilliseconds = 0;
(void) pArg;
(void) SetThreadPriority(GetCurrentThread(),
THREAD_PRIORITY_TIME_CRITICAL);
while (TRUE) {
switch (MSTP_Port.master_state) {
case MSTP_MASTER_STATE_IDLE:
dwMilliseconds = Tno_token;
break;
case MSTP_MASTER_STATE_WAIT_FOR_REPLY:
dwMilliseconds = Treply_timeout;
break;
case MSTP_MASTER_STATE_POLL_FOR_MASTER:
dwMilliseconds = Tusage_timeout;
break;
default:
dwMilliseconds = 0;
break;
}
if (dwMilliseconds)
WaitForSingleObject(Received_Frame_Flag, dwMilliseconds);
MSTP_Master_Node_FSM(&MSTP_Port);
}
}
void dlmstp_fill_bacnet_address(
BACNET_ADDRESS * src,
uint8_t mstp_address)
{
int i = 0;
if (mstp_address == MSTP_BROADCAST_ADDRESS) {
/* mac_len = 0 if broadcast address */
src->mac_len = 0;
src->mac[0] = 0;
} else {
src->mac_len = 1;
src->mac[0] = mstp_address;
}
/* fill with 0's starting with index 1; index 0 filled above */
for (i = 1; i < MAX_MAC_LEN; i++) {
src->mac[i] = 0;
}
src->net = 0;
src->len = 0;
for (i = 0; i < MAX_MAC_LEN; i++) {
src->adr[i] = 0;
}
}
/* for the MS/TP state machine to use for putting received data */
uint16_t MSTP_Put_Receive(
volatile struct mstp_port_struct_t *mstp_port)
{
uint16_t pdu_len = 0;
BOOL rc;
if (!Receive_Packet.ready) {
/* bounds check - maybe this should send an abort? */
pdu_len = mstp_port->DataLength;
if (pdu_len > sizeof(Receive_Packet.pdu))
pdu_len = sizeof(Receive_Packet.pdu);
memmove((void *) &Receive_Packet.pdu[0],
(void *) &mstp_port->InputBuffer[0], pdu_len);
dlmstp_fill_bacnet_address(&Receive_Packet.address,
mstp_port->SourceAddress);
Receive_Packet.pdu_len = mstp_port->DataLength;
Receive_Packet.ready = true;
rc = ReleaseSemaphore(Receive_Packet_Flag, 1, NULL);
}
return pdu_len;
}
/* for the MS/TP state machine to use for getting data to send */
/* Return: amount of PDU data */
uint16_t MSTP_Get_Send(
volatile struct mstp_port_struct_t * mstp_port,
unsigned timeout)
{ /* milliseconds to wait for a packet */
uint16_t pdu_len = 0;
uint8_t destination = 0; /* destination address */
(void) timeout;
if (!Transmit_Packet.ready) {
return 0;
}
/* load destination MAC address */
/* load destination MAC address */
if (Transmit_Packet.address.mac_len) {
destination = Transmit_Packet.address.mac[0];
} else {
destination = MSTP_BROADCAST_ADDRESS;
}
if ((MAX_HEADER + Transmit_Packet.pdu_len) > MAX_MPDU) {
return 0;
}
/* convert the PDU into the MSTP Frame */
pdu_len = MSTP_Create_Frame(&mstp_port->OutputBuffer[0], /* <-- loading this */
mstp_port->OutputBufferSize, Transmit_Packet.frame_type, destination,
mstp_port->This_Station, &Transmit_Packet.pdu[0],
Transmit_Packet.pdu_len);
Transmit_Packet.ready = false;
return pdu_len;
}
bool dlmstp_compare_data_expecting_reply(
uint8_t * request_pdu,
uint16_t request_pdu_len,
uint8_t src_address,
uint8_t * reply_pdu,
uint16_t reply_pdu_len,
BACNET_ADDRESS * dest_address)
{
uint16_t offset;
/* One way to check the message is to compare NPDU
src, dest, along with the APDU type, invoke id.
Seems a bit overkill */
struct DER_compare_t {
BACNET_NPDU_DATA npdu_data;
BACNET_ADDRESS address;
uint8_t pdu_type;
uint8_t invoke_id;
uint8_t service_choice;
};
struct DER_compare_t request;
struct DER_compare_t reply;
/* unused parameters */
request_pdu_len = request_pdu_len;
reply_pdu_len = reply_pdu_len;
/* decode the request data */
request.address.mac[0] = src_address;
request.address.mac_len = 1;
offset =
npdu_decode(&request_pdu[0], NULL, &request.address,
&request.npdu_data);
if (request.npdu_data.network_layer_message) {
return false;
}
request.pdu_type = request_pdu[offset] & 0xF0;
if (request.pdu_type != PDU_TYPE_CONFIRMED_SERVICE_REQUEST) {
return false;
}
request.invoke_id = request_pdu[offset + 2];
/* segmented message? */
if (request_pdu[offset] & BIT3)
request.service_choice = request_pdu[offset + 5];
else
request.service_choice = request_pdu[offset + 3];
/* decode the reply data */
bacnet_address_copy(&reply.address, dest_address);
offset =
npdu_decode(&reply_pdu[0], &reply.address, NULL, &reply.npdu_data);
if (reply.npdu_data.network_layer_message) {
return false;
}
/* reply could be a lot of things:
confirmed, simple ack, abort, reject, error */
reply.pdu_type = reply_pdu[offset] & 0xF0;
switch (reply.pdu_type) {
case PDU_TYPE_SIMPLE_ACK:
reply.invoke_id = reply_pdu[offset + 1];
reply.service_choice = reply_pdu[offset + 2];
break;
case PDU_TYPE_COMPLEX_ACK:
reply.invoke_id = reply_pdu[offset + 1];
/* segmented message? */
if (reply_pdu[offset] & BIT3)
reply.service_choice = reply_pdu[offset + 4];
else
reply.service_choice = reply_pdu[offset + 2];
break;
case PDU_TYPE_ERROR:
reply.invoke_id = reply_pdu[offset + 1];
reply.service_choice = reply_pdu[offset + 2];
break;
case PDU_TYPE_REJECT:
case PDU_TYPE_ABORT:
reply.invoke_id = reply_pdu[offset + 1];
break;
default:
return false;
}
/* these don't have service choice included */
if ((reply.pdu_type == PDU_TYPE_REJECT) ||
(reply.pdu_type == PDU_TYPE_ABORT)) {
if (request.invoke_id != reply.invoke_id) {
return false;
}
} else {
if (request.invoke_id != reply.invoke_id) {
return false;
}
if (request.service_choice != reply.service_choice) {
return false;
}
}
if (request.npdu_data.protocol_version != reply.npdu_data.protocol_version) {
return false;
}
#if 0
/* the NDPU priority doesn't get passed through the stack, and
all outgoing messages have NORMAL priority */
if (request.npdu_data.priority != reply.npdu_data.priority) {
return false;
}
#endif
if (!bacnet_address_same(&request.address, &reply.address)) {
return false;
}
return true;
}
/* Get the reply to a DATA_EXPECTING_REPLY frame, or nothing */
uint16_t MSTP_Get_Reply(
volatile struct mstp_port_struct_t * mstp_port,
unsigned timeout)
{ /* milliseconds to wait for a packet */
uint16_t pdu_len = 0; /* return value */
uint8_t destination = 0; /* destination address */
bool matched = false;
(void) timeout;
if (!Transmit_Packet.ready) {
return 0;
}
/* load destination MAC address */
if (Transmit_Packet.address.mac_len == 1) {
destination = Transmit_Packet.address.mac[0];
} else {
return 0;
}
if ((MAX_HEADER + Transmit_Packet.pdu_len) > MAX_MPDU) {
return 0;
}
/* is this the reply to the DER? */
matched =
dlmstp_compare_data_expecting_reply(&mstp_port->InputBuffer[0],
mstp_port->DataLength, mstp_port->SourceAddress,
&Transmit_Packet.pdu[0], Transmit_Packet.pdu_len,
&Transmit_Packet.address);
if (!matched)
return 0;
/* convert the PDU into the MSTP Frame */
pdu_len = MSTP_Create_Frame(&mstp_port->OutputBuffer[0], /* <-- loading this */
mstp_port->OutputBufferSize, Transmit_Packet.frame_type, destination,
mstp_port->This_Station, &Transmit_Packet.pdu[0],
Transmit_Packet.pdu_len);
Transmit_Packet.ready = false;
return pdu_len;
}
void dlmstp_set_mac_address(
uint8_t mac_address)
{
/* Master Nodes can only have address 0-127 */
if (mac_address <= 127) {
MSTP_Port.This_Station = mac_address;
/* FIXME: implement your data storage */
/* I2C_Write_Byte(
EEPROM_DEVICE_ADDRESS,
mac_address,
EEPROM_MSTP_MAC_ADDR); */
if (mac_address > MSTP_Port.Nmax_master)
dlmstp_set_max_master(mac_address);
}
return;
}
uint8_t dlmstp_mac_address(
void)
{
return MSTP_Port.This_Station;
}
/* This parameter represents the value of the Max_Info_Frames property of */
/* the node's Device object. The value of Max_Info_Frames specifies the */
/* maximum number of information frames the node may send before it must */
/* pass the token. Max_Info_Frames may have different values on different */
/* nodes. This may be used to allocate more or less of the available link */
/* bandwidth to particular nodes. If Max_Info_Frames is not writable in a */
/* node, its value shall be 1. */
void dlmstp_set_max_info_frames(
uint8_t max_info_frames)
{
if (max_info_frames >= 1) {
MSTP_Port.Nmax_info_frames = max_info_frames;
/* FIXME: implement your data storage */
/* I2C_Write_Byte(
EEPROM_DEVICE_ADDRESS,
(uint8_t)max_info_frames,
EEPROM_MSTP_MAX_INFO_FRAMES_ADDR); */
}
return;
}
uint8_t dlmstp_max_info_frames(
void)
{
return MSTP_Port.Nmax_info_frames;
}
/* This parameter represents the value of the Max_Master property of the */
/* node's Device object. The value of Max_Master specifies the highest */
/* allowable address for master nodes. The value of Max_Master shall be */
/* less than or equal to 127. If Max_Master is not writable in a node, */
/* its value shall be 127. */
void dlmstp_set_max_master(
uint8_t max_master)
{
if (max_master <= 127) {
if (MSTP_Port.This_Station <= max_master) {
MSTP_Port.Nmax_master = max_master;
/* FIXME: implement your data storage */
/* I2C_Write_Byte(
EEPROM_DEVICE_ADDRESS,
max_master,
EEPROM_MSTP_MAX_MASTER_ADDR); */
}
}
return;
}
uint8_t dlmstp_max_master(
void)
{
return MSTP_Port.Nmax_master;
}
/* RS485 Baud Rate 9600, 19200, 38400, 57600, 115200 */
void dlmstp_set_baud_rate(
uint32_t baud)
{
RS485_Set_Baud_Rate(baud);
}
uint32_t dlmstp_baud_rate(
void)
{
return RS485_Get_Baud_Rate();
}
void dlmstp_get_my_address(
BACNET_ADDRESS * my_address)
{
int i = 0; /* counter */
my_address->mac_len = 1;
my_address->mac[0] = MSTP_Port.This_Station;
my_address->net = 0; /* local only, no routing */
my_address->len = 0;
for (i = 0; i < MAX_MAC_LEN; i++) {
my_address->adr[i] = 0;
}
return;
}
void dlmstp_get_broadcast_address(
BACNET_ADDRESS * dest)
{ /* destination address */
int i = 0; /* counter */
if (dest) {
dest->mac_len = 1;
dest->mac[0] = MSTP_BROADCAST_ADDRESS;
dest->net = BACNET_BROADCAST_NETWORK;
dest->len = 0; /* always zero when DNET is broadcast */
for (i = 0; i < MAX_MAC_LEN; i++) {
dest->adr[i] = 0;
}
}
return;
}
bool dlmstp_init(
char *ifname)
{
unsigned long hThread = 0;
uint32_t arg_value = 0;
TIMECAPS tc;
/* initialize packet queue */
Receive_Packet.ready = false;
Receive_Packet.pdu_len = 0;
Receive_Packet_Flag = CreateSemaphore(NULL, 0, 1, "dlmstpReceivePacket");
if (Receive_Packet_Flag == NULL)
exit(1);
Received_Frame_Flag = CreateSemaphore(NULL, 0, 1, "dlsmtpReceiveFrame");
if (Received_Frame_Flag == NULL) {
CloseHandle(Receive_Packet_Flag);
exit(1);
}
/* initialize hardware */
/* initialize hardware */
if (ifname) {
RS485_Set_Interface(ifname);
#if PRINT_ENABLED
fprintf(stderr, "MS/TP Interface: %s\n", ifname);
#endif
}
RS485_Initialize();
MSTP_Port.InputBuffer = &RxBuffer[0];
MSTP_Port.InputBufferSize = sizeof(RxBuffer);
MSTP_Port.OutputBuffer = &TxBuffer[0];
MSTP_Port.OutputBufferSize = sizeof(TxBuffer);
MSTP_Port.SilenceTimer = Timer_Silence;
MSTP_Port.SilenceTimerReset = Timer_Silence_Reset;
MSTP_Init(&MSTP_Port);
#if 0
uint8_t data;
/* FIXME: implement your data storage */
data = 64; /* I2C_Read_Byte(
EEPROM_DEVICE_ADDRESS,
EEPROM_MSTP_MAC_ADDR); */
if (data <= 127)
MSTP_Port.This_Station = data;
else
dlmstp_set_my_address(DEFAULT_MAC_ADDRESS);
/* FIXME: implement your data storage */
data = 127; /* I2C_Read_Byte(
EEPROM_DEVICE_ADDRESS,
EEPROM_MSTP_MAX_MASTER_ADDR); */
if ((data <= 127) && (data >= MSTP_Port.This_Station))
MSTP_Port.Nmax_master = data;
else
dlmstp_set_max_master(DEFAULT_MAX_MASTER);
/* FIXME: implement your data storage */
data = 1;
/* I2C_Read_Byte(
EEPROM_DEVICE_ADDRESS,
EEPROM_MSTP_MAX_INFO_FRAMES_ADDR); */
if (data >= 1)
MSTP_Port.Nmax_info_frames = data;
else
dlmstp_set_max_info_frames(DEFAULT_MAX_INFO_FRAMES);
#endif
#if PRINT_ENABLED
fprintf(stderr, "MS/TP MAC: %02X\n", MSTP_Port.This_Station);
fprintf(stderr, "MS/TP Max_Master: %02X\n", MSTP_Port.Nmax_master);
fprintf(stderr, "MS/TP Max_Info_Frames: %u\n", MSTP_Port.Nmax_info_frames);
#endif
/* set timer resolution */
if (timeGetDevCaps(&tc, sizeof(TIMECAPS)) != TIMERR_NOERROR) {
fprintf(stderr, "Failed to set timer resolution\n");
}
TimeBeginPeriod =
min(max(tc.wPeriodMin, TARGET_RESOLUTION), tc.wPeriodMax);
timeBeginPeriod(TimeBeginPeriod);
/* start the threads */
hThread = _beginthread(dlmstp_receive_fsm_task, 4096, &arg_value);
if (hThread == 0) {
fprintf(stderr, "Failed to start recive FSM task\n");
}
hThread = _beginthread(dlmstp_master_fsm_task, 4096, &arg_value);
if (hThread == 0) {
fprintf(stderr, "Failed to start Master Node FSM task\n");
}
return true;
}
#ifdef TEST_DLMSTP
#include <stdio.h>
void apdu_handler(
BACNET_ADDRESS * src, /* source address */
uint8_t * apdu, /* APDU data */
uint16_t pdu_len)
{ /* for confirmed messages */
(void) src;
(void) apdu;
(void) pdu_len;
}
/* returns a delta timestamp */
uint32_t timestamp_ms(
void)
{
DWORD ticks = 0, delta_ticks = 0;
static DWORD last_ticks = 0;
ticks = GetTickCount();
delta_ticks =
(ticks >= last_ticks ? ticks - last_ticks : MAXDWORD - last_ticks);
last_ticks = ticks;
return delta_ticks;
}
static char *Network_Interface = "COM3";
int main(
int argc,
char *argv[])
{
uint16_t pdu_len = 0;
/* argv has the "COM4" or some other device */
if (argc > 1) {
Network_Interface = argv[1];
}
dlmstp_set_baud_rate(38400);
dlmstp_set_mac_address(0x05);
dlmstp_set_max_info_frames(DEFAULT_MAX_INFO_FRAMES);
dlmstp_set_max_master(DEFAULT_MAX_MASTER);
dlmstp_init(Network_Interface);
/* forever task */
for (;;) {
pdu_len = dlmstp_receive(NULL, NULL, 0, INFINITE);
#if 0
MSTP_Create_And_Send_Frame(&MSTP_Port, FRAME_TYPE_TEST_REQUEST,
MSTP_Port.SourceAddress, MSTP_Port.This_Station, NULL, 0);
#endif
}
return 0;
}
#endif
+710
View File
@@ -0,0 +1,710 @@
/**************************************************************************
*
* 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.
*
*********************************************************************/
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifdef __BORLANDC__
#include <process.h>
#endif
#include "bacdef.h"
#include "bacaddr.h"
#include "mstp.h"
#include "dlmstp.h"
#include "rs485.h"
#include "npdu.h"
#include "bits.h"
#include "ringbuf.h"
#include "timer.h"
#define WIN32_LEAN_AND_MEAN
#define STRICT 1
#include <windows.h>
/* Number of MS/TP Packets Rx/Tx */
uint16_t MSTP_Packets = 0;
/* packet queues */
static DLMSTP_PACKET Receive_Packet;
static HANDLE Receive_Packet_Flag;
/* mechanism to wait for a frame in state machine */
HANDLE Received_Frame_Flag;
static DLMSTP_PACKET Transmit_Packet;
/* local MS/TP port data - shared with RS-485 */
volatile struct mstp_port_struct_t MSTP_Port;
/* buffers needed by mstp port struct */
static uint8_t TxBuffer[MAX_MPDU];
static uint8_t RxBuffer[MAX_MPDU];
/* The minimum time without a DataAvailable or ReceiveError event */
/* that a node must wait for a station to begin replying to a */
/* confirmed request: 255 milliseconds. (Implementations may use */
/* larger values for this timeout, not to exceed 300 milliseconds.) */
static uint16_t Treply_timeout = 260;
/* The minimum time without a DataAvailable or ReceiveError event that a */
/* node must wait for a remote node to begin using a token or replying to */
/* a Poll For Master frame: 20 milliseconds. (Implementations may use */
/* larger values for this timeout, not to exceed 100 milliseconds.) */
static uint8_t Tusage_timeout = 50;
/* Timer that indicates line silence - and functions */
static uint32_t Timer_Silence(
void *pArg)
{
return timer_milliseconds(TIMER_SILENCE);
}
static void Timer_Silence_Reset(
void *pArg)
{
timer_reset(TIMER_SILENCE);
}
void dlmstp_cleanup(
void)
{
/* nothing to do for static buffers */
if (Received_Frame_Flag) {
CloseHandle(Received_Frame_Flag);
}
if (Receive_Packet_Flag) {
CloseHandle(Receive_Packet_Flag);
}
}
/* returns number of bytes sent on success, zero on failure */
int dlmstp_send_pdu(
BACNET_ADDRESS * dest, /* destination address */
BACNET_NPDU_DATA * npdu_data, /* network information */
uint8_t * pdu, /* any data to be sent - may be null */
unsigned pdu_len)
{ /* number of bytes of data */
int bytes_sent = 0;
unsigned i = 0;
if (!Transmit_Packet.ready) {
if (npdu_data->data_expecting_reply) {
Transmit_Packet.frame_type =
FRAME_TYPE_BACNET_DATA_EXPECTING_REPLY;
} else {
Transmit_Packet.frame_type =
FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY;
}
Transmit_Packet.pdu_len = (uint16_t) pdu_len;
for (i = 0; i < pdu_len; i++) {
Transmit_Packet.pdu[i] = pdu[i];
}
bacnet_address_copy(&Transmit_Packet.address, dest);
bytes_sent = pdu_len + MAX_HEADER;
Transmit_Packet.ready = true;
}
return bytes_sent;
}
uint16_t dlmstp_receive(
BACNET_ADDRESS * src, /* source address */
uint8_t * pdu, /* PDU data */
uint16_t max_pdu, /* amount of space available in the PDU */
unsigned timeout)
{ /* milliseconds to wait for a packet */
uint16_t pdu_len = 0;
DWORD wait_status = 0;
(void) max_pdu;
/* see if there is a packet available, and a place
to put the reply (if necessary) and process it */
wait_status = WaitForSingleObject(Receive_Packet_Flag, timeout);
if (wait_status == WAIT_OBJECT_0) {
if (Receive_Packet.ready) {
if (Receive_Packet.pdu_len) {
MSTP_Packets++;
if (src) {
memmove(src, &Receive_Packet.address,
sizeof(Receive_Packet.address));
}
if (pdu) {
memmove(pdu, &Receive_Packet.pdu,
sizeof(Receive_Packet.pdu));
}
pdu_len = Receive_Packet.pdu_len;
}
Receive_Packet.ready = false;
}
}
return pdu_len;
}
static void dlmstp_receive_fsm_task(
void *pArg)
{
bool received_frame;
(void) pArg;
(void) SetThreadPriority(GetCurrentThread(),
THREAD_PRIORITY_TIME_CRITICAL);
for (;;) {
/* only do receive state machine while we don't have a frame */
if ((MSTP_Port.ReceivedValidFrame == false) &&
(MSTP_Port.ReceivedInvalidFrame == false)) {
do {
RS485_Check_UART_Data(&MSTP_Port);
MSTP_Receive_Frame_FSM(&MSTP_Port);
received_frame = MSTP_Port.ReceivedValidFrame ||
MSTP_Port.ReceivedInvalidFrame;
if (received_frame) {
ReleaseSemaphore(Received_Frame_Flag, 1, NULL);
break;
}
} while (MSTP_Port.DataAvailable);
}
}
}
static void dlmstp_master_fsm_task(
void *pArg)
{
DWORD dwMilliseconds = 0;
(void) pArg;
(void) SetThreadPriority(GetCurrentThread(),
THREAD_PRIORITY_TIME_CRITICAL);
for (;;) {
switch (MSTP_Port.master_state) {
case MSTP_MASTER_STATE_IDLE:
dwMilliseconds = Tno_token;
break;
case MSTP_MASTER_STATE_WAIT_FOR_REPLY:
dwMilliseconds = Treply_timeout;
break;
case MSTP_MASTER_STATE_POLL_FOR_MASTER:
dwMilliseconds = Tusage_timeout;
break;
default:
dwMilliseconds = 0;
break;
}
if (dwMilliseconds)
WaitForSingleObject(Received_Frame_Flag, dwMilliseconds);
MSTP_Master_Node_FSM(&MSTP_Port);
}
}
void dlmstp_fill_bacnet_address(
BACNET_ADDRESS * src,
uint8_t mstp_address)
{
int i = 0;
if (mstp_address == MSTP_BROADCAST_ADDRESS) {
/* mac_len = 0 if broadcast address */
src->mac_len = 0;
src->mac[0] = 0;
} else {
src->mac_len = 1;
src->mac[0] = mstp_address;
}
/* fill with 0's starting with index 1; index 0 filled above */
for (i = 1; i < MAX_MAC_LEN; i++) {
src->mac[i] = 0;
}
src->net = 0;
src->len = 0;
for (i = 0; i < MAX_MAC_LEN; i++) {
src->adr[i] = 0;
}
}
/* for the MS/TP state machine to use for putting received data */
uint16_t MSTP_Put_Receive(
volatile struct mstp_port_struct_t *mstp_port)
{
uint16_t pdu_len = 0;
BOOL rc;
if (!Receive_Packet.ready) {
/* bounds check - maybe this should send an abort? */
pdu_len = mstp_port->DataLength;
if (pdu_len > sizeof(Receive_Packet.pdu))
pdu_len = sizeof(Receive_Packet.pdu);
memmove((void *) &Receive_Packet.pdu[0],
(void *) &mstp_port->InputBuffer[0], pdu_len);
dlmstp_fill_bacnet_address(&Receive_Packet.address,
mstp_port->SourceAddress);
Receive_Packet.pdu_len = mstp_port->DataLength;
Receive_Packet.ready = true;
rc = ReleaseSemaphore(Receive_Packet_Flag, 1, NULL);
(void) rc;
}
return pdu_len;
}
/* for the MS/TP state machine to use for getting data to send */
/* Return: amount of PDU data */
uint16_t MSTP_Get_Send(
volatile struct mstp_port_struct_t * mstp_port,
unsigned timeout)
{ /* milliseconds to wait for a packet */
uint16_t pdu_len = 0;
uint8_t destination = 0; /* destination address */
(void) timeout;
if (!Transmit_Packet.ready) {
return 0;
}
/* load destination MAC address */
if (Transmit_Packet.address.mac_len) {
destination = Transmit_Packet.address.mac[0];
} else {
destination = MSTP_BROADCAST_ADDRESS;
}
if ((MAX_HEADER + Transmit_Packet.pdu_len) > MAX_MPDU) {
return 0;
}
/* convert the PDU into the MSTP Frame */
pdu_len = MSTP_Create_Frame(&mstp_port->OutputBuffer[0], /* <-- loading this */
mstp_port->OutputBufferSize, Transmit_Packet.frame_type, destination,
mstp_port->This_Station, &Transmit_Packet.pdu[0],
Transmit_Packet.pdu_len);
Transmit_Packet.ready = false;
return pdu_len;
}
static bool dlmstp_compare_data_expecting_reply(
uint8_t * request_pdu,
uint16_t request_pdu_len,
uint8_t src_address,
uint8_t * reply_pdu,
uint16_t reply_pdu_len,
BACNET_ADDRESS * dest_address)
{
uint16_t offset;
/* One way to check the message is to compare NPDU
src, dest, along with the APDU type, invoke id.
Seems a bit overkill */
struct DER_compare_t {
BACNET_NPDU_DATA npdu_data;
BACNET_ADDRESS address;
uint8_t pdu_type;
uint8_t invoke_id;
uint8_t service_choice;
};
struct DER_compare_t request;
struct DER_compare_t reply;
/* unused parameters */
request_pdu_len = request_pdu_len;
reply_pdu_len = reply_pdu_len;
/* decode the request data */
request.address.mac[0] = src_address;
request.address.mac_len = 1;
offset =
(uint16_t) npdu_decode(&request_pdu[0], NULL, &request.address,
&request.npdu_data);
if (request.npdu_data.network_layer_message) {
return false;
}
request.pdu_type = request_pdu[offset] & 0xF0;
if (request.pdu_type != PDU_TYPE_CONFIRMED_SERVICE_REQUEST) {
return false;
}
request.invoke_id = request_pdu[offset + 2];
/* segmented message? */
if (request_pdu[offset] & BIT3)
request.service_choice = request_pdu[offset + 5];
else
request.service_choice = request_pdu[offset + 3];
/* decode the reply data */
bacnet_address_copy(&reply.address, dest_address);
offset =
(uint16_t) npdu_decode(&reply_pdu[0], &reply.address, NULL,
&reply.npdu_data);
if (reply.npdu_data.network_layer_message) {
return false;
}
/* reply could be a lot of things:
confirmed, simple ack, abort, reject, error */
reply.pdu_type = reply_pdu[offset] & 0xF0;
switch (reply.pdu_type) {
case PDU_TYPE_SIMPLE_ACK:
reply.invoke_id = reply_pdu[offset + 1];
reply.service_choice = reply_pdu[offset + 2];
break;
case PDU_TYPE_COMPLEX_ACK:
reply.invoke_id = reply_pdu[offset + 1];
/* segmented message? */
if (reply_pdu[offset] & BIT3)
reply.service_choice = reply_pdu[offset + 4];
else
reply.service_choice = reply_pdu[offset + 2];
break;
case PDU_TYPE_ERROR:
reply.invoke_id = reply_pdu[offset + 1];
reply.service_choice = reply_pdu[offset + 2];
break;
case PDU_TYPE_REJECT:
case PDU_TYPE_ABORT:
reply.invoke_id = reply_pdu[offset + 1];
break;
default:
return false;
}
/* these don't have service choice included */
if ((reply.pdu_type == PDU_TYPE_REJECT) ||
(reply.pdu_type == PDU_TYPE_ABORT)) {
if (request.invoke_id != reply.invoke_id) {
return false;
}
} else {
if (request.invoke_id != reply.invoke_id) {
return false;
}
if (request.service_choice != reply.service_choice) {
return false;
}
}
if (request.npdu_data.protocol_version != reply.npdu_data.protocol_version) {
return false;
}
#if 0
/* the NDPU priority doesn't get passed through the stack, and
all outgoing messages have NORMAL priority */
if (request.npdu_data.priority != reply.npdu_data.priority) {
return false;
}
#endif
if (!bacnet_address_same(&request.address, &reply.address)) {
return false;
}
return true;
}
/* Get the reply to a DATA_EXPECTING_REPLY frame, or nothing */
uint16_t MSTP_Get_Reply(
volatile struct mstp_port_struct_t * mstp_port,
unsigned timeout)
{ /* milliseconds to wait for a packet */
uint16_t pdu_len = 0; /* return value */
uint8_t destination = 0; /* destination address */
bool matched = false;
(void) timeout;
if (!Transmit_Packet.ready) {
return 0;
}
/* load destination MAC address */
if (Transmit_Packet.address.mac_len == 1) {
destination = Transmit_Packet.address.mac[0];
} else {
return 0;
}
if ((MAX_HEADER + Transmit_Packet.pdu_len) > MAX_MPDU) {
return 0;
}
/* is this the reply to the DER? */
matched =
dlmstp_compare_data_expecting_reply(&mstp_port->InputBuffer[0],
mstp_port->DataLength, mstp_port->SourceAddress,
&Transmit_Packet.pdu[0], Transmit_Packet.pdu_len,
&Transmit_Packet.address);
if (!matched)
return 0;
/* convert the PDU into the MSTP Frame */
pdu_len = MSTP_Create_Frame(&mstp_port->OutputBuffer[0], /* <-- loading this */
mstp_port->OutputBufferSize, Transmit_Packet.frame_type, destination,
mstp_port->This_Station, &Transmit_Packet.pdu[0],
Transmit_Packet.pdu_len);
Transmit_Packet.ready = false;
return pdu_len;
}
void dlmstp_set_mac_address(
uint8_t mac_address)
{
/* Master Nodes can only have address 0-127 */
if (mac_address <= 127) {
MSTP_Port.This_Station = mac_address;
/* FIXME: implement your data storage */
/* I2C_Write_Byte(
EEPROM_DEVICE_ADDRESS,
mac_address,
EEPROM_MSTP_MAC_ADDR); */
if (mac_address > MSTP_Port.Nmax_master)
dlmstp_set_max_master(mac_address);
}
return;
}
uint8_t dlmstp_mac_address(
void)
{
return MSTP_Port.This_Station;
}
/* This parameter represents the value of the Max_Info_Frames property of */
/* the node's Device object. The value of Max_Info_Frames specifies the */
/* maximum number of information frames the node may send before it must */
/* pass the token. Max_Info_Frames may have different values on different */
/* nodes. This may be used to allocate more or less of the available link */
/* bandwidth to particular nodes. If Max_Info_Frames is not writable in a */
/* node, its value shall be 1. */
void dlmstp_set_max_info_frames(
uint8_t max_info_frames)
{
if (max_info_frames >= 1) {
MSTP_Port.Nmax_info_frames = max_info_frames;
/* FIXME: implement your data storage */
/* I2C_Write_Byte(
EEPROM_DEVICE_ADDRESS,
(uint8_t)max_info_frames,
EEPROM_MSTP_MAX_INFO_FRAMES_ADDR); */
}
return;
}
uint8_t dlmstp_max_info_frames(
void)
{
return MSTP_Port.Nmax_info_frames;
}
/* This parameter represents the value of the Max_Master property of the */
/* node's Device object. The value of Max_Master specifies the highest */
/* allowable address for master nodes. The value of Max_Master shall be */
/* less than or equal to 127. If Max_Master is not writable in a node, */
/* its value shall be 127. */
void dlmstp_set_max_master(
uint8_t max_master)
{
if (max_master <= 127) {
if (MSTP_Port.This_Station <= max_master) {
MSTP_Port.Nmax_master = max_master;
/* FIXME: implement your data storage */
/* I2C_Write_Byte(
EEPROM_DEVICE_ADDRESS,
max_master,
EEPROM_MSTP_MAX_MASTER_ADDR); */
}
}
return;
}
uint8_t dlmstp_max_master(
void)
{
return MSTP_Port.Nmax_master;
}
/* RS485 Baud Rate 9600, 19200, 38400, 57600, 115200 */
void dlmstp_set_baud_rate(
uint32_t baud)
{
RS485_Set_Baud_Rate(baud);
}
uint32_t dlmstp_baud_rate(
void)
{
return RS485_Get_Baud_Rate();
}
void dlmstp_get_my_address(
BACNET_ADDRESS * my_address)
{
int i = 0; /* counter */
my_address->mac_len = 1;
my_address->mac[0] = MSTP_Port.This_Station;
my_address->net = 0; /* local only, no routing */
my_address->len = 0;
for (i = 0; i < MAX_MAC_LEN; i++) {
my_address->adr[i] = 0;
}
return;
}
void dlmstp_get_broadcast_address(
BACNET_ADDRESS * dest)
{ /* destination address */
int i = 0; /* counter */
if (dest) {
dest->mac_len = 1;
dest->mac[0] = MSTP_BROADCAST_ADDRESS;
dest->net = BACNET_BROADCAST_NETWORK;
dest->len = 0; /* always zero when DNET is broadcast */
for (i = 0; i < MAX_MAC_LEN; i++) {
dest->adr[i] = 0;
}
}
return;
}
bool dlmstp_init(
char *ifname)
{
unsigned long hThread = 0;
uint32_t arg_value = 0;
/* initialize packet queue */
Receive_Packet.ready = false;
Receive_Packet.pdu_len = 0;
Receive_Packet_Flag = CreateSemaphore(NULL, 0, 1, "dlmstpReceivePacket");
if (Receive_Packet_Flag == NULL)
exit(1);
Received_Frame_Flag = CreateSemaphore(NULL, 0, 1, "dlsmtpReceiveFrame");
if (Received_Frame_Flag == NULL) {
CloseHandle(Receive_Packet_Flag);
exit(1);
}
/* initialize hardware */
timer_init();
if (ifname) {
RS485_Set_Interface(ifname);
}
RS485_Initialize();
MSTP_Port.InputBuffer = &RxBuffer[0];
MSTP_Port.InputBufferSize = sizeof(RxBuffer);
MSTP_Port.OutputBuffer = &TxBuffer[0];
MSTP_Port.OutputBufferSize = sizeof(TxBuffer);
MSTP_Port.SilenceTimer = Timer_Silence;
MSTP_Port.SilenceTimerReset = Timer_Silence_Reset;
MSTP_Init(&MSTP_Port);
#if 0
uint8_t data;
/* FIXME: implement your data storage */
data = 64; /* I2C_Read_Byte(
EEPROM_DEVICE_ADDRESS,
EEPROM_MSTP_MAC_ADDR); */
if (data <= 127)
MSTP_Port.This_Station = data;
else
dlmstp_set_my_address(DEFAULT_MAC_ADDRESS);
/* FIXME: implement your data storage */
data = 127; /* I2C_Read_Byte(
EEPROM_DEVICE_ADDRESS,
EEPROM_MSTP_MAX_MASTER_ADDR); */
if ((data <= 127) && (data >= MSTP_Port.This_Station))
MSTP_Port.Nmax_master = data;
else
dlmstp_set_max_master(DEFAULT_MAX_MASTER);
/* FIXME: implement your data storage */
data = 1;
/* I2C_Read_Byte(
EEPROM_DEVICE_ADDRESS,
EEPROM_MSTP_MAX_INFO_FRAMES_ADDR); */
if (data >= 1)
MSTP_Port.Nmax_info_frames = data;
else
dlmstp_set_max_info_frames(DEFAULT_MAX_INFO_FRAMES);
#endif
#if PRINT_ENABLED
fprintf(stderr, "MS/TP MAC: %02X\n", MSTP_Port.This_Station);
fprintf(stderr, "MS/TP Max_Master: %02X\n", MSTP_Port.Nmax_master);
fprintf(stderr, "MS/TP Max_Info_Frames: %u\n",
(unsigned) MSTP_Port.Nmax_info_frames);
#endif
hThread = _beginthread(dlmstp_receive_fsm_task, 4096, &arg_value);
if (hThread == 0) {
fprintf(stderr, "Failed to start recive FSM task\n");
}
hThread = _beginthread(dlmstp_master_fsm_task, 4096, &arg_value);
if (hThread == 0) {
fprintf(stderr, "Failed to start Master Node FSM task\n");
}
return true;
}
#ifdef TEST_DLMSTP
#include <stdio.h>
void apdu_handler(
BACNET_ADDRESS * src, /* source address */
uint8_t * apdu, /* APDU data */
uint16_t pdu_len)
{ /* for confirmed messages */
(void) src;
(void) apdu;
(void) pdu_len;
}
/* returns a delta timestamp */
uint32_t timestamp_ms(
void)
{
DWORD ticks = 0, delta_ticks = 0;
static DWORD last_ticks = 0;
ticks = GetTickCount();
delta_ticks =
(ticks >= last_ticks ? ticks - last_ticks : MAXDWORD - last_ticks);
last_ticks = ticks;
return delta_ticks;
}
static char *Network_Interface = NULL;
int main(
int argc,
char *argv[])
{
uint16_t pdu_len = 0;
/* argv has the "COM4" or some other device */
if (argc > 1) {
Network_Interface = argv[1];
}
dlmstp_set_baud_rate(38400);
dlmstp_set_mac_address(0x05);
dlmstp_set_max_info_frames(DEFAULT_MAX_INFO_FRAMES);
dlmstp_set_max_master(DEFAULT_MAX_MASTER);
dlmstp_init(Network_Interface);
/* forever task */
for (;;) {
pdu_len = dlmstp_receive(NULL, NULL, 0, INFINITE);
#if 0
MSTP_Create_And_Send_Frame(&MSTP_Port, FRAME_TYPE_TEST_REQUEST,
MSTP_Port.SourceAddress, MSTP_Port.This_Station, NULL, 0);
#endif
}
return 0;
}
#endif
+94
View File
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="dlmstp" />
<Option makefile="makefile" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin\Debug\dlmstp" 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\dlmstp" 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="-Wall" />
<Add option="-fexceptions" />
<Add option="-DBACDL_MSTP" />
<Add option="-DTEST_DLMSTP=1" />
<Add option="-DMAX_APDU=50" />
<Add option="-DMAX_TSM_TRANSACTIONS=16" />
<Add option="-DMAX_ADDRESS_CACHE=16" />
<Add option="-DPRINT_ENABLED=1" />
<Add option="-DCRC_USE_TABLE" />
<Add directory="." />
<Add directory="..\..\include" />
<Add directory="..\..\demo\handler" />
<Add directory="..\..\demo\object" />
</Compiler>
<Linker>
<Add library="winmm" />
</Linker>
<Unit filename="..\..\include\bacaddr.h" />
<Unit filename="..\..\include\bacdef.h" />
<Unit filename="..\..\include\bacint.h" />
<Unit filename="..\..\include\crc.h" />
<Unit filename="..\..\include\datalink.h" />
<Unit filename="..\..\include\dlmstp.h" />
<Unit filename="..\..\include\indtext.h" />
<Unit filename="..\..\include\mstp.h" />
<Unit filename="..\..\include\mstptext.h" />
<Unit filename="..\..\include\npdu.h" />
<Unit filename="dlmstp.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="rs485.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="rs485.h" />
<Unit filename="..\..\src\bacaddr.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\..\src\bacint.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\..\src\crc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\..\src\indtext.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\..\src\mstp.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\..\src\mstptext.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\..\src\npdu.c">
<Option compilerVar="CC" />
</Unit>
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
+464
View File
@@ -0,0 +1,464 @@
/*####COPYRIGHTBEGIN####
-------------------------------------------
Copyright (C) 2005 Steve Karg, modified by Kevin Liao
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
The Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA.
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.
This exception does not invalidate any other reasons why a work
based on this file might be covered by the GNU General Public
License.
-------------------------------------------
####COPYRIGHTEND####*/
#include <stdint.h> /* for standard integer types uint8_t etc. */
#include <stdbool.h> /* for the standard bool type. */
#include <assert.h>
#include <direct.h>
#include <io.h>
#include "bacdef.h"
#include "ethernet.h"
#include "bacdcode.h"
/* Uses WinPCap to access raw ethernet */
/* Notes: */
/* To make ethernet.c work under win32, you have to: */
/* 1. install winpcap 3.1 development pack; */
/* 2. install Microsoft Platform SDK Feb 2003. */
/* 3. remove or modify functions used for log such as */
/* "LogError()", "LogInfo()", which were implemented */
/* as a wrapper of Log4cpp. */
/* -- Kevin Liao */
/* includes for accessing ethernet by using winpcap */
#include "pcap.h"
#include "packet32.h"
#include "ntddndis.h"
#include "remote-ext.h"
/* commonly used comparison address for ethernet */
uint8_t Ethernet_Broadcast[MAX_MAC_LEN] =
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
/* commonly used empty address for ethernet quick compare */
uint8_t Ethernet_Empty_MAC[MAX_MAC_LEN] = { 0, 0, 0, 0, 0, 0 };
/* my local device data - MAC address */
uint8_t Ethernet_MAC_Address[MAX_MAC_LEN] = { 0 };
/* couple of var for using winpcap */
static char pcap_errbuf[PCAP_ERRBUF_SIZE + 1];
static pcap_t *pcap_eth802_fp = NULL; /* 802.2 file handle, from winpcap */
static unsigned eth_timeout = 100;
/* couple of external func for runtime error logging, you can simply */
/* replace them with standard "printf(...)" */
/* Logging extern functions: Info level */
extern void LogInfo(
const char *msg);
/* Logging extern functions: Error level*/
extern void LogError(
const char *msg);
/* Logging extern functions: Debug level*/
extern void LogDebug(
const char *msg);
bool ethernet_valid(
void)
{
return (pcap_eth802_fp != NULL);
}
void ethernet_cleanup(
void)
{
if (pcap_eth802_fp) {
pcap_close(pcap_eth802_fp);
pcap_eth802_fp = NULL;
}
LogInfo("ethernet.c: ethernet_cleanup() ok.\n");
}
void ethernet_set_timeout(
unsigned timeout)
{
eth_timeout = timeout;
}
/*----------------------------------------------------------------------
Portable function to set a socket into nonblocking mode.
Calling this on a socket causes all future read() and write() calls on
that socket to do only as much as they can immediately, and return
without waiting.
If no data can be read or written, they return -1 and set errno
to EAGAIN (or EWOULDBLOCK).
Thanks to Bjorn Reese for this code.
----------------------------------------------------------------------*/
/**
* We don't need to use this function since WinPCap has provided one
* named "pcap_setnonblock()".
* Kevin, 2006.08.15
*/
/*
int setNonblocking(int fd)
{
int flags;
if (-1 == (flags = fcntl(fd, F_GETFL, 0)))
flags = 0;
return fcntl(fd, F_SETFL, flags | O_NONBLOCK);
}
*/
bool ethernet_init(
char *if_name)
{
PPACKET_OID_DATA pOidData;
LPADAPTER lpAdapter;
pcap_if_t *pcap_all_if;
pcap_if_t *dev;
BOOLEAN result;
CHAR str[sizeof(PACKET_OID_DATA) + 128];
int i;
char msgBuf[200];
if (ethernet_valid())
ethernet_cleanup();
/**
* Find the interface user specified
*/
/* Retrieve the device list */
if (pcap_findalldevs(&pcap_all_if, pcap_errbuf) == -1) {
sprintf(msgBuf, "ethernet.c: error in pcap_findalldevs: %s\n",
pcap_errbuf);
LogError(msgBuf);
return false;
}
/* Scan the list printing every entry */
for (dev = pcap_all_if; dev; dev = dev->next) {
if (strcmp(if_name, dev->name) == 0)
break;
}
pcap_freealldevs(pcap_all_if); /* we don't need it anymore */
if (dev == NULL) {
sprintf(msgBuf, "ethernet.c: specified interface not found: %s\n",
if_name);
LogError(msgBuf);
return false;
}
/**
* Get local MAC address
*/
ZeroMemory(str, sizeof(PACKET_OID_DATA) + 128);
lpAdapter = PacketOpenAdapter(if_name);
if (lpAdapter == NULL) {
ethernet_cleanup();
sprintf(msgBuf, "ethernet.c: error in PacketOpenAdapter(\"%s\")\n",
if_name);
LogError(msgBuf);
return false;
}
pOidData = (PPACKET_OID_DATA) str;
pOidData->Oid = OID_802_3_CURRENT_ADDRESS;
pOidData->Length = 6;
result = PacketRequest(lpAdapter, FALSE, pOidData);
if (!result) {
PacketCloseAdapter(lpAdapter);
ethernet_cleanup();
LogError("ethernet.c: error in PacketRequest()\n");
return false;
}
for (i = 0; i < 6; ++i)
Ethernet_MAC_Address[i] = pOidData->Data[i];
PacketCloseAdapter(lpAdapter);
/**
* Open interface for subsequent sending and receiving
*/
/* Open the output device */
pcap_eth802_fp = pcap_open(if_name, /* name of the device */
MAX_MPDU, /* portion of the packet to capture */
PCAP_OPENFLAG_PROMISCUOUS, /* promiscuous mode */
eth_timeout, /* read timeout */
NULL, /* authentication on the remote machine */
pcap_errbuf /* error buffer */
);
if (pcap_eth802_fp == NULL) {
PacketCloseAdapter(lpAdapter);
ethernet_cleanup();
sprintf(msgBuf,
"ethernet.c: unable to open the adapter. %s is not supported by WinPcap\n",
if_name);
LogError(msgBuf);
return false;
}
LogInfo("ethernet.c: ethernet_init() ok.\n");
atexit(ethernet_cleanup);
return ethernet_valid();
}
/* function to send a packet out the 802.2 socket */
/* returns bytes sent success, negative on failure */
int ethernet_send(
BACNET_ADDRESS * dest, /* destination address */
BACNET_ADDRESS * src, /* source address */
uint8_t * pdu, /* any data to be sent - may be null */
unsigned pdu_len /* number of bytes of data */
)
{
int bytes = 0;
uint8_t mtu[MAX_MPDU] = { 0 };
int mtu_len = 0;
int i = 0;
/* don't waste time if the socket is not valid */
if (!ethernet_valid()) {
LogError("ethernet.c: invalid 802.2 ethernet interface descriptor!\n");
return -1;
}
/* load destination ethernet MAC address */
if (dest->mac_len == 6) {
for (i = 0; i < 6; i++) {
mtu[mtu_len] = dest->mac[i];
mtu_len++;
}
} else {
LogError("ethernet.c: invalid destination MAC address!\n");
return -2;
}
/* load source ethernet MAC address */
if (src->mac_len == 6) {
for (i = 0; i < 6; i++) {
mtu[mtu_len] = src->mac[i];
mtu_len++;
}
} else {
LogError("ethernet.c: invalid source MAC address!\n");
return -3;
}
if ((14 + 3 + pdu_len) > MAX_MPDU) {
LogError("ethernet.c: PDU is too big to send!\n");
return -4;
}
/* packet length */
mtu_len += encode_unsigned16(&mtu[12], 3 /*DSAP,SSAP,LLC */ + pdu_len);
/* Logical PDU portion */
mtu[mtu_len++] = 0x82; /* DSAP for BACnet */
mtu[mtu_len++] = 0x82; /* SSAP for BACnet */
mtu[mtu_len++] = 0x03; /* Control byte in header */
memcpy(&mtu[mtu_len], pdu, pdu_len);
mtu_len += pdu_len;
/* Send the packet */
if (pcap_sendpacket(pcap_eth802_fp, mtu, mtu_len) != 0) {
/* did it get sent? */
char msgBuf[200];
sprintf(msgBuf, "ethernet.c: error sending packet: %s\n",
pcap_geterr(pcap_eth802_fp));
LogError(msgBuf);
return -5;
}
return mtu_len;
}
/* function to send a packet out the 802.2 socket */
/* returns number of bytes sent on success, negative on failure */
int ethernet_send_pdu(
BACNET_ADDRESS * dest, /* destination address */
uint8_t * pdu, /* any data to be sent - may be null */
unsigned pdu_len /* number of bytes of data */
)
{
int i = 0; /* counter */
BACNET_ADDRESS src = { 0 }; /* source address */
for (i = 0; i < 6; i++) {
src.mac[i] = Ethernet_MAC_Address[i];
src.mac_len++;
}
/* function to send a packet out the 802.2 socket */
/* returns 1 on success, 0 on failure */
return ethernet_send(dest, /* destination address */
&src, /* source address */
pdu, /* any data to be sent - may be null */
pdu_len /* number of bytes of data */
);
}
/* receives an 802.2 framed packet */
/* returns the number of octets in the PDU, or zero on failure */
uint16_t ethernet_receive(
BACNET_ADDRESS * src, /* source address */
uint8_t * pdu, /* PDU data */
uint16_t max_pdu, /* amount of space available in the PDU */
unsigned timeout /* number of milliseconds to wait for a packet. we ommit it due to winpcap API. */
)
{
struct pcap_pkthdr *header;
int res;
u_char *pkt_data;
uint16_t pdu_len = 0; /* return value */
/* Make sure the socket is open */
if (!ethernet_valid()) {
LogError("ethernet.c: invalid 802.2 ethernet interface descriptor!\n");
return 0;
}
/* Capture a packet */
res = pcap_next_ex(pcap_eth802_fp, &header, &pkt_data);
if (res < 0) {
char msgBuf[200];
sprintf(msgBuf, "ethernet.c: error in receiving packet: %s\n",
pcap_geterr(pcap_eth802_fp));
return 0;
} else if (res == 0)
return 0;
if (header->len == 0 || header->caplen == 0)
return 0;
/* the signature of an 802.2 BACnet packet */
if ((pkt_data[14] != 0x82) && (pkt_data[15] != 0x82)) {
/*eth_log_error("ethernet.c: Non-BACnet packet\n"); */
return 0;
}
/* copy the source address */
src->mac_len = 6;
memmove(src->mac, &pkt_data[6], 6);
/* check destination address for when */
/* the Ethernet card is in promiscious mode */
if ((memcmp(&pkt_data[0], Ethernet_MAC_Address, 6) != 0)
&& (memcmp(&pkt_data[0], Ethernet_Broadcast, 6) != 0)) {
/*eth_log_error( "ethernet.c: This packet isn't for us\n"); */
return 0;
}
(void) decode_unsigned16(&pkt_data[12], &pdu_len);
pdu_len -= 3 /* DSAP, SSAP, LLC Control */ ;
/* copy the buffer into the PDU */
if (pdu_len < max_pdu)
memmove(&pdu[0], &pkt_data[17], pdu_len);
/* ignore packets that are too large */
else
pdu_len = 0;
return pdu_len;
}
void ethernet_set_my_address(
BACNET_ADDRESS * my_address)
{
int i = 0;
for (i = 0; i < 6; i++) {
Ethernet_MAC_Address[i] = my_address->mac[i];
}
return;
}
void ethernet_get_my_address(
BACNET_ADDRESS * my_address)
{
int i = 0;
my_address->mac_len = 0;
for (i = 0; i < 6; i++) {
my_address->mac[i] = Ethernet_MAC_Address[i];
my_address->mac_len++;
}
my_address->net = 0; /* local only, no routing */
my_address->len = 0;
for (i = 0; i < MAX_MAC_LEN; i++) {
my_address->adr[i] = 0;
}
return;
}
void ethernet_get_broadcast_address(
BACNET_ADDRESS * dest)
{ /* destination address */
int i = 0; /* counter */
if (dest) {
for (i = 0; i < 6; i++) {
dest->mac[i] = Ethernet_Broadcast[i];
}
dest->mac_len = 6;
dest->net = BACNET_BROADCAST_NETWORK;
dest->len = 0; /* denotes broadcast address */
for (i = 0; i < MAX_MAC_LEN; i++) {
dest->adr[i] = 0;
}
}
return;
}
void ethernet_debug_address(
const char *info,
BACNET_ADDRESS * dest)
{
int i = 0; /* counter */
char msgBuf[200];
if (info) {
sprintf(msgBuf, "%s", info);
LogError(msgBuf);
}
/* if */
if (dest) {
sprintf(msgBuf, "Address:\n MAC Length=%d\n MAC Address=",
dest->mac_len);
LogInfo(msgBuf);
for (i = 0; i < MAX_MAC_LEN; i++) {
sprintf(msgBuf, "%02X ", (unsigned) dest->mac[i]);
LogInfo(msgBuf);
} /* for */
LogInfo("\n");
sprintf(msgBuf, " Net=%hu\n Len=%d\n Adr=", dest->net, dest->len);
LogInfo(msgBuf);
for (i = 0; i < MAX_MAC_LEN; i++) {
sprintf(msgBuf, "%02X ", (unsigned) dest->adr[i]);
LogInfo(msgBuf);
} /* for */
LogInfo("\n");
}
/* if ( dest ) */
return;
}
+310
View File
@@ -0,0 +1,310 @@
/**************************************************************************
*
* Copyright (C) 2005 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.
*
*********************************************************************/
/* This is one way to use the embedded BACnet stack under Win32 */
/* compiled with Borland C++ 5.02 or Visual C++ 6.0 */
#include <winsock2.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <conio.h> /* for kbhit and getch */
#include "iam.h"
#include "address.h"
#include "config.h"
#include "bacdef.h"
#include "npdu.h"
#include "apdu.h"
#include "device.h"
#include "handlers.h"
#include "client.h"
#include "datalink.h"
#include "txbuf.h"
#include "dlenv.h"
/* include the objects */
#include "device.h"
#include "ai.h"
#include "ao.h"
#include "av.h"
#include "bi.h"
#include "bo.h"
#include "bv.h"
#include "lc.h"
#include "lsp.h"
#include "mso.h"
#include "ms-input.h"
#include "trendlog.h"
#if defined(BACFILE)
#include "bacfile.h"
#endif
/* buffer used for receive */
static uint8_t Rx_Buf[MAX_MPDU] = { 0 };
/* send a whois to see who is on the network */
static bool Who_Is_Request = true;
bool I_Am_Request = true;
static void Read_Properties(
void)
{
uint32_t device_id = 0;
bool status = false;
unsigned max_apdu = 0;
BACNET_ADDRESS src;
bool next_device = false;
static unsigned index = 0;
static unsigned property = 0;
/* list of required (and some optional) properties in the
Device Object
note: you could just loop through
all the properties in all the objects. */
const int object_props[] = {
PROP_OBJECT_IDENTIFIER,
PROP_OBJECT_NAME,
PROP_OBJECT_TYPE,
PROP_SYSTEM_STATUS,
PROP_VENDOR_NAME,
PROP_VENDOR_IDENTIFIER,
PROP_MODEL_NAME,
PROP_FIRMWARE_REVISION,
PROP_APPLICATION_SOFTWARE_VERSION,
PROP_PROTOCOL_VERSION,
PROP_PROTOCOL_SERVICES_SUPPORTED,
PROP_PROTOCOL_OBJECT_TYPES_SUPPORTED,
PROP_MAX_APDU_LENGTH_ACCEPTED,
PROP_SEGMENTATION_SUPPORTED,
PROP_LOCAL_TIME,
PROP_LOCAL_DATE,
PROP_UTC_OFFSET,
PROP_DAYLIGHT_SAVINGS_STATUS,
PROP_APDU_SEGMENT_TIMEOUT,
PROP_APDU_TIMEOUT,
PROP_NUMBER_OF_APDU_RETRIES,
PROP_TIME_SYNCHRONIZATION_RECIPIENTS,
PROP_MAX_MASTER,
PROP_MAX_INFO_FRAMES,
PROP_DEVICE_ADDRESS_BINDING,
/* note: PROP_OBJECT_LIST is missing cause
we need to get it with an index method since
the list could be very large */
/* some proprietary properties */
514, 515,
/* end of list */
-1
};
if (address_count()) {
if (address_get_by_index(index, &device_id, &max_apdu, &src)) {
if (object_props[property] < 0)
next_device = true;
else {
status = Send_Read_Property_Request(device_id, /* destination device */
OBJECT_DEVICE, device_id, object_props[property],
BACNET_ARRAY_ALL);
if (status)
property++;
}
} else
next_device = true;
if (next_device) {
next_device = false;
index++;
if (index >= MAX_ADDRESS_CACHE)
index = 0;
property = 0;
}
}
return;
}
static void LocalIAmHandler(
uint8_t * service_request,
uint16_t service_len,
BACNET_ADDRESS * src)
{
int len = 0;
uint32_t device_id = 0;
unsigned max_apdu = 0;
int segmentation = 0;
uint16_t vendor_id = 0;
(void) src;
(void) service_len;
len =
iam_decode_service_request(service_request, &device_id, &max_apdu,
&segmentation, &vendor_id);
fprintf(stderr, "Received I-Am Request");
if (len != -1) {
fprintf(stderr, " from %u!\n", device_id);
address_add(device_id, max_apdu, src);
} else
fprintf(stderr, "!\n");
return;
}
static void Init_Service_Handlers(
void)
{
Device_Init(NULL);
/* we need to handle who-is to support dynamic device binding */
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_WHO_IS, handler_who_is);
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_I_AM, LocalIAmHandler);
/* set the handler for all the services we don't implement */
/* It is required to send the proper reject message... */
apdu_set_unrecognized_service_handler_handler
(handler_unrecognized_service);
/* we must implement read property - it's required! */
apdu_set_confirmed_handler(SERVICE_CONFIRMED_READ_PROPERTY,
handler_read_property);
apdu_set_confirmed_handler(SERVICE_CONFIRMED_READ_PROP_MULTIPLE,
handler_read_property_multiple);
/* handle the data coming back from confirmed requests */
apdu_set_confirmed_ack_handler(SERVICE_CONFIRMED_READ_PROPERTY,
handler_read_property_ack);
#if defined(BACFILE)
apdu_set_confirmed_handler(SERVICE_CONFIRMED_ATOMIC_READ_FILE,
handler_atomic_read_file);
#endif
apdu_set_confirmed_handler(SERVICE_CONFIRMED_SUBSCRIBE_COV,
handler_cov_subscribe);
#if 0
/* Adding these handlers require the project(s) to change. */
#if defined(BACFILE)
apdu_set_confirmed_handler(SERVICE_CONFIRMED_ATOMIC_WRITE_FILE,
handler_atomic_write_file);
#endif
apdu_set_confirmed_handler(SERVICE_CONFIRMED_READ_RANGE,
handler_read_range);
apdu_set_confirmed_handler(SERVICE_CONFIRMED_REINITIALIZE_DEVICE,
handler_reinitialize_device);
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_UTC_TIME_SYNCHRONIZATION,
handler_timesync_utc);
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_TIME_SYNCHRONIZATION,
handler_timesync);
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_COV_NOTIFICATION,
handler_ucov_notification);
/* handle communication so we can shutup when asked */
apdu_set_confirmed_handler(SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL,
handler_device_communication_control);
#endif
}
static void print_address(
char *name,
BACNET_ADDRESS * dest)
{ /* destination address */
int i = 0; /* counter */
if (dest) {
printf("%s: ", name);
for (i = 0; i < dest->mac_len; i++) {
printf("%02X", dest->mac[i]);
}
printf("\n");
}
}
static void print_address_cache(
void)
{
int i, j;
BACNET_ADDRESS address;
uint32_t device_id = 0;
unsigned max_apdu = 0;
fprintf(stderr, "Device\tMAC\tMaxAPDU\tNet\n");
for (i = 0; i < MAX_ADDRESS_CACHE; i++) {
if (address_get_by_index(i, &device_id, &max_apdu, &address)) {
fprintf(stderr, "%u\t", device_id);
for (j = 0; j < address.mac_len; j++) {
fprintf(stderr, "%02X", address.mac[j]);
}
fprintf(stderr, "\t");
fprintf(stderr, "%hu\t", max_apdu);
fprintf(stderr, "%hu\n", address.net);
}
}
}
int main(
int argc,
char *argv[])
{
BACNET_ADDRESS src = {
0
}; /* address where message came from */
uint16_t pdu_len = 0;
unsigned timeout = 100; /* milliseconds */
BACNET_ADDRESS my_address, broadcast_address;
(void) argc;
(void) argv;
Device_Set_Object_Instance_Number(4194300);
address_init();
Init_Service_Handlers();
dlenv_init();
datalink_get_broadcast_address(&broadcast_address);
print_address("Broadcast", &broadcast_address);
datalink_get_my_address(&my_address);
print_address("Address", &my_address);
printf("BACnet stack running...\n");
/* loop forever */
for (;;) {
/* input */
/* returns 0 bytes on timeout */
pdu_len = datalink_receive(&src, &Rx_Buf[0], MAX_MPDU, timeout);
/* process */
if (pdu_len) {
npdu_handler(&src, &Rx_Buf[0], pdu_len);
}
if (I_Am_Request) {
I_Am_Request = false;
Send_I_Am(&Handler_Transmit_Buffer[0]);
} else if (Who_Is_Request) {
Who_Is_Request = false;
Send_WhoIs(-1, -1);
} else {
Read_Properties();
}
/* output */
/* blink LEDs, Turn on or off outputs, etc */
/* wait for ESC from keyboard before quitting */
if (kbhit() && (getch() == 0x1B))
break;
}
print_address_cache();
return 0;
}
+92
View File
@@ -0,0 +1,92 @@
# Makefile for mingw32 on Linux
# Written by Steve Karg <skarg@users.sourceforge.net> 06-Aug-2007
TARGET=bacnet
# Tools
CC=i586-mingw32msvc-gcc
RANLIB = /usr/i586-mingw32msvc/bin/ranlib
ASM = /usr/i586-mingw32msvc/bin/as
MKLIB = /usr/i586-mingw32msvc/bin/ar r
DLLWRAP = /usr/bin/i586-mingw32msvc-dllwrap
BACNET_FLAGS = -DBACDL_MSTP
BACNET_FLAGS += -DPRINT_ENABLED=0
BACNET_FLAGS += -DBIG_ENDIAN=0
BACNET_FLAGS += -DMAX_APDU=480
#BACNET_FLAGS += -DDLMSTP_TEST
INCLUDES = -I. -I../.. -I../../demo/handler -I../../demo/object
OPTIMIZATION = -O0
#OPTIMIZATION = -Os
CFLAGS = $(OPTIMIZATION) $(INCLUDES) $(BACNET_FLAGS) -Wall -g
LIBRARY = lib$(TARGET).a
# -Wl,<options> Pass comma-separated <options> on to the linker
LIBRARIES=-lc,-lgcc,-lm,-lwsock32,-L=.,-l$(TARGET)
LDFLAGS = -Wl,-nostdlib,-Map=$(TARGET).map,$(LIBRARIES)
PORTSRC = main.c \
rs485.c \
dlmstp.c \
../../crc.c \
../../mstp.c
DEMOSRC = ai.c \
../../demo/object/av.c \
../../demo/object/bi.c \
../../demo/object/bv.c \
../../demo/object/h_rp.c \
../../demo/object/h_wp.c \
../../demo/object/device.c \
../../demo/handler/txbuf.c \
../../demo/handler/h_whois.c \
../../demo/handler/noserv.c \
../../demo/handler/s_iam.c \
../../demo/handler/h_rd.c \
../../demo/handler/h_dcc.c
CORESRC = ../../npdu.c \
../../bacint.c \
../../apdu.c \
../../bacdcode.c \
../../bacstr.c \
../../abort.c \
../../bacerror.c \
../../reject.c \
../../bacapp.c \
../../datetime.c \
../../debug.c \
../../rp.c \
../../wp.c \
../../dcc.c \
../../rd.c \
../../whois.c \
../../iam.c \
../../version.c
CSRC = $(PORTSRC) $(DEMOSRC)
COBJ = $(CSRC:.c=.o)
COREOBJ = $(CORESRC:.c=.o)
all: $(TARGET).exe
$(TARGET).exe: $(COBJ) $(LIBRARY) Makefile
$(CC) $(CFLAGS) $(COBJ) $(LDFLAGS) -o $@
lib: $(LIBRARY)
$(LIBRARY): $(COREOBJ) Makefile
$(AR) rcs $@ $(COREOBJ)
.c.o:
$(CC) -c $(CFLAGS) $*.c -o $@
.s.o:
$(CC) -c $(AFLAGS) $*.s -o $@
clean:
touch Makefile
rm $(COBJ) $(COREOBJ)
rm $(TARGET).exe
rm $(LIBRARY)
+75
View File
@@ -0,0 +1,75 @@
/**************************************************************************
*
* Copyright (C) 2005 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 NET_H
#define NET_H
#define WIN32_LEAN_AND_MEAN
#define STRICT 1
/* Windows XP minimum */
#if (_WIN32_WINNT < 0x0501)
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#undef NTDDI_VERSION
#define NTDDI_VERSION 0x05010000
#endif
#include <windows.h>
#if (!defined(USE_INADDR) || (USE_INADDR == 0)) && \
(!defined(USE_CLASSADDR) || (USE_CLASSADDR == 0))
#include <iphlpapi.h>
#endif
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#ifndef IPPROTO_IPV6
// If the version of winsock does not by default include IPV6 then
// use the tech preview if it is avaliable.
#include <tpipv6.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#ifdef __MINGW32__
#include <ws2spi.h>
#else
#include <wspiapi.h>
#endif
#include <sys/timeb.h>
#ifdef _MSC_VER
#define inline __inline
#endif
#ifdef __BORLANDC__
#define inline __inline
#endif
#define close closesocket
typedef int socklen_t;
#endif
+15
View File
@@ -0,0 +1,15 @@
BACnet Stack - Win32
This directory contains a demo program that compiles with a Win32 compiler.
It was tested with the freely downloadable Borland C++ 5.5, as well as
Borland C++ 5 and Visual C++ 6.0.
The makefile.mak file is used with the Borland command line tools.
Run setvars.bat to configure the environment for the Borland tools.
Edit it if necessary to set the correct location of your tools.
The bacnet.ide file is used with the Borland IDE.
The bacnet directory is used with Visual C++ 6 tools, and there is a
workspace file bacnet.dsw that is used to compile the demo program.
+630
View File
@@ -0,0 +1,630 @@
/*####COPYRIGHTBEGIN####
-------------------------------------------
Copyright (C) 2004 Steve Karg
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
The Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307
USA.
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.
This exception does not invalidate any other reasons why a work
based on this file might be covered by the GNU General Public
License.
-------------------------------------------
####COPYRIGHTEND####*/
/** @file win32/rs485.c Provides Windows-specific functions for RS-485 */
/* Suggested USB to RS485 devices:
B&B Electronics USOPTL4
SerialGear USB-COMi-SI-M
USB-RS485-WE-1800-BT
*/
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "mstp.h"
#include "dlmstp.h"
#define WIN32_LEAN_AND_MEAN
#define STRICT 1
#include <windows.h>
#include "rs485.h"
#include "fifo.h"
/* details from Serial Communications in Win32 at MSDN */
/* Win32 handle for the port */
HANDLE RS485_Handle;
/* Original COM Timeouts */
static COMMTIMEOUTS RS485_Timeouts;
/* COM port name COM1, COM2, etc */
static char RS485_Port_Name[256] = "COM4";
/* baud rate - MS enumerated
CBR_110, CBR_300, CBR_600, CBR_1200, CBR_2400,
CBR_4800, CBR_9600, CBR_14400, CBR_19200, CBR_38400,
CBR_56000, CBR_57600, CBR_115200, CBR_128000, CBR_256000 */
static DWORD RS485_Baud = CBR_38400;
/* ByteSize in bits: 5, 6, 7, 8 are valid */
static DWORD RS485_ByteSize = 8;
/* Parity - MS enumerated:
NOPARITY, EVENPARITY, ODDPARITY, MARKPARITY, SPACEPARITY */
static DWORD RS485_Parity = NOPARITY;
/* StopBits - MS enumerated:
ONESTOPBIT, ONE5STOPBITS, TWOSTOPBITS */
static DWORD RS485_StopBits = ONESTOPBIT;
/* DTRControl - MS enumerated:
DTR_CONTROL_ENABLE, DTR_CONTROL_DISABLE, DTR_CONTROL_HANDSHAKE */
static DWORD RS485_DTRControl = DTR_CONTROL_DISABLE;
/* RTSControl - MS enumerated:
RTS_CONTROL_ENABLE, RTS_CONTROL_DISABLE,
RTS_CONTROL_HANDSHAKE, RTS_CONTROL_TOGGLE */
static DWORD RS485_RTSControl = RTS_CONTROL_DISABLE;
/****************************************************************************
* DESCRIPTION: Change the characters in a string to uppercase
* RETURN: nothing
* ALGORITHM: none
* NOTES: none
*****************************************************************************/
static void strupper(
char *str)
{
char *p;
for (p = str; *p != '\0'; ++p) {
*p = (char) toupper(*p);
}
}
/****************************************************************************
* DESCRIPTION: Initializes the RS485 hardware and variables, and starts in
* receive mode.
* RETURN: none
* ALGORITHM: none
* NOTES: expects a constant char ifname, or char from the heap
*****************************************************************************/
void RS485_Set_Interface(
char *ifname)
{
/* For COM ports greater than 9 you have to use a special syntax
for CreateFile. The syntax also works for COM ports 1-9. */
/* http://support.microsoft.com/kb/115831 */
if (ifname) {
strupper(ifname);
if (strncmp("COM", ifname, 3) == 0) {
if (strlen(ifname) > 3) {
sprintf(RS485_Port_Name, "\\\\.\\COM%i", atoi(ifname + 3));
fprintf(stdout, "Adjusted interface name to %s\r\n",
RS485_Port_Name);
}
}
}
}
/****************************************************************************
* DESCRIPTION: Check the serial port to see if port exists
* RETURN: true if port exists
* ALGORITHM: none
* NOTES: none
*****************************************************************************/
bool RS485_Interface_Valid(
unsigned port_number)
{
HANDLE h = 0;
DWORD err = 0;
bool status = false;
char ifname[255] = "";
sprintf(ifname, "\\\\.\\COM%u", port_number);
h = CreateFile(ifname, GENERIC_READ | GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, 0, NULL);
if (h == INVALID_HANDLE_VALUE) {
err = GetLastError();
if ((err == ERROR_ACCESS_DENIED) || (err == ERROR_GEN_FAILURE) ||
(err == ERROR_SHARING_VIOLATION) || (err == ERROR_SEM_TIMEOUT)) {
status = true;
}
} else {
status = true;
CloseHandle(h);
}
return status;
}
const char *RS485_Interface(
void)
{
return RS485_Port_Name;
}
void RS485_Print_Error(
void)
{
LPVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) & lpMsgBuf, 0, NULL);
MessageBox(NULL, lpMsgBuf, "GetLastError", MB_OK | MB_ICONINFORMATION);
LocalFree(lpMsgBuf);
return;
}
static void RS485_Configure_Status(
void)
{
DCB dcb = { 0 };
COMMTIMEOUTS ctNew;
dcb.DCBlength = sizeof(dcb);
/* get current DCB settings */
if (!GetCommState(RS485_Handle, &dcb)) {
fprintf(stderr, "Unable to get status from %s\n", RS485_Port_Name);
RS485_Print_Error();
exit(1);
}
/* update DCB rate, byte size, parity, and stop bits size */
dcb.BaudRate = RS485_Baud;
dcb.ByteSize = (unsigned char) RS485_ByteSize;
dcb.Parity = (unsigned char) RS485_Parity;
dcb.StopBits = (unsigned char) RS485_StopBits;
/* update flow control settings */
dcb.fDtrControl = RS485_DTRControl;
dcb.fRtsControl = RS485_RTSControl;
/*
dcb.fOutxCtsFlow = CTSOUTFLOW(TTYInfo);
dcb.fOutxDsrFlow = DSROUTFLOW(TTYInfo);
dcb.fDsrSensitivity = DSRINFLOW(TTYInfo);
dcb.fOutX = XONXOFFOUTFLOW(TTYInfo);
dcb.fInX = XONXOFFINFLOW(TTYInfo);
dcb.fTXContinueOnXoff = TXAFTERXOFFSENT(TTYInfo);
dcb.XonChar = XONCHAR(TTYInfo);
dcb.XoffChar = XOFFCHAR(TTYInfo);
dcb.XonLim = XONLIMIT(TTYInfo);
dcb.XoffLim = XOFFLIMIT(TTYInfo);
// DCB settings not in the user's control
dcb.fParity = TRUE;
*/
if (!SetCommState(RS485_Handle, &dcb)) {
fprintf(stderr, "Unable to set status on %s\n", RS485_Port_Name);
RS485_Print_Error();
}
/* configure the COM port timeout values */
ctNew.ReadIntervalTimeout = MAXDWORD;
ctNew.ReadTotalTimeoutMultiplier = MAXDWORD;
ctNew.ReadTotalTimeoutConstant = 1000;
ctNew.WriteTotalTimeoutMultiplier = 0;
ctNew.WriteTotalTimeoutConstant = 0;
if (!SetCommTimeouts(RS485_Handle, &ctNew)) {
RS485_Print_Error();
}
/* Get rid of any stray characters */
if (!PurgeComm(RS485_Handle, PURGE_TXABORT | PURGE_RXABORT)) {
fprintf(stderr, "Unable to purge %s\n", RS485_Port_Name);
RS485_Print_Error();
}
/* Set the Comm buffer size */
SetupComm(RS485_Handle, MAX_MPDU, MAX_MPDU);
/* raise DTR */
if (!EscapeCommFunction(RS485_Handle, SETDTR)) {
fprintf(stderr, "Unable to set DTR on %s\n", RS485_Port_Name);
RS485_Print_Error();
}
}
/****************************************************************************
* DESCRIPTION: Cleans up any handles that were created at startup.
* RETURN: none
* ALGORITHM: none
* NOTES: none
*****************************************************************************/
static void RS485_Cleanup(
void)
{
if (!EscapeCommFunction(RS485_Handle, CLRDTR)) {
RS485_Print_Error();
}
if (!SetCommTimeouts(RS485_Handle, &RS485_Timeouts)) {
RS485_Print_Error();
}
CloseHandle(RS485_Handle);
}
/****************************************************************************
* DESCRIPTION: Initializes the RS485 hardware and variables, and starts in
* receive mode.
* RETURN: none
* ALGORITHM: none
* NOTES: none
*****************************************************************************/
void RS485_Initialize(
void)
{
RS485_Handle =
CreateFile(RS485_Port_Name, GENERIC_READ | GENERIC_WRITE, 0, 0,
OPEN_EXISTING,
/*FILE_FLAG_OVERLAPPED */ 0,
0);
if (RS485_Handle == INVALID_HANDLE_VALUE) {
fprintf(stderr, "Unable to open %s\n", RS485_Port_Name);
RS485_Print_Error();
exit(1);
}
if (!GetCommTimeouts(RS485_Handle, &RS485_Timeouts)) {
RS485_Print_Error();
}
RS485_Configure_Status();
#if PRINT_ENABLED
fprintf(stdout, "RS485 Interface: %s\n", RS485_Port_Name);
#endif
atexit(RS485_Cleanup);
return;
}
/****************************************************************************
* DESCRIPTION: Returns the baud rate that we are currently running at
* RETURN: none
* ALGORITHM: none
* NOTES: none
*****************************************************************************/
uint32_t RS485_Get_Baud_Rate(
void)
{
switch (RS485_Baud) {
case CBR_19200:
return 19200;
case CBR_38400:
return 38400;
case CBR_57600:
return 57600;
case CBR_115200:
return 115200;
case CBR_110:
return 110;
case CBR_300:
return 300;
case CBR_600:
return 600;
case CBR_1200:
return 1200;
case CBR_2400:
return 2400;
case CBR_4800:
return 4800;
case CBR_14400:
return 14400;
case CBR_56000:
return 56000;
case CBR_128000:
return 128000;
case CBR_256000:
return 256000;
case 76800:
/* See comments in RS485_Set_Baud_Rate() below
* also look at definition of CBR_xx in winbase.h
* some serial drivers will only support the defined
* baud rates but others will try and configure the
* requested baud rate (or as close as they can get)
*/
return 76800;
case CBR_9600:
default:
return 9600;
}
}
/****************************************************************************
* DESCRIPTION: Sets the baud rate for the chip USART
* RETURN: none
* ALGORITHM: none
* NOTES: none
*****************************************************************************/
bool RS485_Set_Baud_Rate(
uint32_t baud)
{
bool valid = true;
switch (baud) {
case 9600:
RS485_Baud = CBR_9600;
break;
case 19200:
RS485_Baud = CBR_19200;
break;
case 38400:
RS485_Baud = CBR_38400;
break;
case 57600:
RS485_Baud = CBR_57600;
break;
case 115200:
RS485_Baud = CBR_115200;
break;
case 110:
RS485_Baud = CBR_110;
break;
case 300:
RS485_Baud = CBR_300;
break;
case 600:
RS485_Baud = CBR_600;
break;
case 1200:
RS485_Baud = CBR_1200;
break;
case 2400:
RS485_Baud = CBR_2400;
break;
case 4800:
RS485_Baud = CBR_4800;
break;
case 14400:
RS485_Baud = CBR_14400;
break;
case 56000:
RS485_Baud = CBR_56000;
break;
case 128000:
RS485_Baud = CBR_128000;
break;
case 256000:
RS485_Baud = CBR_256000;
break;
case 76800:
/* I'm using the B&B Electronics USOPTL4 USB RS485 adapter
* on Win 7 and building with VS2008 Express Edition and it
* seems to work for the most part if I use the following.
* I get the occasional data errors especially if the devices
* are transmitting with 1 stop bit (some devices receive with
* 1 stop bit but effectivly end up transmitting with 2 stop
* bits, usually because of synchroisation issues in some UARTs
* which mean that if you wait until the serialiser has finished
* with the current character and then load the TX buffer it has
* to wait until the next bit boundary to start transmitting.
* PMcS
*/
RS485_Baud = 76800;
break;
default:
valid = false;
break;
}
if (valid) {
/* FIXME: store the baud rate */
}
return valid;
}
/* Transmits a Frame on the wire */
void RS485_Send_Frame(
volatile struct mstp_port_struct_t *mstp_port, /* port specific data */
uint8_t * buffer, /* frame to send (up to 501 bytes of data) */
uint16_t nbytes)
{ /* number of bytes of data (up to 501) */
DWORD dwWritten = 0;
if (mstp_port) {
uint32_t baud;
uint8_t turnaround_time;
baud = RS485_Get_Baud_Rate();
/* wait about 40 bit times since reception */
if (baud == 9600)
turnaround_time = 4;
else if (baud == 19200)
turnaround_time = 2;
else
turnaround_time = 2;
while (mstp_port->SilenceTimer(NULL) < turnaround_time) {
/* do nothing - wait for timer to increment */
};
}
WriteFile(RS485_Handle, buffer, nbytes, &dwWritten, NULL);
/* per MSTP spec, reset SilenceTimer after each byte is sent */
if (mstp_port) {
mstp_port->SilenceTimerReset(NULL);
}
return;
}
/* called by timer, interrupt(?) or other thread */
void RS485_Check_UART_Data(
volatile struct mstp_port_struct_t *mstp_port)
{
char lpBuf[1];
DWORD dwRead = 0;
if (mstp_port->ReceiveError == true) {
/* wait for state machine to clear this */
}
/* wait for state machine to read from the DataRegister */
else if (mstp_port->DataAvailable == false) {
/* check for data */
if (!ReadFile(RS485_Handle, lpBuf, sizeof(lpBuf), &dwRead, NULL)) {
if (GetLastError() != ERROR_IO_PENDING) {
mstp_port->ReceiveError = TRUE;
}
} else {
if (dwRead) {
mstp_port->DataRegister = lpBuf[0];
mstp_port->DataAvailable = TRUE;
}
}
}
}
/*************************************************************************
* Description: print available COM ports
* Returns: none
* Notes: none
**************************************************************************/
void RS485_Print_Ports(
void)
{
unsigned i = 0;
/* try to open all 255 COM ports */
for (i = 1; i < 256; i++) {
if (RS485_Interface_Valid(i)) {
/* note: format for Wireshark ExtCap */
printf("interface {value=COM%u}"
"{display=BACnet MS/TP on COM%u}\n", i, i);
}
}
}
#ifdef TEST_RS485
#include "mstpdef.h"
static void test_transmit_task(
void *pArg)
{
char *TxBuf = "BACnet MS/TP";
size_t len = strlen(TxBuf) + 1;
while (TRUE) {
Sleep(1000);
RS485_Send_Frame(NULL, &TxBuf[0], len);
}
}
#if defined(_WIN32)
static BOOL WINAPI CtrlCHandler(
DWORD dwCtrlType)
{
dwCtrlType = dwCtrlType;
exit(0);
return TRUE;
}
#endif
static int ascii_hex_to_int(
char ch)
{
int rv = -1;
if ((ch >= '0') && (ch <= '9')) {
rv = ch - '0';
} else if ((ch >= 'a') && (ch <= 'f')) {
rv = 10 + ch - 'a';
} else if ((ch >= 'A') && (ch <= 'F')) {
rv = 10 + ch - 'a';
}
return rv;
}
int main(
int argc,
char *argv[])
{
unsigned long hThread = 0;
uint32_t arg_value = 0;
char lpBuf[1];
DWORD dwRead = 0;
unsigned i = 0, len = 0, count = 0;
char hex_pair[5] = "0xff";
char ch = ' ';
int lsb = 0, msb = 0;
long my_baud = 38400;
uint8_t buffer[501] = { 0 };
if (argc > 1) {
RS485_Set_Interface(argv[1]);
}
if (argc > 2) {
my_baud = strtol(argv[2], NULL, 0);
}
RS485_Set_Baud_Rate(my_baud);
RS485_Initialize();
#if defined(_WIN32)
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), ENABLE_PROCESSED_INPUT);
SetConsoleCtrlHandler((PHANDLER_ROUTINE) CtrlCHandler, TRUE);
#endif
#ifdef TEST_RS485_TRANSMIT
/* read a stream of characters from stdin or argument */
if (argc > 3) {
len = strlen(argv[3]);
for (i = 0; i < len; i++) {
/* grab pairs of hex characters, skip spaces */
ch = argv[3][i];
if (ch == ' ') {
continue;
}
msb = ascii_hex_to_int(ch);
if (msb >= 0) {
i++;
ch = argv[3][i];
lsb = ascii_hex_to_int(ch);
if (lsb >= 0) {
buffer[count] = msb << 4 | lsb;
} else {
buffer[count] = msb;
}
count++;
if (count >= sizeof(buffer)) {
break;
}
}
}
RS485_Send_Frame(NULL, buffer, count);
}
#endif
#ifdef TEST_RS485_RECEIVE
/* receive task */
for (;;) {
if (!ReadFile(RS485_Handle, lpBuf, sizeof(lpBuf), &dwRead, NULL)) {
if (GetLastError() != ERROR_IO_PENDING) {
RS485_Print_Error();
}
} else {
/* print any characters received */
if (dwRead) {
for (i = 0; i < dwRead; i++) {
fprintf(stderr, "%02X ", lpBuf[i]);
}
}
dwRead = 0;
}
}
#endif
}
#endif
+55
View File
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="rs485" />
<Option makefile="makefile" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin\Debug\rs485" 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\rs485" 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="-Wall" />
<Add option="-fexceptions" />
<Add option="-DBACDL_MSTP=1" />
<Add option="-DTEST" />
<Add option="-DTEST_RS485" />
<Add directory="." />
<Add directory="..\..\..\bacnet-stack" />
<Add directory="..\..\demo\handler" />
<Add directory="..\..\demo\object" />
<Add directory="..\..\include" />
</Compiler>
<Unit filename="..\..\include\dlmstp.h" />
<Unit filename="..\..\include\mstp.h" />
<Unit filename="rs485.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="rs485.h" />
<Extensions>
<code_completion />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
+80
View File
@@ -0,0 +1,80 @@
/*####COPYRIGHTBEGIN####
-------------------------------------------
Copyright (C) 2004 Steve Karg
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
The Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307
USA.
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.
This exception does not invalidate any other reasons why a work
based on this file might be covered by the GNU General Public
License.
-------------------------------------------
####COPYRIGHTEND####*/
#ifndef RS485_H
#define RS485_H
#include <stdint.h>
#include "mstp.h"
#include "net.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
void RS485_Set_Interface(
char *ifname);
const char *RS485_Interface(
void);
void RS485_Initialize(
void);
void RS485_Send_Frame(
volatile struct mstp_port_struct_t *mstp_port, /* port specific data */
uint8_t * buffer, /* frame to send (up to 501 bytes of data) */
uint16_t nbytes); /* number of bytes of data (up to 501) */
void RS485_Check_UART_Data(
volatile struct mstp_port_struct_t *mstp_port); /* port specific data */
uint32_t RS485_Get_Baud_Rate(
void);
bool RS485_Set_Baud_Rate(
uint32_t baud);
void RS485_Print_Error(
void);
bool RS485_Interface_Valid(
unsigned port_number);
void RS485_Print_Ports(
void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
+110
View File
@@ -0,0 +1,110 @@
#
# Simple makefile to build an executable for Win32 console
#
# This makefile assumes Borland development environment
# on Windows NT/9x/2000/XP
# Tools: bcc32, make, ilink
!ifndef BORLAND_DIR
BORLAND_DIR_Not_Defined:
@echo .
@echo You must define environment variable BORLAND_DIR to compile.
!endif
PRODUCT = rs485
PRODUCT_EXE = $(PRODUCT).exe
# Choose the Data Link Layer to Enable
DEFINES = -DBACDL_MSTP=1;TEST_RS485;TEST_RS485_TRANSMIT
SRCS = rs485.c
OBJS = $(SRCS:.c=.obj)
# Compiler definitions
#
BCC_CFG = bcc32.cfg
CC = $(BORLAND_DIR)\bin\bcc32 +$(BCC_CFG)
#LINK = $(BORLAND_DIR)\bin\tlink32
LINK = $(BORLAND_DIR)\bin\ilink32
TLIB = $(BORLAND_DIR)\bin\tlib
#
# Include directories
#
CC_DIR = $(BORLAND_DIR)\BIN
BACNET_INCL = ..\..\include;.
INCL_DIRS = -I$(BORLAND_DIR)\include;$(BACNET_INCL)
CFLAGS = $(INCL_DIRS) $(CS_FLAGS) $(DEFINES)
# Libraries
#
C_LIB_DIR = $(BORLAND_DIR)\lib
LIBS = $(C_LIB_DIR)\IMPORT32.lib \
$(C_LIB_DIR)\CW32MT.lib
#
# Main target
#
# This should be the first one in the makefile
all : $(BCC_CFG) $(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly.
#
# need a temp response file (@&&) because command line is too long
$(PRODUCT_EXE) : $(OBJS)
@echo Running Linker for $(PRODUCT_EXE)
$(LINK) -L$(C_LIB_DIR) -m -c -s -v @&&| # temp response file, starts with |
$(BORLAND_DIR)\lib\c0x32.obj $** # $** lists each dependency
$<
$*.map
$(LIBS)
| # end of temp response file
#
# Utilities
clean :
@echo Deleting obj files, $(PRODUCT_EXE) and map files.
del *.obj
del ..\..\*.obj
del ..\..\demo\handler\*.obj
del ..\..\demo\object\*.obj
del $(PRODUCT_EXE)
del *.map
del $(BCC_CFG)
#
# Generic rules
#
.SUFFIXES: .cpp .c .sbr .obj
#
# cc generic rule
#
.c.obj:
$(CC) -o$@ $<
# Compiler configuration file
$(BCC_CFG) :
Copy &&|
$(CFLAGS)
-c
-y #include line numbers in OBJ's
-v #include debug info
-w+ #turn on all warnings
-Od #disable all optimizations
#-a4 #32 bit data alignment
#-M # generate link map
#-ls # linker options
#-WM- #not multithread
-WM #multithread
-w-aus # ignore warning assigned a value that is never used
-w-sig # ignore warning conversion may lose sig digits
| $@
# EOF: makefile
+359
View File
@@ -0,0 +1,359 @@
/*####COPYRIGHTBEGIN####
-------------------------------------------
Copyright (C) 2007 Steve Karg
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
The Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307
USA.
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.
This exception does not invalidate any other reasons why a work
based on this file might be covered by the GNU General Public
License.
-------------------------------------------
####COPYRIGHTEND####*/
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <time.h>
/* Windows includes */
#define WIN32_LEAN_AND_MEAN
#define STRICT 1
#include <windows.h>
/* local includes */
#include "bytes.h"
#include "rs485.h"
#include "mstp.h"
#include "mstptext.h"
#include "crc.h"
#ifndef max
#define max(a,b) (((a) (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
/* file format for libpcap/winpcap */
/* from http://wiki.wireshark.org/Development/LibpcapFileFormat */
typedef struct pcap_hdr_s {
uint32_t magic_number; /* magic number */
uint16_t version_major; /* major version number */
uint16_t version_minor; /* minor version number */
int32_t thiszone; /* GMT to local correction */
uint32_t sigfigs; /* accuracy of timestamps */
uint32_t snaplen; /* max length of captured packets, in octets */
uint32_t network; /* data link type */
} pcap_hdr_t;
typedef struct pcaprec_hdr_s {
uint32_t ts_sec; /* timestamp seconds */
uint32_t ts_usec; /* timestamp microseconds */
uint32_t incl_len; /* number of octets of packet saved in file */
uint32_t orig_len; /* actual length of packet */
} pcaprec_hdr_t;
/* local port data - shared with RS-485 */
volatile struct mstp_port_struct_t MSTP_Port;
static uint8_t RxBuffer[MAX_MPDU];
static uint8_t TxBuffer[MAX_MPDU];
static uint16_t SilenceTime;
#define INCREMENT_AND_LIMIT_UINT16(x) {if (x < 0xFFFF) x++;}
static uint16_t Timer_Silence(
void)
{
return SilenceTime;
}
static void Timer_Silence_Reset(
void)
{
SilenceTime = 0;
}
static void dlmstp_millisecond_timer(
void)
{
INCREMENT_AND_LIMIT_UINT16(SilenceTime);
}
void *milliseconds_task(
void *pArg)
{
(void) pArg;
for (;;) {
Sleep(1);
dlmstp_millisecond_timer();
}
/*return NULL; */
}
/* functions used by the MS/TP state machine to put or get data */
uint16_t MSTP_Put_Receive(
volatile struct mstp_port_struct_t *mstp_port)
{
(void) mstp_port;
return 0;
}
/* for the MS/TP state machine to use for getting data to send */
/* Return: amount of PDU data */
uint16_t MSTP_Get_Send(
volatile struct mstp_port_struct_t * mstp_port,
unsigned timeout)
{ /* milliseconds to wait for a packet */
(void) mstp_port;
(void) timeout;
return 0;
}
uint16_t MSTP_Get_Reply(
volatile struct mstp_port_struct_t * mstp_port,
unsigned timeout)
{ /* milliseconds to wait for a packet */
(void) mstp_port;
(void) timeout;
return 0;
}
#if 0
static void print_received_packet(
volatile struct mstp_port_struct_t *mstp_port)
{
unsigned i;
/* Preamble: two octet preamble: X`55', X`FF' */
/* Frame Type: one octet */
/* Destination Address: one octet address */
/* Source Address: one octet address */
/* Length: two octets, most significant octet first, of the Data field */
/* Header CRC: one octet */
/* Data: (present only if Length is non-zero) */
/* Data CRC: (present only if Length is non-zero) two octets, */
/* least significant octet first */
/* (pad): (optional) at most one octet of padding: X'FF' */
fprintf(stderr, "55 FF %02X %02X %02X %02X %02X %02X ",
mstp_port->FrameType, mstp_port->DestinationAddress,
mstp_port->SourceAddress, HI_BYTE(mstp_port->DataLength),
LO_BYTE(mstp_port->DataLength), mstp_port->HeaderCRCActual);
if (mstp_port->DataLength) {
max_data = min(mstp_port->InputBufferSize, mstp_port->DataLength);
for (i = 0; i < max_data; i++) {
fprintf(stderr, "%02X ", mstp_port->InputBuffer[i]);
}
fprintf(stderr, "%02X %02X ", mstp_port->DataCRCActualMSB,
mstp_port->DataCRCActualLSB);
}
fprintf(stderr, "%s", mstptext_frame_type(mstp_port->FrameType));
fprintf(stderr, "\n");
}
#endif
/* returns a delta timestamp */
void timestamp(
uint32_t * ts_sec, /* timestamp seconds since epoch (Unix) */
uint32_t * ts_usec)
{ /* timestamp microseconds (unix) */
DWORD ticks = 0;
static DWORD initial_ticks = 0;
static time_t initial_seconds = 0;
time_t seconds = 0;
time_t milliseconds = 0;
time_t elapsed_ticks = 0;
if (initial_seconds == 0) {
initial_seconds = time(NULL);
initial_ticks = GetTickCount();
}
ticks = GetTickCount();
/* how much total time has passed? */
elapsed_ticks = ticks - initial_ticks;
seconds = elapsed_ticks / 1000;
milliseconds = elapsed_ticks - (seconds * 1000);
*ts_sec = initial_seconds + seconds;
*ts_usec = milliseconds * 1000;
return;
}
static const char *Capture_Filename = "mstp.cap";
static FILE *pFile = NULL; /* stream pointer */
/* write packet to file in libpcap format */
static void write_global_header(
void)
{
uint32_t magic_number = 0xa1b2c3d4; /* magic number */
uint16_t version_major = 2; /* major version number */
uint16_t version_minor = 4; /* minor version number */
int32_t thiszone = 0; /* GMT to local correction */
uint32_t sigfigs = 0; /* accuracy of timestamps */
uint32_t snaplen = 65535; /* max length of captured packets, in octets */
uint32_t network = 165; /* data link type */
/* create a new file. */
pFile = fopen(Capture_Filename, "wb");
if (pFile) {
fwrite(&magic_number, sizeof(magic_number), 1, pFile);
fwrite(&version_major, sizeof(version_major), 1, pFile);
fwrite(&version_minor, sizeof(version_minor), 1, pFile);
fwrite(&thiszone, sizeof(thiszone), 1, pFile);
fwrite(&sigfigs, sizeof(sigfigs), 1, pFile);
fwrite(&snaplen, sizeof(snaplen), 1, pFile);
fwrite(&network, sizeof(network), 1, pFile);
} else {
fprintf(stderr, "rx_fsm: failed to open %s: %s\n", Capture_Filename,
strerror(errno));
}
}
static void write_received_packet(
volatile struct mstp_port_struct_t *mstp_port)
{
uint32_t ts_sec; /* timestamp seconds */
uint32_t ts_usec; /* timestamp microseconds */
uint32_t incl_len; /* number of octets of packet saved in file */
uint32_t orig_len; /* actual length of packet */
uint8_t header[8]; /* MS/TP header */
if (pFile) {
timestamp(&ts_sec, &ts_usec);
fwrite(&ts_sec, sizeof(ts_sec), 1, pFile);
fwrite(&ts_usec, sizeof(ts_usec), 1, pFile);
if (mstp_port->DataLength) {
max_data = min(mstp_port->InputBufferSize, mstp_port->DataLength);
incl_len = orig_len = 8 + max_data + 2;
} else {
incl_len = orig_len = 8;
}
fwrite(&incl_len, sizeof(incl_len), 1, pFile);
fwrite(&orig_len, sizeof(orig_len), 1, pFile);
header[0] = 0x55;
header[1] = 0xFF;
header[2] = mstp_port->FrameType;
header[3] = mstp_port->DestinationAddress;
header[4] = mstp_port->SourceAddress;
header[5] = HI_BYTE(mstp_port->DataLength);
header[6] = LO_BYTE(mstp_port->DataLength);
header[7] = mstp_port->HeaderCRCActual;
fwrite(header, sizeof(header), 1, pFile);
if (mstp_port->DataLength) {
fwrite(&(mstp_port->DataCRCActualMSB), 1, 1, pFile);
fwrite(&(mstp_port->DataCRCActualLSB), 1, 1, pFile);
}
} else {
fprintf(stderr, "rx_fsm: failed to open %s: %s\n", Capture_Filename,
strerror(errno));
}
}
static char *Network_Interface = NULL;
static void cleanup(
void)
{
if (pFile) {
fflush(pFile); /* stream pointer */
fclose(pFile); /* stream pointer */
}
pFile = NULL;
}
/* simple test to packetize the data and print it */
int main(
int argc,
char *argv[])
{
volatile struct mstp_port_struct_t *mstp_port;
int rc = 0;
unsigned long hThread = 0;
uint32_t arg_value = 0;
long my_mac = 127;
long my_baud = 38400;
/* mimic our pointer in the state machine */
mstp_port = &MSTP_Port;
/* argv has the "COM4" or some other device */
if (argc > 1) {
Network_Interface = argv[1];
}
if (argc > 2) {
my_baud = strtol(argv[2], NULL, 0);
}
if (argc > 3) {
my_mac = strtol(argv[3], NULL, 0);
if (my_mac > 127)
my_mac = 127;
}
/* initialize our interface */
RS485_Set_Interface(Network_Interface);
RS485_Set_Baud_Rate(my_baud);
RS485_Initialize();
MSTP_Port.InputBuffer = &RxBuffer[0];
MSTP_Port.InputBufferSize = sizeof(RxBuffer);
MSTP_Port.OutputBuffer = &TxBuffer[0];
MSTP_Port.OutputBufferSize = sizeof(TxBuffer);
MSTP_Port.This_Station = my_mac;
MSTP_Port.Nmax_info_frames = 1;
MSTP_Port.Nmax_master = 127;
MSTP_Port.SilenceTimer = Timer_Silence;
MSTP_Port.SilenceTimerReset = Timer_Silence_Reset;
MSTP_Init(&MSTP_Port);
mstp_port->Lurking = true;
/* start our MilliSec task */
hThread = _beginthread(milliseconds_task, 4096, &arg_value);
if (hThread == 0) {
fprintf(stderr, "Failed to start timer task\n");
}
atexit(cleanup);
write_global_header();
(void) SetThreadPriority(GetCurrentThread(),
THREAD_PRIORITY_TIME_CRITICAL);
/* run forever */
for (;;) {
RS485_Check_UART_Data(mstp_port);
MSTP_Receive_Frame_FSM(mstp_port);
/* process the data portion of the frame */
if (mstp_port->ReceivedValidFrame) {
mstp_port->ReceivedValidFrame = false;
#if 0
print_received_packet(mstp_port);
#endif
write_received_packet(mstp_port);
} else if (mstp_port->ReceivedInvalidFrame) {
mstp_port->ReceivedInvalidFrame = false;
fprintf(stderr, "ReceivedInvalidFrame\n");
#if 0
print_received_packet(mstp_port);
#endif
write_received_packet(mstp_port);
}
}
/*return 0; */
}
+77
View File
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="rx_fsm" />
<Option makefile="makefile" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="rx_fsm" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Debug\" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
<Add directory="." />
<Add directory="..\..\" />
</Compiler>
</Target>
<Target title="Release">
<Option output="rx_fsm" 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="-Wall" />
<Add option="-fexceptions" />
<Add option="-DBACDL_MSTP=1" />
<Add option="-DBACAPP_ALL" />
<Add option="-DPRINT_ENABLED=1" />
<Add directory="." />
<Add directory="..\..\include" />
</Compiler>
<Unit filename="..\..\include\crc.h" />
<Unit filename="..\..\include\debug.h" />
<Unit filename="..\..\include\indtext.h" />
<Unit filename="..\..\include\mstp.h" />
<Unit filename="..\..\include\mstptext.h" />
<Unit filename="rs485.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="rx_fsm.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="stdbool.h" />
<Unit filename="stdint.h" />
<Unit filename="..\..\src\crc.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\..\src\debug.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\..\src\indtext.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\..\src\mstp.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\..\src\mstptext.c">
<Option compilerVar="CC" />
</Unit>
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
+114
View File
@@ -0,0 +1,114 @@
#
# Simple makefile to build an executable for Win32 console
#
# This makefile assumes Borland development environment
# on Windows NT/9x/2000/XP
# Tools: bcc32, make, ilink
!ifndef BORLAND_DIR
BORLAND_DIR_Not_Defined:
@echo .
@echo You must define environment variable BORLAND_DIR to compile.
!endif
PRODUCT = rx_fsm
PRODUCT_EXE = $(PRODUCT).exe
# Choose the Data Link Layer to Enable
DEFINES = -DBACDL_MSTP -DBACAPP_ALL -DPRINT_ENABLED=1
#DEFINED += -DPRINT_ENABLED_RECEIVE_DATA=1
SRCS = rs485.c \
rx_fsm.c \
..\..\src\mstp.c \
..\..\src\mstptext.c \
..\..\src\indtext.c \
..\..\src\crc.c
OBJS = $(SRCS:.c=.obj)
# Compiler definitions
#
BCC_CFG = bcc32.cfg
CC = $(BORLAND_DIR)\bin\bcc32 +$(BCC_CFG)
#LINK = $(BORLAND_DIR)\bin\tlink32
LINK = $(BORLAND_DIR)\bin\ilink32
TLIB = $(BORLAND_DIR)\bin\tlib
#
# Include directories
#
CC_DIR = $(BORLAND_DIR)\BIN
BACNET_INCL = ..\..\include;.
INCL_DIRS = -I$(BORLAND_DIR)\include;$(BACNET_INCL)
CFLAGS = $(INCL_DIRS) $(CS_FLAGS) $(DEFINES)
# Libraries
#
C_LIB_DIR = $(BORLAND_DIR)\lib
LIBS = $(C_LIB_DIR)\IMPORT32.lib \
$(C_LIB_DIR)\CW32MT.lib
#
# Main target
#
# This should be the first one in the makefile
all : $(BCC_CFG) $(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly.
#
# need a temp response file (@&&) because command line is too long
$(PRODUCT_EXE) : $(OBJS)
@echo Running Linker for $(PRODUCT_EXE)
$(LINK) -L$(C_LIB_DIR) -m -c -s -v @&&| # temp response file, starts with |
$(BORLAND_DIR)\lib\c0x32.obj $** # $** lists each dependency
$<
$*.map
$(LIBS)
| # end of temp response file
#
# Utilities
clean :
@echo Deleting obj files, $(PRODUCT_EXE) and map files.
del $(OBJS)
del $(PRODUCT_EXE)
del *.map
del $(BCC_CFG)
#
# Generic rules
#
.SUFFIXES: .cpp .c .sbr .obj
#
# cc generic rule
#
.c.obj:
$(CC) -o$@ $<
# Compiler configuration file
$(BCC_CFG) :
Copy &&|
$(CFLAGS)
-c
-y #include line numbers in OBJ's
-v #include debug info
-w+ #turn on all warnings
-Od #disable all optimizations
#-a4 #32 bit data alignment
#-M # generate link map
#-ls # linker options
#-WM- #not multithread
-WM #multithread
-w-aus # ignore warning assigned a value that is never used
-w-sig # ignore warning conversion may lose sig digits
| $@
# EOF: makefile
+2
View File
@@ -0,0 +1,2 @@
set BORLAND_DIR=\bcc55
+31
View File
@@ -0,0 +1,31 @@
#ifndef _STDBOOL_H
#define _STDBOOL_H
#include <stdint.h>
/* C99 Boolean types for compilers without C99 support */
/* http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html */
#if !defined(__cplusplus)
#if !defined(__GNUC__)
/* _Bool builtin type is included in GCC */
/* ISO C Standard: 5.2.5 An object declared as
type _Bool is large enough to store
the values 0 and 1. */
/* We choose 8 bit to match C++ */
/* It must also promote to integer */
#if _MSC_VER < 1600
typedef int8_t _Bool;
#endif /* _MSC_VER < 1600 VS 2010 and earlier */
#endif
/* ISO C Standard: 7.16 Boolean type */
#define bool _Bool
#define true 1
#define false 0
#define __bool_true_false_are_defined 1
#endif
#endif
+31
View File
@@ -0,0 +1,31 @@
/* Defines the standard integer types that are used in code */
/* for the x86 processor and Borland Compiler */
#ifndef _STDINT_H
#define _STDINT_H
#include <stddef.h>
typedef unsigned char uint8_t; /* 1 byte 0 to 255 */
typedef signed char int8_t; /* 1 byte -127 to 127 */
typedef unsigned short uint16_t; /* 2 bytes 0 to 65535 */
typedef signed short int16_t; /* 2 bytes -32767 to 32767 */
/*typedef unsigned short long uint24_t; // 3 bytes 0 to 16777215 */
typedef unsigned uint32_t; /* 4 bytes 0 to 4294967295 */
typedef int int32_t; /* 4 bytes -2147483647 to 2147483647 */
/* typedef signed long long int64_t; */
/* typedef unsigned long long uint64_t; */
#define INT8_MIN (-128)
#define INT16_MIN (-32768)
#define INT32_MIN (-2147483647 - 1)
#define INT8_MAX 127
#define INT16_MAX 32767
#define INT32_MAX 2147483647
#define UINT8_MAX 0xff /* 255U */
#define UINT16_MAX 0xffff /* 65535U */
#define UINT32_MAX 0xffffffff /* 4294967295U */
#endif /* STDINT_H */
+281
View File
@@ -0,0 +1,281 @@
/**************************************************************************
*
* Copyright (C) 2009 Steve Karg <skarg@users.sourceforge.net>
* Multimedia Timer contribution by Cameron Crothers, 2008
*
* 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.
*
*********************************************************************/
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
#define WIN32_LEAN_AND_MEAN
#define STRICT 1
#include <windows.h>
#include "net.h"
#include <MMSystem.h>
#include "timer.h"
/* Offset between Windows epoch 1/1/1601 and
Unix epoch 1/1/1970 in 100 nanosec units */
#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) || defined(__BORLANDC__)
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
#else
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
#endif
/* counter for the various timers */
static volatile uint32_t Millisecond_Counter[MAX_MILLISECOND_TIMERS];
/* Windows timer period - in milliseconds */
static uint32_t Timer_Period = 1;
#if defined(_MSC_VER) || defined(__BORLANDC__)
struct timezone {
int tz_minuteswest; /* minutes W of Greenwich */
int tz_dsttime; /* type of dst correction */
};
/*************************************************************************
* Description: simulate the gettimeofday Linux function
* Returns: zero
* Note: The resolution of GetSystemTimeAsFileTime() is 15625 microseconds.
* The resolution of _ftime() is about 16 milliseconds.
* To get microseconds accuracy we need to use QueryPerformanceCounter or
* timeGetTime for the elapsed time.
*************************************************************************/
int gettimeofday(
struct timeval *tp,
void *tzp)
{
static int tzflag = 0;
struct timezone *tz;
/* start calendar time in microseconds */
static LONGLONG usec_timer = 0;
LONGLONG usec_elapsed = 0;
/* elapsed time in milliseconds */
static uint32_t time_start = 0;
/* semi-accurate time from File Timer */
FILETIME ft;
uint32_t elapsed_milliseconds = 0;
tzp = tzp;
if (usec_timer == 0) {
/* a 64-bit value representing the number of
100-nanosecond intervals since January 1, 1601 (UTC). */
GetSystemTimeAsFileTime(&ft);
usec_timer = ft.dwHighDateTime;
usec_timer <<= 32;
usec_timer |= ft.dwLowDateTime;
/*converting file time to unix epoch 1970 */
usec_timer /= 10; /*convert into microseconds */
usec_timer -= DELTA_EPOCH_IN_MICROSECS;
tp->tv_sec = (long) (usec_timer / 1000000UL);
tp->tv_usec = (long) (usec_timer % 1000000UL);
time_start = timeGetTime();
} else {
elapsed_milliseconds = timeGetTime() - time_start;
usec_elapsed = usec_timer + ((LONGLONG) elapsed_milliseconds * 1000UL);
tp->tv_sec = (long) (usec_elapsed / 1000000UL);
tp->tv_usec = (long) (usec_elapsed % 1000000UL);
}
if (tzp) {
if (!tzflag) {
_tzset();
tzflag++;
}
tz = tzp;
tz->tz_minuteswest = _timezone / 60;
tz->tz_dsttime = _daylight;
}
return 0;
}
#endif
/*************************************************************************
* Description: returns the current millisecond count
* Returns: none
* Notes: none
*************************************************************************/
uint32_t timer_milliseconds(
unsigned index)
{
uint32_t now = timeGetTime();
uint32_t delta_time = 0;
if (index < MAX_MILLISECOND_TIMERS) {
if (Millisecond_Counter[index] <= now) {
delta_time = now - Millisecond_Counter[index];
} else {
delta_time = (UINT32_MAX - Millisecond_Counter[index]) + now + 1;
}
}
return delta_time;
}
/*************************************************************************
* Description: compares the current time count with a value
* Returns: true if the time has elapsed
* Notes: none
*************************************************************************/
bool timer_elapsed_milliseconds(
unsigned index,
uint32_t value)
{
return (timer_milliseconds(index) >= value);
}
/*************************************************************************
* Description: compares the current time count with a value
* Returns: true if the time has elapsed
* Notes: none
*************************************************************************/
bool timer_elapsed_seconds(
unsigned index,
uint32_t seconds)
{
return ((timer_milliseconds(index) / 1000) >= seconds);
}
/*************************************************************************
* Description: compares the current time count with a value
* Returns: true if the time has elapsed
* Notes: none
*************************************************************************/
bool timer_elapsed_minutes(
unsigned index,
uint32_t minutes)
{
return ((timer_milliseconds(index) / (1000 * 60)) >= minutes);
}
/*************************************************************************
* Description: Sets the timer counter to zero.
* Returns: none
* Notes: none
*************************************************************************/
uint32_t timer_reset(
unsigned index)
{
uint32_t timer_value = timer_milliseconds(index);
if (index < MAX_MILLISECOND_TIMERS) {
Millisecond_Counter[index] = timeGetTime();
}
return timer_value;
}
/*************************************************************************
* Description: Shut down for timer
* Returns: none
* Notes: none
*************************************************************************/
static void timer_cleanup(
void)
{
timeEndPeriod(Timer_Period);
}
/*************************************************************************
* Description: Initialization for timer
* Returns: none
* Notes: none
*************************************************************************/
void timer_init(
void)
{
TIMECAPS tc;
/* set timer resolution */
if (timeGetDevCaps(&tc, sizeof(TIMECAPS)) != TIMERR_NOERROR) {
fprintf(stderr, "Failed to get timer resolution parameters\n");
}
/* configure for 1ms resolution - if possible */
Timer_Period = min(max(tc.wPeriodMin, 1L), tc.wPeriodMax);
if (Timer_Period != 1L) {
fprintf(stderr,
"Failed to set timer to 1ms. " "Time period set to %ums\n",
(unsigned) Timer_Period);
}
timeBeginPeriod(Timer_Period);
atexit(timer_cleanup);
}
#ifdef TEST_TIMER_WIN
static uint32_t timeval_diff_ms(
struct timeval *old,
struct timeval *now)
{
uint32_t ms = 0;
/* convert to milliseconds */
ms = (now->tv_sec - old->tv_sec) * 1000 + (now->tv_usec -
old->tv_usec) / 1000;
return ms;
}
int main(
int argc,
char *argv[])
{
long now = 0, last = 0, delta = 0;
struct timeval tv;
struct timeval old_tv = { 0 };
timer_init();
printf("Testing granularity of timeGetTime()...\n");
timer_reset(0);
for (;;) {
now = timeGetTime();
delta = now - last;
if (delta) {
if (delta > 1) {
printf("Delta is %ld.\n", delta);
}
last = now;
}
if (timer_elapsed_milliseconds(0, 5000)) {
break;
}
}
printf("Testing granularity of gettimeofday()...\n");
for (;;) {
gettimeofday(&tv, NULL);
delta = timeval_diff_ms(&old_tv, &tv);
if (delta) {
if (delta > 1) {
printf("Delta is %ld.\n", delta);
}
old_tv.tv_sec = tv.tv_sec;
old_tv.tv_usec = tv.tv_usec;
}
if (timer_elapsed_milliseconds(0, 10000)) {
break;
}
}
}
#endif
+82
View File
@@ -0,0 +1,82 @@
/**************************************************************************
*
* Copyright (C) 2009 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 TIMER_H
#define TIMER_H
#include <stdbool.h>
#include <stdint.h>
#define WIN32_LEAN_AND_MEAN
#define STRICT 1
#include <windows.h>
#if defined(__BORLANDC__)
#include <winsock2.h>
#else
#if !defined(_MSC_VER)
#include <sys/time.h>
#endif
#endif
#include <sys/timeb.h>
#if defined(__BORLANDC__)
#define _timeb timeb
#define _ftime(param) ftime(param)
#endif
/* Timer Module */
#ifndef MAX_MILLISECOND_TIMERS
#define TIMER_SILENCE 0
#define MAX_MILLISECOND_TIMERS 1
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
int gettimeofday(
struct timeval *tp,
void *tzp);
void timer_init(
void);
uint32_t timer_milliseconds(
unsigned index);
bool timer_elapsed_milliseconds(
unsigned index,
uint32_t value);
bool timer_elapsed_seconds(
unsigned index,
uint32_t value);
bool timer_elapsed_minutes(
unsigned index,
uint32_t seconds);
uint32_t timer_milliseconds_set(
unsigned index,
uint32_t value);
uint32_t timer_reset(
unsigned index);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif