Skip to content

Commit

Permalink
Added frn config variables and their readout on module initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
sh123 committed Dec 9, 2014
1 parent 7e0ccab commit 5d63157
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/svxlink/modules/frn/ModuleFrn.conf
Expand Up @@ -3,4 +3,13 @@ NAME=Frn
PLUGIN_NAME=Frn
ID=4
TIMEOUT=300
VERSION=201400
EMAIL_ADDRESS=your@example.com
DYN_PASSWORD=12345
CALLSIGN_AND_USER=user
BAND_AND_CHANNEL="446.03125FM CTC131.8"
DESCRIPTION="frn svxlink station"
COUNTRY=Antarctica
CITY_CITY_PART="City - Street"
NET=Test

58 changes: 56 additions & 2 deletions src/svxlink/modules/frn/ModuleFrn.cpp
Expand Up @@ -43,8 +43,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Project Includes
*
****************************************************************************/

#include <version/MODULE_FRN.h>
#include <AsyncConfig.h>



Expand All @@ -54,6 +53,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
****************************************************************************/

#include <version/MODULE_FRN.h>
#include "ModuleFrn.h"


Expand Down Expand Up @@ -201,6 +201,60 @@ bool ModuleFrn::initialize(void)
{
return false;
}
if (!cfg().getValue(cfgName(), "EMAIL_ADDRESS", opt_email_address))
{
cerr << "*** ERROR: Config variable " << cfgName()
<< "/EMAIL_ADDRESS not set\n";
return false;
}
if (!cfg().getValue(cfgName(), "DYN_PASSWORD", opt_dyn_password))
{
cerr << "*** ERROR: Config variable " << cfgName()
<< "/DYN_PASSWORD not set\n";
return false;
}
if (!cfg().getValue(cfgName(), "CALLSIGN_AND_USER", opt_callsign_and_user))
{
cerr << "*** ERROR: Config variable " << cfgName()
<< "/CALLSIGN_AND_USER not set\n";
return false;
}
if (!cfg().getValue(cfgName(), "BAND_AND_CHANNEL", opt_band_and_channel))
{
cerr << "*** ERROR: Config variable " << cfgName()
<< "/BAND_AND_CHANNEL not set\n";
return false;
}
if (!cfg().getValue(cfgName(), "DESCRIPTION", opt_description))
{
cerr << "*** ERROR: Config variable " << cfgName()
<< "/DESCRIPTION not set\n";
return false;
}
if (!cfg().getValue(cfgName(), "COUNTRY", opt_country))
{
cerr << "*** ERROR: Config variable " << cfgName()
<< "/COUNTRY not set\n";
return false;
}
if (!cfg().getValue(cfgName(), "CITY_CITY_PART", opt_city_city_part))
{
cerr << "*** ERROR: Config variable " << cfgName()
<< "/CITY_CITY_PART not set\n";
return false;
}
if (!cfg().getValue(cfgName(), "NET", opt_net))
{
cerr << "*** ERROR: Config variable " << cfgName()
<< "/NET not set\n";
return false;
}
if (!cfg().getValue(cfgName(), "VERSION", opt_version))
{
cerr << "*** ERROR: Config variable " << cfgName()
<< "/VERSION not set\n";
return false;
}

return true;

Expand Down
11 changes: 11 additions & 0 deletions src/svxlink/modules/frn/ModuleFrn.h
Expand Up @@ -130,6 +130,17 @@ class ModuleFrn : public Module
void allMsgsWritten(void);
void reportState(void);

private:
std::string opt_version;
std::string opt_email_address;
std::string opt_dyn_password;
std::string opt_callsign_and_user;
std::string opt_band_and_channel;
std::string opt_description;
std::string opt_country;
std::string opt_city_city_part;
std::string opt_net;

}; /* class ModuleFrn */


Expand Down

0 comments on commit 5d63157

Please sign in to comment.