Using the USRP_UHD with the IDE Chalkboard

365 Views Asked by At

I am trying to write a simple control component that will allow me to start the USRP_UHD device via the Chalkboard. My current environment is CentOS 6.4 with Redhawk 1.9.0.

The component I wrote uses a DigitalTuner_out port and I've written code in a property change listener to call the setTunerCenterFrequency function on the USRP_UHD device when the center frequency changes via my custom component. I am able to connect them both using the ports in the SCA explorer.

The problem is even after I set the update_available_usrp_seq property in the USRP_UHD device to true and let it finish loading there are no tuners are allocated. I know that I have to call the USRP_UHD device allocateCapacity function with a frontend tuner allocation structure. I have already added a allocation property dependency for the DeviceKind = FRONTEND. Only the device kind and device model show up as available in the list when I go to add a dependency with the USRP_UHD.

How do I perform this call to the allocateCapacity function through the IDE? If this is possible, how do I then get the ID string of the tuner that was allocated for use by the control component? My guess would be that I would use the connectionID what is part of the UsesConnection structure that can be retrieved from UsesConnectionSequence returned by calling DigitalTuner_out->connections().

1

There are 1 best solutions below

0
On BEST ANSWER

The component that uses the USRP_UHD device will need to allocate the tuner. In the component's *.spd.xml specifies how to allocate the device. The IDE will place the allocation via the DeviceKind into the xml file, but with this simple property the ApplicationFactory_Impl.cpp does not call the device "allocateCapacity" method. To do that you will need to modify the xml by hand to add some other parameters.

For example

<usesdevice id="DCE:11bafc63-d8ce-428b-8b4e-39cb96034e8c" type="usesDevice">
  <propertyref refid="DCE:cdc5ee18-7ceb-4ae6-bf4c-31f983179b4d" value="FRONTEND:TUNER"/>
  <structref refid="FRONTEND::tuner_allocation">
    <simpleref refid="FRONTEND::tuner_allocation::allocation_id" value="SimFE2TestSink"/>
    <simpleref refid="FRONTEND::tuner_allocation::center_frequency" value="857000000.0"/>
  </structref>
</usesdevice>

The structref portion had to be added by hand.