Merge branch 'master' into M17_AX25_FM
This commit is contained in:
commit
e761e9c083
8 changed files with 86 additions and 36 deletions
|
@ -30,7 +30,8 @@ CThread(),
|
||||||
m_filename(filename),
|
m_filename(filename),
|
||||||
m_reloadTime(reloadTime),
|
m_reloadTime(reloadTime),
|
||||||
m_table(),
|
m_table(),
|
||||||
m_stop(false)
|
m_stop(false),
|
||||||
|
m_reload(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +49,14 @@ bool CDMRLookup::read()
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDMRLookup::reload()
|
||||||
|
{
|
||||||
|
if (m_reloadTime == 0U)
|
||||||
|
m_table.load(m_filename);
|
||||||
|
else
|
||||||
|
m_reload = true;
|
||||||
|
}
|
||||||
|
|
||||||
void CDMRLookup::entry()
|
void CDMRLookup::entry()
|
||||||
{
|
{
|
||||||
LogInfo("Started the DMR Id lookup reload thread");
|
LogInfo("Started the DMR Id lookup reload thread");
|
||||||
|
@ -59,9 +68,10 @@ void CDMRLookup::entry()
|
||||||
sleep(1000U);
|
sleep(1000U);
|
||||||
|
|
||||||
timer.clock();
|
timer.clock();
|
||||||
if (timer.hasExpired()) {
|
if (timer.hasExpired() || m_reload) {
|
||||||
m_table.load(m_filename);
|
m_table.load(m_filename);
|
||||||
timer.start();
|
timer.start();
|
||||||
|
m_reload = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2016,2017 by Jonathan Naylor G4KLX
|
* Copyright (C) 2016,2017,2021 by Jonathan Naylor G4KLX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -31,6 +31,8 @@ public:
|
||||||
|
|
||||||
bool read();
|
bool read();
|
||||||
|
|
||||||
|
void reload();
|
||||||
|
|
||||||
virtual void entry();
|
virtual void entry();
|
||||||
|
|
||||||
std::string find(unsigned int id);
|
std::string find(unsigned int id);
|
||||||
|
@ -45,6 +47,7 @@ private:
|
||||||
unsigned int m_reloadTime;
|
unsigned int m_reloadTime;
|
||||||
class CUserDB m_table;
|
class CUserDB m_table;
|
||||||
bool m_stop;
|
bool m_stop;
|
||||||
|
bool m_reload;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2015-2020 by Jonathan Naylor G4KLX
|
* Copyright (C) 2015-2021 by Jonathan Naylor G4KLX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -53,13 +53,19 @@ const char* DEFAULT_INI_FILE = "/etc/MMDVM.ini";
|
||||||
|
|
||||||
static bool m_killed = false;
|
static bool m_killed = false;
|
||||||
static int m_signal = 0;
|
static int m_signal = 0;
|
||||||
|
static bool m_reload = false;
|
||||||
|
|
||||||
#if !defined(_WIN32) && !defined(_WIN64)
|
#if !defined(_WIN32) && !defined(_WIN64)
|
||||||
static void sigHandler(int signum)
|
static void sigHandler1(int signum)
|
||||||
{
|
{
|
||||||
m_killed = true;
|
m_killed = true;
|
||||||
m_signal = signum;
|
m_signal = signum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void sigHandler2(int signum)
|
||||||
|
{
|
||||||
|
m_reload = true;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char* HEADER1 = "This software is for use on amateur radio networks only,";
|
const char* HEADER1 = "This software is for use on amateur radio networks only,";
|
||||||
|
@ -86,9 +92,10 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(_WIN32) && !defined(_WIN64)
|
#if !defined(_WIN32) && !defined(_WIN64)
|
||||||
::signal(SIGINT, sigHandler);
|
::signal(SIGINT, sigHandler1);
|
||||||
::signal(SIGTERM, sigHandler);
|
::signal(SIGTERM, sigHandler1);
|
||||||
::signal(SIGHUP, sigHandler);
|
::signal(SIGHUP, sigHandler1);
|
||||||
|
::signal(SIGUSR1, sigHandler2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
@ -1116,6 +1123,16 @@ int CMMDVMHost::run()
|
||||||
if (!m_fixedMode)
|
if (!m_fixedMode)
|
||||||
m_modeTimer.clock(ms);
|
m_modeTimer.clock(ms);
|
||||||
|
|
||||||
|
if (m_reload) {
|
||||||
|
if (m_dmrLookup != NULL)
|
||||||
|
m_dmrLookup->reload();
|
||||||
|
|
||||||
|
if (m_nxdnLookup != NULL)
|
||||||
|
m_nxdnLookup->reload();
|
||||||
|
|
||||||
|
m_reload = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_dstar != NULL)
|
if (m_dstar != NULL)
|
||||||
m_dstar->clock();
|
m_dstar->clock();
|
||||||
if (m_dmr != NULL)
|
if (m_dmr != NULL)
|
||||||
|
@ -2525,6 +2542,9 @@ void CMMDVMHost::remoteControl()
|
||||||
m_modem->sendCWId(cwtext);
|
m_modem->sendCWId(cwtext);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case RCD_RELOAD:
|
||||||
|
m_reload = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX
|
* Copyright (C) 2016,2017,2018,2021 by Jonathan Naylor G4KLX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -30,7 +30,8 @@ CThread(),
|
||||||
m_filename(filename),
|
m_filename(filename),
|
||||||
m_reloadTime(reloadTime),
|
m_reloadTime(reloadTime),
|
||||||
m_table(),
|
m_table(),
|
||||||
m_stop(false)
|
m_stop(false),
|
||||||
|
m_reload(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +49,14 @@ bool CNXDNLookup::read()
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CNXDNLookup::reload()
|
||||||
|
{
|
||||||
|
if (m_reloadTime == 0U)
|
||||||
|
m_table.load(m_filename);
|
||||||
|
else
|
||||||
|
m_reload = true;
|
||||||
|
}
|
||||||
|
|
||||||
void CNXDNLookup::entry()
|
void CNXDNLookup::entry()
|
||||||
{
|
{
|
||||||
LogInfo("Started the NXDN Id lookup reload thread");
|
LogInfo("Started the NXDN Id lookup reload thread");
|
||||||
|
@ -59,9 +68,10 @@ void CNXDNLookup::entry()
|
||||||
sleep(1000U);
|
sleep(1000U);
|
||||||
|
|
||||||
timer.clock();
|
timer.clock();
|
||||||
if (timer.hasExpired()) {
|
if (timer.hasExpired() || m_reload) {
|
||||||
m_table.load(m_filename);
|
m_table.load(m_filename);
|
||||||
timer.start();
|
timer.start();
|
||||||
|
m_reload = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,8 @@ public:
|
||||||
|
|
||||||
bool read();
|
bool read();
|
||||||
|
|
||||||
|
void reload();
|
||||||
|
|
||||||
virtual void entry();
|
virtual void entry();
|
||||||
|
|
||||||
std::string find(unsigned int id);
|
std::string find(unsigned int id);
|
||||||
|
@ -45,6 +47,7 @@ private:
|
||||||
unsigned int m_reloadTime;
|
unsigned int m_reloadTime;
|
||||||
class CUserDB m_table;
|
class CUserDB m_table;
|
||||||
bool m_stop;
|
bool m_stop;
|
||||||
|
bool m_reload;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2019,2020 by Jonathan Naylor G4KLX
|
* Copyright (C) 2019,2020,2021 by Jonathan Naylor G4KLX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -131,6 +131,9 @@ REMOTE_COMMAND CRemoteControl::getCommand()
|
||||||
} else if (m_args.at(0U) == "cw" && m_args.size() >= CW_ARGS) {
|
} else if (m_args.at(0U) == "cw" && m_args.size() >= CW_ARGS) {
|
||||||
// CW command is in the form of "cw <message>"
|
// CW command is in the form of "cw <message>"
|
||||||
m_command = RCD_CW;
|
m_command = RCD_CW;
|
||||||
|
} else if (m_args.at(0U) == "reload") {
|
||||||
|
// Reload command is in the form of "reload"
|
||||||
|
m_command = RCD_RELOAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_command == RCD_NONE) {
|
if (m_command == RCD_NONE) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2019,2020 by Jonathan Naylor G4KLX
|
* Copyright (C) 2019,2020,2021 by Jonathan Naylor G4KLX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -52,7 +52,8 @@ enum REMOTE_COMMAND {
|
||||||
RCD_DISABLE_FM,
|
RCD_DISABLE_FM,
|
||||||
RCD_DISABLE_AX25,
|
RCD_DISABLE_AX25,
|
||||||
RCD_PAGE,
|
RCD_PAGE,
|
||||||
RCD_CW
|
RCD_CW,
|
||||||
|
RCD_RELOAD
|
||||||
};
|
};
|
||||||
|
|
||||||
class CRemoteControl {
|
class CRemoteControl {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2015-2020 by Jonathan Naylor G4KLX
|
* Copyright (C) 2015-2021 by Jonathan Naylor G4KLX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -19,6 +19,6 @@
|
||||||
#if !defined(VERSION_H)
|
#if !defined(VERSION_H)
|
||||||
#define VERSION_H
|
#define VERSION_H
|
||||||
|
|
||||||
const char* VERSION = "20201226";
|
const char* VERSION = "20210101";
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue