RTI DDS filter by keyed topic

3 posts / 0 new
Last post
Offline
Last seen: 4 years 9 months ago
Joined: 05/21/2014
Posts: 46
RTI DDS filter by keyed topic

I wrote an IDL file that uses the serial number of a device for a key for a topic. All of the devices report to one main central device. How for keyed topics would I make the devices implement a filter such that they ignore messages not containg their serial number from the central device being used as a key in the code generated from the IDL and only read messages that contain their serial number as the key?

rip
rip's picture
Offline
Last seen: 2 days 21 hours ago
Joined: 04/06/2012
Posts: 324

ContentFilterTopic

There are examples in the Documentation, the above link takes you to the java how to. 

The central device will simply populate an instance with the data, including the target remote device's serial number.  The remote device's subscriber will be based on the ContentFilterTopic, with the filter set to the key == it's own serial.

Gerardo Pardo's picture
Offline
Last seen: 1 month 1 week ago
Joined: 06/02/2010
Posts: 602

The syntax to filter on key fields is the same as for any other fields in the data.

You can also find an example on how to use content fintered topics from all the supported programming languages here: https://community.rti.com/examples/content-filtered-topic

Gerardo