Commit 8fb74fbf authored by captainwong's avatar captainwong

2.4.0

parent ea2321a6
# Ademco Change Log # Ademco Change Log
## 2.4.0 2024-4-18 04:28:43
- split some features from `hb_com` to `hb_core`
## 2.3.0 2024-4-17 17:38:01
## 2.2.2 2024-4-15 13:35:39
## 2.2.1 ## 2.2.1
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
*/ */
#define ADEMCO_VERSION_MAJOR 2 #define ADEMCO_VERSION_MAJOR 2
#define ADEMCO_VERSION_MINOR 2 #define ADEMCO_VERSION_MINOR 4
#define ADEMCO_VERSION_PATCH 1 #define ADEMCO_VERSION_PATCH 0
#define ADEMCO_VERSION_IS_RELEASE 1 #define ADEMCO_VERSION_IS_RELEASE 1
#define ADEMCO_VERSION_SUFFIX "" #define ADEMCO_VERSION_SUFFIX ""
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
|EB BA 3F 07 *P0* **A9** SUM|7|测试地址回应、激活|*P0*:语音| |EB BA 3F 07 *P0* **A9** SUM|7|测试地址回应、激活|*P0*:语音|
|EB BA 3F 09 *P0* **AB** *P1 P2* SUM|9|修改防区探头遗失/失联回应|*P0*:语音;*P1*:防区号;*P2*:0失联关,1失联开,2拒绝设置| |EB BA 3F 09 *P0* **AB** *P1 P2* SUM|9|修改防区探头遗失/失联回应|*P0*:语音;*P1*:防区号;*P2*:0失联关,1失联开,2拒绝设置|
|EB BA 3F *PN* *P0* **AD** *P1 DATA P2* SUM|变长|索要防区探头遗失/失联回应|回应所有失联开的防区。<br/> *PN*:本条数据包含多少字节;*P0*:语音;<br/> *P1*:F0指示DATA以1个字节表示防区号,F1表示DATA以2个字节表示防区号;<br/> *DATA*:所有失联开的防区;<br/> *P2*:FF表示传输结束,其他表示还有更多数据| |EB BA 3F *PN* *P0* **AD** *P1 DATA P2* SUM|变长|索要防区探头遗失/失联回应|回应所有失联开的防区。<br/> *PN*:本条数据包含多少字节;*P0*:语音;<br/> *P1*:F0指示DATA以1个字节表示防区号,F1表示DATA以2个字节表示防区号;<br/> *DATA*:所有失联开的防区;<br/> *P2*:FF表示传输结束,其他表示还有更多数据|
|EB BA 3F 08 *P0* **AF** *P1 P2* SUM|9|三区段主机布撤防回应|*P0*:语音;*P1*:0主机,1区段1,2区段2,3区段3;*P2*:0布防成功,1撤防成功| |EB BA 3F 09 *P0* **AF** *P1 P2* SUM|9|三区段主机布撤防回应|*P0*:语音;*P1*:0主机,1区段1,2区段2,3区段3;*P2*:0布防成功,1撤防成功|
|EB BA 3F 08 *P0* **B1** *P1* SUM|8|三区段主机索要状态回应|*P0*:语音;<br/> *P1*:8位,7/6位主机状态,5/4位区段1状态,3/2位区段2状态,1/0位区段3状态<br/> 值为0布防,1撤防| |EB BA 3F 08 *P0* **B1** *P1* SUM|8|三区段主机索要状态回应|*P0*:语音;<br/> *P1*:8位,7/6位主机状态,5/4位区段1状态,3/2位区段2状态,1/0位区段3状态<br/> 值为0布防,1撤防|
|EB BA 3F 07 *P0* **A8** SUM|7|拒绝设置|主机如果认为对方的命令非法,都可以回复此条命令| |EB BA 3F 07 *P0* **A8** SUM|7|拒绝设置|主机如果认为对方的命令非法,都可以回复此条命令|
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32"> <ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32"> <ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|x64"> <ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion> <VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<ProjectGuid>{0757ea7c-9e3f-4f2f-8544-b1e649c9749a}</ProjectGuid> <ProjectGuid>{0757ea7c-9e3f-4f2f-8544-b1e649c9749a}</ProjectGuid>
<RootNamespace>ademco</RootNamespace> <RootNamespace>ademco</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
</ImportGroup> </ImportGroup>
<ImportGroup Label="Shared"> <ImportGroup Label="Shared">
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <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="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <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="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;WIN32;_DEBUG;ADEMCO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;WIN32;_DEBUG;ADEMCO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC> <EnableUAC>false</EnableUAC>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;WIN32;NDEBUG;ADEMCO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;WIN32;NDEBUG;ADEMCO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC> <EnableUAC>false</EnableUAC>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;_DEBUG;ADEMCO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;_DEBUG;ADEMCO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC> <EnableUAC>false</EnableUAC>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;NDEBUG;ADEMCO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;NDEBUG;ADEMCO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC> <EnableUAC>false</EnableUAC>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\ademco.c" /> <ClCompile Include="..\..\ademco.c" />
<ClCompile Include="..\..\hb_com.c" /> <ClCompile Include="..\..\hb_core.c" />
<ClCompile Include="dllmain.cpp" /> <ClCompile Include="dllmain.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\ademco.h" /> <ClInclude Include="..\..\ademco.h" />
<ClInclude Include="..\..\hb_com.h" /> <ClInclude Include="..\..\hb_core.h" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<Filter Include="Source Files"> <Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions> <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter> </Filter>
<Filter Include="Header Files"> <Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions> <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter> </Filter>
<Filter Include="Resource Files"> <Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> <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> <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter> </Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="dllmain.cpp"> <ClCompile Include="dllmain.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\ademco.c"> <ClCompile Include="..\..\ademco.c">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\hb_com.c"> <ClCompile Include="..\..\hb_core.c">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\ademco.h"> <ClInclude Include="..\..\ademco.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\hb_com.h"> <ClInclude Include="..\..\hb_core.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32"> <ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32"> <ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|x64"> <ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\ademco.c" /> <ClCompile Include="..\..\ademco.c" />
<ClCompile Include="..\..\hb_com.c" /> <ClCompile Include="..\..\hb_core.c" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\ademco.h" /> <ClInclude Include="..\..\ademco.h" />
<ClInclude Include="..\..\hb_com.h" /> <ClInclude Include="..\..\hb_core.h" />
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion> <VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<ProjectGuid>{3a477fa2-f84e-40e5-9767-0ffbd35bc57a}</ProjectGuid> <ProjectGuid>{3a477fa2-f84e-40e5-9767-0ffbd35bc57a}</ProjectGuid>
<RootNamespace>ademcostatic</RootNamespace> <RootNamespace>ademcostatic</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
</ImportGroup> </ImportGroup>
<ImportGroup Label="Shared"> <ImportGroup Label="Shared">
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <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="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <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="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem> <SubSystem>
</SubSystem> </SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem> <SubSystem>
</SubSystem> </SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem> <SubSystem>
</SubSystem> </SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem> <SubSystem>
</SubSystem> </SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<Filter Include="Source Files"> <Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions> <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter> </Filter>
<Filter Include="Header Files"> <Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions> <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter> </Filter>
<Filter Include="Resource Files"> <Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> <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> <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter> </Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\ademco.c"> <ClCompile Include="..\..\ademco.c">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\hb_com.c"> <ClCompile Include="..\..\hb_core.c">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\ademco.h"> <ClInclude Include="..\..\ademco.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\hb_com.h"> <ClInclude Include="..\..\hb_core.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32"> <ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32"> <ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|x64"> <ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\ademco.c" /> <ClCompile Include="..\..\ademco.c" />
<ClCompile Include="..\..\hb_com.c" /> <ClCompile Include="..\..\hb_core.c" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\ademco.h" /> <ClInclude Include="..\..\ademco.h" />
<ClInclude Include="..\..\hb_com.h" /> <ClInclude Include="..\..\hb_core.h" />
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion> <VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<ProjectGuid>{0aa93a45-37ce-40de-a0e9-7163941dfb2a}</ProjectGuid> <ProjectGuid>{0aa93a45-37ce-40de-a0e9-7163941dfb2a}</ProjectGuid>
<RootNamespace>ademcostaticmt</RootNamespace> <RootNamespace>ademcostaticmt</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
</ImportGroup> </ImportGroup>
<ImportGroup Label="Shared"> <ImportGroup Label="Shared">
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <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="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <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="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem> <SubSystem>
</SubSystem> </SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem> <SubSystem>
</SubSystem> </SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem> <SubSystem>
</SubSystem> </SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ADEMCO_ENABLE_CHINESE;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem> <SubSystem>
</SubSystem> </SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<Filter Include="Source Files"> <Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions> <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter> </Filter>
<Filter Include="Header Files"> <Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions> <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter> </Filter>
<Filter Include="Resource Files"> <Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> <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> <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter> </Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\ademco.c"> <ClCompile Include="..\..\ademco.c">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\hb_com.c"> <ClCompile Include="..\..\hb_core.c">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\ademco.h"> <ClInclude Include="..\..\ademco.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\hb_com.h"> <ClInclude Include="..\..\hb_core.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>
\ No newline at end of file
#include "../../ademco.h" #include "../../ademco.h"
#include "../../hb_com.h" #include "../../hb_core.h"
#include <jlib/win32/UnicodeTool.h> #include <jlib/win32/UnicodeTool.h>
#include <jlib/win32/path_op.h> #include <jlib/win32/path_op.h>
#include <jlib/util/std_util.h> #include <jlib/util/std_util.h>
......
#include <stdio.h> #include <stdio.h>
#include "../../hb_com.h" #include "../../hb_core.h"
#include "uvlib/uv_log.h" #include "uvlib/uv_log.h"
#include "uvlib/uv_tcpserver.h" #include "uvlib/uv_tcpserver.h"
#include "cJSON/cJSON.h" #include "cJSON/cJSON.h"
......
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\ademco.c" /> <ClCompile Include="..\..\ademco.c" />
<ClCompile Include="..\..\hb_com.c" /> <ClCompile Include="..\..\hb_core.c" />
<ClCompile Include="cJSON\cJSON.c" /> <ClCompile Include="cJSON\cJSON.c" />
<ClCompile Include="httprelay.c" /> <ClCompile Include="httprelay.c" />
<ClCompile Include="uvlib\llhttp\src\api.c" /> <ClCompile Include="uvlib\llhttp\src\api.c" />
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\ademco.h" /> <ClInclude Include="..\..\ademco.h" />
<ClInclude Include="..\..\hb_com.h" /> <ClInclude Include="..\..\hb_core.h" />
<ClInclude Include="cJSON\cJSON.h" /> <ClInclude Include="cJSON\cJSON.h" />
<ClInclude Include="uvlib\list.h" /> <ClInclude Include="uvlib\list.h" />
<ClInclude Include="uvlib\mybuf.h" /> <ClInclude Include="uvlib\mybuf.h" />
......
...@@ -30,9 +30,6 @@ ...@@ -30,9 +30,6 @@
<ClCompile Include="..\..\ademco.c"> <ClCompile Include="..\..\ademco.c">
<Filter>ademco</Filter> <Filter>ademco</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\hb_com.c">
<Filter>ademco</Filter>
</ClCompile>
<ClCompile Include="httprelay.c"> <ClCompile Include="httprelay.c">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
...@@ -69,14 +66,14 @@ ...@@ -69,14 +66,14 @@
<ClCompile Include="uvlib\uv_tcp.c"> <ClCompile Include="uvlib\uv_tcp.c">
<Filter>uvlib</Filter> <Filter>uvlib</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\hb_core.c">
<Filter>ademco</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\ademco.h"> <ClInclude Include="..\..\ademco.h">
<Filter>ademco</Filter> <Filter>ademco</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\hb_com.h">
<Filter>ademco</Filter>
</ClInclude>
<ClInclude Include="uvlib\list.h"> <ClInclude Include="uvlib\list.h">
<Filter>uvlib</Filter> <Filter>uvlib</Filter>
</ClInclude> </ClInclude>
...@@ -107,5 +104,8 @@ ...@@ -107,5 +104,8 @@
<ClInclude Include="cJSON\cJSON.h"> <ClInclude Include="cJSON\cJSON.h">
<Filter>cJSON</Filter> <Filter>cJSON</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\hb_core.h">
<Filter>ademco</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>
\ No newline at end of file
#include "hb_com.h" #include "hb_core.h"
#include <string.h> #include <string.h>
size_t hb_get_available_zone_properties_by_type(hb_machine_type_t type, size_t hb_get_available_zone_properties_by_type(hb_machine_type_t type,
hb_zone_property_t props[HZP_COUNT]) { hb_zone_property_t props[HZP_COUNT]) {
switch (type) { switch (type) {
case HMT_WIFI: case HMT_WIFI:
break; break;
case HMT_CAMERA: case HMT_CAMERA:
break; break;
case HMT_GPRS_IOT: case HMT_GPRS_IOT:
case HMT_GPRS: case HMT_GPRS:
case HMT_WIFI2: { case HMT_WIFI2: {
hb_zone_property_t hzps[] = { hb_zone_property_t hzps[] = {
HZP_BUGLAR, HZP_BUGLAR,
HZP_EMERGENCY, HZP_EMERGENCY,
HZP_FIRE, HZP_FIRE,
HZP_DURESS, HZP_DURESS,
HZP_GAS, HZP_GAS,
HZP_WATER, HZP_WATER,
HZP_REMOTE_CONTROL, HZP_REMOTE_CONTROL,
}; };
memcpy(props, hzps, sizeof(hzps)); memcpy(props, hzps, sizeof(hzps));
return sizeof(hzps) / sizeof(hb_zone_property_t); return sizeof(hzps) / sizeof(hb_zone_property_t);
} }
case HMT_NETMOD: { case HMT_NETMOD: {
hb_zone_property_t hzps[] = { hb_zone_property_t hzps[] = {
HZP_BUGLAR, HZP_BUGLAR,
HZP_EMERGENCY, HZP_EMERGENCY,
HZP_FIRE, HZP_FIRE,
HZP_DURESS, HZP_DURESS,
HZP_GAS, HZP_GAS,
HZP_WATER, HZP_WATER,
HZP_SUB_MACHINE, HZP_SUB_MACHINE,
HZP_REMOTE_CONTROL, HZP_REMOTE_CONTROL,
HZP_BUGLAR_HALF, HZP_BUGLAR_HALF,
HZP_SHIELD, HZP_SHIELD,
HZP_DOOR_RING, HZP_DOOR_RING,
}; };
memcpy(props, hzps, sizeof(hzps)); memcpy(props, hzps, sizeof(hzps));
return sizeof(hzps) / sizeof(hb_zone_property_t); return sizeof(hzps) / sizeof(hb_zone_property_t);
} }
case HMT_LCD: { case HMT_LCD: {
hb_zone_property_t hzps[] = { hb_zone_property_t hzps[] = {
HZP_BUGLAR, HZP_EMERGENCY, HZP_FIRE, HZP_BUGLAR, HZP_EMERGENCY, HZP_FIRE,
HZP_DURESS, HZP_GAS, HZP_WATER, HZP_SUB_MACHINE, HZP_DURESS, HZP_GAS, HZP_WATER, HZP_SUB_MACHINE,
HZP_REMOTE_CONTROL, HZP_BUGLAR_HALF, HZP_SHIELD, HZP_REMOTE_CONTROL, HZP_BUGLAR_HALF, HZP_SHIELD,
HZP_DOOR_RING, HZP_BYPASS}; HZP_DOOR_RING, HZP_BYPASS};
memcpy(props, hzps, sizeof(hzps)); memcpy(props, hzps, sizeof(hzps));
return sizeof(hzps) / sizeof(hb_zone_property_t); return sizeof(hzps) / sizeof(hb_zone_property_t);
} }
case HMT_WIRED: { case HMT_WIRED: {
hb_zone_property_t hzps[] = { hb_zone_property_t hzps[] = {
HZP_BUGLAR, HZP_BUGLAR,
HZP_EMERGENCY, HZP_EMERGENCY,
HZP_FIRE, HZP_FIRE,
HZP_DURESS, HZP_DURESS,
HZP_GAS, HZP_GAS,
HZP_WATER, HZP_WATER,
HZP_REMOTE_CONTROL, HZP_REMOTE_CONTROL,
}; };
memcpy(props, hzps, sizeof(hzps)); memcpy(props, hzps, sizeof(hzps));
return sizeof(hzps) / sizeof(hb_zone_property_t); return sizeof(hzps) / sizeof(hb_zone_property_t);
} }
case HMT_TRUE_COLOR: { case HMT_TRUE_COLOR: {
hb_zone_property_t hzps[] = { hb_zone_property_t hzps[] = {
HZP_BUGLAR, HZP_EMERGENCY, HZP_FIRE, HZP_BUGLAR, HZP_EMERGENCY, HZP_FIRE,
HZP_DURESS, HZP_GAS, HZP_WATER, HZP_REMOTE_CONTROL, HZP_DURESS, HZP_GAS, HZP_WATER, HZP_REMOTE_CONTROL,
HZP_SHIELD, HZP_DOOR_RING, HZP_BYPASS}; HZP_SHIELD, HZP_DOOR_RING, HZP_BYPASS};
memcpy(props, hzps, sizeof(hzps)); memcpy(props, hzps, sizeof(hzps));
return sizeof(hzps) / sizeof(hb_zone_property_t); return sizeof(hzps) / sizeof(hb_zone_property_t);
} }
case HMT_THREE_SECTION: { case HMT_THREE_SECTION: {
hb_zone_property_t hzps[] = { hb_zone_property_t hzps[] = {
HZP_BUGLAR, HZP_EMERGENCY, HZP_FIRE, HZP_BUGLAR, HZP_EMERGENCY, HZP_FIRE,
HZP_DURESS, HZP_GAS, HZP_WATER, HZP_REMOTE_CONTROL, HZP_DURESS, HZP_GAS, HZP_WATER, HZP_REMOTE_CONTROL,
HZP_SHIELD, HZP_DOOR_RING, HZP_BYPASS}; HZP_SHIELD, HZP_DOOR_RING, HZP_BYPASS};
memcpy(props, hzps, sizeof(hzps)); memcpy(props, hzps, sizeof(hzps));
return sizeof(hzps) / sizeof(hb_zone_property_t); return sizeof(hzps) / sizeof(hb_zone_property_t);
} }
case HMT_IOT: { case HMT_IOT: {
hb_zone_property_t hzps[] = { hb_zone_property_t hzps[] = {
HZP_BUGLAR, HZP_EMERGENCY, HZP_FIRE, HZP_BUGLAR, HZP_EMERGENCY, HZP_FIRE,
HZP_DURESS, HZP_GAS, HZP_WATER, HZP_REMOTE_CONTROL, HZP_DURESS, HZP_GAS, HZP_WATER, HZP_REMOTE_CONTROL,
HZP_SHIELD, HZP_DOOR_RING, HZP_BYPASS}; HZP_SHIELD, HZP_DOOR_RING, HZP_BYPASS};
memcpy(props, hzps, sizeof(hzps)); memcpy(props, hzps, sizeof(hzps));
return sizeof(hzps) / sizeof(hb_zone_property_t); return sizeof(hzps) / sizeof(hb_zone_property_t);
} }
case HMT_GPRS_PHONE: { case HMT_GPRS_PHONE: {
hb_zone_property_t hzps[] = { hb_zone_property_t hzps[] = {
HZP_BUGLAR, HZP_BUGLAR,
HZP_EMERGENCY, HZP_EMERGENCY,
HZP_FIRE, HZP_FIRE,
HZP_DURESS, HZP_DURESS,
HZP_GAS, HZP_GAS,
HZP_WATER, HZP_WATER,
HZP_REMOTE_CONTROL, HZP_REMOTE_CONTROL,
}; };
memcpy(props, hzps, sizeof(hzps)); memcpy(props, hzps, sizeof(hzps));
return sizeof(hzps) / sizeof(hb_zone_property_t); return sizeof(hzps) / sizeof(hb_zone_property_t);
} }
case HMT_NB: { case HMT_NB: {
hb_zone_property_t hzps[] = { hb_zone_property_t hzps[] = {
HZP_BUGLAR, HZP_BUGLAR,
HZP_EMERGENCY, HZP_EMERGENCY,
HZP_FIRE, HZP_FIRE,
HZP_DURESS, HZP_DURESS,
HZP_GAS, HZP_GAS,
HZP_WATER, HZP_WATER,
HZP_DOOR_RING, HZP_DOOR_RING,
}; };
memcpy(props, hzps, sizeof(hzps)); memcpy(props, hzps, sizeof(hzps));
return sizeof(hzps) / sizeof(hb_zone_property_t); return sizeof(hzps) / sizeof(hb_zone_property_t);
} }
default: default:
return 0; return 0;
} }
return 0; return 0;
} }
ademco_zone_t hb_get_max_zone_by_type(hb_machine_type_t type) { ademco_zone_t hb_get_max_zone_by_type(hb_machine_type_t type) {
switch (type) { switch (type) {
case HMT_GPRS_IOT: case HMT_GPRS_IOT:
case HMT_GPRS: case HMT_GPRS:
case HMT_WIRED: case HMT_WIRED:
case HMT_WIFI2: case HMT_WIFI2:
return 99; return 99;
case HMT_NETMOD: case HMT_NETMOD:
case HMT_NB: case HMT_NB:
return 999; return 999;
case HMT_LCD: case HMT_LCD:
return 249; return 249;
case HMT_TRUE_COLOR: case HMT_TRUE_COLOR:
return 68; return 68;
case HMT_THREE_SECTION: case HMT_THREE_SECTION:
return 191; return 191;
case HMT_IOT: case HMT_IOT:
case HMT_GPRS_PHONE: case HMT_GPRS_PHONE:
return 60; return 60;
case HMT_WIFI: case HMT_WIFI:
case HMT_CAMERA: case HMT_CAMERA:
default: default:
return 0; return 0;
break; break;
} }
} }
int hb_is_valid_zone_by_type(hb_machine_type_t type, ademco_zone_t zone) { int hb_is_valid_zone_by_type(hb_machine_type_t type, ademco_zone_t zone) {
return ADEMCO_ZONE_FOR_MACHINE_SELF <= zone && return ADEMCO_ZONE_FOR_MACHINE_SELF <= zone &&
zone <= hb_get_max_zone_by_type(type); zone <= hb_get_max_zone_by_type(type);
} }
int hb_is_valid_zone_by_type_strict(hb_machine_type_t type, ademco_zone_t zone) { int hb_is_valid_zone_by_type_strict(hb_machine_type_t type, ademco_zone_t zone) {
return ADEMCO_ZONE_MIN <= zone && zone <= hb_get_max_zone_by_type(type); return ADEMCO_ZONE_MIN <= zone && zone <= hb_get_max_zone_by_type(type);
} }
int hb_is_machine_on_sale(hb_machine_type_t type) { int hb_is_machine_on_sale(hb_machine_type_t type) {
return type == HMT_GPRS_IOT || return type == HMT_GPRS_IOT ||
type == HMT_NETMOD || type == HMT_NETMOD ||
type == HMT_GPRS || type == HMT_GPRS ||
type == HMT_IOT || type == HMT_IOT ||
type == HMT_LCD || type == HMT_LCD ||
type == HMT_WIRED || type == HMT_WIRED ||
type == HMT_TRUE_COLOR || type == HMT_TRUE_COLOR ||
type == HMT_THREE_SECTION || type == HMT_THREE_SECTION ||
type == HMT_GPRS_PHONE || type == HMT_GPRS_PHONE ||
type == HMT_NB || type == HMT_NB ||
type == HMT_WIFI2; type == HMT_WIFI2;
} }
int hb_machine_can_arm(hb_machine_type_t type) { int hb_machine_can_arm(hb_machine_type_t type) {
return hb_is_machine_on_sale(type) && (type != HMT_NB); return hb_is_machine_on_sale(type) && (type != HMT_NB);
} }
int hb_machine_can_disarm(hb_machine_type_t type) { int hb_machine_can_disarm(hb_machine_type_t type) {
return hb_is_machine_on_sale(type) && (type != HMT_NB); return hb_is_machine_on_sale(type) && (type != HMT_NB);
} }
int hb_machine_can_config(hb_machine_type_t type) { int hb_machine_can_config(hb_machine_type_t type) {
return hb_is_machine_on_sale(type); return hb_is_machine_on_sale(type);
} }
int hb_machine_can_half_arm(hb_machine_type_t type) { int hb_machine_can_half_arm(hb_machine_type_t type) {
return type == HMT_NETMOD || type == HMT_LCD; return type == HMT_NETMOD || type == HMT_LCD;
} }
int hb_machine_can_report_signal_strength(hb_machine_type_t type) { int hb_machine_can_report_signal_strength(hb_machine_type_t type) {
return type == HMT_GPRS || return type == HMT_GPRS ||
type == HMT_GPRS_IOT || type == HMT_GPRS_IOT ||
type == HMT_IOT || type == HMT_IOT ||
type == HMT_LCD || type == HMT_LCD ||
type == HMT_TRUE_COLOR || type == HMT_TRUE_COLOR ||
type == HMT_THREE_SECTION || type == HMT_THREE_SECTION ||
type == HMT_GPRS_PHONE || type == HMT_GPRS_PHONE ||
type == HMT_NB || type == HMT_NB ||
type == HMT_WIFI2; type == HMT_WIFI2;
} }
int hb_machine_can_report_by_sms(hb_machine_type_t type) { int hb_machine_can_report_by_sms(hb_machine_type_t type) {
return type == HMT_GPRS || return type == HMT_GPRS ||
type == HMT_LCD || type == HMT_LCD ||
type == HMT_TRUE_COLOR || type == HMT_TRUE_COLOR ||
type == HMT_THREE_SECTION || type == HMT_THREE_SECTION ||
type == HMT_GPRS_PHONE; type == HMT_GPRS_PHONE;
} }
int hb_machine_has_wired_zones(hb_machine_type_t type) { int hb_machine_has_wired_zones(hb_machine_type_t type) {
return type == HMT_NETMOD || return type == HMT_NETMOD ||
type == HMT_TRUE_COLOR || type == HMT_TRUE_COLOR ||
type == HMT_THREE_SECTION; type == HMT_THREE_SECTION;
} }
ademco_zone_t hb_wired_zone_min(hb_machine_type_t type) { ademco_zone_t hb_wired_zone_min(hb_machine_type_t type) {
switch (type) { switch (type) {
case HMT_NETMOD: case HMT_NETMOD:
return 1; return 1;
case HMT_TRUE_COLOR: case HMT_TRUE_COLOR:
return 1; return 1;
case HMT_THREE_SECTION: case HMT_THREE_SECTION:
return 61; return 61;
default: default:
return 0; return 0;
} }
} }
ademco_zone_t hb_wired_zone_max(hb_machine_type_t type) { ademco_zone_t hb_wired_zone_max(hb_machine_type_t type) {
switch (type) { switch (type) {
case HMT_NETMOD: case HMT_NETMOD:
return 8; return 8;
case HMT_TRUE_COLOR: case HMT_TRUE_COLOR:
return 8; return 8;
case HMT_THREE_SECTION: case HMT_THREE_SECTION:
return 68; return 68;
default: default:
return 0; return 0;
} }
} }
int hb_machine_can_write_zone(hb_machine_type_t type) { int hb_machine_can_write_zone(hb_machine_type_t type) {
return type == HMT_NETMOD; return type == HMT_NETMOD;
} }
int hb_machine_can_link_sub_machine(hb_machine_type_t type) { int hb_machine_can_link_sub_machine(hb_machine_type_t type) {
return type == HMT_NETMOD; return type == HMT_NETMOD;
} }
int hb_zone_can_report_lost(hb_zone_property_t zp) { int hb_zone_can_report_lost(hb_zone_property_t zp) {
switch (zp) { switch (zp) {
case HZP_BUGLAR: case HZP_BUGLAR:
case HZP_EMERGENCY: case HZP_EMERGENCY:
case HZP_DURESS: case HZP_DURESS:
case HZP_SUB_MACHINE: case HZP_SUB_MACHINE:
case HZP_BUGLAR_HALF: case HZP_BUGLAR_HALF:
case HZP_BYPASS: case HZP_BYPASS:
return 1; return 1;
default: default:
return 0; return 0;
} }
} }
void hb_machine_timer_init(hb_machine_timer_t* timer) { void hb_machine_timer_init(hb_machine_timer_t* timer) {
memset(timer->data, 25, sizeof(timer)); memset(timer->data, 25, sizeof(timer));
} }
int hb_is_valid_time_point(hb_machine_time_point_t* tp) { int hb_is_valid_time_point(hb_machine_time_point_t* tp) {
return tp && return tp &&
tp->hour < 24 && tp->hour < 24 &&
tp->minute < 60; tp->minute < 60;
} }
void hb_time_point_to_greenwich(hb_machine_time_point_t* tp) { void hb_time_point_to_greenwich(hb_machine_time_point_t* tp) {
if (tp && tp->hour != 25) if (tp && tp->hour != 25)
tp->hour = (tp->hour + 16) % 24; tp->hour = (tp->hour + 16) % 24;
} }
void hb_time_point_from_greenwich(hb_machine_time_point_t* tp) { void hb_time_point_from_greenwich(hb_machine_time_point_t* tp) {
if (tp && tp->hour != 25) if (tp && tp->hour != 25)
tp->hour = (tp->hour + 8) % 24; tp->hour = (tp->hour + 8) % 24;
} }
int hb_is_valid_timer_one(hb_machine_timer_one_t* timer) { int hb_is_valid_timer_one(hb_machine_timer_one_t* timer) {
return timer && return timer &&
hb_is_valid_time_point(&timer->arm_at) && hb_is_valid_time_point(&timer->arm_at) &&
hb_is_valid_time_point(&timer->disarm_at); hb_is_valid_time_point(&timer->disarm_at);
} }
int hb_is_valid_machine_timer(hb_machine_timer_t* timer) { int hb_is_valid_machine_timer(hb_machine_timer_t* timer) {
return timer && return timer &&
hb_is_valid_timer_one(&timer->timer[0]) && hb_is_valid_timer_one(&timer->timer[0]) &&
hb_is_valid_timer_one(&timer->timer[1]); hb_is_valid_timer_one(&timer->timer[1]);
} }
void hb_machine_timer_to_greenwich(hb_machine_timer_t* timer) { void hb_machine_timer_to_greenwich(hb_machine_timer_t* timer) {
hb_time_point_to_greenwich(&timer->timer[0].arm_at); hb_time_point_to_greenwich(&timer->timer[0].arm_at);
hb_time_point_to_greenwich(&timer->timer[0].disarm_at); hb_time_point_to_greenwich(&timer->timer[0].disarm_at);
hb_time_point_to_greenwich(&timer->timer[1].arm_at); hb_time_point_to_greenwich(&timer->timer[1].arm_at);
hb_time_point_to_greenwich(&timer->timer[1].disarm_at); hb_time_point_to_greenwich(&timer->timer[1].disarm_at);
} }
void hb_machine_timer_from_greenwich(hb_machine_timer_t* timer) { void hb_machine_timer_from_greenwich(hb_machine_timer_t* timer) {
hb_time_point_from_greenwich(&timer->timer[0].arm_at); hb_time_point_from_greenwich(&timer->timer[0].arm_at);
hb_time_point_from_greenwich(&timer->timer[0].disarm_at); hb_time_point_from_greenwich(&timer->timer[0].disarm_at);
hb_time_point_from_greenwich(&timer->timer[1].arm_at); hb_time_point_from_greenwich(&timer->timer[1].arm_at);
hb_time_point_from_greenwich(&timer->timer[1].disarm_at); hb_time_point_from_greenwich(&timer->timer[1].disarm_at);
} }
ademco_event_t hb_machine_status_to_ademco_event(hb_machine_status_t status) { ademco_event_t hb_machine_status_to_ademco_event(hb_machine_status_t status) {
switch (status) { switch (status) {
#define XX(hms, ae) \ #define XX(hms, ae) \
case hms: \ case hms: \
return ae; return ae;
HMS_EVENT_MAP(XX) HMS_EVENT_MAP(XX)
#undef XX #undef XX
default: default:
return EVENT_INVALID_EVENT; return EVENT_INVALID_EVENT;
} }
} }
hb_machine_status_t hb_machine_status_from_ademco_event(ademco_event_t ademco_event) { hb_machine_status_t hb_machine_status_from_ademco_event(ademco_event_t ademco_event) {
switch (ademco_event) { switch (ademco_event) {
#define XX(hms, ae) \ #define XX(hms, ae) \
case ae: \ case ae: \
return hms; return hms;
HMS_EVENT_MAP(XX) HMS_EVENT_MAP(XX)
#undef XX #undef XX
case EVENT_HALFARM_1456: case EVENT_HALFARM_1456:
return HMS_HALF_ARM; return HMS_HALF_ARM;
case EVENT_ENTER_SET_MODE: case EVENT_ENTER_SET_MODE:
return HMS_SETTING; return HMS_SETTING;
default: default:
return HMS_INVALID; return HMS_INVALID;
} }
} }
ademco_event_t hb_machine_type_to_ademco_event(hb_machine_type_t type) { ademco_event_t hb_machine_type_to_ademco_event(hb_machine_type_t type) {
switch (type) { switch (type) {
#define XX(hmt, ae) \ #define XX(hmt, ae) \
case hmt: \ case hmt: \
return ae; return ae;
HMT_EVENT_MAP(XX) HMT_EVENT_MAP(XX)
#undef XX #undef XX
default: default:
return EVENT_INVALID_EVENT; return EVENT_INVALID_EVENT;
} }
} }
hb_machine_type_t hb_machine_type_from_ademco_event(ademco_event_t ademco_event) { hb_machine_type_t hb_machine_type_from_ademco_event(ademco_event_t ademco_event) {
switch (ademco_event) { switch (ademco_event) {
#define XX(hmt, ae) \ #define XX(hmt, ae) \
case ae: \ case ae: \
return hmt; return hmt;
HMT_EVENT_MAP(XX) HMT_EVENT_MAP(XX)
#undef XX #undef XX
default: default:
return HMT_INVALID; return HMT_INVALID;
} }
} }
ademco_event_t hb_zone_property_to_ademco_event(hb_zone_property_t zp) { ademco_event_t hb_zone_property_to_ademco_event(hb_zone_property_t zp) {
switch (zp) { switch (zp) {
#define XX(hzp, ae) \ #define XX(hzp, ae) \
case hzp: \ case hzp: \
return ae; return ae;
HZP_EVENT_MAP(XX) HZP_EVENT_MAP(XX)
#undef XX #undef XX
default: default:
return EVENT_INVALID_EVENT; return EVENT_INVALID_EVENT;
} }
} }
const char* hb_machine_status_to_string(hb_machine_status_t status) { const char* hb_machine_status_to_string(hb_machine_status_t status) {
switch (status) { switch (status) {
#define XX(name, value, str) \ #define XX(name, value, str) \
case HMS_##name: \ case HMS_##name: \
return #name; return #name;
HB_MACHINE_STATUS_MAP(XX) HB_MACHINE_STATUS_MAP(XX)
#undef XX #undef XX
default: default:
return "InvalidMachineStatus"; return "InvalidMachineStatus";
} }
} }
const char* hb_machine_type_to_string(hb_machine_type_t type) { const char* hb_machine_type_to_string(hb_machine_type_t type) {
switch (type) { switch (type) {
#define XX(name, value, str) \ #define XX(name, value, str) \
case HMT_##name: \ case HMT_##name: \
return #name; return #name;
HB_MACHINE_TYPE_MAP(XX) HB_MACHINE_TYPE_MAP(XX)
#undef XX #undef XX
default: default:
return "Unknown hb_machine_type_t"; return "Unknown hb_machine_type_t";
} }
} }
const char* hb_zone_property_to_string(hb_zone_property_t zp) { const char* hb_zone_property_to_string(hb_zone_property_t zp) {
switch (zp) { switch (zp) {
#define XX(name, value, str) \ #define XX(name, value, str) \
case HZP_##name: \ case HZP_##name: \
return #name; return #name;
HB_ZONE_PROPERTY_MAP(XX) HB_ZONE_PROPERTY_MAP(XX)
#undef XX #undef XX
default: default:
return "InvalidZoneProperty"; return "InvalidZoneProperty";
} }
} }
const char* hb_com_req_to_string(hb_com_req_t type) { #if ADEMCO_ENABLE_CHINESE
switch (type) { const char* hb_machine_status_to_string_chinese(hb_machine_status_t status) {
#define XX(name, str) \ switch (status) {
case HB_COM_REQ_##name: \ #define XX(name, value, str) \
return #name; case HMS_##name: \
HB_COM_REQUESTS_MAP(XX) return str;
#undef XX HB_MACHINE_STATUS_MAP(XX)
#undef XX
default:
return "InvalidRequestType"; default:
} return "无效状态";
} }
}
const char* hb_com_resp_to_string(hb_com_resp_t type) {
switch (type) { const char* hb_machine_type_to_string_chinese(hb_machine_type_t type) {
#define XX(name, str) \ switch (type) {
case HB_COM_RESP_##name: \ #define XX(name, value, str) \
return #name; case HMT_##name: \
HB_COM_RESPONSES_MAP(XX) return str;
#undef XX HB_MACHINE_TYPE_MAP(XX)
#undef XX
default:
return "InvalidResponseType"; default:
} return "未知机型";
} }
}
#if ADEMCO_ENABLE_CHINESE
const char* hb_machine_status_to_string_chinese(hb_machine_status_t status) { const char* hb_zone_property_to_string_chinese(hb_zone_property_t zp) {
switch (status) { switch (zp) {
#define XX(name, value, str) \ #define XX(name, value, str) \
case HMS_##name: \ case HZP_##name: \
return str; return str;
HB_MACHINE_STATUS_MAP(XX) HB_ZONE_PROPERTY_MAP(XX)
#undef XX #undef XX
default: default:
return "无效状态"; return "无效属性";
} }
} }
#endif // ADEMCO_ENABLE_CHINESE
const char* hb_machine_type_to_string_chinese(hb_machine_type_t type) {
switch (type) { const char* hb_get_zone_format_str(hb_machine_type_t type) {
#define XX(name, value, str) \ ademco_zone_t zone = hb_get_max_zone_by_type(type);
case HMT_##name: \ if (10 < zone && zone < 100)
return str; return "%02d";
HB_MACHINE_TYPE_MAP(XX) else if (zone < 1000)
#undef XX return "%03d";
else
default: return "%d";
return "未知机型"; }
}
}
const char* hb_zone_property_to_string_chinese(hb_zone_property_t zp) {
switch (zp) {
#define XX(name, value, str) \
case HZP_##name: \
return str;
HB_ZONE_PROPERTY_MAP(XX)
#undef XX
default:
return "无效属性";
}
}
const char* hb_com_req_to_string_chinese(hb_com_req_t type) {
switch (type) {
#define XX(name, str) \
case HB_COM_REQ_##name: \
return str;
HB_COM_REQUESTS_MAP(XX)
#undef XX
default:
return "无效请求";
}
}
const char* hb_com_resp_to_string_chinese(hb_com_resp_t type) {
switch (type) {
#define XX(name, str) \
case HB_COM_RESP_##name: \
return str;
HB_COM_RESPONSES_MAP(XX)
#undef XX
default:
return "无效回应";
}
}
#endif // ADEMCO_ENABLE_CHINESE
const char* hb_get_zone_format_str(hb_machine_type_t type) {
ademco_zone_t zone = hb_get_max_zone_by_type(type);
if (10 < zone && zone < 100)
return "%02d";
else if (zone < 1000)
return "%03d";
else
return "%d";
}
void hb_sum(uint8_t* data, size_t len) {
uint8_t sum = 0;
uint8_t* p = data;
while (p != data + len - 1)
sum += *p++;
*p = sum;
}
int hb_chksum(const uint8_t* data, size_t len) {
uint8_t sum = 0;
const uint8_t* p = data;
while (p != data + len - 1)
sum += *p++;
return sum == *p;
}
#define copy_data_to_com \
if (cd) { \
cd->len = len & 0xFF; \
memcpy(cd->data, data, len & 0xFF); \
}
hb_com_req_t hb_com_parse_req(const uint8_t* data,
size_t len,
hb_com_data_t* cd) {
do {
if (len < 5) {
break;
}
if (data[0] != 0xEB) {
break;
}
switch (data[1]) {
case 0xAB: {
if (data[2] != 0x3F) {
break;
}
switch (data[3]) {
case 0xA0: // EB AB 3F A0 75
{
if (len != HB_COM_REQ_A0_LEN) {
break;
}
if (memcmp(HB_COM_REQ_A0_DATA, data, len) != 0) {
break;
}
copy_data_to_com;
return HB_COM_REQ_A0;
}
case 0xA1: // EB AB 3F A1 76
{
if (len != HB_COM_REQ_A1_LEN) {
break;
}
if (memcmp(HB_COM_REQ_A1_DATA, data, len) != 0) {
break;
}
copy_data_to_com;
return HB_COM_REQ_A1;
}
case 0xA2: // EB AB 3F A2 77
{
if (len != HB_COM_REQ_A2_LEN) {
break;
}
if (memcmp(HB_COM_REQ_A2_DATA, data, len) != 0) {
break;
}
copy_data_to_com;
return HB_COM_REQ_A2;
}
case 0xA5: // EB AB 3F A5 7A
{
if (len != HB_COM_REQ_A5_LEN) {
break;
}
if (memcmp(HB_COM_REQ_A5_DATA, data, len) != 0) {
break;
}
copy_data_to_com;
return HB_COM_REQ_A5;
}
case 0xAC: // EB AB 3F AC 81
{
if (len != HB_COM_REQ_AC_LEN) {
break;
}
if (memcmp(HB_COM_REQ_AC_DATA, data, len) != 0) {
break;
}
copy_data_to_com;
return HB_COM_REQ_AC;
}
case 0xAD: // EB AB 3F AD 82
{
if (len != HB_COM_REQ_AD_LEN) {
break;
}
if (memcmp(HB_COM_REQ_AD_DATA, data, len) != 0) {
break;
}
copy_data_to_com;
return HB_COM_REQ_AD;
}
default:
break;
}
break;
}
case 0xBA: {
if (data[2] != 0x3F) {
break;
}
if (len == HB_COM_REQ_RA_LEN &&
memcmp(data, HB_COM_REQ_RA_DATA, len) == 0) {
copy_data_to_com;
return HB_COM_REQ_RA;
}
break;
}
case 0xCB: {
if (data[2] != 0x3F) {
break;
}
if (data[3] == 0x09 &&
data[4] == 0xA3 &&
len == HB_COM_REQ_A3_LEN) {
// EB CB 3F 09 A3 P1 P2 P3 SUM
if (hb_chksum(data, len)) {
copy_data_to_com;
return HB_COM_REQ_A3;
}
} else if (data[3] == 0x0F &&
data[4] == 0x4D &&
len == HB_COM_REQ_WA_LEN) {
if (hb_chksum(data, len)) {
copy_data_to_com;
return HB_COM_REQ_WA;
}
} else if (data[3] == 0x0E &&
data[4] == 0xA7 &&
len == HB_COM_REQ_A7_LEN) {
// EB CB 3F 0E A7 H1 M1 H2 M2 H3 M3 H4 M4 SUM
if (hb_chksum(data, len)) {
copy_data_to_com;
return HB_COM_REQ_A7;
}
}
/*else if (data[3] == 0x08 && data[4] == 0xA9 && len == A9_len) {
A7 req; memcpy(req.data, data, req.len); sum(req);
if (data[len - 1] == req.data[len - 1]) { return A7; }
}*/
else if (data[3] == 0x08 &&
data[4] == 0xAA &&
len == HB_COM_REQ_AA_LEN) {
// EB CB 3F 08 AA P1 P2 SUM
if (hb_chksum(data, len)) {
copy_data_to_com;
return HB_COM_REQ_AA;
}
}
/*else if (data[3] == 0x08 && data[4] == 0xAE && len == AE_len) {
AA req; memcpy(req.data, data, req.len); sum(req);
if (data[len - 1] == req.data[len - 1]) { return AA; }
}*/
else if (data[3] == 0x06 && data[4] == 0xB0 &&
len == HB_COM_REQ_B0_LEN &&
memcmp(HB_COM_REQ_B0_DATA, data, len) == 0) {
// EB CB 3F 06 B0 AB
copy_data_to_com;
return HB_COM_REQ_B0;
}
}
}
} while (0);
return HB_COM_REQ_INVALID;
}
hb_com_req_t hb_com_parse_xdata_req(const ademco_xdata_t* xdata,
hb_com_data_t* cd) {
if (!xdata) {
return HB_COM_REQ_INVALID;
}
return hb_com_parse_req(
(const uint8_t*)ademco_xdata_get_valid_content_addr(xdata),
ademco_xdata_get_valid_content_len(xdata),
cd);
}
hb_com_resp_t hb_com_parse_resp(const uint8_t* data,
size_t len,
hb_com_data_t* cd) {
do {
if (len < 7) {
break;
} // 所有的 response ,长度最小为 7
if (data[0] != 0xEB || data[1] != 0xBA || data[2] != 0x3F) {
break;
}
switch (data[5]) {
case 0xA0: // EB BA 3F 07 P0 A0 P1 P2 P3 SUM
{
if (len != HB_COM_RESP_A0_LEN) {
break;
}
if (hb_chksum(data, len)) {
copy_data_to_com;
return HB_COM_RESP_A0;
}
break;
}
case 0xA2: // EB BA 3F PN P0 A2 [Z, P]xN P1 SUM
{
if (len != data[3]) {
break;
}
if (hb_chksum(data, len)) {
copy_data_to_com;
return HB_COM_RESP_A2;
}
break;
}
case 0xA3: {
if (len != HB_COM_RESP_A3_LEN) {
break;
}
if (hb_chksum(data, len)) {
copy_data_to_com;
return HB_COM_RESP_A3;
}
break;
}
case 0xA4: {
if (len != HB_COM_RESP_A4_LEN) {
break;
}
if (hb_chksum(data, len)) {
copy_data_to_com;
return HB_COM_RESP_A4;
}
break;
}
case 0xA6: {
if (len != HB_COM_RESP_A6_LEN) {
break;
}
if (hb_chksum(data, len)) {
copy_data_to_com;
return HB_COM_RESP_A6;
}
break;
}
case 0xA7: {
if (len != HB_COM_RESP_A7_LEN) {
break;
}
if (hb_chksum(data, len)) {
copy_data_to_com;
return HB_COM_RESP_A7;
}
break;
}
case 0xA8: {
if (len != HB_COM_RESP_A8_LEN) {
break;
}
if (hb_chksum(data, len)) {
copy_data_to_com;
return HB_COM_RESP_A8;
}
break;
}
case 0xA9: {
// TODO
break;
}
case 0xAB: {
if (len != HB_COM_RESP_AB_LEN) {
break;
}
if (hb_chksum(data, len)) {
copy_data_to_com;
return HB_COM_RESP_AB;
}
break;
}
case 0xAD: // EB BA 3F PN P0 AD P1 DATA P2 SUM
{
if (len != data[3]) {
break;
}
if (hb_chksum(data, len)) {
copy_data_to_com;
return HB_COM_RESP_AD;
}
break;
}
case 0xAF: // TODO
{
break;
}
case 0xB1: // EB BA 3F 08 P0 B1 P1 SUM
{
if (len != HB_COM_RESP_B1_LEN) {
break;
}
if (hb_chksum(data, len)) {
copy_data_to_com;
return HB_COM_RESP_B1;
}
break;
}
}
} while (0);
// 处理读写主机账号回应
do {
if (len >= HB_COM_RESP_WA_LEN &&
memcmp(HB_COM_RESP_WA_DATA, data, HB_COM_RESP_WA_LEN) == 0) {
return HB_COM_RESP_WA;
}
if (len >= HB_COM_RESP_RA_LEN &&
memcmp(HB_COM_RESP_RA_HEAD, data, sizeof(HB_COM_RESP_RA_HEAD) - 1) == 0 &&
hb_chksum(data, len)) {
copy_data_to_com;
return HB_COM_RESP_RA;
}
} while (0);
return HB_COM_RESP_INVALID;
}
hb_com_resp_t hb_com_parse_xdata_resp(const ademco_xdata_t* xdata,
hb_com_data_t* cd) {
if (!xdata) {
return HB_COM_RESP_INVALID;
}
return hb_com_parse_resp(
(const uint8_t*)ademco_xdata_get_valid_content_addr(xdata),
ademco_xdata_get_valid_content_len(xdata),
cd);
}
void hb_com_make_req_a0_get_machine_status(hb_com_data_t* data) {
memcpy(data->data, HB_COM_REQ_A0_DATA, HB_COM_REQ_A0_LEN);
data->len = HB_COM_REQ_A0_LEN;
}
void hb_com_make_req_a1_get_machine_zones(hb_com_data_t* data) {
memcpy(data->data, HB_COM_REQ_A1_DATA, HB_COM_REQ_A1_LEN);
data->len = HB_COM_REQ_A1_LEN;
}
void hb_com_make_req_a2_get_more_machine_zones(hb_com_data_t* data) {
memcpy(data->data, HB_COM_REQ_A2_DATA, HB_COM_REQ_A2_LEN);
data->len = HB_COM_REQ_A2_LEN;
}
void hb_com_make_req_a3_modify_machine_zone(hb_com_data_t* data,
uint8_t zone,
hb_zone_property_t prop,
hb_com_req_a3_p3_t op) {
memcpy(data->data, HB_COM_REQ_A3_DATA, 5);
data->data[5] = zone;
data->data[6] = prop;
data->data[7] = op;
data->len = HB_COM_REQ_A3_LEN;
hb_sum(data->data, data->len);
}
void hb_com_make_req_a5_get_machine_timer(hb_com_data_t* data) {
memcpy(data->data, HB_COM_REQ_A5_DATA, HB_COM_REQ_A5_LEN);
data->len = HB_COM_REQ_A5_LEN;
}
void hb_com_make_req_a7_set_machine_timer(hb_com_data_t* data,
hb_machine_timer_t* timer) {
memcpy(data->data, HB_COM_REQ_A7_HEAD, 5);
memcpy(data->data + 5, timer, sizeof(*timer));
data->len = HB_COM_REQ_A7_LEN;
hb_sum(data->data, data->len);
}
void hb_com_make_req_aa_modify_machine_zone_lost_config(hb_com_data_t* data,
uint8_t zone,
int on) {
memcpy(data->data, HB_COM_REQ_AA_HEAD, 5);
data->data[5] = zone;
data->data[6] = !!on;
data->len = HB_COM_REQ_AA_LEN;
hb_sum(data->data, data->len);
}
void hb_com_make_req_ac_get_machine_zone_lost_config(hb_com_data_t* data) {
memcpy(data->data, HB_COM_REQ_AC_DATA, HB_COM_REQ_AC_LEN);
data->len = HB_COM_REQ_AC_LEN;
}
void hb_com_make_req_ad_get_more_machine_zone_lost_config(hb_com_data_t* data) {
memcpy(data->data, HB_COM_REQ_AD_DATA, HB_COM_REQ_AD_LEN);
data->len = HB_COM_REQ_AD_LEN;
}
void hb_com_make_req_ae_set_3sec_machine_status(hb_com_data_t* data,
hb_com_3sec_which_t p1,
hb_com_3sec_status_t status) {
memcpy(data->data, HB_COM_REQ_AE_HEAD, 5);
data->data[5] = p1;
data->data[6] = status;
data->len = HB_COM_REQ_AE_LEN;
hb_sum(data->data, data->len);
}
void hb_com_make_req_b0_get_3sec_machine_status(hb_com_data_t* data) {
memcpy(data->data, HB_COM_REQ_B0_DATA, HB_COM_REQ_B0_LEN);
data->len = HB_COM_REQ_B0_LEN;
}
void hb_com_make_req_ra_read_acct(hb_com_data_t* data) {
memcpy(data->data, HB_COM_REQ_RA_DATA, HB_COM_REQ_RA_LEN);
data->len = HB_COM_REQ_RA_LEN;
}
void hb_com_make_req_wa_write_acct(hb_com_data_t* data, const char* acct) {
memcpy(data->data, HB_COM_REQ_WA_HEAD, 5);
ademco_hex_str_to_hilo_array(data->data + 5,
ADEMCO_PACKET_ACCT_MAX_LEN / 2,
acct);
data->len = HB_COM_REQ_WA_LEN;
hb_sum(data->data, data->len);
}
void hb_com_resp_a2_iter_init(hb_com_resp_a2_iter_t* iter,
const hb_com_data_t* com) {
if (!iter || !com) return;
iter->com = com;
iter->i = 0;
if (com->len > HB_COM_RESP_A2_MIN_LEN) {
iter->total = (com->len - HB_COM_RESP_A2_MIN_LEN) / 2;
iter->p1 = (com->data[com->len - 2] == 0xFF)
? HB_COM_RESP_A2_P1_NOMORE
: HB_COM_RESP_A2_P1_MORE;
} else {
iter->total = 0;
iter->p1 = HB_COM_RESP_A2_P1_NOMORE;
}
}
hb_com_resp_a2_p1_t hb_com_resp_a2_iter_next(hb_com_resp_a2_iter_t* iter,
hb_zone_and_property_t* zp) {
if (iter->i == iter->total)
return HB_COM_RESP_A2_P1_NOMORE;
zp->zone = iter->com->data[6 + iter->i * 2];
zp->prop = (hb_zone_property_t)iter->com->data[7 + iter->i * 2];
iter->i++;
return HB_COM_RESP_A2_P1_MORE;
}
void hb_com_make_resp_a0_machine_status(hb_com_data_t* data,
hb_machine_status_t status,
hb_machine_type_t type) {
memcpy(data->data, HB_COM_RESP_A0_HEAD, 6);
data->data[6] = status;
data->data[7] = type;
data->len = HB_COM_RESP_A0_LEN;
hb_sum(data->data, data->len);
}
void hb_com_make_resp_a2_machine_zones(hb_com_data_t* data,
size_t count,
ademco_zone_t* zones,
hb_zone_property_t* props,
hb_com_resp_a2_p1_t p1) {
if (count > HB_COM_RESP_A2_MAX_ZONE) {
return;
}
memcpy(data->data, HB_COM_RESP_A2_HEAD, 6);
data->data[3] = (HB_COM_RESP_A2_MIN_LEN + count * 2) & 0xFF;
uint8_t* p = data->data + 6;
for (size_t i = 0; i < count; i++) {
*p++ = zones[i] & 0xFF;
*p++ = props[i];
}
*p++ = (count > 0) ? (uint8_t)p1 : (uint8_t)HB_COM_RESP_A2_P1_NOMORE;
data->len = (++p - data->data) & 0xFF;
hb_sum(data->data, data->len);
}
void hb_com_make_resp_a3_waiting_sensor_signal(hb_com_data_t* data) {
memcpy(data->data, HB_COM_RESP_A3_DATA, HB_COM_RESP_A3_LEN);
data->len = HB_COM_RESP_A3_LEN;
}
void hb_com_make_resp_a4_modify_zone_result(hb_com_data_t* data,
ademco_zone_t zone,
hb_zone_property_t prop,
hb_com_resp_a4_p3_t p3) {
memcpy(data->data, HB_COM_RESP_A4_HEAD, 6);
data->data[6] = zone & 0xFF;
data->data[7] = prop;
data->data[8] = p3;
data->len = HB_COM_RESP_A4_LEN;
hb_sum(data->data, data->len);
}
void hb_com_resp_a7_to_timer(hb_com_data_t* data, hb_machine_timer_t* timer) {
memcpy(timer->data, &data->data[2], 8);
}
void hb_com_make_resp_a6_machine_timer(hb_com_data_t* data,
hb_machine_timer_t* timer) {
memcpy(data->data, HB_COM_RESP_A6_HEAD, 6);
memcpy(data->data + 6, timer->data, sizeof(*timer));
data->len = HB_COM_RESP_A6_LEN;
hb_sum(data->data, data->len);
}
void hb_com_make_resp_a7_set_machine_timer_result(hb_com_data_t* data) {
memcpy(data->data, HB_COM_RESP_A7_DATA, HB_COM_RESP_A7_LEN);
data->len = HB_COM_RESP_A7_LEN;
}
void hb_com_make_resp_a8_reject(hb_com_data_t* data) {
memcpy(data->data, HB_COM_RESP_A8_DATA, HB_COM_RESP_A8_LEN);
data->len = HB_COM_RESP_A8_LEN;
}
void hb_com_make_resp_ab_modify_machine_zone_lost_config_result(hb_com_data_t* data,
ademco_zone_t zone,
hb_com_resp_ab_p2_t p2) {
memcpy(data->data, HB_COM_RESP_AB_HEAD, 6);
data->data[6] = zone & 0xFF;
data->data[7] = p2;
data->len = HB_COM_RESP_AB_LEN;
hb_sum(data->data, data->len);
}
void hb_com_make_resp_ad_machine_zone_lost_config(hb_com_data_t* data,
hb_com_resp_ad_p1_t p1,
size_t count,
ademco_zone_t* zones,
hb_com_resp_ad_p2_t p2) {
if (count > HB_COM_RESP_AD_MAX_ZONE) {
return;
}
memcpy(data->data, HB_COM_RESP_AD_HEAD, 6);
data->data[3] = (HB_COM_RESP_AD_MIN_LEN +
(p1 == HB_COM_RESP_AD_P1_SINGLE ? count : count * 2)) &
0xFF;
data->data[6] = p1;
uint8_t* p = data->data + 7;
for (size_t i = 0; i < count; i++) {
if (p1 == HB_COM_RESP_AD_P1_SINGLE) {
*p++ = zones[i] & 0xFF;
} else {
*p++ = zones[i] >> 8 & 0xFF;
*p++ = zones[i] & 0xFF;
}
}
*p++ = (count > 0) ? (uint8_t)p2 : (uint8_t)HB_COM_RESP_AD_P2_NOMORE;
data->len = (++p - data->data) & 0xFF;
hb_sum(data->data, data->len);
}
void hb_com_resp_ad_iter_init(hb_com_resp_ad_iter_t* iter, const hb_com_data_t* com) {
if (!iter || !com) return;
iter->com = com;
iter->i = 0;
if (com->len > HB_COM_RESP_AD_MIN_LEN) {
iter->p1 = com->data[6];
iter->total = (com->len - HB_COM_RESP_AD_MIN_LEN);
if (iter->p1 == HB_COM_RESP_AD_P1_DOUBLE) {
iter->total >>= 1;
}
iter->p2 = (com->data[com->len - 2] == 0xFF)
? HB_COM_RESP_AD_P2_NOMORE
: HB_COM_RESP_AD_P2_MORE;
} else {
iter->total = 0;
iter->p1 = HB_COM_RESP_AD_P1_SINGLE;
iter->p2 = HB_COM_RESP_AD_P2_NOMORE;
}
}
hb_com_resp_ad_p2_t hb_com_resp_ad_iter_next(hb_com_resp_ad_iter_t* iter, ademco_zone_t* zone) {
if (iter->i == iter->total)
return HB_COM_RESP_AD_P2_NOMORE;
if (iter->p1 == HB_COM_RESP_AD_P1_SINGLE) {
*zone = iter->com->data[7 + iter->i];
} else {
*zone = iter->com->data[7 + iter->i * 2] << 8;
*zone += iter->com->data[7 + iter->i * 2 + 1];
}
iter->i++;
return HB_COM_RESP_AD_P2_MORE;
}
void hb_com_make_resp_af_set_3sec_machine_status_result(hb_com_data_t* data,
hb_com_3sec_which_t p1,
hb_com_3sec_status_t status) {
memcpy(data->data, HB_COM_RESP_AF_HEAD, 6);
data->data[6] = p1;
data->data[7] = status;
data->len = HB_COM_RESP_AF_LEN;
hb_sum(data->data, data->len);
}
void hb_com_make_resp_b1_3sec_machine_status(hb_com_data_t* data,
hb_machine_status_t statusMachine,
hb_machine_status_t statusSec1,
hb_machine_status_t statusSec2,
hb_machine_status_t statusSec3) {
memcpy(data->data, HB_COM_RESP_B1_HEAD, 6);
data->data[6] = ((uint8_t)statusMachine << 6) |
((uint8_t)statusSec1 << 4) |
((uint8_t)statusSec2 << 2) |
((uint8_t)statusSec3);
data->len = HB_COM_RESP_B1_LEN;
hb_sum(data->data, data->len);
}
void hb_com_data_to_ademco_xdata(const hb_com_data_t* const data,
ademco_xdata_t* xdata,
ademco_xdata_length_format_t xlf,
ademco_xdata_transform_t xtr) {
ademco_make_xdata(xdata, xlf, xtr, (const char*)data->data, data->len);
}
#ifndef __HB_COM_H__ #ifndef __HB_CORE_H__
#define __HB_COM_H__ #define __HB_CORE_H__
#pragma once #pragma once
#include "ademco.h" #include "ademco.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
// 串口透传数据最大长度
#define HB_COM_DATA_MAX_LEN 64 // 三防区主机状态GG范围 1~3
#define HB_3SECTION_MACHINE_GG_MIN 1
// 三防区主机状态GG范围 1~3 #define HB_3SECTION_MACHINE_GG_MAX 3
#define HB_3SECTION_MACHINE_GG_MIN 1
#define HB_3SECTION_MACHINE_GG_MAX 3 // 是否合法的三防区主机状态GG
#define hb_is_valid_3section_machine_gg(gg) \
// 是否合法的三防区主机状态GG HB_3SECTION_MACHINE_GG_MIN <= (gg) && \
#define hb_is_valid_3section_machine_gg(gg) \ (gg) <= HB_3SECTION_MACHINE_GG_MAX
HB_3SECTION_MACHINE_GG_MIN <= (gg) && \
(gg) <= HB_3SECTION_MACHINE_GG_MAX // 主机状态表
#define HB_MACHINE_STATUS_MAP(XX) \
// 主机状态表 XX(ARM, 0, "布防") \
#define HB_MACHINE_STATUS_MAP(XX) \ XX(HALF_ARM, 1, "半布防") \
XX(ARM, 0, "布防") \ XX(DISARM, 2, "撤防") \
XX(HALF_ARM, 1, "半布防") \ XX(SETTING, 3, "设置")
XX(DISARM, 2, "撤防") \
XX(SETTING, 3, "设置") // 主机状态与安定宝事件码对照表
#define HMS_EVENT_MAP(XX) \
// 主机状态与安定宝事件码对照表 XX(HMS_ARM, EVENT_ARM) \
#define HMS_EVENT_MAP(XX) \ XX(HMS_HALF_ARM, EVENT_HALFARM) \
XX(HMS_ARM, EVENT_ARM) \ XX(HMS_DISARM, EVENT_DISARM) \
XX(HMS_HALF_ARM, EVENT_HALFARM) \ XX(HMS_SETTING, EVENT_ENTER_SETTING_MODE)
XX(HMS_DISARM, EVENT_DISARM) \
XX(HMS_SETTING, EVENT_ENTER_SETTING_MODE) // 主机状态
typedef enum hb_machine_status_t {
// 主机状态 #define XX(name, value, str) HMS_##name = value,
typedef enum hb_machine_status_t { HB_MACHINE_STATUS_MAP(XX)
#define XX(name, value, str) HMS_##name = value, #undef XX
HB_MACHINE_STATUS_MAP(XX) // valid count
#undef XX HMS_COUNT = 4,
// valid count // invalid
HMS_COUNT = 4, HMS_INVALID = -1,
// invalid } hb_machine_status_t;
HMS_INVALID = -1,
} hb_machine_status_t; // 主机类型表
#define HB_MACHINE_TYPE_MAP(XX) \
// 主机类型表 XX(WIFI, 0, "WiFi主机") \
#define HB_MACHINE_TYPE_MAP(XX) \ XX(CAMERA, 1, "网络摄像机") \
XX(WIFI, 0, "WiFi主机") \ XX(GPRS_IOT, 2, "简化物联卡主机") \
XX(CAMERA, 1, "网络摄像机") \ XX(NETMOD, 3, "网络模块主机") \
XX(GPRS_IOT, 2, "简化物联卡主机") \ XX(GPRS, 4, "GPRS主机") \
XX(NETMOD, 3, "网络模块主机") \ XX(LCD, 5, "液晶主机") \
XX(GPRS, 4, "GPRS主机") \ XX(WIRED, 6, "网线主机") \
XX(LCD, 5, "液晶主机") \ XX(TRUE_COLOR, 7, "真彩主机") \
XX(WIRED, 6, "网线主机") \ XX(THREE_SECTION, 8, "三区段主机") \
XX(TRUE_COLOR, 7, "真彩主机") \ XX(IOT, 9, "物联卡主机") \
XX(THREE_SECTION, 8, "三区段主机") \ XX(GPRS_PHONE, 10, "GPRS主机可电话") \
XX(IOT, 9, "物联卡主机") \ XX(NB, 11, "NB报警接收主机") \
XX(GPRS_PHONE, 10, "GPRS主机可电话") \ XX(WIFI2, 12, "WiFi主机新版")
XX(NB, 11, "NB报警接收主机") \
XX(WIFI2, 12, "WiFi主机新版") // 主机类型与安定宝事件码对照表
#define HMT_EVENT_MAP(XX) \
// 主机类型与安定宝事件码对照表 XX(HMT_WIFI, EVENT_I_AM_WIFI_MACHINE) \
#define HMT_EVENT_MAP(XX) \ XX(HMT_GPRS_IOT, EVENT_I_AM_GPRS_IOT) \
XX(HMT_WIFI, EVENT_I_AM_WIFI_MACHINE) \ XX(HMT_NETMOD, EVENT_I_AM_NET_MODULE) \
XX(HMT_GPRS_IOT, EVENT_I_AM_GPRS_IOT) \ XX(HMT_GPRS, EVENT_I_AM_GPRS) \
XX(HMT_NETMOD, EVENT_I_AM_NET_MODULE) \ XX(HMT_LCD, EVENT_I_AM_LCD_MACHINE) \
XX(HMT_GPRS, EVENT_I_AM_GPRS) \ XX(HMT_WIRED, EVENT_I_AM_WIRE_MACHINE) \
XX(HMT_LCD, EVENT_I_AM_LCD_MACHINE) \ XX(HMT_TRUE_COLOR, EVENT_I_AM_TRUE_COLOR) \
XX(HMT_WIRED, EVENT_I_AM_WIRE_MACHINE) \ XX(HMT_THREE_SECTION, EVENT_I_AM_3_SECTION_MACHINE) \
XX(HMT_TRUE_COLOR, EVENT_I_AM_TRUE_COLOR) \ XX(HMT_IOT, EVENT_I_AM_IOT_MACHINE) \
XX(HMT_THREE_SECTION, EVENT_I_AM_3_SECTION_MACHINE) \ XX(HMT_GPRS_PHONE, EVENT_I_AM_GPRS_PHONE) \
XX(HMT_IOT, EVENT_I_AM_IOT_MACHINE) \ XX(HMT_NB, EVENT_I_AM_NB_MACHINE) \
XX(HMT_GPRS_PHONE, EVENT_I_AM_GPRS_PHONE) \ XX(HMT_WIFI2, EVENT_I_AM_WIFI2_MACHINE)
XX(HMT_NB, EVENT_I_AM_NB_MACHINE) \
XX(HMT_WIFI2, EVENT_I_AM_WIFI2_MACHINE) // 主机类型
typedef enum hb_machine_type_t {
// 主机类型 #define XX(name, value, str) HMT_##name = value,
typedef enum hb_machine_type_t { HB_MACHINE_TYPE_MAP(XX)
#define XX(name, value, str) HMT_##name = value, #undef XX
HB_MACHINE_TYPE_MAP(XX) // valid count
#undef XX HMT_COUNT = 13,
// valid count // invalid
HMT_COUNT = 13, HMT_INVALID = -1,
// invalid } hb_machine_type_t;
HMT_INVALID = -1,
} hb_machine_type_t; // 防区属性表
#define HB_ZONE_PROPERTY_MAP(XX) \
// 防区属性表 XX(BUGLAR, 0, "匪警全局") \
#define HB_ZONE_PROPERTY_MAP(XX) \ XX(EMERGENCY, 1, "匪警紧急") \
XX(BUGLAR, 0, "匪警全局") \ XX(FIRE, 2, "火警防区") \
XX(EMERGENCY, 1, "匪警紧急") \ XX(DURESS, 3, "胁迫防区") \
XX(FIRE, 2, "火警防区") \ XX(GAS, 4, "燃气防区") \
XX(DURESS, 3, "胁迫防区") \ XX(WATER, 5, "淹水防区") \
XX(GAS, 4, "燃气防区") \ XX(SUB_MACHINE, 6, "分机") \
XX(WATER, 5, "淹水防区") \ XX(REMOTE_CONTROL, 7, "遥控器") \
XX(SUB_MACHINE, 6, "分机") \ XX(BUGLAR_HALF, 8, "匪警半局") \
XX(REMOTE_CONTROL, 7, "遥控器") \ XX(SHIELD, 9, "屏蔽防区") \
XX(BUGLAR_HALF, 8, "匪警半局") \ XX(DOOR_RING, 0x0A, "门铃防区") \
XX(SHIELD, 9, "屏蔽防区") \ XX(BYPASS, 0x0F, "旁路防区")
XX(DOOR_RING, 0x0A, "门铃防区") \
XX(BYPASS, 0x0F, "旁路防区") // 防区属性与安定宝事件码对照表
#define HZP_EVENT_MAP(XX) \
// 防区属性与安定宝事件码对照表 XX(HZP_BUGLAR, EVENT_BURGLAR) \
#define HZP_EVENT_MAP(XX) \ XX(HZP_BUGLAR_HALF, EVENT_BURGLAR) \
XX(HZP_BUGLAR, EVENT_BURGLAR) \ XX(HZP_EMERGENCY, EVENT_EMERGENCY) \
XX(HZP_BUGLAR_HALF, EVENT_BURGLAR) \ XX(HZP_FIRE, EVENT_FIRE) \
XX(HZP_EMERGENCY, EVENT_EMERGENCY) \ XX(HZP_DURESS, EVENT_DURESS) \
XX(HZP_FIRE, EVENT_FIRE) \ XX(HZP_GAS, EVENT_GAS) \
XX(HZP_DURESS, EVENT_DURESS) \ XX(HZP_WATER, EVENT_WATER) \
XX(HZP_GAS, EVENT_GAS) \ XX(HZP_DOOR_RING, EVENT_DOORRINGING)
XX(HZP_WATER, EVENT_WATER) \
XX(HZP_DOOR_RING, EVENT_DOORRINGING) // 防区属性
typedef enum hb_zone_property_t {
// 防区属性 #define XX(name, value, str) HZP_##name = value,
typedef enum hb_zone_property_t { HB_ZONE_PROPERTY_MAP(XX)
#define XX(name, value, str) HZP_##name = value, #undef XX
HB_ZONE_PROPERTY_MAP(XX)
#undef XX // valid count
HZP_COUNT = 12,
// valid count // invalid
HZP_COUNT = 12, HZP_INVALID = -1,
// invalid } hb_zone_property_t;
HZP_INVALID = -1,
} hb_zone_property_t; typedef struct {
ademco_zone_t zone;
typedef struct hb_zone_and_property_t { hb_zone_property_t prop;
ademco_zone_t zone; } hb_zone_and_property_t;
hb_zone_property_t prop;
} hb_zone_and_property_t; typedef struct {
uint8_t hour;
typedef struct hb_machine_time_point_t { uint8_t minute;
uint8_t hour; } hb_machine_time_point_t;
uint8_t minute;
} hb_machine_time_point_t; typedef struct {
hb_machine_time_point_t arm_at;
typedef struct hb_machine_timer_one_t { hb_machine_time_point_t disarm_at;
hb_machine_time_point_t arm_at; } hb_machine_timer_one_t;
hb_machine_time_point_t disarm_at;
} hb_machine_timer_one_t; typedef union {
hb_machine_timer_one_t timer[2]; // 2 set of timer
typedef union hb_machine_timer_t { uint8_t data[8];
hb_machine_timer_one_t timer[2]; // 2 set of timer } hb_machine_timer_t;
uint8_t data[8];
} hb_machine_timer_t; ///////////////////////////// property functions //////////////////////////////
// 串口透传数据 // return available count
typedef struct hb_com_data_t { // props must have at least HZP_COUNT items
uint8_t data[HB_COM_DATA_MAX_LEN]; ADEMCO_EXPORT_SYMBOL
uint8_t len; size_t hb_get_available_zone_properties_by_type(hb_machine_type_t type,
} hb_com_data_t; hb_zone_property_t props[HZP_COUNT]);
// COM request table // 最大防区号根据型号不同而不同
#define HB_COM_REQUESTS_MAP(XX) \ ADEMCO_EXPORT_SYMBOL
XX(A0, "索要主机状态") \ ademco_zone_t hb_get_max_zone_by_type(hb_machine_type_t type);
XX(A1, "索要防区") \
XX(A2, "索要更多防区") \ // 防区号是否合法(可以包含0防区)
XX(A3, "修改防区") \ ADEMCO_EXPORT_SYMBOL
XX(A5, "获取定时器") \ int hb_is_valid_zone_by_type(hb_machine_type_t type, ademco_zone_t zone);
XX(A7, "设置定时器") \
XX(A9, "TODO") \ // 防区号是否合法(不可以可以包含0防区)
XX(AA, "修改防区探头遗失/失联") \ ADEMCO_EXPORT_SYMBOL
XX(AC, "索要防区探头遗失/失联--第一次索要") \ int hb_is_valid_zone_by_type_strict(hb_machine_type_t type, ademco_zone_t zone);
XX(AD, "索要防区探头遗失/失联--继续索要") \
XX(AE, "三区段主机布撤防命令") \ // 主机是否已投产使用
XX(B0, "索要三区段主机状态") \ ADEMCO_EXPORT_SYMBOL
XX(RA, "读取主机账号") \ int hb_is_machine_on_sale(hb_machine_type_t type);
XX(WA, "写入主机账号")
// 主机是否具有布防功能
// 发给主机 ADEMCO_EXPORT_SYMBOL
typedef enum hb_com_req_t { int hb_machine_can_arm(hb_machine_type_t type);
#define XX(name, str) HB_COM_REQ_##name,
HB_COM_REQUESTS_MAP(XX) // 主机是否具有撤防功能
#undef XX ADEMCO_EXPORT_SYMBOL
int hb_machine_can_disarm(hb_machine_type_t type);
// invalid
HB_COM_REQ_INVALID = -1, // 主机是否可以进入设置状态
} hb_com_req_t; ADEMCO_EXPORT_SYMBOL
int hb_machine_can_config(hb_machine_type_t type);
// COM response table
#define HB_COM_RESPONSES_MAP(XX) \ // 主机是否具有半布防功能
XX(A0, "索要主机状态回应") \ ADEMCO_EXPORT_SYMBOL
XX(A2, "索要防区回应") \ int hb_machine_can_half_arm(hb_machine_type_t type);
XX(A3, "学码开始回应") \
XX(A4, "修改防区回应") \ // 主机是否可以报告信号强度
XX(A6, "获取定时器回应") \ ADEMCO_EXPORT_SYMBOL
XX(A7, "设置定时器回应") \ int hb_machine_can_report_signal_strength(hb_machine_type_t type);
XX(A8, "拒绝设置或设置失败回应") \
XX(A9, "TODO") \ // 主机本身是否可以短信报警(不算通过服务如阿里语音等)
XX(AB, "修改防区探头遗失/失联回应") \ ADEMCO_EXPORT_SYMBOL
XX(AD, "索要防区探头遗失/失联回应") \ int hb_machine_can_report_by_sms(hb_machine_type_t type);
XX(AF, "三区段主机布撤防命令回应") \
XX(B1, "三区段主机状态回应") \ // 主机是否支持有线防区
XX(RA, "读取主机账号回应") \ ADEMCO_EXPORT_SYMBOL
XX(WA, "写入主机账号回应") int hb_machine_has_wired_zones(hb_machine_type_t type);
// 主机回应 // 主机最小有线防区号
typedef enum hb_com_resp_t { ADEMCO_EXPORT_SYMBOL
#define XX(name, str) HB_COM_RESP_##name, ademco_zone_t hb_wired_zone_min(hb_machine_type_t type);
HB_COM_RESPONSES_MAP(XX)
#undef XX // 主机最大有线防区号
ADEMCO_EXPORT_SYMBOL
// invalid ademco_zone_t hb_wired_zone_max(hb_machine_type_t type);
HB_COM_RESP_INVALID = -1,
} hb_com_resp_t; // 主机是否可以直接写入防区数据(无需对码)
ADEMCO_EXPORT_SYMBOL
// 索要主机状态 EB AB 3F A0 75 int hb_machine_can_write_zone(hb_machine_type_t type);
#define HB_COM_REQ_A0_LEN 5 // 主机是否可以挂载分机
#define HB_COM_REQ_A0_DATA "\xEB\xAB\x3F\xA0\x75" ADEMCO_EXPORT_SYMBOL
int hb_machine_can_link_sub_machine(hb_machine_type_t type);
// 回应主机状态 EB BA 3F 07 P0 A0 P1 P2 SUM
#define HB_COM_RESP_A0_LEN 9 // 根据防区属性判断是否支持失联报告
#define HB_COM_RESP_A0_HEAD "\xEB\xBA\x3F\x07\xCC\xA0" // 失联报告是主机侧实现的跟防区属性没关系,但是人为限制了只有以下属性的才可以设置
ADEMCO_EXPORT_SYMBOL
// 索要主机防区 EB AB 3F A1 76 int hb_zone_can_report_lost(hb_zone_property_t zp);
#define HB_COM_REQ_A1_LEN 5
#define HB_COM_REQ_A1_DATA "\xEB\xAB\x3F\xA1\x76" ///////////////////////////// timer functions /////////////////////////////////
// 回应主机防区 EB BA 3F PN P0 A2 [Z, P]xN P1 SUM ADEMCO_EXPORT_SYMBOL
// 无防区数据时长度最小为8 void hb_machine_timer_init(hb_machine_timer_t* timer);
#define HB_COM_RESP_A2_MIN_LEN 8
// 最多可以包含 20 个防区 ADEMCO_EXPORT_SYMBOL
#define HB_COM_RESP_A2_MAX_ZONE 20 int hb_is_valid_time_point(hb_machine_time_point_t* tp);
// 一包数据最多有8+20*2=48个字节
#define HB_COM_RESP_A2_MAX_LEN (HB_COM_RESP_A2_MIN_LEN + HB_COM_RESP_A2_MAX_ZONE * 2) ADEMCO_EXPORT_SYMBOL
typedef enum hb_com_resp_a2_p1_t { void hb_time_point_to_greenwich(hb_machine_time_point_t* tp);
HB_COM_RESP_A2_P1_MORE = 0x00, // 还有更多防区
HB_COM_RESP_A2_P1_NOMORE = 0xFF, // 无更多防区 ADEMCO_EXPORT_SYMBOL
} hb_com_resp_a2_p1_t; void hb_time_point_from_greenwich(hb_machine_time_point_t* tp);
#define HB_COM_RESP_A2_HEAD "\xEB\xBA\x3F\x08\xCC\xA2"
typedef struct hb_com_resp_a2_iter_t { ADEMCO_EXPORT_SYMBOL
const hb_com_data_t* com; int hb_is_valid_timer_one(hb_machine_timer_one_t* timer);
uint8_t i, total;
hb_com_resp_a2_p1_t p1; ADEMCO_EXPORT_SYMBOL
} hb_com_resp_a2_iter_t; int hb_is_valid_machine_timer(hb_machine_timer_t* timer);
// 索要更多主机防区 EB AB 3F A2 77 // 传输的是格林威治时间
// 仅应在收到ZoneResponse的param非0xFF时发送,以索要全部防区 ADEMCO_EXPORT_SYMBOL
#define HB_COM_REQ_A2_LEN 5 void hb_machine_timer_to_greenwich(hb_machine_timer_t* timer);
#define HB_COM_REQ_A2_DATA "\xEB\xAB\x3F\xA2\x77"
ADEMCO_EXPORT_SYMBOL
// 修改主机防区 EB CB 3F 09 A3 P1 P2 P3 SUM void hb_machine_timer_from_greenwich(hb_machine_timer_t* timer);
#define HB_COM_REQ_A3_LEN 9
#define HB_COM_REQ_A3_DATA "\xEB\xCB\x3F\x09\xA3" ///////////////////////////// helper functions ////////////////////////////////
typedef enum hb_com_req_a3_p3_t { ADEMCO_EXPORT_SYMBOL
HB_COM_REQ_A3_P3_DEL = 0x00, // 删除防区 ademco_event_t hb_machine_status_to_ademco_event(hb_machine_status_t status);
HB_COM_REQ_A3_P3_PAIR = 0x01, // 学码
HB_COM_REQ_A3_P3_STOP = 0x02, // 停止学码 ADEMCO_EXPORT_SYMBOL
HB_COM_REQ_A3_P3_MOD = 0x03, // 修改防区属性 hb_machine_status_t hb_machine_status_from_ademco_event(ademco_event_t ademco_event);
} hb_com_req_a3_p3_t;
ADEMCO_EXPORT_SYMBOL
// 学码开始回应 EB BA 3F 07 P0 A3 5A ademco_event_t hb_machine_type_to_ademco_event(hb_machine_type_t type);
// 因为学码时主机要等待外部无线信号(用户触发探测器),
// 因此先回应A3表示已经开始学码,学码成功时回 ZoneOpResponse A4 ADEMCO_EXPORT_SYMBOL
#define HB_COM_RESP_A3_LEN 7 hb_machine_type_t hb_machine_type_from_ademco_event(ademco_event_t ademco_event);
#define HB_COM_RESP_A3_DATA "\xEB\xBA\x3F\x07\xCC\xA3\x5A"
ADEMCO_EXPORT_SYMBOL
// 修改防区回应 EB BA 3F 0A P0 A4 P1 P2 P3 SUM ademco_event_t hb_zone_property_to_ademco_event(hb_zone_property_t zp);
#define HB_COM_RESP_A4_LEN 10
#define HB_COM_RESP_A4_HEAD "\xEB\xBA\x3F\x0A\xCC\xA4" ADEMCO_EXPORT_SYMBOL
typedef enum hb_com_resp_a4_p3_t { const char* hb_machine_status_to_string(hb_machine_status_t status);
HB_COM_RESP_A4_P3_FAIL = 0x00, // 失败
HB_COM_RESP_A4_P3_OK = 0x01, // 成功 ADEMCO_EXPORT_SYMBOL
HB_COM_RESP_A4_P3_DUP = 0x02, // 失败--重码 const char* hb_machine_type_to_string(hb_machine_type_t type);
HB_COM_RESP_A4_P3_NE = 0x03, // 失败--防区未对码 not exists
} hb_com_resp_a4_p3_t; ADEMCO_EXPORT_SYMBOL
const char* hb_zone_property_to_string(hb_zone_property_t zp);
// 获取主机定时器
// EB AB 3F A5 7A #if ADEMCO_ENABLE_CHINESE
#define HB_COM_REQ_A5_LEN 5 ADEMCO_EXPORT_SYMBOL
#define HB_COM_REQ_A5_DATA "\xEB\xAB\x3F\xA5\x7A" const char* hb_machine_status_to_string_chinese(hb_machine_status_t status);
// 获取主机定时器回应 ADEMCO_EXPORT_SYMBOL
// EB BA 3F 0F P0 A6 H1 M1 H2 M2 H3 M3 H4 M4 SUM const char* hb_machine_type_to_string_chinese(hb_machine_type_t type);
#define HB_COM_RESP_A6_LEN 15
#define HB_COM_RESP_A6_HEAD "\xEB\xBA\x3F\x0F\xCC\xA6" ADEMCO_EXPORT_SYMBOL
const char* hb_zone_property_to_string_chinese(hb_zone_property_t zp);
// 设置主机定时器 #endif // ADEMCO_ENABLE_CHINESE
// EB CB 3F 0E A7 H1 M1 H2 M2 H3 M3 H4 M4 SUM
#define HB_COM_REQ_A7_LEN 14 ADEMCO_EXPORT_SYMBOL
#define HB_COM_REQ_A7_HEAD "\xEB\xCB\x3F\x0E\xA7" const char* hb_get_zone_format_str(hb_machine_type_t type);
// 设置主机定时器回应 #ifdef __cplusplus
// EB BA 3F 07 P0 A7 SUM }
#define HB_COM_RESP_A7_LEN 7 #endif
#define HB_COM_RESP_A7_DATA "\xEB\xBA\x3F\x07\xCC\xA7\x5E"
#endif
// 拒绝设置回应
// EB BA 3F 07 P0 A8 SUM
// 任何操作,主机如果认为非法,都可以用A8直接回复
#define HB_COM_RESP_A8_LEN 7
#define HB_COM_RESP_A8_DATA "\xEB\xBA\x3F\x07\xCC\xA8\x5F"
// 修改防区探头遗失/失联
// EB CB 3F 08 AA P1 P2 SUM
#define HB_COM_REQ_AA_LEN 8
#define HB_COM_REQ_AA_HEAD "\xEB\xAB\x3F\x08\xAA"
// 修改防区探头遗失/失联回应
// EB BA 3F 09 P0 AB P1 P2 SUM
#define HB_COM_RESP_AB_LEN 9
#define HB_COM_RESP_AB_HEAD "\xEB\xBA\x3F\x09\xCC\xAB"
typedef enum hb_com_resp_ab_p2_t {
HB_COM_RESP_AB_P2_CLOSE = 0, // 防区失联关
HB_COM_RESP_AB_P2_OPEN = 1, // 防区失联开
HB_COM_RESP_AB_P2_REJECT = 2, // 拒绝操作
} hb_com_resp_ab_p2_t;
// 索要防区探头遗失/失联,第一次索要
// EB AB 3F AC 81
#define HB_COM_REQ_AC_LEN 5
#define HB_COM_REQ_AC_DATA "\xEB\xAB\x3F\xAC\x81"
// 索要防区探头遗失/失联,索要更多
// EB AB 3F AD 82
#define HB_COM_REQ_AD_LEN 5
#define HB_COM_REQ_AD_DATA "\xEB\xAB\x3F\xAD\x82"
// 索要防区探头遗失/失联回应
// EB BA 3F PN P0 AD P1 DATA P2 SUM
// 无防区失联数据时一包长度最小为9
#define HB_COM_RESP_AD_MIN_LEN 9
// 一包最多包含20个防区
#define HB_COM_RESP_AD_MAX_ZONE 20
// 一包最多有 9 + 20 *2 = 49 个字节
#define HB_COM_RESP_AD_MAX_LEN \
(HB_COM_RESP_AD_MIN_LEN + HB_COM_RESP_AD_MAX_ZONE * 2)
typedef enum hb_com_resp_ad_p1_t {
HB_COM_RESP_AD_P1_SINGLE = 0xF0, // 防区号以单字节表示
HB_COM_RESP_AD_P1_DOUBLE = 0xF1, // 防区号以双字节表示
} hb_com_resp_ad_p1_t;
typedef enum hb_com_resp_ad_p2_t {
HB_COM_RESP_AD_P2_MORE = 0x00, // 还有更多防区
HB_COM_RESP_AD_P2_NOMORE = 0xFF, // 无更多防区
} hb_com_resp_ad_p2_t;
#define HB_COM_RESP_AD_HEAD "\xEB\xBA\x3F\x09\xCC\xAD"
typedef struct hb_com_resp_ad_iter_t {
const hb_com_data_t* com;
uint8_t i, total;
hb_com_resp_ad_p1_t p1;
hb_com_resp_ad_p2_t p2;
} hb_com_resp_ad_iter_t;
typedef enum hb_com_3sec_status_t {
HB_COM_3SEC_ARM = 0x00, // 布防(成功)
HB_COM_3SEC_DISARM = 0x01, // 撤防(成功)
} hb_com_3sec_status_t;
typedef enum hb_com_3sec_which_t {
HB_COM_3SEC_MACHINE, // 主机
HB_COM_3SEC_SECTION1, // 区段1
HB_COM_3SEC_SECTION2, // 区段2
HB_COM_3SEC_SECTION3, // 区段3
} hb_com_3sec_which_t;
// 三区段主机布撤防命令 EB CB 3F 08 AE P1 P2 SUM
#define HB_COM_REQ_AE_LEN 8
#define HB_COM_REQ_AE_HEAD "\xEB\xCB\x3F\x08\xAE"
// 三区段主机布撤防命令回应 EB BA 3F 08 P0 AF P1 P2 SUM
#define HB_COM_RESP_AF_LEN 9
#define HB_COM_RESP_AF_HEAD "\xEB\xBA\x3F\x08\xCC\xAF"
// 三区段主机索要主机状态 EB CB 3F 06 B0 AB
#define HB_COM_REQ_B0_LEN 6
#define HB_COM_REQ_B0_DATA "\xEB\xCB\x3F\x06\xB0\xAB"
// 三区段主机状态回应 EB BA 3F 08 P0 B1 P1 SUM
#define HB_COM_RESP_B1_LEN 8
#define HB_COM_RESP_B1_HEAD "\xEB\xBA\x3F\x08\xCC\xB1"
#define hb_com_resp_b1_get_status(d) \
((((d)[6] >> 6) & 0x03) == HB_COM_3SEC_ARM ? HMS_ARM : HMS_DISARM)
#define hb_com_resp_b1_get_status1(d) \
((((d)[6] >> 4) & 0x03) == HB_COM_3SEC_ARM ? HMS_ARM : HMS_DISARM)
#define hb_com_resp_b1_get_status2(d) \
((((d)[6] >> 2) & 0x03) == HB_COM_3SEC_ARM ? HMS_ARM : HMS_DISARM)
#define hb_com_resp_b1_get_status3(d) \
((((d)[6]) & 0x03) == HB_COM_3SEC_ARM ? HMS_ARM : HMS_DISARM)
// 读取主机账号
#define HB_COM_REQ_RA_LEN 7
#define HB_COM_REQ_RA_DATA "\xEB\xBA\x3F\x07\x00\x4C\x37"
// 读取主机账号回应
#define HB_COM_RESP_RA_LEN 15
#define HB_COM_RESP_RA_HEAD "\xEB\xCB\x3F\x0F\x4C"
// 写入主机账号
#define HB_COM_REQ_WA_LEN 15
#define HB_COM_REQ_WA_HEAD "\xEB\xCB\x3F\x0F\x4D"
// 写入主机账号回应(与读取命令相同)
#define HB_COM_RESP_WA_LEN HB_COM_REQ_RA_LEN
#define HB_COM_RESP_WA_DATA HB_COM_REQ_RA_DATA
///////////////////////////// property functions //////////////////////////////
// return available count
// props must have at least HZP_COUNT items
ADEMCO_EXPORT_SYMBOL
size_t hb_get_available_zone_properties_by_type(hb_machine_type_t type, hb_zone_property_t props[HZP_COUNT]);
// 最大防区号根据型号不同而不同
ADEMCO_EXPORT_SYMBOL
ademco_zone_t hb_get_max_zone_by_type(hb_machine_type_t type);
// 防区号是否合法(可以包含0防区)
ADEMCO_EXPORT_SYMBOL
int hb_is_valid_zone_by_type(hb_machine_type_t type, ademco_zone_t zone);
// 防区号是否合法(不可以可以包含0防区)
ADEMCO_EXPORT_SYMBOL
int hb_is_valid_zone_by_type_strict(hb_machine_type_t type, ademco_zone_t zone);
// 主机是否已投产使用
ADEMCO_EXPORT_SYMBOL
int hb_is_machine_on_sale(hb_machine_type_t type);
// 主机是否具有布防功能
ADEMCO_EXPORT_SYMBOL
int hb_machine_can_arm(hb_machine_type_t type);
// 主机是否具有撤防功能
ADEMCO_EXPORT_SYMBOL
int hb_machine_can_disarm(hb_machine_type_t type);
// 主机是否可以进入设置状态
ADEMCO_EXPORT_SYMBOL
int hb_machine_can_config(hb_machine_type_t type);
// 主机是否具有半布防功能
ADEMCO_EXPORT_SYMBOL
int hb_machine_can_half_arm(hb_machine_type_t type);
// 主机是否可以报告信号强度
ADEMCO_EXPORT_SYMBOL
int hb_machine_can_report_signal_strength(hb_machine_type_t type);
// 主机本身是否可以短信报警(不算通过服务如阿里语音等)
ADEMCO_EXPORT_SYMBOL
int hb_machine_can_report_by_sms(hb_machine_type_t type);
// 主机是否支持有线防区
ADEMCO_EXPORT_SYMBOL
int hb_machine_has_wired_zones(hb_machine_type_t type);
// 主机最小有线防区号
ADEMCO_EXPORT_SYMBOL
ademco_zone_t hb_wired_zone_min(hb_machine_type_t type);
// 主机最大有线防区号
ADEMCO_EXPORT_SYMBOL
ademco_zone_t hb_wired_zone_max(hb_machine_type_t type);
// 主机是否可以直接写入防区数据(无需对码)
ADEMCO_EXPORT_SYMBOL
int hb_machine_can_write_zone(hb_machine_type_t type);
// 主机是否可以挂载分机
ADEMCO_EXPORT_SYMBOL
int hb_machine_can_link_sub_machine(hb_machine_type_t type);
// 根据防区属性判断是否支持失联报告
// 失联报告是主机侧实现的跟防区属性没关系,但是人为限制了只有以下属性的才可以设置
ADEMCO_EXPORT_SYMBOL
int hb_zone_can_report_lost(hb_zone_property_t zp);
///////////////////////////// timer functions /////////////////////////////////
ADEMCO_EXPORT_SYMBOL
void hb_machine_timer_init(hb_machine_timer_t* timer);
ADEMCO_EXPORT_SYMBOL
int hb_is_valid_time_point(hb_machine_time_point_t* tp);
ADEMCO_EXPORT_SYMBOL
void hb_time_point_to_greenwich(hb_machine_time_point_t* tp);
ADEMCO_EXPORT_SYMBOL
void hb_time_point_from_greenwich(hb_machine_time_point_t* tp);
ADEMCO_EXPORT_SYMBOL
int hb_is_valid_timer_one(hb_machine_timer_one_t* timer);
ADEMCO_EXPORT_SYMBOL
int hb_is_valid_machine_timer(hb_machine_timer_t* timer);
// 传输的是格林威治时间
ADEMCO_EXPORT_SYMBOL
void hb_machine_timer_to_greenwich(hb_machine_timer_t* timer);
ADEMCO_EXPORT_SYMBOL
void hb_machine_timer_from_greenwich(hb_machine_timer_t* timer);
///////////////////////////// helper functions ////////////////////////////////
ADEMCO_EXPORT_SYMBOL
ademco_event_t hb_machine_status_to_ademco_event(hb_machine_status_t status);
ADEMCO_EXPORT_SYMBOL
hb_machine_status_t hb_machine_status_from_ademco_event(ademco_event_t ademco_event);
ADEMCO_EXPORT_SYMBOL
ademco_event_t hb_machine_type_to_ademco_event(hb_machine_type_t type);
ADEMCO_EXPORT_SYMBOL
hb_machine_type_t hb_machine_type_from_ademco_event(ademco_event_t ademco_event);
ADEMCO_EXPORT_SYMBOL
ademco_event_t hb_zone_property_to_ademco_event(hb_zone_property_t zp);
ADEMCO_EXPORT_SYMBOL
const char* hb_machine_status_to_string(hb_machine_status_t status);
ADEMCO_EXPORT_SYMBOL
const char* hb_machine_type_to_string(hb_machine_type_t type);
ADEMCO_EXPORT_SYMBOL
const char* hb_zone_property_to_string(hb_zone_property_t zp);
ADEMCO_EXPORT_SYMBOL
const char* hb_com_req_to_string(hb_com_req_t type);
ADEMCO_EXPORT_SYMBOL
const char* hb_com_resp_to_string(hb_com_resp_t type);
#if ADEMCO_ENABLE_CHINESE
ADEMCO_EXPORT_SYMBOL
const char* hb_machine_status_to_string_chinese(hb_machine_status_t status);
ADEMCO_EXPORT_SYMBOL
const char* hb_machine_type_to_string_chinese(hb_machine_type_t type);
ADEMCO_EXPORT_SYMBOL
const char* hb_zone_property_to_string_chinese(hb_zone_property_t zp);
ADEMCO_EXPORT_SYMBOL
const char* hb_com_req_to_string_chinese(hb_com_req_t type);
ADEMCO_EXPORT_SYMBOL
const char* hb_com_resp_to_string_chinese(hb_com_resp_t type);
#endif // ADEMCO_ENABLE_CHINESE
ADEMCO_EXPORT_SYMBOL
const char* hb_get_zone_format_str(hb_machine_type_t type);
///////////////////////////// COM functions ///////////////////////////////////
// 累加校验,计算data[0] ~ data[len-2],校验和放在data[len-1]
ADEMCO_EXPORT_SYMBOL
void hb_sum(uint8_t* data, size_t len);
// 校验和是否正确, return 0 for incorrect, otherwise correct
ADEMCO_EXPORT_SYMBOL
int hb_chksum(const uint8_t* data, size_t len);
ADEMCO_EXPORT_SYMBOL
hb_com_req_t hb_com_parse_req(const uint8_t* buff, size_t len, hb_com_data_t* cd);
ADEMCO_EXPORT_SYMBOL
hb_com_req_t hb_com_parse_xdata_req(const ademco_xdata_t* xdata, hb_com_data_t* cd);
// parse COM response and return response type.
// If cd is non-NULL, valid data will be copied to cd
ADEMCO_EXPORT_SYMBOL
hb_com_resp_t hb_com_parse_resp(const uint8_t* buff, size_t len, hb_com_data_t* cd);
// parse COM response and return response type.
// If cd is non-NULL, valid data will be copied to cd
ADEMCO_EXPORT_SYMBOL
hb_com_resp_t hb_com_parse_xdata_resp(const ademco_xdata_t* xdata, hb_com_data_t* cd);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_req_a0_get_machine_status(hb_com_data_t* data);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_req_a1_get_machine_zones(hb_com_data_t* data);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_req_a2_get_more_machine_zones(hb_com_data_t* data);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_req_a3_modify_machine_zone(hb_com_data_t* data,
uint8_t zone,
hb_zone_property_t prop,
hb_com_req_a3_p3_t op);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_req_a5_get_machine_timer(hb_com_data_t* data);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_req_a7_set_machine_timer(hb_com_data_t* data, hb_machine_timer_t* timer);
// TODO
// ADEMCO_EXPORT_SYMBOL
// void hbComMakeReqA9(hb_com_data_t* data, hb_machine_status_t status, hb_machine_type_t type);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_req_aa_modify_machine_zone_lost_config(hb_com_data_t* data, uint8_t zone, int on);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_req_ac_get_machine_zone_lost_config(hb_com_data_t* data);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_req_ad_get_more_machine_zone_lost_config(hb_com_data_t* data);
// p2 must be HB_COM_3SEC_ARM or HB_COM_3SEC_DISARM
ADEMCO_EXPORT_SYMBOL
void hb_com_make_req_ae_set_3sec_machine_status(hb_com_data_t* data,
hb_com_3sec_which_t p1,
hb_com_3sec_status_t status);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_req_b0_get_3sec_machine_status(hb_com_data_t* data);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_req_ra_read_acct(hb_com_data_t* data);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_req_wa_write_acct(hb_com_data_t* data, const char* acct);
ADEMCO_EXPORT_SYMBOL
void hb_com_resp_a2_iter_init(hb_com_resp_a2_iter_t* iter, const hb_com_data_t* com);
ADEMCO_EXPORT_SYMBOL
hb_com_resp_a2_p1_t hb_com_resp_a2_iter_next(hb_com_resp_a2_iter_t* iter,
hb_zone_and_property_t* zp);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_resp_a0_machine_status(hb_com_data_t* data,
hb_machine_status_t status,
hb_machine_type_t type);
// zones and props length is count
// if count is 0, p1 wil be set to HB_COM_RESP_A2_P1_NOMORE
ADEMCO_EXPORT_SYMBOL
void hb_com_make_resp_a2_machine_zones(hb_com_data_t* data,
size_t count,
ademco_zone_t* zones,
hb_zone_property_t* props,
hb_com_resp_a2_p1_t p1);
// 学码开始,等待探测器无线信号中
ADEMCO_EXPORT_SYMBOL
void hb_com_make_resp_a3_waiting_sensor_signal(hb_com_data_t* data);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_resp_a4_modify_zone_result(hb_com_data_t* data,
ademco_zone_t zone,
hb_zone_property_t prop,
hb_com_resp_a4_p3_t p3);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_resp_a6_machine_timer(hb_com_data_t* data, hb_machine_timer_t* timer);
ADEMCO_EXPORT_SYMBOL
void hb_com_resp_a7_to_timer(hb_com_data_t* data, hb_machine_timer_t* timer);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_resp_a7_set_machine_timer_result(hb_com_data_t* data);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_resp_a8_reject(hb_com_data_t* data);
// TODO
// ADEMCO_EXPORT_SYMBOL void hbComMakeRespA9_(hb_com_data_t* data);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_resp_ab_modify_machine_zone_lost_config_result(hb_com_data_t* data,
ademco_zone_t zone,
hb_com_resp_ab_p2_t p2);
// 返回所有失联开的防区
ADEMCO_EXPORT_SYMBOL
void hb_com_make_resp_ad_machine_zone_lost_config(hb_com_data_t* data,
hb_com_resp_ad_p1_t p1,
size_t count,
ademco_zone_t* zones,
hb_com_resp_ad_p2_t p2);
ADEMCO_EXPORT_SYMBOL
void hb_com_resp_ad_iter_init(hb_com_resp_ad_iter_t* iter, const hb_com_data_t* com);
ADEMCO_EXPORT_SYMBOL
hb_com_resp_ad_p2_t hb_com_resp_ad_iter_next(hb_com_resp_ad_iter_t* iter, ademco_zone_t* zone);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_resp_af_set_3sec_machine_status_result(hb_com_data_t* data,
hb_com_3sec_which_t p1,
hb_com_3sec_status_t status);
ADEMCO_EXPORT_SYMBOL
void hb_com_make_resp_b1_3sec_machine_status(hb_com_data_t* data,
hb_machine_status_t statusMachine,
hb_machine_status_t statusSec1,
hb_machine_status_t statusSec2,
hb_machine_status_t statusSec3);
ADEMCO_EXPORT_SYMBOL
void hb_com_data_to_ademco_xdata(const hb_com_data_t* const data,
ademco_xdata_t* xdata,
ademco_xdata_length_format_t xlf,
ademco_xdata_transform_t xtr);
#ifdef __cplusplus
}
#endif
#endif
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"sources":[ "sources":[
"libademco_wrap.cxx", "libademco_wrap.cxx",
"../ademco.c", "../ademco.c",
"../hb_com.c", "../hb_core.c",
], ],
'conditions': [ 'conditions': [
['OS=="win"', { ['OS=="win"', {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
/* Includes the header in the wrapper code */ /* Includes the header in the wrapper code */
#include "../ademco_config.h" #include "../ademco_config.h"
#include "../ademco_version.h" #include "../ademco_version.h"
#include "../hb_com.h" #include "../hb_core.h"
%} %}
#ifdef SWIGJAVA #ifdef SWIGJAVA
...@@ -41,5 +41,5 @@ JAVA_ARRAYS_TYPEMAPS(uint8_t, byte, jbyte, Uint8, "[B") ...@@ -41,5 +41,5 @@ JAVA_ARRAYS_TYPEMAPS(uint8_t, byte, jbyte, Uint8, "[B")
%include "../ademco_config.h" %include "../ademco_config.h"
%include "../ademco_version.h" %include "../ademco_version.h"
%include "../ademco.h" %include "../ademco.h"
%include "../hb_com.h" %include "../hb_core.h"
...@@ -9,8 +9,8 @@ repo=/h/dev_hb/libhb/libhb ...@@ -9,8 +9,8 @@ repo=/h/dev_hb/libhb/libhb
cp -f ${repo}/ademco.h ../ cp -f ${repo}/ademco.h ../
cp -f ${repo}/ademco.c ../ cp -f ${repo}/ademco.c ../
cp -f ${repo}/hb_com.h ../ cp -f ${repo}/hb_core.h ../
cp -f ${repo}/hb_com.c ../ cp -f ${repo}/hb_core.c ../
cp -f ${repo}/ademco_version.h ../ cp -f ${repo}/ademco_version.h ../
cp -f ${repo}/ademco_config.h ../ cp -f ${repo}/ademco_config.h ../
cp -f ${repo}/CHANGELOG.md ../ cp -f ${repo}/CHANGELOG.md ../
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment