mirror of
https://github.com/oe7drt/YSFClients.git
synced 2026-04-06 14:53:52 +00:00
Add remote command capability.
This commit is contained in:
parent
b058539a71
commit
adade2ebe2
6 changed files with 164 additions and 9 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2019 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015-2020 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
|
||||
|
|
@ -35,7 +35,8 @@ enum SECTION {
|
|||
SECTION_NETWORK,
|
||||
SECTION_YSF_NETWORK,
|
||||
SECTION_FCS_NETWORK,
|
||||
SECTION_MOBILE_GPS
|
||||
SECTION_MOBILE_GPS,
|
||||
SECTION_REMOTE_COMMANDS
|
||||
};
|
||||
|
||||
CConf::CConf(const std::string& file) :
|
||||
|
|
@ -89,7 +90,9 @@ m_fcsNetworkFile(),
|
|||
m_fcsNetworkPort(0U),
|
||||
m_mobileGPSEnabled(false),
|
||||
m_mobileGPSAddress(),
|
||||
m_mobileGPSPort(0U)
|
||||
m_mobileGPSPort(0U),
|
||||
m_remoteCommandsEnabled(false),
|
||||
m_remoteCommandsPort(6073U)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -129,6 +132,8 @@ bool CConf::read()
|
|||
section = SECTION_FCS_NETWORK;
|
||||
else if (::strncmp(buffer, "[Mobile GPS]", 12U) == 0)
|
||||
section = SECTION_MOBILE_GPS;
|
||||
else if (::strncmp(buffer, "[Remote Commands]", 17U) == 0)
|
||||
section = SECTION_REMOTE_COMMANDS;
|
||||
else
|
||||
section = SECTION_NONE;
|
||||
|
||||
|
|
@ -254,6 +259,11 @@ bool CConf::read()
|
|||
m_mobileGPSAddress = value;
|
||||
else if (::strcmp(key, "Port") == 0)
|
||||
m_mobileGPSPort = (unsigned int)::atoi(value);
|
||||
} else if (section == SECTION_REMOTE_COMMANDS) {
|
||||
if (::strcmp(key, "Enable") == 0)
|
||||
m_remoteCommandsEnabled = ::atoi(value) == 1;
|
||||
else if (::strcmp(key, "Port") == 0)
|
||||
m_remoteCommandsPort = (unsigned int)::atoi(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -512,3 +522,13 @@ unsigned int CConf::getMobileGPSPort() const
|
|||
{
|
||||
return m_mobileGPSPort;
|
||||
}
|
||||
|
||||
bool CConf::getRemoteCommandsEnabled() const
|
||||
{
|
||||
return m_remoteCommandsEnabled;
|
||||
}
|
||||
|
||||
unsigned int CConf::getRemoteCommandsPort() const
|
||||
{
|
||||
return m_remoteCommandsPort;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue