With regard to your issue concerning connecting to IDM Channels, this is a recently discovered bug in the 1.9.0 release of the core framework. An AdapterNonExistent exception is thrown when find_POA is called on line 833 of the Device_Impl.cpp class. The Device_Impl.cpp class is the base class used by all C++ devices so the problem is not limited to just the USRP C++ device.
Devices use the IDM the channel to send StateChangeEventType events (see http://redhawksdr.github.io/Documentation/mainch16.html#x18-26800016.3.1)
If your system relies on these event types, your devices are C++, and you are using v1.9.0 of the framework you can work around this issue by overriding the connectSupplierToIncomingEventChannel method in your device. However this work around should be removed when upgrading to v1.9.1.
Within your C++ device's header class and below the existing include statements add the following:
#if ENABLE_EVENTS
#include <COS/CosEventChannelAdmin.hh>
#include "ossie/CorbaUtils.h"
#endif
Then within the public method declaration add the following:
#if ENABLE_EVENTS
void connectSupplierToIncomingEventChannel (CosEventChannelAdmin::EventChannel_ptr idmChannel);
CosEventChannelAdmin::EventChannel_var IDM_channel;
CosEventChannelAdmin::ProxyPushConsumer_var proxy_consumer;
#endif
Within your device's cpp class, below the service function, add the following method.
#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