3.5. Create Publisher

A publishing application needs to create a DDS Publisher and then a DataWriter for each Topic it wants to publish.

In Connext DDS Micro, PublisherQos in general contains no policies that need to be customized, while DataWriterQos does contain several customizable policies.

  • Create Publisher:

    DDS_Publisher *publisher = NULL;
    publisher = DDS_DomainParticipant_create_publisher(participant,
                                                       &DDS_PUBLISHER_QOS_DEFAULT,
                                                       NULL,
                                                       DDS_STATUS_MASK_NONE);
    if (publisher == NULL)
    {
        /* failure */
    }
    

For more information, see the Sending Data section in the User’s Manual.