There isn't really a 'best' way to allocate a frontend tuner device. It really just depends on which way makes the most sense for your specific scenario.
The two examples you provided are valid ways of allocating a frontend tuner via XML, but there's another option (using python) that may help clarify what is going on under the hood.
Assuming your device is already running:
from ossie.utils import redhawk
from ossie.cf import CF
# Attach to the domain
domain = redhawk.attach("REDHAWK_DEV")
# Locate your FEI device
myFEIDevice = None
for device in domain.devices:
if device.name == "myFEIDevice":
myFEIDevice = device
# Sanity check
if not myFEIDevice:
raise Exception("Unable to locate myFEIDevice!")
At this point, your FEI device should accept an allocateCapacity(tunerRequestProps)
call:
from ossie.utils import uuid
# Setup tuning variables
allocationId = str(uuid.uuid4())
tunerType = "RX_DIGITIZER_CHANNELIZER"
centerFreq = 100e6
sampleRate = 48000.0
sampleRateTol = 10.0
bandwidth = 16000.0
bandwidthTol = 10.0
deviceControl = False
groupId = ""
rfFlowId = ""
# Setup allocation request properties
props = []
props.append(CF.DataType("FRONTEND::tuner_allocation::tuner_type", tunerType))
props.append(CF.DataType("FRONTEND::tuner_allocation::allocation_id", allocationId))
props.append(CF.DataType("FRONTEND::tuner_allocation::center_frequency", centerFreq))
props.append(CF.DataType("FRONTEND::tuner_allocation::bandwidth", bandwidth))
props.append(CF.DataType("FRONTEND::tuner_allocation::bandwidth_tolerance", bandwidthTol))
props.append(CF.DataType("FRONTEND::tuner_allocation::sample_rate", sampleRate))
props.append(CF.DataType("FRONTEND::tuner_allocation::sample_rate_tolerance", sampleRateTol))
props.append(CF.DataType("FRONTEND::tuner_allocation::device_control", deviceControl))
props.append(CF.DataType("FRONTEND::tuner_allocation::group_id", groupId))
props.append(CF.DataType("FRONTEND::tuner_allocation::rf_flow_id", rfFlowId))
# Setup tuner request struct properties
fe_alloc_props = {}
fe_alloc_props["FRONTEND::tuner_allocation"] = props
# Attempt to allocate your device
allocationResult = myFEIDevice.allocateCapacity(fe_alloc_props)
At this point, if the allocation was successful, you should see the allocation request is now represented in the device's frontend_tuner_status property