mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2026-08-26 12:32:31 -04:00
Clean ups involved with the renaming.
This commit is contained in:
parent
652e229996
commit
7accedd5e0
13 changed files with 57 additions and 57 deletions
|
|
@ -1,7 +1,7 @@
|
|||
# DMRplus - Startup Options
|
||||
|
||||
## Introduction
|
||||
This file is to give an overview over the Options-parameter in MMDVMHost.ini [DMR Network]-section.
|
||||
This file is to give an overview over the Options-parameter in MMDVM-Host.ini [DMR Network]-section.
|
||||
|
||||
## Example
|
||||
You can pull some conection-info at startup to the DMRplus-Network to define the behavior of TS1 and TS2 in DMR-mode.
|
||||
|
|
|
|||
12
Dockerfile
12
Dockerfile
|
|
@ -9,13 +9,13 @@ RUN apk add --update --no-cache \
|
|||
linux-headers \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
ADD ./ /MMDVMHost
|
||||
WORKDIR /MMDVMHost
|
||||
ADD ./ /MMDVM-Host
|
||||
WORKDIR /MMDVM-Host
|
||||
RUN make \
|
||||
&& cp MMDVMHost /usr/local/bin
|
||||
&& cp MMDVM-Host /usr/local/bin
|
||||
|
||||
VOLUME /MMDVMHost
|
||||
WORKDIR /MMDVMHost
|
||||
VOLUME /MMDVM-Host
|
||||
WORKDIR /MMDVM-Host
|
||||
|
||||
CMD ["MMDVMHost", "/MMDVMHost/MMDVMHost.ini"]
|
||||
CMD ["MMDVM-Host", "/MMDVM-Host/MMDVM-Host.ini"]
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "MMDVMHost.h"
|
||||
#include "MMDVM-Host.h"
|
||||
#include "NXDNKenwoodNetwork.h"
|
||||
#include "NXDNIcomNetwork.h"
|
||||
#include "RSSIInterpolator.h"
|
||||
|
|
@ -51,9 +51,9 @@
|
|||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
const char* DEFAULT_INI_FILE = "MMDVMHost.ini";
|
||||
const char* DEFAULT_INI_FILE = "MMDVM-Host.ini";
|
||||
#else
|
||||
const char* DEFAULT_INI_FILE = "/etc/MMDVMHost.ini";
|
||||
const char* DEFAULT_INI_FILE = "/etc/MMDVM-Host.ini";
|
||||
#endif
|
||||
|
||||
static bool m_killed = false;
|
||||
|
|
@ -85,10 +85,10 @@ int main(int argc, char** argv)
|
|||
for (int currentArg = 1; currentArg < argc; ++currentArg) {
|
||||
std::string arg = argv[currentArg];
|
||||
if ((arg == "-v") || (arg == "--version")) {
|
||||
::fprintf(stdout, "MMDVMHost version %s git #%.7s\n", VERSION, gitversion);
|
||||
::fprintf(stdout, "MMDVM-Host version %s git #%.7s\n", VERSION, gitversion);
|
||||
return 0;
|
||||
} else if (arg.substr(0,1) == "-") {
|
||||
::fprintf(stderr, "Usage: MMDVMHost [-v|--version] [filename]\n");
|
||||
::fprintf(stderr, "Usage: MMDVM-Host [-v|--version] [filename]\n");
|
||||
return 1;
|
||||
} else {
|
||||
iniFile = argv[currentArg];
|
||||
|
|
@ -118,17 +118,17 @@ int main(int argc, char** argv)
|
|||
case 0:
|
||||
break;
|
||||
case 2:
|
||||
::LogInfo("MMDVMHost-%s exited on receipt of SIGINT", VERSION);
|
||||
::LogInfo("MMDVM-Host-%s exited on receipt of SIGINT", VERSION);
|
||||
break;
|
||||
case 15:
|
||||
::LogInfo("MMDVMHost-%s exited on receipt of SIGTERM", VERSION);
|
||||
::LogInfo("MMDVM-Host-%s exited on receipt of SIGTERM", VERSION);
|
||||
break;
|
||||
case 1:
|
||||
::LogInfo("MMDVMHost-%s is restarting on receipt of SIGHUP", VERSION);
|
||||
::LogInfo("MMDVM-Host-%s is restarting on receipt of SIGHUP", VERSION);
|
||||
m_reload = true;
|
||||
break;
|
||||
default:
|
||||
::LogInfo("MMDVMHost-%s exited on receipt of an unknown signal", VERSION);
|
||||
::LogInfo("MMDVM-Host-%s exited on receipt of an unknown signal", VERSION);
|
||||
break;
|
||||
}
|
||||
} while (m_reload || (m_signal == 1));
|
||||
|
|
@ -272,7 +272,7 @@ int CMMDVMHost::run()
|
|||
{
|
||||
bool ret = m_conf.read();
|
||||
if (!ret) {
|
||||
::fprintf(stderr, "MMDVMHost: cannot read the .ini file\n");
|
||||
::fprintf(stderr, "MMDVM-Host: cannot read the .ini file\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -346,7 +346,7 @@ int CMMDVMHost::run()
|
|||
m_mqtt = new CMQTTConnection(m_conf.getMQTTHost(), m_conf.getMQTTPort(), m_conf.getMQTTName(), m_conf.getMQTTAuthEnabled(), m_conf.getMQTTUsername(), m_conf.getMQTTPassword(), subscriptions, m_conf.getMQTTKeepalive());
|
||||
ret = m_mqtt->open();
|
||||
if (!ret) {
|
||||
::fprintf(stderr, "MMDVMHost: unable to start the MQTT Publisher\n");
|
||||
::fprintf(stderr, "MMDVM-Host: unable to start the MQTT Publisher\n");
|
||||
delete m_mqtt;
|
||||
m_mqtt = nullptr;
|
||||
}
|
||||
|
|
@ -363,10 +363,10 @@ int CMMDVMHost::run()
|
|||
LogInfo(HEADER3);
|
||||
LogInfo(HEADER4);
|
||||
|
||||
LogInfo("MMDVMHost-%s is starting", VERSION);
|
||||
LogInfo("MMDVM-Host-%s is starting", VERSION);
|
||||
LogInfo("Built %s %s (GitID #%.7s)", __TIME__, __DATE__, gitversion);
|
||||
|
||||
writeJSONMessage("MMDVMHost is starting");
|
||||
writeJSONMessage("MMDVM-Host is starting");
|
||||
|
||||
readParams();
|
||||
|
||||
|
|
@ -1366,8 +1366,8 @@ int CMMDVMHost::run()
|
|||
CThread::sleep(5U);
|
||||
}
|
||||
|
||||
LogInfo("MMDVMHost is stopping");
|
||||
writeJSONMessage("MMDVMHost is stopping");
|
||||
LogInfo("MMDVM-Host is stopping");
|
||||
writeJSONMessage("MMDVM-Host is stopping");
|
||||
|
||||
setMode(MODE_QUIT);
|
||||
|
||||
|
|
@ -1464,8 +1464,8 @@ int CMMDVMHost::run()
|
|||
delete m_fm;
|
||||
#endif
|
||||
|
||||
LogInfo("MMDVMHost-%s has stopped", VERSION);
|
||||
writeJSONMessage("MMDVMHost has stopped");
|
||||
LogInfo("MMDVM-Host-%s has stopped", VERSION);
|
||||
writeJSONMessage("MMDVM-Host has stopped");
|
||||
|
||||
m_modem->close();
|
||||
delete m_modem;
|
||||
|
|
@ -32,7 +32,7 @@ Auth=0
|
|||
Username=mmdvm
|
||||
Password=mmdvm
|
||||
Keepalive=60
|
||||
Name=mmdvm
|
||||
Name=host
|
||||
|
||||
[CW Id]
|
||||
Enable=1
|
||||
|
|
@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.271
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MMDVMHost", "MMDVMHost.vcxproj", "{1D34E8C1-CFA5-4D60-B509-9DB58DC4AE92}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MMDVM-Host", "MMDVM-Host.vcxproj", "{1D34E8C1-CFA5-4D60-B509-9DB58DC4AE92}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{1D34E8C1-CFA5-4D60-B509-9DB58DC4AE92}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>MMDVMHost</RootNamespace>
|
||||
<RootNamespace>MMDVM-Host</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
|
|
@ -195,7 +195,7 @@
|
|||
<ClInclude Include="DMRLookup.h" />
|
||||
<ClInclude Include="IIRDirectForm1Filter.h" />
|
||||
<ClInclude Include="Log.h" />
|
||||
<ClInclude Include="MMDVMHost.h" />
|
||||
<ClInclude Include="MMDVM-Host.h" />
|
||||
<ClInclude Include="ModemPort.h" />
|
||||
<ClInclude Include="MQTTConnection.h" />
|
||||
<ClInclude Include="Mutex.h" />
|
||||
|
|
@ -286,7 +286,7 @@
|
|||
<ClCompile Include="Hamming.cpp" />
|
||||
<ClCompile Include="IIRDirectForm1Filter.cpp" />
|
||||
<ClCompile Include="Log.cpp" />
|
||||
<ClCompile Include="MMDVMHost.cpp" />
|
||||
<ClCompile Include="MMDVM-Host.cpp" />
|
||||
<ClCompile Include="ModemPort.cpp" />
|
||||
<ClCompile Include="MQTTConnection.cpp" />
|
||||
<ClCompile Include="Mutex.cpp" />
|
||||
|
|
@ -340,4 +340,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
<ClInclude Include="Log.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MMDVMHost.h">
|
||||
<ClInclude Include="MMDVM-Host.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="QR1676.h">
|
||||
|
|
@ -319,7 +319,7 @@
|
|||
<ClCompile Include="Log.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="MMDVMHost.cpp">
|
||||
<ClCompile Include="MMDVM-Host.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QR1676.cpp">
|
||||
|
|
@ -536,4 +536,4 @@
|
|||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2022,2023,2025 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2022,2023,2025,2026 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -59,12 +59,12 @@ bool CMQTTConnection::open()
|
|||
{
|
||||
char name[50U];
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
::sprintf(name, "MMDVMHost.%u", (unsigned)::_getpid());
|
||||
::sprintf(name, "Host.%u", (unsigned)::_getpid());
|
||||
#else
|
||||
::sprintf(name, "MMDVMHost.%u", (unsigned)::getpid());
|
||||
::sprintf(name, "Host.%u", (unsigned)::getpid());
|
||||
#endif
|
||||
|
||||
::fprintf(stdout, "MMDVMHost (%s) connecting to MQTT as %s\n", m_name.c_str(), name);
|
||||
::fprintf(stdout, "MMDVM-Host (%s) connecting to MQTT as %s\n", m_name.c_str(), name);
|
||||
|
||||
m_mosq = ::mosquitto_new(name, true, this);
|
||||
if (m_mosq == nullptr) {
|
||||
|
|
|
|||
24
Makefile
24
Makefile
|
|
@ -10,10 +10,10 @@ SRCS = $(wildcard *.cpp)
|
|||
OBJS = $(SRCS:.cpp=.o)
|
||||
DEPS = $(SRCS:.cpp=.d)
|
||||
|
||||
all: MMDVMHost
|
||||
all: MMDVM-Host
|
||||
|
||||
MMDVMHost: GitVersion.h $(OBJS)
|
||||
$(CXX) $(OBJS) $(LDFLAGS) $(LIBS) -o MMDVMHost
|
||||
MMDVM-Host: GitVersion.h $(OBJS)
|
||||
$(CXX) $(OBJS) $(LDFLAGS) $(LIBS) -o MMDVM-Host
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||
|
|
@ -21,10 +21,10 @@ MMDVMHost: GitVersion.h $(OBJS)
|
|||
|
||||
.PHONY install:
|
||||
install: all
|
||||
install -m 755 MMDVMHost /usr/local/bin/
|
||||
install -m 755 MMDVM-Host /usr/local/bin/
|
||||
|
||||
.PHONY install-service:
|
||||
install-service: install /etc/MMDVMHost.ini
|
||||
install-service: install /etc/MMDVM-Host.ini
|
||||
@useradd --user-group -M --system mmdvm --shell /bin/false || true
|
||||
@usermod --groups dialout --append mmdvm || true
|
||||
@mkdir /var/log/mmdvm || true
|
||||
|
|
@ -32,21 +32,21 @@ install-service: install /etc/MMDVMHost.ini
|
|||
@cp ./linux/systemd/mmdvmhost.service /lib/systemd/system/
|
||||
@systemctl enable mmdvmhost.service
|
||||
|
||||
/etc/MMDVMHost.ini:
|
||||
@cp -n MMDVMHost.ini /etc/MMDVMHost.ini
|
||||
@sed -i 's/FilePath=./FilePath=\/var\/log\/mmdvm\//' /etc/MMDVMHost.ini
|
||||
@sed -i 's/Daemon=0/Daemon=1/' /etc/MMDVMHost.ini
|
||||
@chown mmdvm:mmdvm /etc/MMDVMHost.ini
|
||||
/etc/MMDVM-Host.ini:
|
||||
@cp -n MMDVM-Host.ini /etc/MMDVM-Host.ini
|
||||
@sed -i 's/FilePath=./FilePath=\/var\/log\/mmdvm\//' /etc/MMDVM-Host.ini
|
||||
@sed -i 's/Daemon=0/Daemon=1/' /etc/MMDVM-Host.ini
|
||||
@chown mmdvm:mmdvm /etc/MMDVM-Host.ini
|
||||
|
||||
.PHONY uninstall-service:
|
||||
uninstall-service:
|
||||
@systemctl stop mmdvmhost.service || true
|
||||
@systemctl disable mmdvmhost.service || true
|
||||
@rm -f /usr/local/bin/MMDVMHost || true
|
||||
@rm -f /usr/local/bin/MMDVM-Host || true
|
||||
@rm -f /lib/systemd/system/mmdvmhost.service || true
|
||||
|
||||
clean:
|
||||
$(RM) MMDVMHost *.o *.d *.bak *~ GitVersion.h
|
||||
$(RM) MMDVM-Host *.o *.d *.bak *~ GitVersion.h
|
||||
|
||||
# Export the current git version if the index file exists, else 000...
|
||||
GitVersion.h:
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
On Linux, to run MMDVMHost as a daemon, set "Daemon=1" in the ini file.
|
||||
On Linux, to run MMDVM-Host as a daemon, set "Daemon=1" in the ini file.
|
||||
|
||||
It is possible to run the MMDVMHost via systemd, if this method is used, then
|
||||
It is possible to run the MMDVM-Host via systemd, if this method is used, then
|
||||
the following does not apply, and Daemon should be set to 0 in the ini file.
|
||||
|
||||
When Daemon is set, MMDVMHost will attempt to drop privileges to user "mmdvm" and
|
||||
When Daemon is set, MMDVM-Host will attempt to drop privileges to user "mmdvm" and
|
||||
group "mmdvm". If this user and group do not exist on your system, an error
|
||||
will occur and MMDVMHost will not start.
|
||||
will occur and MMDVM-Host will not start.
|
||||
|
||||
To add these users, please do the following from the Linux command line:
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ groupadd mmdvm
|
|||
useradd mmdvm -g mmdvm -s /sbin/nologin
|
||||
usermod mmdvm -G dialout
|
||||
|
||||
Note, without the last line, MMDVMHost will not be able to open the modem.
|
||||
Note, without the last line, MMDVM-Host will not be able to open the modem.
|
||||
|
||||
Also note, when running as a daemon, STDIN, STDOUT and STDERR are closed, so
|
||||
you must use MQTT to capture logging. The paths to the other files (DMRIds,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2019,2020,2021,2023,2024,2025 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2019,2020,2021,2023,2024,2025,2026 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
*/
|
||||
|
||||
#include "RemoteControl.h"
|
||||
#include "MMDVMHost.h"
|
||||
#include "MMDVM-Host.h"
|
||||
#include "Log.h"
|
||||
|
||||
#include <cstdio>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,6 @@
|
|||
#if !defined(VERSION_H)
|
||||
#define VERSION_H
|
||||
|
||||
const char* VERSION = "20260518";
|
||||
const char* VERSION = "20260528";
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue