2014-02-19 18 views
0

我在Centos 6.4(32位)操作系統上使用REDHAWK 1.9。分配前端II接口兼容設備

我有一個符合Tuner的FrontEnd(FE)II接口的設備。 FEII兼容設備的分配是通過一個結構(frontend_tuner_allocation)來實現的。 IDE似乎不允許在實現選項卡上定義此分配。我看着REDHAWK UHD device usage。它描述瞭如何建立必要的連接,但我沒有看到如何通過調諧器分配結構進行分配。

我見過的例子(離線)在哪裏做這個分配的分配結構必須手動編碼到XML文件。我在一個案例中看到這是在組件spd.xml文件中完成的。我有另一個例子,它是在波形中完成的。

例子1: 在組件spd.xml

<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> 

例子2: 在波形spd.xml

<usesdevicedependencies> 
    <usesdevice id="DCE:93a650f5-719f-4dc3-8143-fd438b94c19f" type="usesXX"> 
     <propertyref refid="DCE:cdc5ee18-7ceb-4ae6-bf4c-31f983179b4d" value="FRONTEND::TUNER"/> 
     <structref refid="FRONTEND::tuner_allocation"> 
     <simpleref refid="FRONTEND::tuner_allocation::tuner_type" value="RX_DIGITIZER_CHANNELIZER"/> 
     <simpleref refid="FRONTEND::tuner_allocation::allocation_id" value="XXDevice"/> 
     <simpleref refid="FRONTEND::tuner_allocation::center_frequency" value="100000000"/> 
     <simpleref refid="FRONTEND::tuner_allocation::bandwidth" value="128000"/> 
     <simpleref refid="FRONTEND::tuner_allocation::sample_rate" value="256000"/> 
     <simpleref refid="FRONTEND::tuner_allocation::group_id" value=""/> 
     <simpleref refid="FRONTEND::tuner_allocation::rf_flow_id" value=""/> 
     </structref> 
    </usesdevice> 
    </usesdevicedependencies> 

如何分配前端調諧器的最佳方式?

回答

1

分配前端調諧器設備並沒有真正的'最佳'方法。這實際上取決於哪種方式對您的特定場景最有意義。

您提供的兩個示例是通過XML分配前端調諧器的有效方式,但還有另一個選項(使用python)可以幫助您弄清楚發生了什麼。

假設你的設備已經在運行:

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!") 

在這一點上,您的FEI設備應該接受allocateCapacity(tunerRequestProps)電話:

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) 

在這一點上,如果分配成功,您應該看到分配請求現在在設備的frontend_tuner_status屬性中表示