
-->
<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="NDDS/ndds.5.2.0/resource/schema/rti_dds_qos_profiles.xsd" version="5.2.0">
  <!-- Qos Library -->
  <qos_library name="UserQosProfilesLibrary">
    <qos_profile name="User.Generic.Common" base_name="BuiltinQosLib::Generic.Common"/>

    <qos_profile name="User.Generic.Monitoring.Common" base_name="BuiltinQosLib::Generic.Monitoring.Common"/>

    <qos_profile name="User.Generic.ConnextMicroCompatibility" base_name="BuiltinQosLib::Generic.ConnextMicroCompatibility"/>

    <qos_profile name="User.Generic.OtherDDSVendorCompatibility" base_name="BuiltinQosLib::Generic.OtherDDSVendorCompatibility"/>

    <qos_profile name="User.Generic.StrictReliable" base_name="BuiltinQosLibExp::Generic.StrictReliable"/>

    <qos_profile name="User.Generic.KeepLastReliable" base_name="BuiltinQosLibExp::Generic.KeepLastReliable"/>

    <qos_profile name="User.Generic.BestEffort" base_name="BuiltinQosLibExp::Generic.BestEffort"/>

    <qos_profile name="User.Generic.StrictReliable.HighThroughput" base_name="BuiltinQosLibExp::Generic.StrictReliable.HighThroughput"/>

    <qos_profile name="User.Generic.StrictReliable.LowLatency" base_name="BuiltinQosLibExp::Generic.StrictReliable.LowLatency"/>

    <qos_profile name="User.Generic.Participant.LargeData" base_name="BuiltinQosLibExp::Generic.Participant.LargeData"/>

    <qos_profile name="User.Generic.Participant.LargeData.Monitoring" base_name="BuiltinQosLibExp::Generic.Participant.LargeData.Monitoring"/>

    <qos_profile name="User.Generic.StrictReliable.LargeData" base_name="BuiltinQosLibExp::Generic.StrictReliable.LargeData"/>

    <qos_profile name="User.Generic.KeepLastReliable.LargeData" base_name="BuiltinQosLibExp::Generic.KeepLastReliable.LargeData"/>

    <qos_profile name="User.Generic.StrictReliable.LargeData.FastFlow" base_name="BuiltinQosLibExp::Generic.StrictReliable.LargeData.FastFlow"/>

    <qos_profile name="User.Generic.StrictReliable.LargeData.MediumFlow" base_name="BuiltinQosLibExp::Generic.StrictReliable.LargeData.MediumFlow"/>

    <qos_profile name="User.Generic.StrictReliable.LargeData.SlowFlow" base_name="BuiltinQosLibExp::Generic.StrictReliable.LargeData.SlowFlow"/>

    <qos_profile name="User.Generic.KeepLastReliable.LargeData.FastFlow" base_name="BuiltinQosLibExp::Generic.KeepLastReliable.LargeData.FastFlow"/>

    <qos_profile name="User.Generic.KeepLastReliable.LargeData.MediumFlow" base_name="BuiltinQosLibExp::Generic.KeepLastReliable.LargeData.MediumFlow"/>

    <qos_profile name="User.Generic.KeepLastReliable.LargeData.SlowFlow" base_name="BuiltinQosLibExp::Generic.KeepLastReliable.LargeData.SlowFlow"/>

    <qos_profile name="User.Generic.KeepLastReliable.TransientLocal" base_name="BuiltinQosLibExp::Generic.KeepLastReliable.TransientLocal"/>

    <qos_profile name="User.Generic.KeepLastReliable.Transient" base_name="BuiltinQosLibExp::Generic.KeepLastReliable.Transient"/>

    <qos_profile name="User.Generic.KeepLastReliable.Persistent" base_name="BuiltinQosLibExp::Generic.KeepLastReliable.Persistent"/>

    <qos_profile name="User.Generic.AutoTuning" base_name="BuiltinQosLibExp::Generic.AutoTuning"/>

    <qos_profile name="User.Pattern.PeriodicData" base_name="BuiltinQosLibExp::Pattern.PeriodicData"/>

    <qos_profile name="User.Pattern.Streaming" base_name="BuiltinQosLibExp::Pattern.Streaming"/>

    <qos_profile name="User.Pattern.ReliableStreaming" base_name="BuiltinQosLibExp::Pattern.ReliableStreaming"/>

    <qos_profile name="User.Pattern.Event" base_name="BuiltinQosLibExp::Pattern.Event"/>

    <qos_profile name="User.Pattern.AlarmEvent" base_name="BuiltinQosLibExp::Pattern.AlarmEvent"/>

    <qos_profile name="User.Pattern.Status" base_name="BuiltinQosLibExp::Pattern.Status"/>

    <qos_profile name="User.Pattern.AlarmStatus" base_name="BuiltinQosLibExp::Pattern.AlarmStatus"/>

    <qos_profile name="User.Pattern.LastValueCache" base_name="BuiltinQosLibExp::Pattern.LastValueCache"/>

    <!-- *****************************************************************************************
          QoS to be used as a basic inheritance for common stuff
         *****************************************************************************************-->
    <qos_profile name="User.Participant" is_default_participant_factory_profile="true">
      <!-- Logging verbosity is configured to see what and why errors hapen inside DDS-->
      <participant_factory_qos>
         <logging>
          <output_file>SmartDoseDdsLog.txt</output_file>
          <verbosity>WARNING</verbosity>
          <print_format>TIMESTAMPED</print_format>
          <category>ALL</category>
        </logging> 

      </participant_factory_qos>
      <participant_factory_qos>
        <entity_factory>
          <autoenable_created_entities>true</autoenable_created_entities>
        </entity_factory>
      </participant_factory_qos>

      <datawriter_qos>
       
        <!-- This property is needed when using -unboundedSupport command-line option
                 in order to configure the memory allocation policy for the buffers that are
                 used to serialize the samples -->
        <property>
          <value>
            <element>
              <name>
                dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size
              </name>
              <value>16384</value>
            </element>
          </value>
        </property>
      </datawriter_qos>

      <datareader_qos>
        <!-- This property is needed when using -unboundedSupport command-line option
 			    in order to configure the memory allocation policy for the buffers that are 
 			    used to keep the serialized keys for the instances -->
        <property>
          <value>
            <element>
              <name>
                dds.data_reader.history.memory_manager.fast_pool.pool_buffer_max_size
              </name>
              <value>16384</value>
            </element>
          </value>
        </property>
      </datareader_qos>
      <!--
                The participant name, if it is set, will be displayed in the
                RTI tools, making it easier for you to tell one
                application from another when you're debugging.
                -->
      <participant_qos>
        <participant_name>
          <name>Participant</name>
        </participant_name>
        <!-- <property>
                <value>
                     enable monitoring
                    <element>
                        <name>rti.monitor.library</name>
                        <value>rtimonitoring</value>
                    </element>
                    <element>
                        <name>rti.monitor.create_function</name>
                        <value>RTIDefaultMonitor_create</value>
                    </element>
                </value>
            </property> -->
      </participant_qos>
    </qos_profile>


    <!-- *****************************************************************************************
          QoS to be used as a Fast Flow topic QoS
         *****************************************************************************************-->
    <qos_profile name="User.FastFlow" base_name="User.Pattern.Event">

    </qos_profile>


    <!-- *****************************************************************************************
          QoS to be used as a Transient persistent topic
         *****************************************************************************************-->
    <qos_profile name="Custom.Transient.Local" base_name="User.Generic.KeepLastReliable.TransientLocal">
      <topic_qos name="TransientTopicQos">
        <reliability>
          <!--
                    Enable reliability.
                    The writer maximum blocking time is 5 seconds.
                    -->
          <kind>RELIABLE_RELIABILITY_QOS</kind>
          <max_blocking_time>
            <sec>30</sec>
            <nanosec>0</nanosec>
          </max_blocking_time>
        </reliability>

        <history>
          <!--
                    The last sample is relevant.
                    Data older than that will not be provided to your
                    application and will not be repaired by the reliability
                    protocol if dropped.

                    This policy applies independently to each instance of the
                    topic.
                    -->
          <kind>KEEP_LAST_HISTORY_QOS</kind>
          <depth>1</depth>
        </history>

        <durability>
          <!--
                    Retain all data that has not yet been expired by the
                    above contracts on behalf of late-joining subscribers.
                    -->
          <kind>TRANSIENT_LOCAL_DURABILITY_QOS</kind>
        </durability>
        <!--
                The publishing application promises to update each instance
                of the topic at least once every two seconds. If it fails to abide by
                this contract, it will receive a notification.

                The subscribing application declares that it expects to
                receive an update to each instance at least once every two seconds.
                If it fails to receive data on time, it will receive a
                notification.

                Especially on a non-real-time operating system, where jitter
                can introduce small non-deterministic delivery delays, it is
                usually best to publish data updates slightly faster than
                the promised rate to avoid frequent-but-spurious deadline
                notifications.
                -->
        <deadline>
          <period>
            <sec>0</sec>
            <nanosec>200000</nanosec>
          </period>
        </deadline>
        <!--
            It's possible to customize each QoS policy per-reader and
            per-writer. Some policies are reader-specific or writer-specific.
            In this case, we specify everything we can at the topic level,
            then we just define the reader and writer configuration in terms
            of the topic, adding to it or overriding as necessary.
            -->
      </topic_qos>
      <datareader_qos base_name="TransientTopicQos">
        <!--
                Only present to the subscribing application one sample of
                each instance each second.

                If you set a time-based filter, it's best to take that into
                account in the deadline you specify as well in order to
                ensure that overlaps between your publication rate, minimum
                separation, and deadline period don't lead to reader-side
                deadline notifications that you don't expect. See the
                documentation for DeadlineQosPolicy and
                TimeBasedFilterQosPolicy in the online API documentation for
                more information.
                -->
        
                <time_based_filter>
                    <minimum_separation>
                        <sec>1</sec>
                        <nanosec>1</nanosec>
                    </minimum_separation>
                </time_based_filter>
                <deadline>
                    <period>
                        <sec>3</sec>
                        <nanosec>0</nanosec>
                    </period>
                </deadline>
      <property>
          <value>
            <element>
              <name>
                dds.data_reader.history.memory_manager.fast_pool.pool_buffer_max_size
              </name>
              <value>16384</value>
            </element>
          </value>
        </property>
      </datareader_qos>

      <datawriter_qos base_name="TransientTopicQos">
        <property>
          <value>
            <element>
              <name>
                dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size
              </name>
              <value>16</value>
            </element>
          </value>
        </property>
        <lifespan>
          <!--
                    Samples that arrives within the last 6 seconds are still
                    relevant. Data older than that will not be provided to
                    your application and will not be repaired by the
                    reliability protocol if dropped.

                    In a topic that is being updated strictly periodically,
                    it may be redundant to specify the lifespan when you have
                    already specified the history depth, since together with
                    the period, the history depth implies an effective
                    "lifespan." In this case, we do specify it because
                    different instances are being updated at different rates
                    and to give you a knob to experiment with.-->
                    <duration>
                        <sec>6</sec>
                        <nanosec>0</nanosec>
                    </duration>
        </lifespan>
      </datawriter_qos>
    </qos_profile>

    <!-- *****************************************************************************************
          QoS to be used as a Batch topic
         *****************************************************************************************-->
    <qos_profile name="Custom.Batch" base_name="User.Generic.StrictReliable">

      <datawriter_qos>
        <publication_name>
          <name>batch_writer</name>
        </publication_name>
        <!--
                The default max_data_bytes is 1024 bytes, so if your data_type 
                size or your max_samples are bigger, the batch could be sent 
                because the max_data_bytes is reached 
                
                -->
        <batch>
          <enable>true</enable>
          <max_samples>10</max_samples>
          <max_data_bytes>1024</max_data_bytes>
        </batch>
      </datawriter_qos>

      <datareader_qos>
        <subscription_name>
          <name>batch_dataDataReader</name>
        </subscription_name>
        <!--
                If you are going to use a batch bigger than 80 samples, 
                you have to modify this QoS, or the DataReader will not 
                store more samples than the resource_limits.max_samples 
                -->
        <resource_limits>
          <max_samples>80</max_samples>
        </resource_limits>
      </datareader_qos>
      <participant_qos>
        <!--
                The participant name, if it is set, will be displayed in the
                RTI tools, making it easier for you to tell one
                application from another when you're debugging.
                -->
        <participant_name>
          <name>batch_dataParticipant</name>
          <role_name>batch_dataParticipantRole</role_name>
        </participant_name>
      </participant_qos>
    </qos_profile>

    <!-- *****************************************************************************************
          QoS to be used as a Async topic
         *****************************************************************************************-->

    <qos_profile name="Custom.Async" base_name="User.Generic.StrictReliable">
      <datareader_qos>
        <reliability>
          <kind>RELIABLE_RELIABILITY_QOS</kind>
        </reliability>
        <history>
          <kind>KEEP_ALL_HISTORY_QOS</kind>
        </history>
      </datareader_qos>

      <datawriter_qos>
        <reliability>
          <kind>RELIABLE_RELIABILITY_QOS</kind>
          <max_blocking_time>
            <sec>60</sec>
          </max_blocking_time>
        </reliability>
        <history>
          <kind>KEEP_ALL_HISTORY_QOS</kind>
        </history>
      </datawriter_qos>
    </qos_profile>

    <!-- *****************************************************************************************
          QoS to be used as a Turbo Mode topic
         *****************************************************************************************-->
    <qos_profile name="turbo_mode_profile" base_name="User.Generic.StrictReliable">
      <datawriter_qos>
        <publication_name>
          <name>turbo_mode_dataDataWriter</name>
        </publication_name>
        <property>
          <value>
            <element>
              <name>dds.data_writer.enable_turbo_mode</name>
              <value>true</value>
            </element>
          </value>
        </property>
      </datawriter_qos>

      <datareader_qos>
        <subscription_name>
          <name>turbo_mode_dataDataReader</name>
        </subscription_name>
      </datareader_qos>
      <participant_qos>
        <!--
                The participant name, if it is set, will be displayed in the
                RTI tools, making it easier for you to tell one
                application from another when you're debugging.
              -->
        <participant_name>
          <name>turbo_mode_dataParticipant</name>
          <role_name>turbo_mode_dataParticipantRole</role_name>
        </participant_name>
        <transport_builtin>
          <mask>UDPv4</mask>
        </transport_builtin>
      </participant_qos>
    </qos_profile>

    <!-- *****************************************************************************************
                                QoS defined by the topic name
         *****************************************************************************************
         *****************************************************************************************
         *****************************************************************************************
         *****************************************************************************************  
         *****************************************************************************************
         *****************************************************************************************
         ***************************************************************************************** -->

    <!-- Machine order Qos-->
    <qos_profile name="MachineOrderChange" base_name="Custom.Batch"/>

    <qos_profile name="MachineOrderChangeNotification" base_name="Custom.Batch"/>

    <qos_profile name="MachineOrder" base_name="Custom.Transient.Local"/>

    <!-- Tray Qos-->
    <qos_profile name="TrayChange" base_name="Custom.Batch"/>

    <qos_profile name="TrayChangeNotification" base_name="Custom.Batch"/>

    <qos_profile name="Tray" base_name="Custom.Transient.Local"/>

    <qos_profile name="Test" base_name="Custom.Async"/>


 <!-- *****************************************************************************************
         Legacy QoS
         *****************************************************************************************-->
    <qos_profile name="User.Custom.Participant" base_name="User.Generic.BestEffort" is_default_qos="true">
  
      <participant_factory_qos>

      </participant_factory_qos>
      <participant_factory_qos>
        <entity_factory>
          <autoenable_created_entities>true</autoenable_created_entities>
        </entity_factory>
      </participant_factory_qos>

      <datawriter_qos>
        <property>
          <value>
            <element>
              <name>
                dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size
              </name>
              <value>16384</value>
            </element>
          </value>
        </property>
        <durability_service>
          <history_kind>KEEP_LAST_HISTORY_QOS</history_kind>
          <history_depth>1</history_depth>
        </durability_service>
        <deadline>
          <period>
            <nanosec>100000</nanosec>
          </period>
        </deadline>
      </datawriter_qos>

      <datareader_qos>
        <property>
          <value>
            <element>
              <name>
                dds.data_reader.history.memory_manager.fast_pool.pool_buffer_max_size
              </name>
              <value>16384</value>
            </element>
          </value>
        </property>
      </datareader_qos>
    </qos_profile>
    
  </qos_library>
</dds>
