Commit 3cfd4b65 authored by captainwong's avatar captainwong

static lib

parent a9f29aea
...@@ -416,7 +416,7 @@ AdemcoParseResult ademcoParseDataSegment(const ademco_char_t* packet, size_t pac ...@@ -416,7 +416,7 @@ AdemcoParseResult ademcoParseDataSegment(const ademco_char_t* packet, size_t pac
return RESULT_OK; return RESULT_OK;
} else if (packet_len >= ADEMCO_PACKET_DATA_SEGMENT_FULL_LEN && packet[0] == '[' && packet[packet_len - 1] == ']') { // [#000000|1400 00 000] } else if (packet_len >= ADEMCO_PACKET_DATA_SEGMENT_FULL_LEN && packet[0] == '[' && packet[packet_len - 1] == ']') { // [#000000|1400 00 000]
do { do {
const uint8_t* p = packet + 2; const char* p = packet + 2;
size_t acct_len = packet_len - 15; size_t acct_len = packet_len - 15;
if (acct_len < 6) { if (acct_len < 6) {
break; break;
...@@ -463,9 +463,10 @@ AdemcoParseResult ademcoParseDataSegment(const ademco_char_t* packet, size_t pac ...@@ -463,9 +463,10 @@ AdemcoParseResult ademcoParseDataSegment(const ademco_char_t* packet, size_t pac
size_t ademcoDataSegmentToCongwinFe100(ademco_char_t* fe100, const AdemcoDataSegment* dataSegment) size_t ademcoDataSegmentToCongwinFe100(ademco_char_t* fe100, const AdemcoDataSegment* dataSegment)
{ {
if (dataSegment->raw_len == ADEMCO_PACKET_DATA_SEGMENT_EMPTY_LEN) { if (dataSegment->raw_len == ADEMCO_PACKET_DATA_SEGMENT_EMPTY_LEN) {
return 0; fe100[0] = '\n';
fe100[1] = '\r';
return 2;
} else if (dataSegment->raw_len >= ADEMCO_PACKET_DATA_SEGMENT_FULL_LEN) { } else if (dataSegment->raw_len >= ADEMCO_PACKET_DATA_SEGMENT_FULL_LEN) {
int ndx = 0;
char* p = fe100; char* p = fe100;
*p++ = '\n'; *p++ = '\n';
*p++ = ' '; *p++ = ' ';
...@@ -534,14 +535,14 @@ int ademcoXDataConvert(AdemcoXDataSegment* xdata, AdemcoXDataLengthFormat xlf) ...@@ -534,14 +535,14 @@ int ademcoXDataConvert(AdemcoXDataSegment* xdata, AdemcoXDataLengthFormat xlf)
if (xdata->lenghFormat == xlf) { return ADEMCO_OK; } if (xdata->lenghFormat == xlf) { return ADEMCO_OK; }
size_t len = ademcoXDataGetValidContentLen(xdata); size_t len = ademcoXDataGetValidContentLen(xdata);
uint8_t raw[ADEMCO_PACKET_XDATA_MAX_LEN]; char raw[ADEMCO_PACKET_XDATA_MAX_LEN];
if (xlf == TWO_HEX) { if (xlf == TWO_HEX) {
if (len + 6 > ADEMCO_PACKET_XDATA_MAX_LEN) { if (len + 6 > ADEMCO_PACKET_XDATA_MAX_LEN) {
return ADEMCO_ERR; return ADEMCO_ERR;
} }
xdata->raw[5 + ademcoXDataGetValidContentLen(xdata)] = '\0'; xdata->raw[5 + ademcoXDataGetValidContentLen(xdata)] = '\0';
len = ademcoHexStrToArray(raw, ademcoXDataGetValidContentAddr(xdata), 0x0F); len = ademcoHexStrToArray((uint8_t*)raw, ademcoXDataGetValidContentAddr(xdata), 0x0F);
ademcoMakeXData(xdata, TWO_HEX, AdemcoXDataTransform_as_is, raw, len); ademcoMakeXData(xdata, TWO_HEX, AdemcoXDataTransform_as_is, raw, len);
} else { } else {
memcpy(raw, ademcoXDataGetValidContentAddr(xdata), len); memcpy(raw, ademcoXDataGetValidContentAddr(xdata), len);
...@@ -567,7 +568,7 @@ const char* ademcoXDataGetValidContentAddr(const AdemcoXDataSegment* xdata) ...@@ -567,7 +568,7 @@ const char* ademcoXDataGetValidContentAddr(const AdemcoXDataSegment* xdata)
int ademcoXDataMemcmp(const AdemcoXDataSegment* xdata, const void* buf, size_t buf_len) int ademcoXDataMemcmp(const AdemcoXDataSegment* xdata, const void* buf, size_t buf_len)
{ {
if (ademcoXDataGetValidContentLen(xdata) != buf_len) return 0; if (ademcoXDataGetValidContentLen(xdata) != buf_len) return 0;
const uint8_t* p = ademcoXDataGetValidContentAddr(xdata); const void* p = ademcoXDataGetValidContentAddr(xdata);
if (!p) return 0; if (!p) return 0;
return memcmp(p, buf, buf_len); return memcmp(p, buf, buf_len);
} }
...@@ -603,7 +604,7 @@ int ademcoMakeXData(AdemcoXDataSegment* xdata, AdemcoXDataLengthFormat xlf, Adem ...@@ -603,7 +604,7 @@ int ademcoMakeXData(AdemcoXDataSegment* xdata, AdemcoXDataLengthFormat xlf, Adem
memcpy(transformed, content, len); memcpy(transformed, content, len);
} else { } else {
if (len * 2 < ADEMCO_PACKET_XDATA_MAX_LEN) { if (len * 2 < ADEMCO_PACKET_XDATA_MAX_LEN) {
translen = ademcoHexArrayToStr(transformed, content, len) & 0xFFFF; translen = ademcoHexArrayToStr(transformed, (const uint8_t*)content, len) & 0xFFFF;
} else { } else {
return ADEMCO_ERR; return ADEMCO_ERR;
} }
...@@ -684,11 +685,11 @@ static void getNowTimestamp(char* buff) ...@@ -684,11 +685,11 @@ static void getNowTimestamp(char* buff)
size_t ademcoMakeEmptyDataPacket(ademco_char_t* dst_buff, size_t len, const char* id, uint16_t seq, const char* acct, AdemcoId ademcoId) size_t ademcoMakeEmptyDataPacket(ademco_char_t* dst_buff, size_t len, const char* id, uint16_t seq, const char* acct, AdemcoId ademcoId)
{ {
uint8_t buff[ADEMCO_PACKET_MAX_LEN]; char buff[ADEMCO_PACKET_MAX_LEN];
uint8_t* p = buff; char* p = buff;
uint8_t* pcrc = buff + 1; char* pcrc = buff + 1;
uint8_t* plen = buff + 5; char* plen = buff + 5;
uint8_t* pid = buff + 9; char* pid = buff + 9;
buff[0] = ADEMCO_PACKET_PREFIX; buff[0] = ADEMCO_PACKET_PREFIX;
memcpy(pid, id, strlen(id)); memcpy(pid, id, strlen(id));
...@@ -788,7 +789,7 @@ size_t ademcoMakeHbPacket(ademco_char_t* dst_buff, size_t len, uint16_t seq, con ...@@ -788,7 +789,7 @@ size_t ademcoMakeHbPacket(ademco_char_t* dst_buff, size_t len, uint16_t seq, con
size_t ademco_len = packet_len - 1 - 4 - 4 - 1; size_t ademco_len = packet_len - 1 - 4 - 4 - 1;
snprintf(temp, 5, "%04zX", ademco_len); snprintf(temp, 5, "%04zX", ademco_len);
memcpy(plen, temp, 4); memcpy(plen, temp, 4);
uint16_t crc = ademcoCRC16((const uint8_t*)pid, ademco_len); uint16_t crc = ademcoCRC16(pid, ademco_len);
snprintf(temp, 5, "%04X", crc); snprintf(temp, 5, "%04X", crc);
memcpy(pcrc, temp, 4); memcpy(pcrc, temp, 4);
...@@ -860,7 +861,6 @@ AdemcoParseResult ademcoPacketParse(const ademco_char_t* buff, size_t len, Ademc ...@@ -860,7 +861,6 @@ AdemcoParseResult ademcoPacketParse(const ademco_char_t* buff, size_t len, Ademc
do{ do{
const char* p = buff; const char* p = buff;
if (*p++ != ADEMCO_PACKET_PREFIX) { if (*p++ != ADEMCO_PACKET_PREFIX) {
dline;
break; break;
} }
...@@ -921,7 +921,7 @@ AdemcoParseResult ademcoPacketParse(const ademco_char_t* buff, size_t len, Ademc ...@@ -921,7 +921,7 @@ AdemcoParseResult ademcoPacketParse(const ademco_char_t* buff, size_t len, Ademc
// *rrcvr // *rrcvr
if (*p == 'R') { // rrcvr exists if (*p == 'R') { // rrcvr exists
const uint8_t* prcvr = p; //const char* prcvr = p;
while (p < pcr && *p != 'L' && *p != '#') { p++; } while (p < pcr && *p != 'L' && *p != '#') { p++; }
if (p >= pcr || (*p != 'L' && *p != '#')) { dline; break; } if (p >= pcr || (*p != 'L' && *p != '#')) { dline; break; }
// only check if format is correct, ignore it's content // only check if format is correct, ignore it's content
...@@ -1030,7 +1030,7 @@ size_t ademcoHiLoArrayToDecStr(ademco_char_t* str, const uint8_t* arr, size_t le ...@@ -1030,7 +1030,7 @@ size_t ademcoHiLoArrayToDecStr(ademco_char_t* str, const uint8_t* arr, size_t le
size_t ademcoDecStrToHiLoArray(uint8_t* arr, size_t len, const char* str) size_t ademcoDecStrToHiLoArray(uint8_t* arr, size_t len, const char* str)
{ {
char* p = arr; char* p = (char*)arr;
size_t slen = str ? strlen(str) : 0; size_t slen = str ? strlen(str) : 0;
if (slen > len * 2) { if (slen > len * 2) {
slen = len * 2; slen = len * 2;
...@@ -1071,7 +1071,6 @@ static uint8_t hex2char(uint8_t h) { ...@@ -1071,7 +1071,6 @@ static uint8_t hex2char(uint8_t h) {
size_t ademcoHexArrayToStr(char* str, const uint8_t* arr, size_t len) size_t ademcoHexArrayToStr(char* str, const uint8_t* arr, size_t len)
{ {
uint8_t c = 0;
char* p = str; char* p = str;
for (size_t i = 0; i < len; i++) { for (size_t i = 0; i < len; i++) {
*p++ = hex2char((arr[i] >> 4) & 0x0F); *p++ = hex2char((arr[i] >> 4) & 0x0F);
......
...@@ -9,6 +9,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gen_event_md", "gen_event_m ...@@ -9,6 +9,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gen_event_md", "gen_event_m
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ademco", "ademco\ademco.vcxproj", "{0757EA7C-9E3F-4F2F-8544-B1E649C9749A}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ademco", "ademco\ademco.vcxproj", "{0757EA7C-9E3F-4F2F-8544-B1E649C9749A}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ademco_static", "ademco_static\ademco_static.vcxproj", "{3A477FA2-F84E-40E5-9767-0FFBD35BC57A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ademco_static_mt", "ademco_static_mt\ademco_static_mt.vcxproj", "{0AA93A45-37CE-40DE-A0E9-7163941DFB2A}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -65,6 +69,34 @@ Global ...@@ -65,6 +69,34 @@ Global
{0757EA7C-9E3F-4F2F-8544-B1E649C9749A}.Release|x64.Build.0 = Release|x64 {0757EA7C-9E3F-4F2F-8544-B1E649C9749A}.Release|x64.Build.0 = Release|x64
{0757EA7C-9E3F-4F2F-8544-B1E649C9749A}.Release|x86.ActiveCfg = Release|Win32 {0757EA7C-9E3F-4F2F-8544-B1E649C9749A}.Release|x86.ActiveCfg = Release|Win32
{0757EA7C-9E3F-4F2F-8544-B1E649C9749A}.Release|x86.Build.0 = Release|Win32 {0757EA7C-9E3F-4F2F-8544-B1E649C9749A}.Release|x86.Build.0 = Release|Win32
{3A477FA2-F84E-40E5-9767-0FFBD35BC57A}.Debug|Any CPU.ActiveCfg = Debug|Win32
{3A477FA2-F84E-40E5-9767-0FFBD35BC57A}.Debug|ARM.ActiveCfg = Debug|Win32
{3A477FA2-F84E-40E5-9767-0FFBD35BC57A}.Debug|ARM64.ActiveCfg = Debug|Win32
{3A477FA2-F84E-40E5-9767-0FFBD35BC57A}.Debug|x64.ActiveCfg = Debug|x64
{3A477FA2-F84E-40E5-9767-0FFBD35BC57A}.Debug|x64.Build.0 = Debug|x64
{3A477FA2-F84E-40E5-9767-0FFBD35BC57A}.Debug|x86.ActiveCfg = Debug|Win32
{3A477FA2-F84E-40E5-9767-0FFBD35BC57A}.Debug|x86.Build.0 = Debug|Win32
{3A477FA2-F84E-40E5-9767-0FFBD35BC57A}.Release|Any CPU.ActiveCfg = Release|Win32
{3A477FA2-F84E-40E5-9767-0FFBD35BC57A}.Release|ARM.ActiveCfg = Release|Win32
{3A477FA2-F84E-40E5-9767-0FFBD35BC57A}.Release|ARM64.ActiveCfg = Release|Win32
{3A477FA2-F84E-40E5-9767-0FFBD35BC57A}.Release|x64.ActiveCfg = Release|x64
{3A477FA2-F84E-40E5-9767-0FFBD35BC57A}.Release|x64.Build.0 = Release|x64
{3A477FA2-F84E-40E5-9767-0FFBD35BC57A}.Release|x86.ActiveCfg = Release|Win32
{3A477FA2-F84E-40E5-9767-0FFBD35BC57A}.Release|x86.Build.0 = Release|Win32
{0AA93A45-37CE-40DE-A0E9-7163941DFB2A}.Debug|Any CPU.ActiveCfg = Debug|Win32
{0AA93A45-37CE-40DE-A0E9-7163941DFB2A}.Debug|ARM.ActiveCfg = Debug|Win32
{0AA93A45-37CE-40DE-A0E9-7163941DFB2A}.Debug|ARM64.ActiveCfg = Debug|Win32
{0AA93A45-37CE-40DE-A0E9-7163941DFB2A}.Debug|x64.ActiveCfg = Debug|x64
{0AA93A45-37CE-40DE-A0E9-7163941DFB2A}.Debug|x64.Build.0 = Debug|x64
{0AA93A45-37CE-40DE-A0E9-7163941DFB2A}.Debug|x86.ActiveCfg = Debug|Win32
{0AA93A45-37CE-40DE-A0E9-7163941DFB2A}.Debug|x86.Build.0 = Debug|Win32
{0AA93A45-37CE-40DE-A0E9-7163941DFB2A}.Release|Any CPU.ActiveCfg = Release|Win32
{0AA93A45-37CE-40DE-A0E9-7163941DFB2A}.Release|ARM.ActiveCfg = Release|Win32
{0AA93A45-37CE-40DE-A0E9-7163941DFB2A}.Release|ARM64.ActiveCfg = Release|Win32
{0AA93A45-37CE-40DE-A0E9-7163941DFB2A}.Release|x64.ActiveCfg = Release|x64
{0AA93A45-37CE-40DE-A0E9-7163941DFB2A}.Release|x64.Build.0 = Release|x64
{0AA93A45-37CE-40DE-A0E9-7163941DFB2A}.Release|x86.ActiveCfg = Release|Win32
{0AA93A45-37CE-40DE-A0E9-7163941DFB2A}.Release|x86.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\ademco.c" />
<ClCompile Include="..\..\hb_com.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\ademco.h" />
<ClInclude Include="..\..\hb_com.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{3a477fa2-f84e-40e5-9767-0ffbd35bc57a}</ProjectGuid>
<RootNamespace>ademcostatic</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<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" />
</ImportGroup>
<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" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\ademco.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\hb_com.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\ademco.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\hb_com.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\ademco.c" />
<ClCompile Include="..\..\hb_com.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\ademco.h" />
<ClInclude Include="..\..\hb_com.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{0aa93a45-37ce-40de-a0e9-7163941dfb2a}</ProjectGuid>
<RootNamespace>ademcostaticmt</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<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" />
</ImportGroup>
<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" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\ademco.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\hb_com.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\ademco.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\hb_com.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
\ No newline at end of file
...@@ -611,7 +611,7 @@ HbComRequestType hbComParseRequest(const uint8_t* data, size_t len, HbComData* c ...@@ -611,7 +611,7 @@ HbComRequestType hbComParseRequest(const uint8_t* data, size_t len, HbComData* c
ADEMCO_EXPORT_SYMBOL HbComRequestType hbComParseXDataRequest(const AdemcoXDataSegment* xdata, HbComData* cd) ADEMCO_EXPORT_SYMBOL HbComRequestType hbComParseXDataRequest(const AdemcoXDataSegment* xdata, HbComData* cd)
{ {
if (!xdata) { return HbComReq_Invalid; } if (!xdata) { return HbComReq_Invalid; }
return hbComParseRequest(ademcoXDataGetValidContentAddr(xdata), ademcoXDataGetValidContentLen(xdata), cd); return hbComParseRequest((const uint8_t*)ademcoXDataGetValidContentAddr(xdata), ademcoXDataGetValidContentLen(xdata), cd);
} }
HbComResponseType hbComParseResponse(const uint8_t* data, size_t len, HbComData* cd) HbComResponseType hbComParseResponse(const uint8_t* data, size_t len, HbComData* cd)
...@@ -740,7 +740,7 @@ HbComResponseType hbComParseResponse(const uint8_t* data, size_t len, HbComData* ...@@ -740,7 +740,7 @@ HbComResponseType hbComParseResponse(const uint8_t* data, size_t len, HbComData*
HbComResponseType hbComParseXDataResponse(const AdemcoXDataSegment* xdata, HbComData* cd) HbComResponseType hbComParseXDataResponse(const AdemcoXDataSegment* xdata, HbComData* cd)
{ {
if (!xdata) { return HbComReq_Invalid; } if (!xdata) { return HbComReq_Invalid; }
return hbComParseResponse(ademcoXDataGetValidContentAddr(xdata), ademcoXDataGetValidContentLen(xdata), cd); return hbComParseResponse((const uint8_t*)ademcoXDataGetValidContentAddr(xdata), ademcoXDataGetValidContentLen(xdata), cd);
} }
void hbComMakeReqA0_getMachineStatus(HbComData* data) void hbComMakeReqA0_getMachineStatus(HbComData* data)
...@@ -969,7 +969,7 @@ void hbComMakeRespB1_get3SectionMachineStatus(HbComData* data, HbMachineStatus s ...@@ -969,7 +969,7 @@ void hbComMakeRespB1_get3SectionMachineStatus(HbComData* data, HbMachineStatus s
void hbComDataToAdemcoXData(const HbComData* const data, AdemcoXDataSegment* xdata, AdemcoXDataLengthFormat xlf, AdemcoXDataTransform xtr) void hbComDataToAdemcoXData(const HbComData* const data, AdemcoXDataSegment* xdata, AdemcoXDataLengthFormat xlf, AdemcoXDataTransform xtr)
{ {
ademcoMakeXData(xdata, xlf, xtr, data->data, data->len); ademcoMakeXData(xdata, xlf, xtr, (const char*)data->data, data->len);
} }
xcopy /i /s /y G:\dev_libs\ademco\hb\ademco.h ..\
xcopy /i /s /y G:\dev_libs\ademco\hb\ademco.c ..\
xcopy /i /s /y G:\dev_libs\ademco\hb\hb_com.h ..\
xcopy /i /s /y G:\dev_libs\ademco\hb\hb_com.c ..\
\ No newline at end of file
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