Jump to content
OpenSplice DDS Forum

[Lang C] ospl conf and dds pub sub to remote

Recommended Posts


I want to connect to remote IP to write data onto it. As per the discussion : 

The configuration should be changed accordingly. Now the ospl.xml is in 

PXXX-VortexOpenSplice-6.7.171127OSS-HDE-x86_64.linux-gcc5.4.0-glibc2.23-installer/HDE/x86_64.linux/etc/config/ location

So if I change this, it will be reflected globally. So what is the linkage of ospl.xml with example codes ? Like the hello world publisher of C code needs include the conf and will run accordingly. So is there anyway so that only that C program uses my own conf file? Also the snippet says :

   <NetworkService name="networking">
        <GlobalPartition Address=","/>

So the two addr,

in which addr my specific publisher will connect ?

In the HelloWorldpublisher.c this snippet creates a publisher and writes to it which is by default a local address (not mentioned though explicitly in the code, as per the FAQ it will point to local address)

   // Create the Publisher's in the DDS Domain.
   message_Publisher = createPublisher(domainParticipant);

   // Request a Writer from the the Publisher.
   message_DataWriter = createDataWriter(message_Publisher, messageTopic);

   message_Sample = HelloWorldData_Msg__alloc();

   message_Sample->userID = 1;
   message_Sample->message = DDS_string_alloc(HelloWorldLength);
   strncpy(message_Sample->message, HelloWorld, HelloWorldLength);

   printf("\n=== [Publisher] writing a message containing :");
   printf("\n    userID  : %d", message_Sample->userID);
   printf("\n    Message : \"%s\"\n", message_Sample->message);

   g_status = HelloWorldData_MsgDataWriter_write(message_DataWriter, message_Sample, DDS_HANDLE_NIL);
   checkStatus(g_status, "HelloWorldData_MsgDataWriter_write");

So where to mention this publisher will only point to explicitly this topic, this port and this ip address (as in the conf file multiple ip can be defined, so which ip for which publisher?)? Please let me know.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now