aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/gps_ctrl.cpp
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2011-04-13 12:32:35 -0700
committerJosh Blum <josh@joshknows.com>2011-04-29 09:58:55 -0700
commit4d73aae4638e5c08b2f55ea229414319befec68e (patch)
tree589b1fa27e3876c1b82b083ef36ca4158472fe35 /host/lib/usrp/gps_ctrl.cpp
parent44c8069855aff9adb65448692de3272d0bb1603a (diff)
downloaduhd-4d73aae4638e5c08b2f55ea229414319befec68e.tar.gz
uhd-4d73aae4638e5c08b2f55ea229414319befec68e.tar.bz2
uhd-4d73aae4638e5c08b2f55ea229414319befec68e.zip
GPS parser fixes for get_time.
Diffstat (limited to 'host/lib/usrp/gps_ctrl.cpp')
-rw-r--r--host/lib/usrp/gps_ctrl.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/host/lib/usrp/gps_ctrl.cpp b/host/lib/usrp/gps_ctrl.cpp
index ace56e7ed..de97710f2 100644
--- a/host/lib/usrp/gps_ctrl.cpp
+++ b/host/lib/usrp/gps_ctrl.cpp
@@ -125,7 +125,6 @@ public:
}
-//TODO: this isn't generalizeable to non-USRP2 USRPs.
std::string safe_gps_read() {
return _recv();
}
@@ -147,18 +146,19 @@ public:
found_gprmc = true;
break;
}
+ boost::this_thread::sleep(boost::posix_time::milliseconds(200));
}
UHD_ASSERT_THROW(found_gprmc);
tok.assign(reply);
toked.assign(tok.begin(), tok.end());
- UHD_ASSERT_THROW(toked.size() == 11); //if it's not we got something weird in there
+ UHD_ASSERT_THROW(toked.size() == 12); //if it's not we got something weird in there
now = ptime( date(
- greg_year(boost::lexical_cast<int>(toked[8].substr(4, 2)) + 2000), //just trust me on this one
- greg_month(boost::lexical_cast<int>(toked[8].substr(2, 2))),
- greg_day(boost::lexical_cast<int>(toked[8].substr(0, 2)))
+ greg_year(boost::lexical_cast<int>(toked[9].substr(4, 2)) + 2000), //just trust me on this one
+ greg_month(boost::lexical_cast<int>(toked[9].substr(2, 2))),
+ greg_day(boost::lexical_cast<int>(toked[9].substr(0, 2)))
),
hours( boost::lexical_cast<int>(toked[1].substr(0, 2)))
+ minutes(boost::lexical_cast<int>(toked[1].substr(2, 2)))