How to Give location of USER_QOS_PROFILES.xml

6 posts / 0 new
Last post
Offline
Last seen: 5 years 6 months ago
Joined: 02/05/2014
Posts: 5
How to Give location of USER_QOS_PROFILES.xml

HI

   I have some binaries which are using RTI but they are located in differrent location but in the same machine. For communication we need USER_QOS_PROFILES.xml where we override some default QOS. But the expectation is this file should be present in the same directory from where we are launching the bienaries. As in our case its distrubuted in diferrent folders we need to create a separate copy everywhere. Is there any way to tell RTI to refer USER_QOS_PROFILES.xml from a dedicated location. 

Organization:
Keywords:
rip
rip's picture
Offline
Last seen: 1 day 2 hours ago
Joined: 04/06/2012
Posts: 316

there's an environment variable you can use.  Use the search bar on this page to look for 'NDDS_QOS_PROFILES', and more info is availabe in the documentation.

Offline
Last seen: 1 year 10 months ago
Joined: 07/16/2015
Posts: 17

..for a stand-alone app which may not be able to expect an environment variable set, I see it's possible to set using a URL. I can find a struct with likely looking members (DDS_ProfileQosPolicy) I cannot fathom from the docs how to use it.

Is there an example?

Gerardo Pardo's picture
Offline
Last seen: 3 weeks 14 hours ago
Joined: 06/02/2010
Posts: 589
Offline
Last seen: 1 year 10 months ago
Joined: 07/16/2015
Posts: 17

Tried to get the URL version working having copied the example out of the docs - it doesn't work at all. Tells me it can't use the self-same-file I'd just been using and renamed from USER_PROFILE_QOS.xml in a path I know exists (and checked, and changed).

Bizarrely also, there's a nasty interaction with the logging set_output_file - calling "factoryQos.profile.url_profile.from_array" seems to disregard/reset the previously set "set_output_file" and sticks up a black-dialog-of-doom.

 DDSDomainParticipantFactory *factory = DDSDomainParticipantFactory::get_instance();

DDS_DomainParticipantFactoryQos factoryQos;
DDS_ReturnCode_t retcode = factory->get_qos(factoryQos);
if (retcode != DDS_RETCODE_OK)
{
qDebug("get_qos fail");
}
const char *url_profiles[] = { "file:///c:/myqos.xml" };
factoryQos.profile.url_profile.from_array(url_profiles, 1);
// factoryQos.profile.ignore_resource_profile = DDS_BOOLEAN_TRUE;
//factoryQos.profile.ignore_environment_profile = DDS_BOOLEAN_TRUE;
//factoryQos.profile.ignore_resource_profile = DDS_BOOLEAN_TRUE;
factory->set_qos(factoryQos);

 

 

rip
rip's picture
Offline
Last seen: 1 day 2 hours ago
Joined: 04/06/2012
Posts: 316

I believe that it doesn't mean same file, I think it means same symbols.  It's a symbol table that is created, and it is loading USER_QOS_PROFILES.xml on boot, and then you are trying to load the same file (with all the same symbols) again.

What happens if you create a simple myqos.xml that has no name conflicts with the default USER_QOS_PROFILES.xml file?