我已经成功安装了 UHD 设备以及 REDHAWK 版本 1.8.3。对我来说,如何将波形中的组件连接到设备管理器管理的设备并不明显。我也不清楚 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')
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)