How to access distributed logger's command request datareader

3 posts / 0 new
Last post
Offline
Last seen: 1 year 11 months ago
Joined: 08/18/2017
Posts: 2
How to access distributed logger's command request datareader

Hi,

I'm having trouble accessing the distributed logger's command_request datareader. I'm using the traditional C++ API and running on linux.

We created a participant and attached our instance of the distributed logger to it.

dlOptions.setDomainParticipant(loggerParticipant);
RTI_DLDistLogger::setOptions(dlOptions);
dlLogger = RTI_DLDistLogger::getInstance();

Then we tried to access the datareader by setting a subscriber_name.name in the qos profile and looking it up from the participant but we kept getting NULL.

domainParticipant->lookup_datareader_by_name([subscription_name]);  // always returned NULL

We also tried looping through all the subscribers and their datareaders using domainParticipant->get_subscribers() and subscriber->get_all_datareaders(). We found other subscribers and datareaders we use but not the distributed logger's subscriber. We also confirmed that the distributed logger's subscribers and publishers are under the intended participant using rtimonitor.

We are trying to access the datareader so that we can access the samples when they arrive using a waitset. Is it the intended behavior that we can't access the distributed logger's subscribers using get_subscribers? If so, how can we access the samples recieved by the command_request reader?

Thanks,

Nixon Mathew

harish's picture
Offline
Last seen: 2 weeks 1 day ago
Joined: 09/17/2014
Posts: 11

Hi Nixon,
 
The get_subscribers() and lookup_datareader_by_name() APIs are used to obtain entities created by the user application. The entities used by distributed logger are internal and cannot be obtained by these APIs. The command_request reader receives the requests and tries to execute the requested command.
 
I would like to understand your use case better and the purpose of accessing the samples received by the command_request reader. 
 
Regards
Harish 
Offline
Last seen: 1 year 11 months ago
Joined: 08/18/2017
Posts: 2

Thanks Harish.

We had some code we wanted to execute alongside the distributed logger changing its log level. We managed to work around the issue by creating another datareader that subscribed to the command request topic and attaching a listener to it.