diff options
author | Nick Foster <nick@nerdnetworks.org> | 2011-04-08 14:59:46 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-04-29 09:58:54 -0700 |
commit | a4aa89ed5d73b6afa5d2d28d8f2b6cc206baf22d (patch) | |
tree | 216703a0056e4634ef85b14a08a7386a9670e5d2 /host/lib/usrp/gps_ctrl.cpp | |
parent | 4df082cb4eb6659d76dd9a38988033c82c662fa9 (diff) | |
download | uhd-a4aa89ed5d73b6afa5d2d28d8f2b6cc206baf22d.tar.gz uhd-a4aa89ed5d73b6afa5d2d28d8f2b6cc206baf22d.tar.bz2 uhd-a4aa89ed5d73b6afa5d2d28d8f2b6cc206baf22d.zip |
USRP2: Added GPS time support to the sensors interface. gps_time sensor returns epoch time as time_t. Untested.
Diffstat (limited to 'host/lib/usrp/gps_ctrl.cpp')
-rw-r--r-- | host/lib/usrp/gps_ctrl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/host/lib/usrp/gps_ctrl.cpp b/host/lib/usrp/gps_ctrl.cpp index ff8e9cee6..ace56e7ed 100644 --- a/host/lib/usrp/gps_ctrl.cpp +++ b/host/lib/usrp/gps_ctrl.cpp @@ -172,6 +172,10 @@ public: } return now; } + + time_t get_epoch_time(void) { + return (get_time() - boost::posix_time::from_time_t(0)).total_seconds(); + } bool gps_detected(void) { return (gps_type != GPS_TYPE_NONE); |