10.3. DataWriter profiles

The DataWriter profiles allow for configuring DataWriters from an XML file. These profiles are defined within the <data_writer> or <publisher> XML tags. Thus, the following XML code snippets are equivalent.

DataWriter profile - Definition method 1

DataWriter profile - Definition method 2

<data_writer profile_name="my_datawriter_profile">
    <topic>
        <!-- TOPIC_TYPE -->
    </topic>
    <qos>
        <!-- QOS -->
    </qos>
    <!-- Other elements -->
</data_writer>
<publisher profile_name="my_publisher_profile">
    <topic>
        <!-- TOPIC_TYPE -->
    </topic>
    <qos>
        <!-- QOS -->
    </qos>
    <!-- Other elements -->
</publisher>

Important

The <publisher> and <data_writer> XML tags are equivalent. Therefore, XML profiles in which the DataWriters are defined with the <publisher> tag are fully compatible with Fast DDS.

10.3.1. DataWriter XML attributes

The <data_writer> element has two attributes defined: profile_name and is_default_profile.

Name

Description

Use

profile_name

Sets the name under which the <data_writer> profile is registered in the DDS Domain,
so that it can be loaded later by the DomainParticipant, as shown in
Loading and applying profiles.

Mandatory

is_default_profile

Sets the <data_writer> profile as the default profile. Thus, if a default profile
exists, it will be used when no other DataWriter profile is specified at the
DataWriter’s creation.

Optional

10.3.2. DataWriter configuration

The DataWriter configuration is performed through the XML elements listed in the following table.

Name

Description

Values

Default

<topic>

TopicType configuration of the DataWriter.

TopicType

<qos>

DataWriter QoS configuration.

QoS

<times>

It configures some time related parameters
of the DataWriter.

Times

<unicastLocatorList>

List of input unicast locators.
It expects a LocatorListType.

<locator>

<multicastLocatorList>

List of input multicast locators.
It expects a LocatorListType.

<locator>

<throughputController>

Limits the output bandwidth of the
DataWriter.

Throughput Configuration

<historyMemoryPolicy>

Memory allocation kind for DataWriter’s
history. See HistoryQosPolicyKind.

HistoryMemoryPolicy

PREALLOCATED

<propertiesPolicy>

Additional configuration properties.

PropertiesPolicyType

<userDefinedID>

Used for EDPStatic.

int16_t

-1

<entityID>

Sets the entity_id of the RTPSEndpointQos
class.

int16_t

-1

<matchedSubscribersAllocation>

Sets the limits of the collection of matched
DataReaders. See
ParticipantResourceLimitsQos.

Allocation Configuration

Example

<?xml version="1.0" encoding="UTF-8" ?>
<dds>
    <profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles" >
        <data_writer profile_name="datawriter_profile_name">
            <topic>
                <!-- TOPIC_TYPE -->
            </topic>

            <qos>
                <!-- QOS -->
            </qos>

            <times> <!-- writerTimesType -->
                <initialHeartbeatDelay>
                    <sec>0</sec>
                    <nanosec>12</nanosec>
                </initialHeartbeatDelay>

                <heartbeatPeriod>
                    <sec>3</sec>
                    <nanosec>0</nanosec>
                </heartbeatPeriod>

                <nackResponseDelay>
                    <sec>0</sec>
                    <nanosec>5</nanosec>
                </nackResponseDelay>

                <nackSupressionDuration>
                    <sec>0</sec>
                    <nanosec>0</nanosec>
                </nackSupressionDuration>
            </times>

            <unicastLocatorList>
                <!-- LOCATOR_LIST -->
                <locator>
                    <udpv4/>
                </locator>
            </unicastLocatorList>

            <multicastLocatorList>
                <!-- LOCATOR_LIST -->
                <locator>
                    <udpv4/>
                </locator>
            </multicastLocatorList>

            <throughputController>
                <bytesPerPeriod>8192</bytesPerPeriod>
                <periodMillisecs>1000</periodMillisecs>
            </throughputController>

            <historyMemoryPolicy>DYNAMIC</historyMemoryPolicy>

            <propertiesPolicy>
                <!-- PROPERTIES_POLICY -->
            </propertiesPolicy>

            <userDefinedID>55</userDefinedID>

            <entityID>66</entityID>

            <matchedSubscribersAllocation>
                <initial>0</initial>
                <maximum>0</maximum>
                <increment>1</increment>
            </matchedSubscribersAllocation>
        </data_writer>
    </profiles>
<dds>

Note

10.3.2.1. Times

Name

Description

Values

Default

<initialHeartbeatDelay>

Initial heartbeat delay.

DurationType

12 ms

<heartbeatPeriod>

Periodic heartbeat period.

DurationType

3 s

<nackResponseDelay>

Delay to apply to the response of an ACKNACK message.

DurationType

5 ms

<nackSupressionDuration>

This time allows the DataWriter to ignore NACK
messages for a given period of time right after
the data has been sent.

DurationType

0 ms