1

I'm currently developing a simple C++ program for basic USRP B210 transmission and reception. I can receive and transmit on a single subdevice without any problem. I would however prefer to be able to change the antenna (e.g. RX2 on subdev 1, RX2 on subdev 2). Is it possible to change the subdevice once the USRP is up and running?

Another alternative I see is receiving from both subdevices at the same time and taking the samples from one subdevice and dropping the samples from the other subdevice. Is this possible with the B210? I welcome all suggestions and thoughts. Feel free to share some examples too.

USRP Initialization
USRPDriver::USRPDriver()
{
    try
    {
        usrp = uhd::usrp::multi_usrp::make(std::string(""));
    }
    catch(...) //const uhd::exception &e
    {
        std::cout << "Some Error Has Happened" <<std::endl;
        m_bDeviceUp = false;
        return;
    }
    m_bDeviceUp = true;

    moveToThread(&m_Thread);
    QObject::connect(&m_Thread,SIGNAL(started()),this,SLOT(RxEventLoop()));

}

// Rx thread function

void
USRPDriver::RxEventLoop()
{
    if(m_bDeviceUp){
        uhd::rx_metadata_t md;
        uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);
        stream_cmd.stream_now = true;
        stream_cmd.num_samps = NUM_SAMPS;
       
        std::vector<std::complex<float> > fcpxIQ;
        fcpxIQ.resize(NUM_SAMPS);
        usrp->issue_stream_cmd(stream_cmd);
        while(true)
        {
            size_t num_rx_samps = rx_stream->recv(&fcpxIQ[0], NUM_SAMPS, md);
            emit ReceiveIQ(fcpxIQ);
        }
    }
}

Moses.

0 Answers0