summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-03 13:49:03 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-03 13:49:03 +0200
commit2046b6ebf9c6fdf24506efa716ed8aa99df1d63f (patch)
tree441f7703add025952e33bec152987da9b378feee /src
parent06cec484b141d64ae257e91c46f01da392722567 (diff)
downloaddabmod-2046b6ebf9c6fdf24506efa716ed8aa99df1d63f.tar.gz
dabmod-2046b6ebf9c6fdf24506efa716ed8aa99df1d63f.tar.bz2
dabmod-2046b6ebf9c6fdf24506efa716ed8aa99df1d63f.zip
Replace fixtype by timelock sensor in OutputUHD
Diffstat (limited to 'src')
-rw-r--r--src/OutputUHD.cpp30
-rw-r--r--src/OutputUHD.h4
2 files changed, 17 insertions, 17 deletions
diff --git a/src/OutputUHD.cpp b/src/OutputUHD.cpp
index b815a4c..adc7b9a 100644
--- a/src/OutputUHD.cpp
+++ b/src/OutputUHD.cpp
@@ -59,25 +59,27 @@ void uhd_msg_handler(uhd::msg::type_t type, const std::string &msg)
else if (type == uhd::msg::error) {
etiLog.level(error) << "UHD Error: " << msg;
}
+ else {
+ etiLog.level(debug) << "UHD Message: " << msg;
+ }
}
-// Check function for GPS fixtype
-bool check_gps_fix_ok(uhd::usrp::multi_usrp::sptr usrp)
+// Check function for GPS TIMELOCK sensor
+bool check_gps_timelock(uhd::usrp::multi_usrp::sptr usrp)
{
try {
- std::string fixtype(
- usrp->get_mboard_sensor("gps_fixtype", 0).to_pp_string());
-
- if (fixtype.find("3d fix") == std::string::npos) {
- etiLog.level(warn) << "OutputUHD: " << fixtype;
+ std::string sensor_value(
+ usrp->get_mboard_sensor("gps_timelock", 0).to_pp_string());
+ if (sensor_value.find("TIME LOCKED") == std::string::npos) {
+ etiLog.level(warn) << "OutputUHD: gps_timelock " << sensor_value;
return false;
}
return true;
}
catch (uhd::lookup_error &e) {
- etiLog.level(warn) << "OutputUHD: no gps_fixtype sensor";
+ etiLog.level(warn) << "OutputUHD: no gps_timelock sensor";
return false;
}
}
@@ -198,8 +200,6 @@ OutputUHD::OutputUHD(
MDEBUG("OutputUHD:Mute on missing timestamps: %s ...\n",
myConf.muteNoTimestamps ? "enabled" : "disabled");
- set_usrp_time();
-
// preparing output thread worker data
uwd.myUsrp = myUsrp;
#endif
@@ -484,7 +484,7 @@ void OutputUHD::initial_gps_check()
if (last_gps_fix_check.tv_sec >
first_gps_fix_check.tv_sec + initial_gps_fix_wait) {
stringstream ss;
- ss << "GPS did not fix in " << initial_gps_fix_wait << " seconds";
+ ss << "GPS did not show time lock in " << initial_gps_fix_wait << " seconds";
throw std::runtime_error(ss.str());
}
@@ -545,14 +545,14 @@ void OutputUHD::check_gps()
if (not gps_fix_future.get()) {
if (num_checks_without_gps_fix == 0) {
etiLog.level(alert) <<
- "OutputUHD: GPS Fix lost";
+ "OutputUHD: GPS Time Lock lost";
}
num_checks_without_gps_fix++;
}
else {
if (num_checks_without_gps_fix) {
etiLog.level(info) <<
- "OutputUHD: GPS Fix recovered";
+ "OutputUHD: GPS Time Lock recovered";
}
num_checks_without_gps_fix = 0;
}
@@ -560,7 +560,7 @@ void OutputUHD::check_gps()
if (gps_fix_check_interval * num_checks_without_gps_fix >
myConf.maxGPSHoldoverTime) {
std::stringstream ss;
- ss << "Lost GPS fix for " << gps_fix_check_interval *
+ ss << "Lost GPS Time Lock for " << gps_fix_check_interval *
num_checks_without_gps_fix << " seconds";
throw std::runtime_error(ss.str());
}
@@ -570,7 +570,7 @@ void OutputUHD::check_gps()
// Checking the sensor here takes too much
// time, it has to be done in a separate thread.
gps_fix_pt = boost::packaged_task<bool>(
- boost::bind(check_gps_fix_ok, myUsrp) );
+ boost::bind(check_gps_timelock, myUsrp) );
gps_fix_future = gps_fix_pt.get_future();
diff --git a/src/OutputUHD.h b/src/OutputUHD.h
index 633de04..8513745 100644
--- a/src/OutputUHD.h
+++ b/src/OutputUHD.h
@@ -121,7 +121,7 @@ struct UHDWorkerData {
// If we want to verify loss of refclk
bool check_refclk_loss;
- // If we want to check for the gps_fixtype sensor
+ // If we want to check for the gps_timelock sensor
bool check_gpsfix;
// muting set by remote control
@@ -279,7 +279,7 @@ class OutputUHD: public ModOutput, public RemoteControllable {
boost::thread gps_fix_task;
// Wait time in seconds to get fix
- static const int initial_gps_fix_wait = 60;
+ static const int initial_gps_fix_wait = 180;
// Interval for checking the GPS at runtime
static const double gps_fix_check_interval = 10.0; // seconds