discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing USRP subdevice on the fly


From: Marcus D. Leech
Subject: Re: Changing USRP subdevice on the fly
Date: Tue, 22 Nov 2022 16:48:31 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 22/11/2022 16:24, Moses Browne Mwakyanjala wrote:
Hi everyone,
I wrote a simple program for a usrp b210. I would like to change the RX antenna on the fly. That is, antenna 0 should be RX2 on Subdevice A:A and antenna 1 RX2 on Subdevice A:B as shown in the piece of code below. The problem I face is that I can't change the subdevice on the fly. The usrp->set_rx_subdev_spec(sRxSubDev) call doesn't seem to have any effect if it is called more than once. How should I proceed?

        std::string sRxSubDev;
        switch(m_Settings.m_nTMAntenna)
        {
        case 0:// Using antenna 1
            sRxSubDev = std::string("A:A");
            break;
        case 1:// Using antenna 2
            sRxSubDev = std::string("A:B");
            break;
        }
        usrp->set_rx_subdev_spec(sRxSubDev);
        usrp->set_rx_antenna("RX2");
Thanks in advance,
Moses. 
You would likely have to tear down the streamer and start a new one.

Alternately, you could just stream both channels at the same time, and simply drop the samples from the part of the stream
  you don't care about.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]