Lesson 10: Add a domain participant for your subscriber entity
In this lesson, you add a domain participant for your MySubscriber
subscriber entity.
In the SubscriberPkg package, create a domain participant
and open the Features window for it:
On the General tab, name the
domain participant MySubscribingApplication. Notice that by default the same name has also been entered
in the Directory field, and Executable has
been selected in the Type area.
On the Scope tab, make sure that
the scope is set to SubscriberPkg. If other check boxes are selected, clear them. Click OK.
Specify the configuration for the MySubscribingApplication
domain participant:
Open the Features window for the DefaultConfig configuration
under MySubscribingApplication
On the Initialization tab, expand SubscriberPkg and
select MySubscriber
On the Settings tab, select the MSVC9 or Linux environment,
and then click OK
Add a dependency from the MySubscribingApplication domain
participant to the MyTopicStructLib domain participant.
Open the Features window for the dependency, and on the General tab,
in the Stereotype field, select Usage
in PredefinedTypes. As well, on the General tab,
make sure that the Usage field is set to Specification.
Click OK.
Add a constructor to the MySubscriber subscriber:
Right-click the MySubscriber subscriber and select Add New > Constructor, and click OK
Open the Features window for the constructor operation,
and enter the following code on the Implementation tab:
printf("ready to receive data\n");
Click OK
Lesson checkpoint
In this lesson, you learned how to add a domain participant
to your MySubscriber publisher entity.
In the next lesson, you will see how to listen to Data Distribution
Service for Real-Time Systems events related to MyDataReader.