discuss-gnuradio
[Top][All Lists]
Advanced

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

Changing USRP subdevice on the fly


From: Moses Browne Mwakyanjala
Subject: Changing USRP subdevice on the fly
Date: Tue, 22 Nov 2022 22:24:07 +0100

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. 

reply via email to

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