diff options
author | Josh Blum <josh@joshknows.com> | 2013-04-09 21:20:26 -0500 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2013-04-09 21:20:26 -0500 |
commit | f01d1a28e2adec61828793c59e3f83817b7f1882 (patch) | |
tree | 513bd5f97c607655add1157b5e1ec9ce3518ec68 /host/lib/usrp/gps_ctrl.cpp | |
parent | 31f0e964aa54a2c8e4d299432513623d2c49bbf0 (diff) | |
download | uhd-f01d1a28e2adec61828793c59e3f83817b7f1882.tar.gz uhd-f01d1a28e2adec61828793c59e3f83817b7f1882.tar.bz2 uhd-f01d1a28e2adec61828793c59e3f83817b7f1882.zip |
gps: only enable SERV:TRAC when requested
Diffstat (limited to 'host/lib/usrp/gps_ctrl.cpp')
-rw-r--r-- | host/lib/usrp/gps_ctrl.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/host/lib/usrp/gps_ctrl.cpp b/host/lib/usrp/gps_ctrl.cpp index 8c177382a..c3af75faa 100644 --- a/host/lib/usrp/gps_ctrl.cpp +++ b/host/lib/usrp/gps_ctrl.cpp @@ -303,13 +303,22 @@ private: } std::string get_servo(void) { + + //enable servo reporting + _send("SERV:TRAC 1\n"); + sleep(milliseconds(FIREFLY_STUPID_DELAY_MS)); + std::string reply; const boost::system_time comm_timeout = boost::get_system_time() + milliseconds(GPS_COMM_TIMEOUT_MS); while(boost::get_system_time() < comm_timeout) { - reply = get_cached_sensor("SERVO", GPS_SERVO_FRESHNESS, false); + reply = get_cached_sensor("SERVO", GPS_NMEA_LOW_FRESHNESS, false); if(reply.size()) - return reply; + { + //disable it before leaving function + _send("SERV:TRAC 0\n"); + return reply; + } boost::this_thread::sleep(milliseconds(GPS_TIMEOUT_DELAY_MS)); } throw uhd::value_error("get_stat(): no servo message found"); |