Hi all - I have an Octoclock-G. I'm trying to get confirmation on what
get_sensor("gps_time")  actually returns.

I guess it's not number of seconds since the GPS epoch (Jan 6 1980), as I
had assumed from the tag "gps_time".

It looks more like Unix seconds. So, seconds since  the Jan 1 1970 epoch
(UTC epoch).
Is that right, and if so, how are leap seconds handled? If it uses the Unix
epoch then I would guess it is also subtracting leap seconds, but that's
just a guess..

If indeed it is returning Unix time, then I believe this would be correct
(for now, until the next leap sec):
gpsSeconds = get_sensor("gps_time") - 315964782;

Our code looks something like:
   uhd::device_addr_t dev_addr_octoclock;
   dev_addr_octoclock["addr0"] = "192.168.13.1";
   uhd::usrp_clock::multi_usrp_clock::sptr octoclock =
uhd::usrp_clock::multi_usrp_clock::make(dev_addr_octoclock);
   signed gps_time = octoclock->get_sensor("gps_time",0).to_int();

Thanks much,
Eric
_______________________________________________
USRP-users mailing list
[email protected]
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

Reply via email to