mirror of
https://github.com/g4klx/DMRGateway
synced 2025-12-20 21:25:37 +08:00
Merge branch 'master' into XLXs
This commit is contained in:
16
Conf.cpp
16
Conf.cpp
@@ -62,6 +62,7 @@ m_dmrNetwork1Local(0U),
|
|||||||
m_dmrNetwork1Password(),
|
m_dmrNetwork1Password(),
|
||||||
m_dmrNetwork1Options(),
|
m_dmrNetwork1Options(),
|
||||||
m_dmrNetwork1Debug(false),
|
m_dmrNetwork1Debug(false),
|
||||||
|
m_dmrNetwork1Location(true),
|
||||||
m_dmrNetwork1TGRewrites(),
|
m_dmrNetwork1TGRewrites(),
|
||||||
m_dmrNetwork1PCRewrites(),
|
m_dmrNetwork1PCRewrites(),
|
||||||
m_dmrNetwork1TypeRewrites(),
|
m_dmrNetwork1TypeRewrites(),
|
||||||
@@ -76,6 +77,7 @@ m_dmrNetwork2Port(0U),
|
|||||||
m_dmrNetwork2Local(0U),
|
m_dmrNetwork2Local(0U),
|
||||||
m_dmrNetwork2Password(),
|
m_dmrNetwork2Password(),
|
||||||
m_dmrNetwork2Options(),
|
m_dmrNetwork2Options(),
|
||||||
|
m_dmrNetwork2Location(true),
|
||||||
m_dmrNetwork2Debug(false),
|
m_dmrNetwork2Debug(false),
|
||||||
m_dmrNetwork2TGRewrites(),
|
m_dmrNetwork2TGRewrites(),
|
||||||
m_dmrNetwork2PCRewrites(),
|
m_dmrNetwork2PCRewrites(),
|
||||||
@@ -213,6 +215,8 @@ bool CConf::read()
|
|||||||
m_dmrNetwork1Password = value;
|
m_dmrNetwork1Password = value;
|
||||||
else if (::strcmp(key, "Options") == 0)
|
else if (::strcmp(key, "Options") == 0)
|
||||||
m_dmrNetwork1Options = value;
|
m_dmrNetwork1Options = value;
|
||||||
|
else if (::strcmp(key, "Location") == 0)
|
||||||
|
m_dmrNetwork1Location = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "Debug") == 0)
|
else if (::strcmp(key, "Debug") == 0)
|
||||||
m_dmrNetwork1Debug = ::atoi(value) == 1;
|
m_dmrNetwork1Debug = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "TGRewrite") == 0) {
|
else if (::strcmp(key, "TGRewrite") == 0) {
|
||||||
@@ -297,6 +301,8 @@ bool CConf::read()
|
|||||||
m_dmrNetwork2Password = value;
|
m_dmrNetwork2Password = value;
|
||||||
else if (::strcmp(key, "Options") == 0)
|
else if (::strcmp(key, "Options") == 0)
|
||||||
m_dmrNetwork2Options = value;
|
m_dmrNetwork2Options = value;
|
||||||
|
else if (::strcmp(key, "Location") == 0)
|
||||||
|
m_dmrNetwork2Location = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "Debug") == 0)
|
else if (::strcmp(key, "Debug") == 0)
|
||||||
m_dmrNetwork2Debug = ::atoi(value) == 1;
|
m_dmrNetwork2Debug = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "TGRewrite") == 0) {
|
else if (::strcmp(key, "TGRewrite") == 0) {
|
||||||
@@ -540,6 +546,11 @@ std::string CConf::getDMRNetwork1Options() const
|
|||||||
return m_dmrNetwork1Options;
|
return m_dmrNetwork1Options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CConf::getDMRNetwork1Location() const
|
||||||
|
{
|
||||||
|
return m_dmrNetwork1Location;
|
||||||
|
}
|
||||||
|
|
||||||
bool CConf::getDMRNetwork1Debug() const
|
bool CConf::getDMRNetwork1Debug() const
|
||||||
{
|
{
|
||||||
return m_dmrNetwork1Debug;
|
return m_dmrNetwork1Debug;
|
||||||
@@ -618,6 +629,11 @@ std::string CConf::getDMRNetwork2Options() const
|
|||||||
return m_dmrNetwork2Options;
|
return m_dmrNetwork2Options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CConf::getDMRNetwork2Location() const
|
||||||
|
{
|
||||||
|
return m_dmrNetwork2Location;
|
||||||
|
}
|
||||||
|
|
||||||
bool CConf::getDMRNetwork2Debug() const
|
bool CConf::getDMRNetwork2Debug() const
|
||||||
{
|
{
|
||||||
return m_dmrNetwork2Debug;
|
return m_dmrNetwork2Debug;
|
||||||
|
|||||||
4
Conf.h
4
Conf.h
@@ -91,6 +91,7 @@ public:
|
|||||||
unsigned int getDMRNetwork1Local() const;
|
unsigned int getDMRNetwork1Local() const;
|
||||||
std::string getDMRNetwork1Password() const;
|
std::string getDMRNetwork1Password() const;
|
||||||
std::string getDMRNetwork1Options() const;
|
std::string getDMRNetwork1Options() const;
|
||||||
|
bool getDMRNetwork1Location() const;
|
||||||
bool getDMRNetwork1Debug() const;
|
bool getDMRNetwork1Debug() const;
|
||||||
std::vector<CTGRewriteStruct> getDMRNetwork1TGRewrites() const;
|
std::vector<CTGRewriteStruct> getDMRNetwork1TGRewrites() const;
|
||||||
std::vector<CPCRewriteStruct> getDMRNetwork1PCRewrites() const;
|
std::vector<CPCRewriteStruct> getDMRNetwork1PCRewrites() const;
|
||||||
@@ -108,6 +109,7 @@ public:
|
|||||||
unsigned int getDMRNetwork2Local() const;
|
unsigned int getDMRNetwork2Local() const;
|
||||||
std::string getDMRNetwork2Password() const;
|
std::string getDMRNetwork2Password() const;
|
||||||
std::string getDMRNetwork2Options() const;
|
std::string getDMRNetwork2Options() const;
|
||||||
|
bool getDMRNetwork2Location() const;
|
||||||
bool getDMRNetwork2Debug() const;
|
bool getDMRNetwork2Debug() const;
|
||||||
std::vector<CTGRewriteStruct> getDMRNetwork2TGRewrites() const;
|
std::vector<CTGRewriteStruct> getDMRNetwork2TGRewrites() const;
|
||||||
std::vector<CPCRewriteStruct> getDMRNetwork2PCRewrites() const;
|
std::vector<CPCRewriteStruct> getDMRNetwork2PCRewrites() const;
|
||||||
@@ -156,6 +158,7 @@ private:
|
|||||||
unsigned int m_dmrNetwork1Local;
|
unsigned int m_dmrNetwork1Local;
|
||||||
std::string m_dmrNetwork1Password;
|
std::string m_dmrNetwork1Password;
|
||||||
std::string m_dmrNetwork1Options;
|
std::string m_dmrNetwork1Options;
|
||||||
|
bool m_dmrNetwork1Location;
|
||||||
bool m_dmrNetwork1Debug;
|
bool m_dmrNetwork1Debug;
|
||||||
std::vector<CTGRewriteStruct> m_dmrNetwork1TGRewrites;
|
std::vector<CTGRewriteStruct> m_dmrNetwork1TGRewrites;
|
||||||
std::vector<CPCRewriteStruct> m_dmrNetwork1PCRewrites;
|
std::vector<CPCRewriteStruct> m_dmrNetwork1PCRewrites;
|
||||||
@@ -172,6 +175,7 @@ private:
|
|||||||
unsigned int m_dmrNetwork2Local;
|
unsigned int m_dmrNetwork2Local;
|
||||||
std::string m_dmrNetwork2Password;
|
std::string m_dmrNetwork2Password;
|
||||||
std::string m_dmrNetwork2Options;
|
std::string m_dmrNetwork2Options;
|
||||||
|
bool m_dmrNetwork2Location;
|
||||||
bool m_dmrNetwork2Debug;
|
bool m_dmrNetwork2Debug;
|
||||||
std::vector<CTGRewriteStruct> m_dmrNetwork2TGRewrites;
|
std::vector<CTGRewriteStruct> m_dmrNetwork2TGRewrites;
|
||||||
std::vector<CPCRewriteStruct> m_dmrNetwork2PCRewrites;
|
std::vector<CPCRewriteStruct> m_dmrNetwork2PCRewrites;
|
||||||
|
|||||||
@@ -416,7 +416,6 @@ int CDMRGateway::run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_xlxReflector = m_xlxRoom;
|
m_xlxReflector = m_xlxRoom;
|
||||||
|
|
||||||
if (voice != NULL) {
|
if (voice != NULL) {
|
||||||
if (m_xlxReflector < 4001U || m_xlxReflector > 4026U)
|
if (m_xlxReflector < 4001U || m_xlxReflector > 4026U)
|
||||||
voice->unlinked();
|
voice->unlinked();
|
||||||
@@ -830,6 +829,7 @@ bool CDMRGateway::createDMRNetwork1()
|
|||||||
unsigned int local = m_conf.getDMRNetwork1Local();
|
unsigned int local = m_conf.getDMRNetwork1Local();
|
||||||
unsigned int id = m_conf.getDMRNetwork1Id();
|
unsigned int id = m_conf.getDMRNetwork1Id();
|
||||||
std::string password = m_conf.getDMRNetwork1Password();
|
std::string password = m_conf.getDMRNetwork1Password();
|
||||||
|
bool location = m_conf.getDMRNetwork1Location();
|
||||||
bool debug = m_conf.getDMRNetwork1Debug();
|
bool debug = m_conf.getDMRNetwork1Debug();
|
||||||
m_dmr1Name = m_conf.getDMRNetwork1Name();
|
m_dmr1Name = m_conf.getDMRNetwork1Name();
|
||||||
|
|
||||||
@@ -845,6 +845,7 @@ bool CDMRGateway::createDMRNetwork1()
|
|||||||
LogInfo(" Local: %u", local);
|
LogInfo(" Local: %u", local);
|
||||||
else
|
else
|
||||||
LogInfo(" Local: random");
|
LogInfo(" Local: random");
|
||||||
|
LogInfo(" Location Data: %s", location ? "yes" : "no");
|
||||||
|
|
||||||
m_dmrNetwork1 = new CDMRNetwork(address, port, local, id, password, m_dmr1Name, debug);
|
m_dmrNetwork1 = new CDMRNetwork(address, port, local, id, password, m_dmr1Name, debug);
|
||||||
|
|
||||||
@@ -860,6 +861,9 @@ bool CDMRGateway::createDMRNetwork1()
|
|||||||
unsigned char config[400U];
|
unsigned char config[400U];
|
||||||
unsigned int len = m_repeater->getConfig(config);
|
unsigned int len = m_repeater->getConfig(config);
|
||||||
|
|
||||||
|
if (!location)
|
||||||
|
::memcpy(config + 30U, "0.00000000.000000", 17U);
|
||||||
|
|
||||||
m_dmrNetwork1->setConfig(config, len);
|
m_dmrNetwork1->setConfig(config, len);
|
||||||
|
|
||||||
bool ret = m_dmrNetwork1->open();
|
bool ret = m_dmrNetwork1->open();
|
||||||
@@ -952,6 +956,7 @@ bool CDMRGateway::createDMRNetwork2()
|
|||||||
unsigned int local = m_conf.getDMRNetwork2Local();
|
unsigned int local = m_conf.getDMRNetwork2Local();
|
||||||
unsigned int id = m_conf.getDMRNetwork2Id();
|
unsigned int id = m_conf.getDMRNetwork2Id();
|
||||||
std::string password = m_conf.getDMRNetwork2Password();
|
std::string password = m_conf.getDMRNetwork2Password();
|
||||||
|
bool location = m_conf.getDMRNetwork2Location();
|
||||||
bool debug = m_conf.getDMRNetwork2Debug();
|
bool debug = m_conf.getDMRNetwork2Debug();
|
||||||
m_dmr2Name = m_conf.getDMRNetwork2Name();
|
m_dmr2Name = m_conf.getDMRNetwork2Name();
|
||||||
|
|
||||||
@@ -967,6 +972,7 @@ bool CDMRGateway::createDMRNetwork2()
|
|||||||
LogInfo(" Local: %u", local);
|
LogInfo(" Local: %u", local);
|
||||||
else
|
else
|
||||||
LogInfo(" Local: random");
|
LogInfo(" Local: random");
|
||||||
|
LogInfo(" Location Data: %s", location ? "yes" : "no");
|
||||||
|
|
||||||
m_dmrNetwork2 = new CDMRNetwork(address, port, local, id, password, m_dmr2Name, debug);
|
m_dmrNetwork2 = new CDMRNetwork(address, port, local, id, password, m_dmr2Name, debug);
|
||||||
|
|
||||||
@@ -982,6 +988,9 @@ bool CDMRGateway::createDMRNetwork2()
|
|||||||
unsigned char config[400U];
|
unsigned char config[400U];
|
||||||
unsigned int len = m_repeater->getConfig(config);
|
unsigned int len = m_repeater->getConfig(config);
|
||||||
|
|
||||||
|
if (!location)
|
||||||
|
::memcpy(config + 30U, "0.00000000.000000", 17U);
|
||||||
|
|
||||||
m_dmrNetwork2->setConfig(config, len);
|
m_dmrNetwork2->setConfig(config, len);
|
||||||
|
|
||||||
bool ret = m_dmrNetwork2->open();
|
bool ret = m_dmrNetwork2->open();
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ SrcRewrite=2,4000,2,9,1001
|
|||||||
PassAllPC=1
|
PassAllPC=1
|
||||||
PassAllPC=2
|
PassAllPC=2
|
||||||
Password=PASSWORD
|
Password=PASSWORD
|
||||||
|
Location=1
|
||||||
Debug=0
|
Debug=0
|
||||||
|
|
||||||
# DMR+
|
# DMR+
|
||||||
@@ -72,4 +73,5 @@ PCRewrite=2,84000,2,4000,1001
|
|||||||
PassAllTG=1
|
PassAllTG=1
|
||||||
PassAllTG=2
|
PassAllTG=2
|
||||||
Password=PASSWORD
|
Password=PASSWORD
|
||||||
|
Location=0
|
||||||
Debug=0
|
Debug=0
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="15.0" 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>
|
||||||
@@ -22,32 +22,32 @@
|
|||||||
<ProjectGuid>{862A3182-C71A-4B01-B58D-5F0725927A56}</ProjectGuid>
|
<ProjectGuid>{862A3182-C71A-4B01-B58D-5F0725927A56}</ProjectGuid>
|
||||||
<Keyword>Win32Proj</Keyword>
|
<Keyword>Win32Proj</Keyword>
|
||||||
<RootNamespace>DMRGateway</RootNamespace>
|
<RootNamespace>DMRGateway</RootNamespace>
|
||||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
<WindowsTargetPlatformVersion>10.0.15063.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>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<PlatformToolset>v140</PlatformToolset>
|
<PlatformToolset>v141</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>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<PlatformToolset>v140</PlatformToolset>
|
<PlatformToolset>v141</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>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<PlatformToolset>v140</PlatformToolset>
|
<PlatformToolset>v141</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>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<PlatformToolset>v140</PlatformToolset>
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user