Toy C++ example attached, with g++ compiling info commented out at the top.
The code does nothing besides logging the blocking time of the
get_mboard_sensor( "gps_time" ) call.
This definitely blocks on B210 with GPSDO, UHD 3.10.2, x86 host.

On Wed, Nov 22, 2017 at 5:43 AM, ROBIN TORTORA <[email protected]> wrote:

> Our apps that poll for location get the string periodically and look for
> when the string changes...  I dont recall it blocking...
>
>
> It is typically updated once per second, but it doesnt always update every
> second, sometimes there are misses.
>
>
> We are on the older 3.9 branch, but they have made some updates in 3.10
> that may have made the misses occur less frequently according to release
> notes...
>
> On November 21, 2017 at 10:36 PM Dario Fertonani via USRP-users <
> [email protected]> wrote:
>
> Yes, but that doesn't imply a blocking call. For example, PPS hits also
> occur once per second, but the relevant read-value call get_time_last_pps(
> ) isn't blocking, it just returns the last value read.
> The API isn't consistent, but I think I got my answer from experimenting.
>
> On Tue, Nov 21, 2017 at 7:19 PM, Marcus D. Leech via USRP-users <
> [email protected]> wrote:
>
> On 11/21/2017 10:12 PM, Dario Fertonani via USRP-users wrote:
>
> From experiments it seems that the subject call blocks until the next GPS
> whole second hits. Is that correct?
>
> Thanks,
> Dario
>
> The relevant NMEA message from the GPSDO only occurs once per second.
>
>
>
> _______________________________________________
> USRP-users mailing list
> [email protected]
> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
>
>
> _______________________________________________
> USRP-users mailing list
> [email protected]
> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
>
>
//  [Compile]
//      g++ gpsTest.cpp -o gpsTest -std=c++11 -O3 -luhd -lboost_system
#include <iostream>
#include <chrono>
#include <uhd/usrp/multi_usrp.hpp>
#include <uhd/utils/thread_priority.hpp>


//
int main( )
{

    //init board
    auto rfBoardPtr = uhd::usrp::multi_usrp::make( uhd::device_addr_t( "" ) );
    
    //GPSDO clock
    rfBoardPtr->set_clock_source( "gpsdo" );
    rfBoardPtr->set_time_source( "gpsdo" );
    sleep( 2 );
    if ( rfBoardPtr->get_mboard_sensor( "gps_locked" ).to_bool( ) == false )
    {
        std::cerr << std::endl;
        std::cerr << "Unable to lock to GPS." << std::endl;
        return -1;
    }
    
    // rfBoardPtr->get_mboard_sensor( "gps_time" )
    for ( auto oldTime = std::chrono::steady_clock::now( ) ; ; )
    {
        std::cout << std::endl;
        std::cout << rfBoardPtr->get_mboard_sensor( "gps_time" ).to_int( ) << std::endl;
        const auto NewTime = std::chrono::steady_clock::now( );
        std::cout << std::chrono::duration_cast< std::chrono::milliseconds >( NewTime - oldTime ).count( ) << std::endl;
        oldTime = NewTime;
    }
    
    //return
    return 0;
    
}

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

Reply via email to