Hi

I think there is a misunderstanding.
I do not want to set the time of the USRP.
I want to use the USRP (with GPSDO) as my time reference.
This is why I want to query the USRP using the UHD function ptime
get_time(void) in
/host/lib/usrp/gps_ctrl.cpp @ line 133

This function only returns date and time down to seconds, and the
toked[] array has a bigger length than what is used :
"
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[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)))
  + seconds(boost::lexical_cast<int>(toked[1].substr(4, 2)))
);
"

So I would like to know the format of the string returned by the
safe_gps_read(); function,
"
reply = safe_gps_read();
"

or better the description of the toked[] array after it get through
"
tok.assign(reply);
toked.assign(tok.begin(), tok.end());
"

Bastien

On 2011-05-19 14:46, Josh Blum wrote:
> 
>> Is it possible to extract from the reply the milli ? micro ? and nano
>> seconds ? For example using toked[2-8] or toked[10-11] (because
> 
> I recommend that you use query the seconds to catch the PPS edge, and
> then set the time for the next PPS. This will set the GPSDO time into
> the device at the precision of a clock cycle:
> 
> http://www.ettus.com/uhd_docs/doxygen/html/classuhd_1_1usrp_1_1multi__usrp.html#aaa80cd6ee4b3c1bf52afb9c3ef02f64d
> 
> -Josh
> 


_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to