Tuesday, November 22, 2022

Changing USRP subdevice on the fly

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. 

No comments:

Post a Comment