我已成功安装了REDHAWK版本1.8.3的UHD设备.我不清楚如何将波形中的组件连接到由设备管理器管理的设备.我也不清楚IDL接口和USRP设备上的数据端口之间的相互作用.
我无法找到一个简单的例子来发送和接收利用USRP设备的波形(例如,信号发生器组件向USRP发送正弦波).有没有人有这个或任何建议的经验?
在运行环境中将组件连接到设备的一种方法是通过REDHAWK python模块.它能够连接到正在运行的域,查询任何已启动的应用程序并将端口从组件连接到设备.以下是一个示例python脚本(注意,为了使连接成功,端口必须是相同的类型):
from ossie.utils import redhawk
from ossie.cf import CF
# Connect to the running domain
domain = redhawk.attach("REDHAWK_DEV")
# Gets a reference to the running application
for app in domain.apps:
# Find desired application
if app.name == 'desired_name':
application = app
# Gets the component from the application
for comp in application.comps:
# Find desired component
if comp.name == 'desired_name':
component = comp
# Gets the device to connect
for devMgr in domain.devMgrs:
for dev in devMgr.devs:
# Find desired device
if dev.name = 'desired_name':
device = dev
# Gets the references to the input and output ports
comp_port = component.getPort('port_name')._narrow(CF.Port)
dev_port = device.getPort('port_name')
# Makes the actual connection
comp_port.connectPort(dev_port, 'ConnectionID')
# Make sure device is started
device.start()
# Start application
application.start()
# To disconnect:
# Stop device and application
application.stop()
device.stop()
comp_port.disconnectPort('ConnectionID')
Run Code Online (Sandbox Code Playgroud)