Not able to change EntityName either before or after participant created

3 posts / 0 new
Last post
Offline
Last seen: 2 years 7 months ago
Joined: 01/15/2018
Posts: 8
Not able to change EntityName either before or after participant created

Hello,

I am having a problem where I couldn't change the entity name of the participant either before or after it is created.

We have QoS profile that we load using the url_profiles in the factory which has the participant name defined. Once loaded, we query it by calling factory to get_default_participant_qos.

Using this qos we create the participant with the EntityName as part of the profile. However, I also want to include the ROLE and modify the EntityName programmatically to something different.

I have tried before creating the participant by modifying the default qos from calling get_default_participant_qos, and once the participant is created, calling participant.get_qos() and it returns null.

A simple case I created not involving any default profiles by using the default QoS profile from the Factory PARTICIPANT_QOS_DEFAULT for the participant and then modified the EntityName before creating. But when calling participant.get_qos() verify, it is returned null.

How do I ensure that the the participant is created with the EntityName programmatically?

Thanks for your help. I am currently using 6.0.1.

Tyler

Keywords:
Howard's picture
Offline
Last seen: 14 hours 21 min ago
Joined: 11/29/2012
Posts: 570

You cannot modify a QOS Profile in code.  You can load a QOS structure from a defined QOS Profile, modify the QOS structure, and the use the QOS structure to create a participant.

That's the way to modify the participant name (as well as any other QOS) in code...

    DDS_DomainParticipantQos part_qos;

    DDSTheParticipantFactory->get_default_participant_qos(part_qos);

    part_qos.participant_name.name = DDS_String_dup("new name");
    part_qos.participant_name.role_name = DDS_String_dup("new role name");

    DDSTheParticipantFactory->create_participant(id, part_qos, NULL, DDS_STATUS_MASK_NONE);

 

Offline
Last seen: 2 years 7 months ago
Joined: 01/15/2018
Posts: 8

Thank you!