0

我正在使用此处找到的 USRP_UHD 项目:https ://github.com/RedhawkSDR/USRP_UHD

我已经看到了这个问题:Component uses a device - failed to allocateCapacity。这位先生似乎有类似的问题,但我没有他的任何其他问题。

我正在尝试通过“目标 SDR”启​​动包含 USRP_UHD 设备的节点。我最终得到这个警告:

WARN:Device_impl - 无法连接到 IDM 通道

系统说明:
CentOS 6.4 64 Bit
REDHAWK 1.8.4 Ettus
N200 + XCVR 2450 Daughtercard
GNU C++ version 4.4.7 20120313 (Red Hat 4.4.7-3);升压_104100;UHD_003.005.002-0-未知

节点未运行时:
nameclt list REDHAWK_DEV
list: NotFound exception: missing node

节点运行时:
nameclt list REDHAWK_DEV
ODM_Channel
IDM_Channel
REDHAWK_DEV
USRP-TEST/(这是我的节点名)

eventviewer REDHAWK_DEV IDM_Channel
接收事件。按“进入”键退出

在我看来一切都还好。我相信这里会发出警告:Device_impl.h

#if ENABLE_EVENTS
    if (idm_channel_ior) {
        try {
            CORBA::Object_var IDM_channel_obj = ossie::corba::Orb()->string_to_object(idm_channel_ior);
            if (CORBA::is_nil(IDM_channel_obj)) {
                LOG_ERROR(Device_impl, "Invalid IDM channel IOR: " << idm_channel_ior);
            } else {
                CosEventChannelAdmin::EventChannel_var idm_channel = CosEventChannelAdmin::EventChannel::_narrow(IDM_channel_obj);
                (*devPtr)->connectSupplierToIncomingEventChannel(idm_channel);
            }
        } catch (...) {
            LOG_WARN(Device_impl, "Unable to connect to IDM channel");
        }
    }
#endif

USRP 设备似乎没有获取我在 USRP_UHD.prf.xml 中设置的任何属性 - 我希望解决此问题会有所帮助。谢谢!

4

1 回答 1

0

关于您关于连接到 IDM 频道的问题,这是最近在核心框架 1.9.0 版本中发现的一个错误。在 Device_Impl.cpp 类的第 833 行调用 find_POA 时会引发 AdapterNonExistent 异常。Device_Impl.cpp 类是所有 C++ 设备使用的基类,因此问题不仅限于 USRP C++ 设备。

设备使用 IDM 通道发送 StateChangeEventType 事件(参见http://redhawksdr.github.io/Documentation/mainch16.html#x18-26800016.3.1

如果您的系统依赖于这些事件类型,您的设备是 C++,并且您使用的是框架的 v1.9.0,您可以通过覆盖设备中的 connectSupplierToIncomingEventChannel 方法来解决此问题。但是,当升级到 v1.9.1 时,应删除此解决方法。

在 C++ 设备的标头类中和现有的 include 语句下方添加以下内容:

#if ENABLE_EVENTS
#include <COS/CosEventChannelAdmin.hh>
#include "ossie/CorbaUtils.h"
#endif

然后在公共方法声明中添加以下内容:

#if ENABLE_EVENTS
    void connectSupplierToIncomingEventChannel (CosEventChannelAdmin::EventChannel_ptr idmChannel);
    CosEventChannelAdmin::EventChannel_var IDM_channel;
    CosEventChannelAdmin::ProxyPushConsumer_var proxy_consumer;
#endif

在您设备的 cpp 类中,在服务函数下方,添加以下方法。

#if ENABLE_EVENTS
void workAroundDevice_i::connectSupplierToIncomingEventChannel(CosEventChannelAdmin::EventChannel_ptr idm_channel)
{
    TRACE_ENTER(Device_impl);

    IDM_channel = CosEventChannelAdmin::EventChannel::_duplicate(idm_channel);

    CosEventChannelAdmin::SupplierAdmin_var supplier_admin;
    unsigned int number_tries;
    unsigned int maximum_tries = 10;

    number_tries = 0;
    while (true)
    {
        try {
            supplier_admin = IDM_channel->for_suppliers ();
            if (CORBA::is_nil(supplier_admin))
            {
                IDM_channel = CosEventChannelAdmin::EventChannel::_nil();
                return;
            }
            break;
        }
        catch (CORBA::COMM_FAILURE& ex) {
            if (number_tries == maximum_tries) {
                IDM_channel = CosEventChannelAdmin::EventChannel::_nil();
                return;
            }
            usleep(1000);   // wait 1 ms
            number_tries++;
            continue;
        }
    }
    proxy_consumer = CosEventChannelAdmin::ProxyPushConsumer::_nil();
    number_tries = 0;
    while (true)
    {
        try {
            proxy_consumer = supplier_admin->obtain_push_consumer ();
            if (CORBA::is_nil(proxy_consumer))
            {
                IDM_channel = CosEventChannelAdmin::EventChannel::_nil();
                return;
            }
            break;
        }
        catch (CORBA::COMM_FAILURE& ex) {
            if (number_tries == maximum_tries) {
                IDM_channel = CosEventChannelAdmin::EventChannel::_nil();
                return;
            }
            usleep(1000);   // wait 1 ms
            number_tries++;
            continue;
        }
    }
    //
    // Connect Push Supplier - retrying on Comms Failure.
    PortableServer::POA_var root_poa = PortableServer::POA::_narrow(ossie::corba::RootPOA());

    IDM_Channel_Supplier_i* supplier_servant = new IDM_Channel_Supplier_i(this);

    PortableServer::ObjectId_var oid = root_poa->activate_object(supplier_servant);

    CosEventComm::PushSupplier_var sptr = supplier_servant->_this();

    supplier_servant->_remove_ref();
    number_tries = 0;
    while (true)
    {
        try {
            proxy_consumer->connect_push_supplier(sptr.in());
            break;
        }
        catch (CORBA::BAD_PARAM& ex) {
            IDM_channel = CosEventChannelAdmin::EventChannel::_nil();
            return;
        }
        catch (CosEventChannelAdmin::AlreadyConnected& ex) {
            break;
        }
        catch (CORBA::COMM_FAILURE& ex) {
            if (number_tries == maximum_tries) {
                IDM_channel = CosEventChannelAdmin::EventChannel::_nil();
                return;
            }
            usleep(1000);   // wait 1 ms
            number_tries++;
            continue;
        }
    }

}
#endif
于 2013-12-09T17:07:03.367 回答